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

Remove deprecated Options::access_hint_on_compaction_start #11654

Closed
Closed
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
29 changes: 0 additions & 29 deletions db/c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3516,35 +3516,6 @@ unsigned char rocksdb_options_get_advise_random_on_open(
return opt->rep.advise_random_on_open;
}

void rocksdb_options_set_access_hint_on_compaction_start(rocksdb_options_t* opt,
int v) {
switch (v) {
case 0:
opt->rep.access_hint_on_compaction_start =
ROCKSDB_NAMESPACE::Options::NONE;
break;
case 1:
opt->rep.access_hint_on_compaction_start =
ROCKSDB_NAMESPACE::Options::NORMAL;
break;
case 2:
opt->rep.access_hint_on_compaction_start =
ROCKSDB_NAMESPACE::Options::SEQUENTIAL;
break;
case 3:
opt->rep.access_hint_on_compaction_start =
ROCKSDB_NAMESPACE::Options::WILLNEED;
break;
default:
assert(0);
}
}

int rocksdb_options_get_access_hint_on_compaction_start(
rocksdb_options_t* opt) {
return opt->rep.access_hint_on_compaction_start;
}

void rocksdb_options_set_use_adaptive_mutex(rocksdb_options_t* opt,
unsigned char v) {
opt->rep.use_adaptive_mutex = v;
Expand Down
9 changes: 0 additions & 9 deletions db/c_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2039,8 +2039,6 @@ int main(int argc, char** argv) {
rocksdb_options_set_advise_random_on_open(o, 1);
CheckCondition(1 == rocksdb_options_get_advise_random_on_open(o));

rocksdb_options_set_access_hint_on_compaction_start(o, 3);
CheckCondition(3 == rocksdb_options_get_access_hint_on_compaction_start(o));

rocksdb_options_set_use_adaptive_mutex(o, 1);
CheckCondition(1 == rocksdb_options_get_use_adaptive_mutex(o));
Expand Down Expand Up @@ -2236,8 +2234,6 @@ int main(int argc, char** argv) {
CheckCondition(18 == rocksdb_options_get_stats_dump_period_sec(copy));
CheckCondition(5 == rocksdb_options_get_stats_persist_period_sec(copy));
CheckCondition(1 == rocksdb_options_get_advise_random_on_open(copy));
CheckCondition(3 ==
rocksdb_options_get_access_hint_on_compaction_start(copy));
CheckCondition(1 == rocksdb_options_get_use_adaptive_mutex(copy));
CheckCondition(19 == rocksdb_options_get_bytes_per_sync(copy));
CheckCondition(20 == rocksdb_options_get_wal_bytes_per_sync(copy));
Expand Down Expand Up @@ -2520,11 +2516,6 @@ int main(int argc, char** argv) {
CheckCondition(0 == rocksdb_options_get_advise_random_on_open(copy));
CheckCondition(1 == rocksdb_options_get_advise_random_on_open(o));

rocksdb_options_set_access_hint_on_compaction_start(copy, 2);
CheckCondition(2 ==
rocksdb_options_get_access_hint_on_compaction_start(copy));
CheckCondition(3 == rocksdb_options_get_access_hint_on_compaction_start(o));

rocksdb_options_set_use_adaptive_mutex(copy, 0);
CheckCondition(0 == rocksdb_options_get_use_adaptive_mutex(copy));
CheckCondition(1 == rocksdb_options_get_use_adaptive_mutex(o));
Expand Down
4 changes: 0 additions & 4 deletions include/rocksdb/c.h
Original file line number Diff line number Diff line change
Expand Up @@ -1505,10 +1505,6 @@ extern ROCKSDB_LIBRARY_API void rocksdb_options_set_advise_random_on_open(
rocksdb_options_t*, unsigned char);
extern ROCKSDB_LIBRARY_API unsigned char
rocksdb_options_get_advise_random_on_open(rocksdb_options_t*);
extern ROCKSDB_LIBRARY_API void
rocksdb_options_set_access_hint_on_compaction_start(rocksdb_options_t*, int);
extern ROCKSDB_LIBRARY_API int
rocksdb_options_get_access_hint_on_compaction_start(rocksdb_options_t*);
extern ROCKSDB_LIBRARY_API void rocksdb_options_set_use_adaptive_mutex(
rocksdb_options_t*, unsigned char);
extern ROCKSDB_LIBRARY_API unsigned char rocksdb_options_get_use_adaptive_mutex(
Expand Down
9 changes: 0 additions & 9 deletions include/rocksdb/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -954,15 +954,6 @@ struct DBOptions {
// Default: null
std::shared_ptr<WriteBufferManager> write_buffer_manager = nullptr;

// DEPRECATED
// This flag has no effect on the behavior of compaction and we plan to delete
// it in the future.
// Specify the file access pattern once a compaction is started.
// It will be applied to all input files of a compaction.
// Default: NORMAL
enum AccessHint { NONE, NORMAL, SEQUENTIAL, WILLNEED };
AccessHint access_hint_on_compaction_start = NORMAL;

// If non-zero, we perform bigger reads when doing compaction. If you're
// running RocksDB on spinning disks, you should set this to at least 2MB.
// That way RocksDB's compaction is doing sequential instead of random reads.
Expand Down
6 changes: 3 additions & 3 deletions include/rocksdb/utilities/options_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ class OptionTypeInfo {
template <typename T>
static OptionTypeInfo Enum(
int offset, const std::unordered_map<std::string, T>* const map,
OptionTypeFlags flags = OptionTypeFlags::kNone) {
OptionTypeInfo info(offset, OptionType::kEnum,
OptionVerificationType::kNormal, flags);
OptionTypeFlags flags = OptionTypeFlags::kNone,
OptionVerificationType verification = OptionVerificationType::kNormal) {
OptionTypeInfo info(offset, OptionType::kEnum, verification, flags);
info.SetParseFunc(
// Uses the map argument to convert the input string into
// its corresponding enum value. If value is found in the map,
Expand Down
3 changes: 1 addition & 2 deletions java/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ set(JAVA_MAIN_CLASSES
src/main/java/org/rocksdb/AbstractTransactionNotifier.java
src/main/java/org/rocksdb/AbstractWalFilter.java
src/main/java/org/rocksdb/AbstractWriteBatch.java
src/main/java/org/rocksdb/AccessHint.java
src/main/java/org/rocksdb/AdvancedColumnFamilyOptionsInterface.java
src/main/java/org/rocksdb/AdvancedMutableColumnFamilyOptionsInterface.java
src/main/java/org/rocksdb/BackgroundErrorReason.java
Expand Down Expand Up @@ -870,4 +869,4 @@ foreach (CLAZZ ${JAVA_TEST_RUNNING_CLASSES})
COMMAND ${Java_JAVA_EXECUTABLE} ${JVMARGS} -ea -Xcheck:jni -Djava.library.path=${PROJECT_BINARY_DIR}/java -classpath ${JAVA_RUN_TESTCLASSPATH}:${ROCKSDBJNI_CLASSES_TEST_JAR_FILE} org.rocksdb.test.RocksJunitRunner ${CLAZZ}
)
endif()
endforeach(CLAZZ)
endforeach(CLAZZ)
Original file line number Diff line number Diff line change
Expand Up @@ -614,9 +614,6 @@ private void prepareOptions(Options options) throws RocksDBException {
(Integer)flags_.get(Flag.universal_compression_size_percent));
// TODO(yhchiang): add RocksDB.openForReadOnly() to enable Flag.readonly
// TODO(yhchiang): enable Flag.merge_operator by switch
options.setAccessHintOnCompactionStart(
(String)flags_.get(Flag.compaction_fadvice));
// available values of fadvice are "NONE", "NORMAL", "SEQUENTIAL", "WILLNEED" for fadvice
*/
}

Expand Down
48 changes: 0 additions & 48 deletions java/rocksjni/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1554,30 +1554,6 @@ jlong Java_org_rocksdb_Options_dbWriteBufferSize(JNIEnv*, jclass,
return static_cast<jlong>(opt->db_write_buffer_size);
}

/*
* Class: org_rocksdb_Options
* Method: setAccessHintOnCompactionStart
* Signature: (JB)V
*/
void Java_org_rocksdb_Options_setAccessHintOnCompactionStart(
JNIEnv*, jclass, jlong jhandle, jbyte jaccess_hint_value) {
auto* opt = reinterpret_cast<ROCKSDB_NAMESPACE::Options*>(jhandle);
opt->access_hint_on_compaction_start =
ROCKSDB_NAMESPACE::AccessHintJni::toCppAccessHint(jaccess_hint_value);
}

/*
* Class: org_rocksdb_Options
* Method: accessHintOnCompactionStart
* Signature: (J)B
*/
jbyte Java_org_rocksdb_Options_accessHintOnCompactionStart(JNIEnv*, jclass,
jlong jhandle) {
auto* opt = reinterpret_cast<ROCKSDB_NAMESPACE::Options*>(jhandle);
return ROCKSDB_NAMESPACE::AccessHintJni::toJavaAccessHint(
opt->access_hint_on_compaction_start);
}

/*
* Class: org_rocksdb_Options
* Method: setCompactionReadaheadSize
Expand Down Expand Up @@ -7084,30 +7060,6 @@ jlong Java_org_rocksdb_DBOptions_dbWriteBufferSize(JNIEnv*, jclass,
return static_cast<jlong>(opt->db_write_buffer_size);
}

/*
* Class: org_rocksdb_DBOptions
* Method: setAccessHintOnCompactionStart
* Signature: (JB)V
*/
void Java_org_rocksdb_DBOptions_setAccessHintOnCompactionStart(
JNIEnv*, jclass, jlong jhandle, jbyte jaccess_hint_value) {
auto* opt = reinterpret_cast<ROCKSDB_NAMESPACE::DBOptions*>(jhandle);
opt->access_hint_on_compaction_start =
ROCKSDB_NAMESPACE::AccessHintJni::toCppAccessHint(jaccess_hint_value);
}

/*
* Class: org_rocksdb_DBOptions
* Method: accessHintOnCompactionStart
* Signature: (J)B
*/
jbyte Java_org_rocksdb_DBOptions_accessHintOnCompactionStart(JNIEnv*, jclass,
jlong jhandle) {
auto* opt = reinterpret_cast<ROCKSDB_NAMESPACE::DBOptions*>(jhandle);
return ROCKSDB_NAMESPACE::AccessHintJni::toJavaAccessHint(
opt->access_hint_on_compaction_start);
}

/*
* Class: org_rocksdb_DBOptions
* Method: setCompactionReadaheadSize
Expand Down
42 changes: 0 additions & 42 deletions java/rocksjni/portal.h
Original file line number Diff line number Diff line change
Expand Up @@ -4730,48 +4730,6 @@ class CompactionPriorityJni {
}
};

// The portal class for org.rocksdb.AccessHint
class AccessHintJni {
public:
// Returns the equivalent org.rocksdb.AccessHint for the provided
// C++ ROCKSDB_NAMESPACE::DBOptions::AccessHint enum
static jbyte toJavaAccessHint(
const ROCKSDB_NAMESPACE::DBOptions::AccessHint& access_hint) {
switch (access_hint) {
case ROCKSDB_NAMESPACE::DBOptions::AccessHint::NONE:
return 0x0;
case ROCKSDB_NAMESPACE::DBOptions::AccessHint::NORMAL:
return 0x1;
case ROCKSDB_NAMESPACE::DBOptions::AccessHint::SEQUENTIAL:
return 0x2;
case ROCKSDB_NAMESPACE::DBOptions::AccessHint::WILLNEED:
return 0x3;
default:
// undefined/default
return 0x1;
}
}

// Returns the equivalent C++ ROCKSDB_NAMESPACE::DBOptions::AccessHint enum
// for the provided Java org.rocksdb.AccessHint
static ROCKSDB_NAMESPACE::DBOptions::AccessHint toCppAccessHint(
jbyte jaccess_hint) {
switch (jaccess_hint) {
case 0x0:
return ROCKSDB_NAMESPACE::DBOptions::AccessHint::NONE;
case 0x1:
return ROCKSDB_NAMESPACE::DBOptions::AccessHint::NORMAL;
case 0x2:
return ROCKSDB_NAMESPACE::DBOptions::AccessHint::SEQUENTIAL;
case 0x3:
return ROCKSDB_NAMESPACE::DBOptions::AccessHint::WILLNEED;
default:
// undefined/default
return ROCKSDB_NAMESPACE::DBOptions::AccessHint::NORMAL;
}
}
};

// The portal class for org.rocksdb.WALRecoveryMode
class WALRecoveryModeJni {
public:
Expand Down
54 changes: 0 additions & 54 deletions java/src/main/java/org/rocksdb/AccessHint.java

This file was deleted.

18 changes: 0 additions & 18 deletions java/src/main/java/org/rocksdb/DBOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -746,21 +746,6 @@ public long dbWriteBufferSize() {
return dbWriteBufferSize(nativeHandle_);
}

@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_));
}

@Override
public DBOptions setCompactionReadaheadSize(final long compactionReadaheadSize) {
assert(isOwningHandle());
Expand Down Expand Up @@ -1360,9 +1345,6 @@ private static native void setStatsHistoryBufferSize(
private static native void setWriteBufferManager(
final long dbOptionsHandle, final long writeBufferManagerHandle);
private static native long dbWriteBufferSize(final long handle);
private static native void setAccessHintOnCompactionStart(
final long handle, final byte accessHintOnCompactionStart);
private static native byte accessHintOnCompactionStart(final long handle);
private static native void setCompactionReadaheadSize(
final long handle, final long compactionReadaheadSize);
private static native long compactionReadaheadSize(final long handle);
Expand Down
22 changes: 0 additions & 22 deletions java/src/main/java/org/rocksdb/DBOptionsInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -938,28 +938,6 @@ public interface DBOptionsInterface<T extends DBOptionsInterface<T>> {
*/
long dbWriteBufferSize();

/**
* Specify the file access pattern once a compaction is started.
* It will be applied to all input files of a compaction.
*
* Default: {@link AccessHint#NORMAL}
*
* @param accessHint The access hint
*
* @return the reference to the current options.
*/
@Deprecated T setAccessHintOnCompactionStart(final AccessHint accessHint);

/**
* Specify the file access pattern once a compaction is started.
* It will be applied to all input files of a compaction.
*
* Default: {@link AccessHint#NORMAL}
*
* @return The access hint
*/
@Deprecated AccessHint accessHintOnCompactionStart();

/**
* This is a maximum buffer size that is used by WinMmapReadableFile in
* unbuffered disk I/O mode. We need to maintain an aligned buffer for
Expand Down
18 changes: 0 additions & 18 deletions java/src/main/java/org/rocksdb/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -834,21 +834,6 @@ public long dbWriteBufferSize() {
return dbWriteBufferSize(nativeHandle_);
}

@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_));
}

@Override
public Options setCompactionReadaheadSize(final long compactionReadaheadSize) {
assert(isOwningHandle());
Expand Down Expand Up @@ -2268,9 +2253,6 @@ private static native void setStatsHistoryBufferSize(
private static native void setWriteBufferManager(
final long handle, final long writeBufferManagerHandle);
private static native long dbWriteBufferSize(final long handle);
private static native void setAccessHintOnCompactionStart(
final long handle, final byte accessHintOnCompactionStart);
private static native byte accessHintOnCompactionStart(final long handle);
private static native void setCompactionReadaheadSize(
final long handle, final long compactionReadaheadSize);
private static native long compactionReadaheadSize(final long handle);
Expand Down
Loading
Loading