@Test public void get() { }
public Map<String, byte[]> get(String key, String... keys) throws KitDBException { try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); DAssert.notEmpty(keys, ErrorType.EMPTY, "keys is empty"); Meta metaV = getMeta(key_b); if (metaV == null) { return new HashMap<>(); } Map<String, byte[]> map = new HashMap<>(keys.length); List<byte[]> keyList = new ArrayList<>(); for (String mkey : keys) { byte[] mkey_b = mkey.getBytes(charset); Key vkey = new Key(key_b.length, key_b, metaV.getVersion(), mkey_b); keyList.add(vkey.convertBytes().toBytes()); } Map<byte[], byte[]> resMap = multiGet(keyList, SstColumnFamily.DEFAULT); Iterator<Map.Entry<byte[], byte[]>> iter = resMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<byte[], byte[]> entry = iter.next(); byte[] resKey = entry.getKey(); KeyD keyd = KeyD.build(resKey); map.put(new String(keyd.convertValue().getKey()), entry.getValue()); } return map; } }
RMap extends RCollection { public Map<String, byte[]> get(String key, String... keys) throws KitDBException { try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); DAssert.notEmpty(keys, ErrorType.EMPTY, "keys is empty"); Meta metaV = getMeta(key_b); if (metaV == null) { return new HashMap<>(); } Map<String, byte[]> map = new HashMap<>(keys.length); List<byte[]> keyList = new ArrayList<>(); for (String mkey : keys) { byte[] mkey_b = mkey.getBytes(charset); Key vkey = new Key(key_b.length, key_b, metaV.getVersion(), mkey_b); keyList.add(vkey.convertBytes().toBytes()); } Map<byte[], byte[]> resMap = multiGet(keyList, SstColumnFamily.DEFAULT); Iterator<Map.Entry<byte[], byte[]>> iter = resMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<byte[], byte[]> entry = iter.next(); byte[] resKey = entry.getKey(); KeyD keyd = KeyD.build(resKey); map.put(new String(keyd.convertValue().getKey()), entry.getValue()); } return map; } } }
RMap extends RCollection { public Map<String, byte[]> get(String key, String... keys) throws KitDBException { try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); DAssert.notEmpty(keys, ErrorType.EMPTY, "keys is empty"); Meta metaV = getMeta(key_b); if (metaV == null) { return new HashMap<>(); } Map<String, byte[]> map = new HashMap<>(keys.length); List<byte[]> keyList = new ArrayList<>(); for (String mkey : keys) { byte[] mkey_b = mkey.getBytes(charset); Key vkey = new Key(key_b.length, key_b, metaV.getVersion(), mkey_b); keyList.add(vkey.convertBytes().toBytes()); } Map<byte[], byte[]> resMap = multiGet(keyList, SstColumnFamily.DEFAULT); Iterator<Map.Entry<byte[], byte[]>> iter = resMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<byte[], byte[]> entry = iter.next(); byte[] resKey = entry.getKey(); KeyD keyd = KeyD.build(resKey); map.put(new String(keyd.convertValue().getKey()), entry.getValue()); } return map; } } protected  RMap(DB db); }
RMap extends RCollection { public Map<String, byte[]> get(String key, String... keys) throws KitDBException { try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); DAssert.notEmpty(keys, ErrorType.EMPTY, "keys is empty"); Meta metaV = getMeta(key_b); if (metaV == null) { return new HashMap<>(); } Map<String, byte[]> map = new HashMap<>(keys.length); List<byte[]> keyList = new ArrayList<>(); for (String mkey : keys) { byte[] mkey_b = mkey.getBytes(charset); Key vkey = new Key(key_b.length, key_b, metaV.getVersion(), mkey_b); keyList.add(vkey.convertBytes().toBytes()); } Map<byte[], byte[]> resMap = multiGet(keyList, SstColumnFamily.DEFAULT); Iterator<Map.Entry<byte[], byte[]>> iter = resMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<byte[], byte[]> entry = iter.next(); byte[] resKey = entry.getKey(); KeyD keyd = KeyD.build(resKey); map.put(new String(keyd.convertValue().getKey()), entry.getValue()); } return map; } } protected  RMap(DB db); void put(String key, String mkey, byte[] value); void putTTL(String key, String mkey, byte[] value, int ttl); void put(String key, Map<String, byte[]> map); void putMayTTL(String key, int ttl, Map<String, byte[]> map); void putMayTTL(String key, int ttl, String mkey, byte[] value); Map<String, byte[]> get(String key, String... keys); byte[] get(String key, String mkey); void remove(String key, String... keys); @Override void delete(String key); @Override KeyIterator getKeyIterator(); void deleteFast(String key); @Override RIterator<RMap> iterator(String key); @Override Entry getEntry(RocksIterator iterator); @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); }
RMap extends RCollection { public Map<String, byte[]> get(String key, String... keys) throws KitDBException { try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); DAssert.notEmpty(keys, ErrorType.EMPTY, "keys is empty"); Meta metaV = getMeta(key_b); if (metaV == null) { return new HashMap<>(); } Map<String, byte[]> map = new HashMap<>(keys.length); List<byte[]> keyList = new ArrayList<>(); for (String mkey : keys) { byte[] mkey_b = mkey.getBytes(charset); Key vkey = new Key(key_b.length, key_b, metaV.getVersion(), mkey_b); keyList.add(vkey.convertBytes().toBytes()); } Map<byte[], byte[]> resMap = multiGet(keyList, SstColumnFamily.DEFAULT); Iterator<Map.Entry<byte[], byte[]>> iter = resMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<byte[], byte[]> entry = iter.next(); byte[] resKey = entry.getKey(); KeyD keyd = KeyD.build(resKey); map.put(new String(keyd.convertValue().getKey()), entry.getValue()); } return map; } } protected  RMap(DB db); void put(String key, String mkey, byte[] value); void putTTL(String key, String mkey, byte[] value, int ttl); void put(String key, Map<String, byte[]> map); void putMayTTL(String key, int ttl, Map<String, byte[]> map); void putMayTTL(String key, int ttl, String mkey, byte[] value); Map<String, byte[]> get(String key, String... keys); byte[] get(String key, String mkey); void remove(String key, String... keys); @Override void delete(String key); @Override KeyIterator getKeyIterator(); void deleteFast(String key); @Override RIterator<RMap> iterator(String key); @Override Entry getEntry(RocksIterator iterator); @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); static byte[] HEAD_B; final static byte[] HEAD_KEY_B; }