From 527526e3466c69096dcfe765d9decf5159b20bfb Mon Sep 17 00:00:00 2001 From: Alan Paxton Date: Wed, 2 Oct 2024 14:44:43 +0100 Subject: [PATCH] Format fixes --- .../main/java/org/rocksdb/jmh/GetNotFoundBenchmarks.java | 7 ++++--- java/rocksjni/kv_helper.h | 3 ++- java/rocksjni/transaction.cc | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/java/jmh/src/main/java/org/rocksdb/jmh/GetNotFoundBenchmarks.java b/java/jmh/src/main/java/org/rocksdb/jmh/GetNotFoundBenchmarks.java index b91ee498ff1..8422ee2355e 100644 --- a/java/jmh/src/main/java/org/rocksdb/jmh/GetNotFoundBenchmarks.java +++ b/java/jmh/src/main/java/org/rocksdb/jmh/GetNotFoundBenchmarks.java @@ -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; @@ -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))); } /** @@ -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))); } } \ No newline at end of file diff --git a/java/rocksjni/kv_helper.h b/java/rocksjni/kv_helper.h index fc54e44ccd7..e1eecf3ceb6 100644 --- a/java/rocksjni/kv_helper.h +++ b/java/rocksjni/kv_helper.h @@ -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(pinnable_slice_.size()); diff --git a/java/rocksjni/transaction.cc b/java/rocksjni/transaction.cc index 03c341cc8d1..c97764b5005 100644 --- a/java/rocksjni/transaction.cc +++ b/java/rocksjni/transaction.cc @@ -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; @@ -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; @@ -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(); @@ -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();