Skip to content

Commit

Permalink
Mark deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
hx235 committed Jul 31, 2023
1 parent bb8fcc0 commit 3b236f8
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/rocksdb/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ struct DBOptions {
// Default: null
std::shared_ptr<WriteBufferManager> write_buffer_manager = nullptr;

// DEPRECATED
// Specify the file access pattern once a compaction is started.
// It will be applied to all input files of a compaction.
// Default: NORMAL
Expand Down
1 change: 1 addition & 0 deletions java/src/main/java/org/rocksdb/AccessHint.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/**
* File access pattern once a compaction has started
*/
@Deprecated
public enum AccessHint {
NONE((byte)0x0),
NORMAL((byte)0x1),
Expand Down
2 changes: 2 additions & 0 deletions java/src/main/java/org/rocksdb/DBOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -752,13 +752,15 @@ public long dbWriteBufferSize() {
}

@Override
@Deprecated
public DBOptions setAccessHintOnCompactionStart(final AccessHint accessHint) {
assert(isOwningHandle());
setAccessHintOnCompactionStart(nativeHandle_, accessHint.getValue());
return this;
}

@Override
@Deprecated
public AccessHint accessHintOnCompactionStart() {
assert(isOwningHandle());
return AccessHint.getAccessHint(accessHintOnCompactionStart(nativeHandle_));
Expand Down
4 changes: 2 additions & 2 deletions java/src/main/java/org/rocksdb/DBOptionsInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ public interface DBOptionsInterface<T extends DBOptionsInterface<T>> {
*
* @return the reference to the current options.
*/
T setAccessHintOnCompactionStart(final AccessHint accessHint);
@Deprecated T setAccessHintOnCompactionStart(final AccessHint accessHint);

/**
* Specify the file access pattern once a compaction is started.
Expand All @@ -945,7 +945,7 @@ public interface DBOptionsInterface<T extends DBOptionsInterface<T>> {
*
* @return The access hint
*/
AccessHint accessHintOnCompactionStart();
@Deprecated AccessHint accessHintOnCompactionStart();

/**
* This is a maximum buffer size that is used by WinMmapReadableFile in
Expand Down
2 changes: 2 additions & 0 deletions java/src/main/java/org/rocksdb/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -840,13 +840,15 @@ public long dbWriteBufferSize() {
}

@Override
@Deprecated
public Options setAccessHintOnCompactionStart(final AccessHint accessHint) {
assert(isOwningHandle());
setAccessHintOnCompactionStart(nativeHandle_, accessHint.getValue());
return this;
}

@Override
@Deprecated
public AccessHint accessHintOnCompactionStart() {
assert(isOwningHandle());
return AccessHint.getAccessHint(accessHintOnCompactionStart(nativeHandle_));
Expand Down
1 change: 1 addition & 0 deletions java/src/test/java/org/rocksdb/DBOptionsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ public void setWriteBufferManagerWithZeroBufferSize() throws RocksDBException {
}
}

@SuppressWarnings("deprecated")
@Test
public void accessHintOnCompactionStart() {
try(final DBOptions opt = new DBOptions()) {
Expand Down
1 change: 1 addition & 0 deletions java/src/test/java/org/rocksdb/OptionsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ public void setWriteBufferManagerWithAllowStall() throws RocksDBException {
}
}

@SuppressWarnings("deprecated")
@Test
public void accessHintOnCompactionStart() {
try (final Options opt = new Options()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Mark `Options::access_hint_on_compaction_start` related APIs as deprecated. See #11631 for alternative behavior.

0 comments on commit 3b236f8

Please sign in to comment.