@Override public void remove(String key) { try { db.remove(key.getBytes()); } catch (Exception e) { LOG.error("Failed to remove " + key); } }
@Override public void remove(K key) throws IOException { try { rocksDb.remove(columnFamily, serializer.serialize(key)); } catch (RocksDBException e) { throw new IOException(String.format("Failed to remove key=%s", key), e); } }
@Override public void delete(String key) throws FailStoreException { try { db.remove(key.getBytes("UTF-8")); } catch (Exception e) { throw new FailStoreException(e); } }
@Override public void delete(String key) throws FailStoreException { try { db.remove(key.getBytes("UTF-8")); } catch (Exception e) { throw new FailStoreException(e); } }
@Override public Object get(String key) { try { byte[] data = db.get(key.getBytes()); if (data != null) { try { return deserialize(data); } catch (Exception e) { LOG.error("Failed to deserialize obj of " + key, e); db.remove(key.getBytes()); return null; } } } catch (Exception ignored) { } return null; }
} catch (Exception e) { LOG.error("Failed to deserialize obj of " + new String(keyByte)); db.remove(keyByte); continue;
@Override public void remove(String key) { try { db.remove(key.getBytes()); } catch (Exception e) { LOG.error("Failed to remove " + key); } }
public boolean del(String key) { if (key.length() == 0) return false; try { db.remove(key.getBytes()); return true; } catch (Exception e) { e.printStackTrace(); log.error(e.getMessage()); } return false; }
@Override public void delete(String key) throws FailStoreException { try { db.remove(key.getBytes("UTF-8")); } catch (Exception e) { throw new FailStoreException(e); } }
@Override public void remove() { if (cacheIndex == 0 || cacheIndex > cacheEntries.size()) { throw new IllegalStateException("The remove operation must be called after an valid next operation."); } RocksDBMapEntry lastEntry = cacheEntries.get(cacheIndex - 1); lastEntry.remove(); }
static void removeEvent(final String eventKey) throws Exception{ try { final byte[] keyBytes = eventKey.getBytes(StandardCharsets.UTF_8); byte[] value = transientStateDB.get(keyBytes); if (value != null) { transientStateDB.remove(keyBytes); } } catch (RocksDBException ex) { //would want to log this occurring throw new Exception(ex.getMessage()); } }
@Override public void clear() { try { writeCurrentKeyWithGroupAndNamespace(); byte[] key = keySerializationStream.toByteArray(); backend.db.remove(columnFamily, writeOptions, key); } catch (IOException|RocksDBException e) { throw new RuntimeException("Error while removing entry from RocksDB", e); } }
@Override public Object get(String key) { try { byte[] data = db.get(key.getBytes()); if (data != null) { try { return deserialize(data); } catch (Exception e) { LOG.error("Failed to deserialize obj of " + key); db.remove(key.getBytes()); return null; } } } catch (Exception ignored) { } return null; }
@Override public V remove(Object key) { putAll(); V value = get(key); try { ByteArrayOutputStream keyBytes = new ByteArrayOutputStream(); ObjectOutput keyOut = new ObjectOutputStream(keyBytes); keyOut.writeObject(key); keyOut.flush(); db.remove(keyBytes.toByteArray()); } catch (IOException | RocksDBException e) { Throwables.propagate(e); } return value; }
static void moveToFailed(final String eventKey) { try { final byte[] keyBytes = eventKey.getBytes(StandardCharsets.UTF_8); final byte[] eventBody = transientStateDB.get(keyBytes); if(null != eventBody) { failedStateDB.put(keyBytes, eventBody); //now remove it from the transient try { transientStateDB.remove(keyBytes); } catch (Exception ex) { //we should at least log this.... } } } catch (Exception ex) { //this should be logged and perhaps throw } }
@Override public void removeBlob(String namespace, String path) { try (RocksDBReference dbRef = db()) { dbRef.db().remove(key(namespace, path)); } catch (RocksDBException e) { throw Throwables.propagate(e); } }
@Override public void delete(ObjectId objectId) { checkNotNull(objectId, "argument objectId is null"); checkWritable(); byte[] key = objectId.getRawValue(); try (RocksDBReference dbRef = dbhandle.getReference()) { dbRef.db().remove(key); } catch (RocksDBException e) { throw Throwables.propagate(e); } }
@Override public void remove(byte[] key) { key.getClass(); Preconditions.checkState(!this.closed, "closed"); this.cursorTracker.poll(); if (this.writeBatch != null) { assert RocksDBUtil.isInitialized(this.writeBatch); synchronized (this.writeBatch) { this.writeBatch.remove(key); } } else { assert RocksDBUtil.isInitialized(this.db); try { this.db.remove(key); } catch (RocksDBException e) { throw new RuntimeException("RocksDB error", e); } } }
@Override public void removeBlobs(String namespace) { byte[] namespacePrefix = (namespace + ".").getBytes(); try (RocksDBReference dbRef = db()) { try (RocksIterator it = dbRef.db().newIterator()) { it.seek(namespacePrefix); while (it.isValid()) { byte[] key = it.key(); for (int i = 0; i < namespacePrefix.length; i++) { if (namespacePrefix[i] != key[i]) { return; } } try { dbRef.db().remove(key); } catch (RocksDBException e) { Throwables.propagate(e); } it.next(); } } } } }