title: RocksDB: how to use ttl in java?
body: <p>I am testing rocksdb for java api. I put a key-value entry into the map, and then wait for 20s, then get from map. Why the entry is not deleted? 
  this is my code:</p>
  
  <pre><code>import org.rocksdb.Options;
  import org.rocksdb.RocksDBException;
  import org.rocksdb.TtlDB;
  
  public class Test2 {
      public static void main(String[] args) throws Exception {
          TtlDB.loadLibrary();
          Options options = new Options()
                  .setCreateIfMissing(true);
  
  
          TtlDB db = TtlDB.open(options, args[0],20,false);
          if(args.length &gt; 3 &amp;&amp; "put".equals(args[1])) {
              db.put(args[2].getBytes(), args[3].getBytes());
          }
  
          byte[] arr = db.get(args[2].getBytes());
          if(arr != null) {
              System.out.println(new String(arr));
          } else {
              System.out.println(arr);
          }
          System.out.println(db.get(args[2].getBytes()));
          Thread.sleep(21000);
          System.out.println(db.get(args[2].getBytes()));
          db.close();
      }
  }
  </code></pre>