@Test public void delTtl() throws Exception { RKv kv = db.getrKv(); String head = "delTtlA"; try { for (int i = 0; i < 10000; i++) { kv.set(head + i, ("test" + i).getBytes(), 3); } for (int i = 0; i < 10000; i++) { kv.delTtl(head + i); } Thread.sleep(3 * 1000); for (int i = 0; i < 10000; i++) { byte[] bytes = kv.get(head + i); Assert.assertNotNull(bytes); } } catch (Exception e) { kv.delPrefix(head); } }
void delTtl(String key) throws KitDBException { checkTxStart(); try (CloseLock ignored = checkClose()) { LockEntity lockEntity = lock.lock(key); try { byte[] keyb = getKey(key); start(); deleteDB(ArrayKits.addAll(HEAD_TTL, keyb), SstColumnFamily.DEFAULT); commit(); } finally { lock.unlock(lockEntity); release(); } checkTxCommit(); } catch (Exception e) { checkTxRollBack(); throw e; } }
RKv extends RBase { void delTtl(String key) throws KitDBException { checkTxStart(); try (CloseLock ignored = checkClose()) { LockEntity lockEntity = lock.lock(key); try { byte[] keyb = getKey(key); start(); deleteDB(ArrayKits.addAll(HEAD_TTL, keyb), SstColumnFamily.DEFAULT); commit(); } finally { lock.unlock(lockEntity); release(); } checkTxCommit(); } catch (Exception e) { checkTxRollBack(); throw e; } } }
RKv extends RBase { void delTtl(String key) throws KitDBException { checkTxStart(); try (CloseLock ignored = checkClose()) { LockEntity lockEntity = lock.lock(key); try { byte[] keyb = getKey(key); start(); deleteDB(ArrayKits.addAll(HEAD_TTL, keyb), SstColumnFamily.DEFAULT); commit(); } finally { lock.unlock(lockEntity); release(); } checkTxCommit(); } catch (Exception e) { checkTxRollBack(); throw e; } } protected  RKv(DB db); }
RKv extends RBase { void delTtl(String key) throws KitDBException { checkTxStart(); try (CloseLock ignored = checkClose()) { LockEntity lockEntity = lock.lock(key); try { byte[] keyb = getKey(key); start(); deleteDB(ArrayKits.addAll(HEAD_TTL, keyb), SstColumnFamily.DEFAULT); commit(); } finally { lock.unlock(lockEntity); release(); } checkTxCommit(); } catch (Exception e) { checkTxRollBack(); throw e; } } protected  RKv(DB db); void set(String key, byte[] value); long incr(String key, int step, int ttl); long incr(String key, int step); void set(Map<String, byte[]> map); void set(Map<String, byte[]> map, int ttl); void set(String key, byte[] value, int ttl); void ttl(String key, int ttl); Map<String, byte[]> get(List<String> keys); byte[] get(String key); byte[] getNoTTL(String key); void del(String key); void delPrefix(String key_); List<String> keys(String key_, int start, int limit); }
RKv extends RBase { void delTtl(String key) throws KitDBException { checkTxStart(); try (CloseLock ignored = checkClose()) { LockEntity lockEntity = lock.lock(key); try { byte[] keyb = getKey(key); start(); deleteDB(ArrayKits.addAll(HEAD_TTL, keyb), SstColumnFamily.DEFAULT); commit(); } finally { lock.unlock(lockEntity); release(); } checkTxCommit(); } catch (Exception e) { checkTxRollBack(); throw e; } } protected  RKv(DB db); void set(String key, byte[] value); long incr(String key, int step, int ttl); long incr(String key, int step); void set(Map<String, byte[]> map); void set(Map<String, byte[]> map, int ttl); void set(String key, byte[] value, int ttl); void ttl(String key, int ttl); Map<String, byte[]> get(List<String> keys); byte[] get(String key); byte[] getNoTTL(String key); void del(String key); void delPrefix(String key_); List<String> keys(String key_, int start, int limit); final static String HEAD; final static byte[] HEAD_TTL; final static byte[] HEAD_B; }