Skip to content

Commit

Permalink
Format fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpaxton committed Nov 19, 2024
1 parent 6eb8ae9 commit 527526e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public class GetNotFoundBenchmarks {
@Param({"no_column_family", "20_column_families"}) String columnFamilyTestType;

@Param({"1000", "100000"}) int keyCount;
private final static int extraKeyCount = 16; // some slack to deal with odd/even tests rounding up key values
private final static int extraKeyCount =
16; // some slack to deal with odd/even tests rounding up key values

@Param({"12"}) int keySize;

Expand Down Expand Up @@ -176,7 +177,7 @@ private byte[] getKeyArr(final int keyOffset, final int increment) {
*/
@Benchmark
public void getNotFoundEven(Blackhole blackhole) throws RocksDBException {
blackhole.consume(db.get(getColumnFamily(), getKeyArr(0,2)));
blackhole.consume(db.get(getColumnFamily(), getKeyArr(0, 2)));
}

/**
Expand All @@ -185,6 +186,6 @@ public void getNotFoundEven(Blackhole blackhole) throws RocksDBException {
*/
@Benchmark
public void getNotFoundOdd(Blackhole blackhole) throws RocksDBException {
blackhole.consume(db.get(getColumnFamily(), getKeyArr(1,2)));
blackhole.consume(db.get(getColumnFamily(), getKeyArr(1, 2)));
}
}
3 changes: 2 additions & 1 deletion java/rocksjni/kv_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ class JByteArrayPinnableSlice {
/**
* @brief create a new Java buffer and copy the result into it
*
* @return jbyteArray the java buffer holding the result, nullptr if a buffer could not be allocated
* @return jbyteArray the java buffer holding the result, nullptr if a buffer
* could not be allocated
*/
jbyteArray NewByteArray() {
const jint pinnable_len = static_cast<jint>(pinnable_slice_.size());
Expand Down
8 changes: 4 additions & 4 deletions java/rocksjni/transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jbyteArray Java_org_rocksdb_Transaction_get__JJ_3BIIJ(
auto status = ROCKSDB_NAMESPACE::KVException::ThrowOnError(
env, txn->Get(*read_options, column_family_handle, key.slice(),
&value.pinnable_slice()));
if (status.IsNotFound()) return nullptr;
if (status.IsNotFound()) return nullptr;
return value.NewByteArray();
} catch (ROCKSDB_NAMESPACE::KVException&) {
return nullptr;
Expand All @@ -203,7 +203,7 @@ jbyteArray Java_org_rocksdb_Transaction_get__JJ_3BII(
ROCKSDB_NAMESPACE::JByteArrayPinnableSlice value(env);
auto status = ROCKSDB_NAMESPACE::KVException::ThrowOnError(
env, txn->Get(*read_options, key.slice(), &value.pinnable_slice()));
if (status.IsNotFound()) return nullptr;
if (status.IsNotFound()) return nullptr;
return value.NewByteArray();
} catch (ROCKSDB_NAMESPACE::KVException&) {
return nullptr;
Expand Down Expand Up @@ -232,7 +232,7 @@ jint Java_org_rocksdb_Transaction_get__JJ_3BII_3BIIJ(
auto status = ROCKSDB_NAMESPACE::KVException::ThrowOnError(
env, txn->Get(*read_options, column_family_handle, key.slice(),
&value.pinnable_slice()));
if (status.IsNotFound()) return ROCKSDB_NAMESPACE::KVException::kNotFound;
if (status.IsNotFound()) return ROCKSDB_NAMESPACE::KVException::kNotFound;
return value.Fetch();
} catch (ROCKSDB_NAMESPACE::KVException& e) {
return e.Code();
Expand Down Expand Up @@ -265,7 +265,7 @@ jint Java_org_rocksdb_Transaction_getDirect(JNIEnv* env, jclass, jlong jhandle,
auto status = ROCKSDB_NAMESPACE::KVException::ThrowOnError(
env, txn->Get(*read_options, column_family_handle, key.slice(),
&value.pinnable_slice()));
if (status.IsNotFound()) return ROCKSDB_NAMESPACE::KVException::kNotFound;
if (status.IsNotFound()) return ROCKSDB_NAMESPACE::KVException::kNotFound;
return value.Fetch();
} catch (const ROCKSDB_NAMESPACE::KVException& e) {
return e.Code();
Expand Down

0 comments on commit 527526e

Please sign in to comment.