org.rocksdb.Status Java Examples

The following examples show how to use org.rocksdb.Status. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RocksDBColumnarKeyValueStorage.java    From besu with Apache License 2.0 5 votes vote down vote up
@Override
public boolean tryDelete(final ColumnFamilyHandle segmentHandle, final byte[] key) {
  try {
    db.delete(segmentHandle, tryDeleteOptions, key);
    return true;
  } catch (RocksDBException e) {
    if (e.getStatus().getCode() == Status.Code.Incomplete) {
      return false;
    } else {
      throw new StorageException(e);
    }
  }
}
 
Example #2
Source File: RocksDBKeyValueStorage.java    From besu with Apache License 2.0 5 votes vote down vote up
@Override
public boolean tryDelete(final byte[] key) {
  try {
    db.delete(tryDeleteOptions, key);
    return true;
  } catch (RocksDBException e) {
    if (e.getStatus().getCode() == Status.Code.Incomplete) {
      return false;
    } else {
      throw new StorageException(e);
    }
  }
}
 
Example #3
Source File: TestByteStoreManager.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
@Test
public void testNoDBOpenRetry() throws Exception {
  String dbPath = temporaryFolder.newFolder().getAbsolutePath();

  try (ByteStoreManager bsm = new ByteStoreManager(dbPath, false)) {
    bsm.start();
    ByteStoreManager bsm2 = new ByteStoreManager(dbPath, false, true);
    bsm2.start();

    fail("ByteStoreManager shouldn't have been able to open a locked instance");
  } catch (RocksDBException e) {
    assertTrue("RocksDBException isn't IOError type", Status.Code.IOError.equals(e.getStatus().getCode()));
    assertTrue("Incorrect error message", e.getStatus().getState().contains("While lock"));
  }
}
 
Example #4
Source File: KafkaStreamsProcessor.java    From quarkus with Apache License 2.0 4 votes vote down vote up
private void registerClassesThatAreAccessedViaJni(BuildProducer<JniRuntimeAccessBuildItem> jniRuntimeAccessibleClasses) {
    jniRuntimeAccessibleClasses
            .produce(new JniRuntimeAccessBuildItem(true, false, false, RocksDBException.class, Status.class));
}