@Test public void deleteFast() throws KitDBException { String head = "deleteFast0"; RSet set = db.getSet(); int num = 100; Set<String> keys = new HashSet<>(); try { for (int i = 0; i < num; i++) { int num2 = 1000; keys.add(head + i); for (int i1 = 0; i1 < num2; i1++) { set.add(head + i, ("hello world" + i).getBytes()); } } for (int i = 0; i < num; i++) { set.deleteFast(head + i); } for (int i = 0; i < num; i++) { Assert.assertTrue(!set.isExist(head + i)); } } finally { } }
public void deleteFast(String key) throws KitDBException { checkTxStart(); LockEntity lockEntity = lock(key); try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); byte[] k_v = getDB(key_b, SstColumnFamily.META); if (k_v == null) { checkTxCommit(); return; } MetaV meta = MetaD.build(k_v).convertMetaV(); try { deleteFast(key_b, meta); } finally { unlock(lockEntity); } checkTxCommit(); } catch (KitDBException e) { checkTxRollBack(); throw e; } }
RSet extends RCollection { public void deleteFast(String key) throws KitDBException { checkTxStart(); LockEntity lockEntity = lock(key); try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); byte[] k_v = getDB(key_b, SstColumnFamily.META); if (k_v == null) { checkTxCommit(); return; } MetaV meta = MetaD.build(k_v).convertMetaV(); try { deleteFast(key_b, meta); } finally { unlock(lockEntity); } checkTxCommit(); } catch (KitDBException e) { checkTxRollBack(); throw e; } } }
RSet extends RCollection { public void deleteFast(String key) throws KitDBException { checkTxStart(); LockEntity lockEntity = lock(key); try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); byte[] k_v = getDB(key_b, SstColumnFamily.META); if (k_v == null) { checkTxCommit(); return; } MetaV meta = MetaD.build(k_v).convertMetaV(); try { deleteFast(key_b, meta); } finally { unlock(lockEntity); } checkTxCommit(); } catch (KitDBException e) { checkTxRollBack(); throw e; } } protected  RSet(DB db); }
RSet extends RCollection { public void deleteFast(String key) throws KitDBException { checkTxStart(); LockEntity lockEntity = lock(key); try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); byte[] k_v = getDB(key_b, SstColumnFamily.META); if (k_v == null) { checkTxCommit(); return; } MetaV meta = MetaD.build(k_v).convertMetaV(); try { deleteFast(key_b, meta); } finally { unlock(lockEntity); } checkTxCommit(); } catch (KitDBException e) { checkTxRollBack(); throw e; } } protected  RSet(DB db); List<byte[]> pop(String key, int num); void remove(String key, byte[]... values); boolean contains(String key, byte[] value); void addMayTTL(String key, int ttl, byte[]... values); void add(String key, byte[]... values); @Override void delete(String key); @Override KeyIterator getKeyIterator(); void deleteFast(String key); @Override @SuppressWarnings("unchecked") RIterator<RSet> iterator(String key); @Override int getTtl(String key); @Override void delTtl(String key); @Override void ttl(String key, int ttl); @Override boolean isExist(String key); @Override int size(String key); @Override Entry getEntry(RocksIterator iterator); }
RSet extends RCollection { public void deleteFast(String key) throws KitDBException { checkTxStart(); LockEntity lockEntity = lock(key); try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); byte[] k_v = getDB(key_b, SstColumnFamily.META); if (k_v == null) { checkTxCommit(); return; } MetaV meta = MetaD.build(k_v).convertMetaV(); try { deleteFast(key_b, meta); } finally { unlock(lockEntity); } checkTxCommit(); } catch (KitDBException e) { checkTxRollBack(); throw e; } } protected  RSet(DB db); List<byte[]> pop(String key, int num); void remove(String key, byte[]... values); boolean contains(String key, byte[] value); void addMayTTL(String key, int ttl, byte[]... values); void add(String key, byte[]... values); @Override void delete(String key); @Override KeyIterator getKeyIterator(); void deleteFast(String key); @Override @SuppressWarnings("unchecked") RIterator<RSet> iterator(String key); @Override int getTtl(String key); @Override void delTtl(String key); @Override void ttl(String key, int ttl); @Override boolean isExist(String key); @Override int size(String key); @Override Entry getEntry(RocksIterator iterator); final static String HEAD; final static byte[] HEAD_B; final static byte[] HEAD_V_B; }