Apply formatter on recent 45 commits. (#5827)

Summary:
Some recent commits might not have passed through the formatter. I formatted recent 45 commits. The script hangs for more commits so I stopped there.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5827

Test Plan: Run all existing tests.

Differential Revision: D17483727

fbshipit-source-id: af23113ee63015d8a43d89a3bc2c1056189afe8f
main
sdong 5 years ago committed by Facebook Github Bot
parent 6ec6a4a9a4
commit c06b54d0c6
  1. 12
      db/compaction/compaction_iterator.h
  2. 6
      db/compaction/compaction_job.cc
  3. 12
      db/compaction/compaction_job.h
  4. 9
      db/db_impl/db_impl_compaction_flush.cc
  5. 2
      db/db_impl/db_impl_readonly.cc
  6. 5
      db/db_iter.h
  7. 8
      db/db_test2.cc
  8. 42
      java/benchmark/src/main/java/org/rocksdb/benchmark/DbBenchmark.java
  9. 31
      java/rocksjni/sst_file_reader_iterator.cc
  10. 8
      java/rocksjni/sst_file_readerjni.cc
  11. 11
      java/src/main/java/org/rocksdb/SstFileReader.java
  12. 16
      java/src/test/java/org/rocksdb/SstFileReaderTest.java
  13. 3
      options/options_settable_test.cc
  14. 6
      tools/block_cache_analyzer/block_cache_trace_analyzer.cc
  15. 3
      tools/db_stress.cc
  16. 3
      tools/sst_dump_tool.cc
  17. 18
      util/bloom_impl.h
  18. 4
      util/concurrent_task_limiter_impl.h
  19. 12
      util/crc32c_arm64.h
  20. 6
      util/dynamic_bloom_test.cc
  21. 2
      utilities/transactions/write_unprepared_txn_db.cc

@ -59,9 +59,9 @@ class CompactionIterator {
const Compaction* compaction_;
};
CompactionIterator(InternalIterator* input, const Comparator* cmp,
MergeHelper* merge_helper, SequenceNumber last_sequence,
std::vector<SequenceNumber>* snapshots,
CompactionIterator(
InternalIterator* input, const Comparator* cmp, MergeHelper* merge_helper,
SequenceNumber last_sequence, std::vector<SequenceNumber>* snapshots,
SequenceNumber earliest_write_conflict_snapshot,
const SnapshotChecker* snapshot_checker, Env* env,
bool report_detailed_time, bool expect_valid_internal_key,
@ -73,9 +73,9 @@ class CompactionIterator {
const std::atomic<bool>* manual_compaction_paused = nullptr);
// Constructor with custom CompactionProxy, used for tests.
CompactionIterator(InternalIterator* input, const Comparator* cmp,
MergeHelper* merge_helper, SequenceNumber last_sequence,
std::vector<SequenceNumber>* snapshots,
CompactionIterator(
InternalIterator* input, const Comparator* cmp, MergeHelper* merge_helper,
SequenceNumber last_sequence, std::vector<SequenceNumber>* snapshots,
SequenceNumber earliest_write_conflict_snapshot,
const SnapshotChecker* snapshot_checker, Env* env,
bool report_detailed_time, bool expect_valid_internal_key,

@ -870,7 +870,8 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) {
db_options_.statistics.get());
TEST_SYNC_POINT("CompactionJob::Run():Inprogress");
TEST_SYNC_POINT_CALLBACK("CompactionJob::Run():PausingManualCompaction:1",
TEST_SYNC_POINT_CALLBACK(
"CompactionJob::Run():PausingManualCompaction:1",
reinterpret_cast<void*>(
const_cast<std::atomic<bool>*>(manual_compaction_paused_)));
@ -954,7 +955,8 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) {
input_status = input->status();
output_file_ended = true;
}
TEST_SYNC_POINT_CALLBACK("CompactionJob::Run():PausingManualCompaction:2",
TEST_SYNC_POINT_CALLBACK(
"CompactionJob::Run():PausingManualCompaction:2",
reinterpret_cast<void*>(
const_cast<std::atomic<bool>*>(manual_compaction_paused_)));
c_iter->Next();

@ -62,19 +62,21 @@ class VersionSet;
// if needed.
class CompactionJob {
public:
CompactionJob(
int job_id, Compaction* compaction, const ImmutableDBOptions& db_options,
CompactionJob(int job_id, Compaction* compaction,
const ImmutableDBOptions& db_options,
const EnvOptions env_options, VersionSet* versions,
const std::atomic<bool>* shutting_down,
const SequenceNumber preserve_deletes_seqnum, LogBuffer* log_buffer,
Directory* db_directory, Directory* output_directory, Statistics* stats,
const SequenceNumber preserve_deletes_seqnum,
LogBuffer* log_buffer, Directory* db_directory,
Directory* output_directory, Statistics* stats,
InstrumentedMutex* db_mutex, ErrorHandler* db_error_handler,
std::vector<SequenceNumber> existing_snapshots,
SequenceNumber earliest_write_conflict_snapshot,
const SnapshotChecker* snapshot_checker,
std::shared_ptr<Cache> table_cache, EventLogger* event_logger,
bool paranoid_file_checks, bool measure_io_stats,
const std::string& dbname, CompactionJobStats* compaction_job_stats,
const std::string& dbname,
CompactionJobStats* compaction_job_stats,
Env::Priority thread_pri,
const std::atomic<bool>* manual_compaction_paused = nullptr);

@ -983,8 +983,7 @@ Status DBImpl::CompactFilesImpl(
snapshot_checker, table_cache_, &event_logger_,
c->mutable_cf_options()->paranoid_file_checks,
c->mutable_cf_options()->report_bg_io_stats, dbname_,
&compaction_job_stats, Env::Priority::USER,
&manual_compaction_paused_);
&compaction_job_stats, Env::Priority::USER, &manual_compaction_paused_);
// Creating a compaction influences the compaction score because the score
// takes running compactions into account (by skipping files that are already
@ -2313,8 +2312,7 @@ void DBImpl::BackgroundCallCompaction(PrepickedCompaction* prepicked_compaction,
env_->SleepForMicroseconds(10000); // prevent hot loop
mutex_.Lock();
} else if (!s.ok() && !s.IsShutdownInProgress() &&
!s.IsManualCompactionPaused() &&
!s.IsColumnFamilyDropped()) {
!s.IsManualCompactionPaused() && !s.IsColumnFamilyDropped()) {
// Wait a little bit before retrying background compaction in
// case this is an environmental problem and we do not want to
// chew up resources for failed compactions for the duration of
@ -2335,8 +2333,7 @@ void DBImpl::BackgroundCallCompaction(PrepickedCompaction* prepicked_compaction,
ManualCompactionState* m = prepicked_compaction->manual_compaction_state;
assert(m);
ROCKS_LOG_BUFFER(&log_buffer, "[%s] [JOB %d] Manual compaction paused",
m->cfd->GetName().c_str(),
job_context.job_id);
m->cfd->GetName().c_str(), job_context.job_id);
}
ReleaseFileNumberFromPendingOutputs(pending_outputs_inserted_elem);

@ -3,8 +3,8 @@
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
#include "db/arena_wrapped_db_iter.h"
#include "db/db_impl/db_impl_readonly.h"
#include "db/arena_wrapped_db_iter.h"
#include "db/compacted_db_impl.h"
#include "db/db_impl/db_impl.h"

@ -66,10 +66,7 @@ class DBIter final: public Iterator {
// this->key().
// (2) When moving backwards, the internal iterator is positioned
// just before all entries whose user key == this->key().
enum Direction {
kForward,
kReverse
};
enum Direction { kForward, kReverse };
// LocalStatistics contain Statistics counters that will be aggregated per
// each iterator instance and then will be sent to the global statistics when

@ -2458,8 +2458,7 @@ TEST_F(DBTest2, PausingManualCompaction1) {
manual_compactions_paused = 0;
// Now make sure CompactFiles also not run
dbfull()->CompactFiles(rocksdb::CompactionOptions(),
files_before_compact, 0);
dbfull()->CompactFiles(rocksdb::CompactionOptions(), files_before_compact, 0);
// Wait for manual compaction to get scheduled and finish
dbfull()->TEST_WaitForCompact(true);
@ -2530,9 +2529,8 @@ TEST_F(DBTest2, PausingManualCompaction3) {
#endif // !ROCKSDB_LITE
int run_manual_compactions = 0;
rocksdb::SyncPoint::GetInstance()->SetCallBack(
"CompactionJob::Run():PausingManualCompaction:1", [&](void* /*arg*/) {
run_manual_compactions++;
});
"CompactionJob::Run():PausingManualCompaction:1",
[&](void* /*arg*/) { run_manual_compactions++; });
rocksdb::SyncPoint::GetInstance()->EnableProcessing();
dbfull()->DisableManualCompaction();

@ -646,8 +646,8 @@ public class DbBenchmark {
currentTaskId++, randSeed_, num_, num_, writeOpt, 1));
break;
case "fillbatch":
tasks.add(new WriteSequentialTask(
currentTaskId++, randSeed_, num_, num_, writeOpt, 1000));
tasks.add(
new WriteSequentialTask(currentTaskId++, randSeed_, num_, num_, writeOpt, 1000));
break;
case "fillrandom":
tasks.add(new WriteRandomTask(
@ -901,27 +901,23 @@ public class DbBenchmark {
}
private enum Flag {
benchmarks(
Arrays.asList(
"fillseq",
"readrandom",
"fillrandom"),
"Comma-separated list of operations to run in the specified order\n" +
"\tActual benchmarks:\n" +
"\t\tfillseq -- write N values in sequential key order in async mode.\n" +
"\t\tfillrandom -- write N values in random key order in async mode.\n" +
"\t\tfillbatch -- write N/1000 batch where each batch has 1000 values\n" +
"\t\t in sequential key order in sync mode.\n" +
"\t\tfillsync -- write N/100 values in random key order in sync mode.\n" +
"\t\tfill100K -- write N/1000 100K values in random order in async mode.\n" +
"\t\treadseq -- read N times sequentially.\n" +
"\t\treadrandom -- read N times in random order.\n" +
"\t\treadhot -- read N times in random order from 1% section of DB.\n" +
"\t\treadwhilewriting -- measure the read performance of multiple readers\n" +
"\t\t with a bg single writer. The write rate of the bg\n" +
"\t\t is capped by --writes_per_second.\n" +
"\tMeta Operations:\n" +
"\t\tdelete -- delete DB") {
benchmarks(Arrays.asList("fillseq", "readrandom", "fillrandom"),
"Comma-separated list of operations to run in the specified order\n"
+ "\tActual benchmarks:\n"
+ "\t\tfillseq -- write N values in sequential key order in async mode.\n"
+ "\t\tfillrandom -- write N values in random key order in async mode.\n"
+ "\t\tfillbatch -- write N/1000 batch where each batch has 1000 values\n"
+ "\t\t in sequential key order in sync mode.\n"
+ "\t\tfillsync -- write N/100 values in random key order in sync mode.\n"
+ "\t\tfill100K -- write N/1000 100K values in random order in async mode.\n"
+ "\t\treadseq -- read N times sequentially.\n"
+ "\t\treadrandom -- read N times in random order.\n"
+ "\t\treadhot -- read N times in random order from 1% section of DB.\n"
+ "\t\treadwhilewriting -- measure the read performance of multiple readers\n"
+ "\t\t with a bg single writer. The write rate of the bg\n"
+ "\t\t is capped by --writes_per_second.\n"
+ "\tMeta Operations:\n"
+ "\t\tdelete -- delete DB") {
@Override public Object parseValue(String value) {
return new ArrayList<String>(Arrays.asList(value.split(",")));
}

@ -6,13 +6,13 @@
// This file implements the "bridge" between Java and C++ and enables
// calling c++ rocksdb::Iterator methods from Java side.
#include <jni.h>
#include <stdio.h>
#include <stdlib.h>
#include <jni.h>
#include "include/org_rocksdb_SstFileReaderIterator.h"
#include "rocksjni/portal.h"
#include "rocksdb/iterator.h"
#include "rocksjni/portal.h"
/*
* Class: org_rocksdb_SstFileReaderIterator
@ -65,7 +65,8 @@ void Java_org_rocksdb_SstFileReaderIterator_seekToLast0(JNIEnv* /*env*/,
* Method: next0
* Signature: (J)V
*/
void Java_org_rocksdb_SstFileReaderIterator_next0(JNIEnv* /*env*/, jobject /*jobj*/,
void Java_org_rocksdb_SstFileReaderIterator_next0(JNIEnv* /*env*/,
jobject /*jobj*/,
jlong handle) {
reinterpret_cast<rocksdb::Iterator*>(handle)->Next();
}
@ -75,7 +76,8 @@ void Java_org_rocksdb_SstFileReaderIterator_next0(JNIEnv* /*env*/, jobject /*job
* Method: prev0
* Signature: (J)V
*/
void Java_org_rocksdb_SstFileReaderIterator_prev0(JNIEnv* /*env*/, jobject /*jobj*/,
void Java_org_rocksdb_SstFileReaderIterator_prev0(JNIEnv* /*env*/,
jobject /*jobj*/,
jlong handle) {
reinterpret_cast<rocksdb::Iterator*>(handle)->Prev();
}
@ -86,7 +88,8 @@ void Java_org_rocksdb_SstFileReaderIterator_prev0(JNIEnv* /*env*/, jobject /*job
* Signature: (J[BI)V
*/
void Java_org_rocksdb_SstFileReaderIterator_seek0(JNIEnv* env, jobject /*jobj*/,
jlong handle, jbyteArray jtarget,
jlong handle,
jbyteArray jtarget,
jint jtarget_len) {
jbyte* target = env->GetByteArrayElements(jtarget, nullptr);
if (target == nullptr) {
@ -94,8 +97,7 @@ void Java_org_rocksdb_SstFileReaderIterator_seek0(JNIEnv* env, jobject /*jobj*/,
return;
}
rocksdb::Slice target_slice(
reinterpret_cast<char*>(target), jtarget_len);
rocksdb::Slice target_slice(reinterpret_cast<char*>(target), jtarget_len);
auto* it = reinterpret_cast<rocksdb::Iterator*>(handle);
it->Seek(target_slice);
@ -108,7 +110,8 @@ void Java_org_rocksdb_SstFileReaderIterator_seek0(JNIEnv* env, jobject /*jobj*/,
* Method: seekForPrev0
* Signature: (J[BI)V
*/
void Java_org_rocksdb_SstFileReaderIterator_seekForPrev0(JNIEnv* env, jobject /*jobj*/,
void Java_org_rocksdb_SstFileReaderIterator_seekForPrev0(JNIEnv* env,
jobject /*jobj*/,
jlong handle,
jbyteArray jtarget,
jint jtarget_len) {
@ -118,8 +121,7 @@ void Java_org_rocksdb_SstFileReaderIterator_seekForPrev0(JNIEnv* env, jobject /*
return;
}
rocksdb::Slice target_slice(
reinterpret_cast<char*>(target), jtarget_len);
rocksdb::Slice target_slice(reinterpret_cast<char*>(target), jtarget_len);
auto* it = reinterpret_cast<rocksdb::Iterator*>(handle);
it->SeekForPrev(target_slice);
@ -132,7 +134,8 @@ void Java_org_rocksdb_SstFileReaderIterator_seekForPrev0(JNIEnv* env, jobject /*
* Method: status0
* Signature: (J)V
*/
void Java_org_rocksdb_SstFileReaderIterator_status0(JNIEnv* env, jobject /*jobj*/,
void Java_org_rocksdb_SstFileReaderIterator_status0(JNIEnv* env,
jobject /*jobj*/,
jlong handle) {
auto* it = reinterpret_cast<rocksdb::Iterator*>(handle);
rocksdb::Status s = it->status();
@ -149,7 +152,8 @@ void Java_org_rocksdb_SstFileReaderIterator_status0(JNIEnv* env, jobject /*jobj*
* Method: key0
* Signature: (J)[B
*/
jbyteArray Java_org_rocksdb_SstFileReaderIterator_key0(JNIEnv* env, jobject /*jobj*/,
jbyteArray Java_org_rocksdb_SstFileReaderIterator_key0(JNIEnv* env,
jobject /*jobj*/,
jlong handle) {
auto* it = reinterpret_cast<rocksdb::Iterator*>(handle);
rocksdb::Slice key_slice = it->key();
@ -159,7 +163,8 @@ jbyteArray Java_org_rocksdb_SstFileReaderIterator_key0(JNIEnv* env, jobject /*jo
// exception thrown: OutOfMemoryError
return nullptr;
}
env->SetByteArrayRegion(jkey, 0, static_cast<jsize>(key_slice.size()),
env->SetByteArrayRegion(
jkey, 0, static_cast<jsize>(key_slice.size()),
const_cast<jbyte*>(reinterpret_cast<const jbyte*>(key_slice.data())));
return jkey;
}

@ -102,9 +102,9 @@ jobject Java_org_rocksdb_SstFileReader_getTableProperties(JNIEnv *env,
jobject /*jobj*/,
jlong jhandle) {
auto *sst_file_reader = reinterpret_cast<rocksdb::SstFileReader *>(jhandle);
std::shared_ptr<const rocksdb::TableProperties> tp = sst_file_reader->GetTableProperties();
jobject jtable_properties = rocksdb::TablePropertiesJni::fromCppTableProperties(
env, *(tp.get()));
std::shared_ptr<const rocksdb::TableProperties> tp =
sst_file_reader->GetTableProperties();
jobject jtable_properties =
rocksdb::TablePropertiesJni::fromCppTableProperties(env, *(tp.get()));
return jtable_properties;
}

@ -32,8 +32,7 @@ public class SstFileReader extends RocksObject {
*/
public SstFileReaderIterator newIterator(final ReadOptions readOptions) {
assert (isOwningHandle());
long iter = newIterator(nativeHandle_,
readOptions.nativeHandle_);
long iter = newIterator(nativeHandle_, readOptions.nativeHandle_);
return new SstFileReaderIterator(this, iter);
}
@ -68,14 +67,10 @@ public class SstFileReader extends RocksObject {
return getTableProperties(nativeHandle_);
}
@Override protected final native void disposeInternal(final long handle);
private native long newIterator(final long handle,
final long readOptionsHandle);
private native long newIterator(final long handle, final long readOptionsHandle);
private native void open(final long handle, final String filePath)
throws RocksDBException;
private native void open(final long handle, final String filePath) throws RocksDBException;
private native static long newSstFileReader(final long optionsHandle);
private native void verifyChecksum(final long handle) throws RocksDBException;

@ -50,7 +50,8 @@ public class SstFileReaderTest {
enum OpType { PUT, PUT_BYTES, MERGE, MERGE_BYTES, DELETE, DELETE_BYTES }
private File newSstFile(final List<KeyValueWithOp> keyValues) throws IOException, RocksDBException {
private File newSstFile(final List<KeyValueWithOp> keyValues)
throws IOException, RocksDBException {
final EnvOptions envOptions = new EnvOptions();
final StringAppendOperator stringAppendOperator = new StringAppendOperator();
final Options options = new Options().setMergeOperator(stringAppendOperator);
@ -105,15 +106,11 @@ public class SstFileReaderTest {
final List<KeyValueWithOp> keyValues = new ArrayList<>();
keyValues.add(new KeyValueWithOp("key1", "value1", OpType.PUT));
final File sstFile = newSstFile(keyValues);
try(final StringAppendOperator stringAppendOperator =
new StringAppendOperator();
final Options options = new Options()
.setCreateIfMissing(true)
.setMergeOperator(stringAppendOperator);
final SstFileReader reader = new SstFileReader(options)
) {
try (final StringAppendOperator stringAppendOperator = new StringAppendOperator();
final Options options =
new Options().setCreateIfMissing(true).setMergeOperator(stringAppendOperator);
final SstFileReader reader = new SstFileReader(options)) {
// Open the sst file and iterator
reader.open(sstFile.getAbsolutePath());
final ReadOptions readOptions = new ReadOptions();
@ -133,5 +130,4 @@ public class SstFileReaderTest {
assertThat(iterator.value()).isEqualTo("value1".getBytes());
}
}
}

@ -356,8 +356,7 @@ TEST_F(OptionsSettableTest, ColumnFamilyOptionsAllFieldsSettable) {
{offset_of(&ColumnFamilyOptions::snap_refresh_nanos), sizeof(uint64_t)},
{offset_of(&ColumnFamilyOptions::table_factory),
sizeof(std::shared_ptr<TableFactory>)},
{offset_of(&ColumnFamilyOptions::cf_paths),
sizeof(std::vector<DbPath>)},
{offset_of(&ColumnFamilyOptions::cf_paths), sizeof(std::vector<DbPath>)},
{offset_of(&ColumnFamilyOptions::compaction_thread_limiter),
sizeof(std::shared_ptr<ConcurrentTaskLimiter>)},
};

@ -1830,8 +1830,10 @@ void BlockCacheTraceAnalyzer::PrintDataBlockAccessStats() const {
hist_naccess_per_key.Add(caller_access.second);
}
}
uint64_t avg_accesses = static_cast<uint64_t>(hist_naccess_per_key.Average());
uint64_t stdev_accesses = static_cast<uint64_t>(hist_naccess_per_key.StandardDeviation());
uint64_t avg_accesses =
static_cast<uint64_t>(hist_naccess_per_key.Average());
uint64_t stdev_accesses =
static_cast<uint64_t>(hist_naccess_per_key.StandardDeviation());
avg_naccesses_per_key_in_a_data_block.Add(avg_accesses);
cf_avg_naccesses_per_key_in_a_data_block[cf_name].Add(avg_accesses);
stdev_naccesses_per_key_in_a_data_block.Add(stdev_accesses);

@ -353,7 +353,8 @@ DEFINE_int32(bloom_bits, 10, "Bloom filter bits per key. "
DEFINE_bool(use_block_based_filter, false, "use block based filter"
"instead of full filter for block based table");
DEFINE_bool(partition_filters, false, "use partitioned filters "
DEFINE_bool(partition_filters, false,
"use partitioned filters "
"for block-based table");
DEFINE_int32(

@ -405,7 +405,8 @@ Status SstFileDumper::ReadTableProperties(
namespace {
void print_help() {
fprintf(stderr,
fprintf(
stderr,
R"(sst_dump --file=<data_dir_OR_sst_file> [--command=check|scan|raw|recompress]
--file=<data_dir_OR_sst_file>
Path to SST file or directory containing SST files

@ -27,8 +27,8 @@ namespace rocksdb {
//
class LegacyNoLocalityBloomImpl {
public:
static inline void AddHash(uint32_t h, uint32_t total_bits,
int num_probes, char *data) {
static inline void AddHash(uint32_t h, uint32_t total_bits, int num_probes,
char *data) {
const uint32_t delta = (h >> 17) | (h << 15); // Rotate right 17 bits
for (int i = 0; i < num_probes; i++) {
const uint32_t bitpos = h % total_bits;
@ -51,7 +51,6 @@ public:
}
};
// A legacy Bloom filter implementation with probes local to a single
// cache line (fast). Because SST files might be transported between
// platforms, the cache line size is a parameter rather than hard coded.
@ -77,10 +76,10 @@ private:
uint32_t offset_h = ExtraRotates ? (h >> 11) | (h << 21) : h;
return offset_h % num_lines;
}
public:
static inline void AddHash(uint32_t h, uint32_t num_lines,
int num_probes, char *data,
int log2_cache_line_bytes) {
static inline void AddHash(uint32_t h, uint32_t num_lines, int num_probes,
char *data, int log2_cache_line_bytes) {
const int log2_cache_line_bits = log2_cache_line_bytes + 3;
char *data_at_offset =
@ -103,8 +102,8 @@ public:
int log2_cache_line_bytes) {
uint32_t b = GetLine(h, num_lines) << log2_cache_line_bytes;
PREFETCH(data + b, 0 /* rw */, 1 /* locality */);
PREFETCH(data + b + ((1 << log2_cache_line_bytes) - 1),
0 /* rw */, 1 /* locality */);
PREFETCH(data + b + ((1 << log2_cache_line_bytes) - 1), 0 /* rw */,
1 /* locality */);
*byte_offset = b;
}
@ -112,8 +111,7 @@ public:
int num_probes, const char *data,
int log2_cache_line_bytes) {
uint32_t b = GetLine(h, num_lines) << log2_cache_line_bytes;
return HashMayMatchPrepared(h, num_probes,
data + b, log2_cache_line_bytes);
return HashMayMatchPrepared(h, num_probes, data + b, log2_cache_line_bytes);
}
static inline bool HashMayMatchPrepared(uint32_t h, int num_probes,

@ -24,8 +24,8 @@ class ConcurrentTaskLimiterImpl : public ConcurrentTaskLimiter {
int32_t max_outstanding_task);
// No copying allowed
ConcurrentTaskLimiterImpl(const ConcurrentTaskLimiterImpl&) = delete;
ConcurrentTaskLimiterImpl& operator=(
const ConcurrentTaskLimiterImpl&) = delete;
ConcurrentTaskLimiterImpl& operator=(const ConcurrentTaskLimiterImpl&) =
delete;
virtual ~ConcurrentTaskLimiterImpl();

@ -18,10 +18,14 @@
#define crc32c_u32(crc, v) __crc32cw(crc, v)
#define crc32c_u64(crc, v) __crc32cd(crc, v)
#define PREF4X64L1(buffer, PREF_OFFSET, ITR) \
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 0)*64));\
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 1)*64));\
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 2)*64));\
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]"::[v]"r"(buffer), [c]"I"((PREF_OFFSET) + ((ITR) + 3)*64));
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]" ::[v] "r"(buffer), \
[c] "I"((PREF_OFFSET) + ((ITR) + 0) * 64)); \
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]" ::[v] "r"(buffer), \
[c] "I"((PREF_OFFSET) + ((ITR) + 1) * 64)); \
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]" ::[v] "r"(buffer), \
[c] "I"((PREF_OFFSET) + ((ITR) + 2) * 64)); \
__asm__("PRFM PLDL1KEEP, [%x[v],%[c]]" ::[v] "r"(buffer), \
[c] "I"((PREF_OFFSET) + ((ITR) + 3) * 64));
#define PREF1KL1(buffer, PREF_OFFSET) \
PREF4X64L1(buffer, (PREF_OFFSET), 0) \

@ -263,8 +263,7 @@ TEST_F(DynamicBloomTest, concurrent_with_perf) {
StopWatchNano timer(Env::Default());
timer.Start();
for (uint64_t i = 1 + t; i <= num_keys; i += num_threads) {
bool f =
std_bloom.MayContain(km.Seq(i));
bool f = std_bloom.MayContain(km.Seq(i));
ASSERT_TRUE(f);
}
elapsed += timer.ElapsedNanos();
@ -289,8 +288,7 @@ TEST_F(DynamicBloomTest, concurrent_with_perf) {
timer.Start();
for (uint64_t i = num_keys + 1 + t; i <= 2 * num_keys;
i += num_threads) {
bool f =
std_bloom.MayContain(km.Seq(i));
bool f = std_bloom.MayContain(km.Seq(i));
if (f) {
++false_positives;
}

@ -5,8 +5,8 @@
#ifndef ROCKSDB_LITE
#include "db/arena_wrapped_db_iter.h"
#include "utilities/transactions/write_unprepared_txn_db.h"
#include "db/arena_wrapped_db_iter.h"
#include "rocksdb/utilities/transaction_db.h"
#include "util/cast_util.h"

Loading…
Cancel
Save