Thursday, August 29, 2013

[Solved] Esper Query Only Generate Insert or ADD event

I have the following Esper query:
SELECT istream column1, column2, column3 
FROM myEventWindow

However, whenever I update any record I always get a ADD event which means in Esper result oldEvent is always null.  What is the problem with my query?


Use irstream instead of istream.  The keyword irstream will include both insert and remove events, that's why it's called irstream.  Change the query to use irstream and my problem is solved. 

SELECT irstream column1, column2, column3 
FROM myEventWindow

Monday, February 25, 2013

Setup SSH Private-Public Keys on Unix

  1. Generate Key-Pair using PuTTYGen
  2. Save private key to a safe place.  
  3. Massage the public key into openSSH format by doing the following
    •     Remove lirst 2 line
    •     Remove last line
    •     Join all lines into a single line
    •     Add 'ssh-rsa ' (remember the trailing space) at the start of the line

  4. Copy public key to unix ~/.ssh/authorized_keys file or append to the existing file content
  5. Use PuTTY to select the private key to ssh to the remote server


If using Java library such as JSch to connect using private key, need to export private key into openSSH format first.  Load the private key just created into PuTTYGen and select convertion -> Export Openssh Key option.  Use the openssh format private key in Java code to connect to ssh.