Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up RocksJava compilation warnings #13319

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions java/src/main/java/org/rocksdb/DBOptionsInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,8 @@ T setEnableWriteThreadAdaptiveYield(
* this field blank. Default: Empty string (no offpeak).
*
* @param offpeakTimeUTC String value from which to parse offpeak time range
*
* @return the instance of the current object.
*/
T setDailyOffpeakTimeUTC(final String offpeakTimeUTC);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ public interface MutableDBOptionsInterface<T extends MutableDBOptionsInterface<T
* this field blank. Default: Empty string (no offpeak).
*
* @param offpeakTimeUTC String value from which to parse offpeak time range
* @return the reference to the current options.
*/
T setDailyOffpeakTimeUTC(final String offpeakTimeUTC);

Expand Down
2 changes: 1 addition & 1 deletion java/src/main/java/org/rocksdb/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@ public List<TablePropertiesCollectorFactory> tablePropertiesCollectorFactory() {
* Set TablePropertiesCollectorFactory in underlying C++ object.
* This method create its own copy of the list. Caller is responsible for
* closing all the instances in the list.
* @param factories
* @param factories to set
*/
public void setTablePropertiesCollectorFactory(List<TablePropertiesCollectorFactory> factories) {
long[] factoryHandlers = new long[factories.size()];
Expand Down
12 changes: 12 additions & 0 deletions java/src/main/java/org/rocksdb/PerfContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ public long getBlobDecompressTime() {
* hidden by the tombstones will be included here.
* 4. symmetric cases for Prev() and SeekToLast()
* internal_recent_skipped_count is not included in this counter.
*
* @return total number of internal keys skipped over during iteration
*/
public long getInternalKeySkippedCount() {
return getInternalKeySkippedCount(nativeHandle_);
Expand All @@ -248,6 +250,8 @@ public long getInternalKeySkippedCount() {
* SeekToFirst(), there may be one or more deleted keys before the next valid
* key. Every deleted key is counted once. We don't recount here if there are
* still older updates invalidated by the tombstones.
*
* @return Total number of deletes and single deletes skipped over during iteration
*/
public long getInternalDeleteSkippedCount() {
return getInternalDeleteSkippedCount(nativeHandle_);
Expand All @@ -256,6 +260,8 @@ public long getInternalDeleteSkippedCount() {
/**
* How many times iterators skipped over internal keys that are more recent
* than the snapshot that iterator is using.
*
* @return number of skipped recent internal keys
*/
public long getInternalRecentSkippedCount() {
return getInternalRecentSkippedCount(nativeHandle_);
Expand All @@ -264,6 +270,8 @@ public long getInternalRecentSkippedCount() {
/**
* How many merge operands were fed into the merge operator by iterators.
* Note: base values are not included in the count.
*
* @return How many merge operands were fed into the merge operator by iterator
*/
public long getInternalMergeCount() {
return getInternalMergeCount(nativeHandle_);
Expand All @@ -272,6 +280,8 @@ public long getInternalMergeCount() {
/**
* How many merge operands were fed into the merge operator by point lookups.
* Note: base values are not included in the count.
*
* @return How many merge operands were fed into the merge operator by point lookups
*/
public long getInternalMergePointLookupCount() {
return getInternalMergePointLookupCount(nativeHandle_);
Expand All @@ -281,6 +291,8 @@ public long getInternalMergePointLookupCount() {
* Number of times we reseeked inside a merging iterator, specifically to skip
* after or before a range of keys covered by a range deletion in a newer LSM
* component.
*
* @return Number of times we reseeked inside a merging iterator
*/
public long getInternalRangeDelReseekCount() {
return getInternalRangeDelReseekCount(nativeHandle_);
Expand Down
9 changes: 6 additions & 3 deletions java/src/main/java/org/rocksdb/RocksDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,8 @@ public List<ColumnFamilyHandle> createColumnFamilies(
* The ColumnFamilyHandle is automatically disposed with DB disposal.
*
* @param columnFamilyDescriptor column family to be created.
* @param importColumnFamilyOptions options for the files being imported.
* @param metadata description of the column family
* @return {@link org.rocksdb.ColumnFamilyHandle} instance.
*
* @throws RocksDBException thrown if error happens in underlying
Expand Down Expand Up @@ -3868,10 +3870,11 @@ public void setOptions(

/**
* Set performance level for rocksdb performance measurement.
* @param level
* @param level to set
* @throws IllegalArgumentException for UNINITIALIZED and OUT_OF_BOUNDS values
* as they can't be used for settings.
*/
@SuppressWarnings("deprecation")
public void setPerfLevel(final PerfLevel level) {
if (level == PerfLevel.UNINITIALIZED) {
throw new IllegalArgumentException("Unable to set UNINITIALIZED level");
Expand All @@ -3884,7 +3887,7 @@ public void setPerfLevel(final PerfLevel level) {

/**
* Return current performance level measurement settings.
* @return
* @return current performance level measurement settings
*/
public PerfLevel getPerfLevel() {
byte level = getPerfLevelNative();
Expand All @@ -3893,7 +3896,7 @@ public PerfLevel getPerfLevel() {

/**
* Return perf context bound to this thread.
* @return
* @return perf context bound to this thread
*/
public PerfContext getPerfContext() {
long native_handle = getPerfContextNative();
Expand Down
3 changes: 3 additions & 0 deletions java/src/main/java/org/rocksdb/RocksIteratorInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ public interface RocksIteratorInterface {
/**
* Similar to {@link #refresh()} but the iterator will be reading the latest DB state under the
* given snapshot.
*
* @param snapshot to refresh from
* @throws RocksDBException if an error occurs during the refresh
*/
void refresh(Snapshot snapshot) throws RocksDBException;
}
1 change: 1 addition & 0 deletions java/src/main/java/org/rocksdb/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public void clearSnapshot() {

/**
* Prepare the current transaction for 2PC
* @throws RocksDBException if an error occurs when preparing the transaction
*/
public void prepare() throws RocksDBException {
//TODO(AR) consider a Java'ish version of this function, which returns an AutoCloseable (commit)
Expand Down
14 changes: 14 additions & 0 deletions java/src/test/java/org/rocksdb/AbstractTransactionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public void savePoint() throws RocksDBException {
}
}

@SuppressWarnings("deprecation")
@Test
public void getPut_cf() throws RocksDBException {
final byte[] k1 = "key1".getBytes(UTF_8);
Expand Down Expand Up @@ -333,6 +334,7 @@ public void getPutIndirectByteBuffer_cf() throws RocksDBException {
getPutByteBuffer_cf(ByteBuffer::allocate);
}

@SuppressWarnings("deprecation")
@Test
public void multiGetPut_cf() throws RocksDBException {
final byte[][] keys = new byte[][] {"key1".getBytes(UTF_8), "key2".getBytes(UTF_8)};
Expand Down Expand Up @@ -373,6 +375,7 @@ public void multiGetPutAsList_cf() throws RocksDBException {
}
}

@SuppressWarnings("deprecation")
@Test
public void multiGetPut() throws RocksDBException {
final byte[][] keys = new byte[][] {"key1".getBytes(UTF_8), "key2".getBytes(UTF_8)};
Expand Down Expand Up @@ -589,6 +592,7 @@ public void getForUpdateByteBuffer_cf(final Function<Integer, ByteBuffer> alloca
}
}

@SuppressWarnings("deprecation")
@Test
public void multiGetForUpdate_cf() throws RocksDBException {
final byte[][] keys = new byte[][] {"key1".getBytes(UTF_8), "key2".getBytes(UTF_8)};
Expand All @@ -610,6 +614,7 @@ public void multiGetForUpdate_cf() throws RocksDBException {
}
}

@SuppressWarnings("deprecation")
@Test
public void multiGetForUpdate() throws RocksDBException {
final byte[][] keys = new byte[][] {"key1".getBytes(UTF_8), "key2".getBytes(UTF_8)};
Expand Down Expand Up @@ -728,6 +733,7 @@ public void getIterator_cf() throws RocksDBException {
}
}

@SuppressWarnings("deprecation")
@Test
public void merge_cf() throws RocksDBException {
final byte[] k1 = "key1".getBytes(UTF_8);
Expand Down Expand Up @@ -795,6 +801,7 @@ public void mergeIndirectByteBuffer() throws RocksDBException {
}
}

@SuppressWarnings("deprecation")
@Test
public void mergeDirectByteBuffer_cf() throws RocksDBException {
final ByteBuffer k1 = ByteBuffer.allocateDirect(100).put("key1".getBytes(UTF_8));
Expand All @@ -817,6 +824,8 @@ public void mergeDirectByteBuffer_cf() throws RocksDBException {
.isEqualTo("value1**value2".getBytes());
}
}

@SuppressWarnings("deprecation")
public void mergeIndirectByteBuffer_cf() throws RocksDBException {
final ByteBuffer k1 = ByteBuffer.allocate(100).put("key1".getBytes(UTF_8));
k1.flip();
Expand All @@ -837,6 +846,7 @@ public void mergeIndirectByteBuffer_cf() throws RocksDBException {
}
}

@SuppressWarnings("deprecation")
@Test
public void delete_cf() throws RocksDBException {
final byte[] k1 = "key1".getBytes(UTF_8);
Expand Down Expand Up @@ -872,6 +882,7 @@ public void delete() throws RocksDBException {
}
}

@SuppressWarnings("deprecation")
@Test
public void delete_parts_cf() throws RocksDBException {
final byte[][] keyParts = new byte[][] {"ke".getBytes(UTF_8), "y1".getBytes(UTF_8)};
Expand Down Expand Up @@ -915,6 +926,7 @@ public void delete_parts() throws RocksDBException {
}
}

@SuppressWarnings("deprecation")
@Test
public void getPutUntracked_cf() throws RocksDBException {
final byte[] k1 = "key1".getBytes(UTF_8);
Expand Down Expand Up @@ -1127,6 +1139,7 @@ public void mergeUntrackedByteBuffer_cf() throws RocksDBException {
}
}

@SuppressWarnings("deprecation")
@Test
public void deleteUntracked_cf() throws RocksDBException {
final byte[] k1 = "key1".getBytes(UTF_8);
Expand Down Expand Up @@ -1162,6 +1175,7 @@ public void deleteUntracked() throws RocksDBException {
}
}

@SuppressWarnings("deprecation")
@Test
public void deleteUntracked_parts_cf() throws RocksDBException {
final byte[][] keyParts = new byte[][] {"ke".getBytes(UTF_8), "y1".getBytes(UTF_8)};
Expand Down
Loading
Loading