Skip to content

Instantly share code, notes, and snippets.

@ttyusupov
Last active December 13, 2019 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ttyusupov/fea3736f0265c11c4b1e8bc4d1e69f93 to your computer and use it in GitHub Desktop.
Save ttyusupov/fea3736f0265c11c4b1e8bc4d1e69f93 to your computer and use it in GitHub Desktop.
----------------------------------------------------------------------------------------------------
./rocksdb/tools/rdb/db_wrapper.cc
Handle<Value> v = db_wrapper->status_.ok() ?
String::NewSymbol(value.c_str()) : Null();
----------------------------------------------------------------------------------------------------
./rocksdb/tools/db_bench_tool.cc
FLAGS_cache_size >= 0
? (FLAGS_cache_numshardbits >= 1
----------------------------------------------------------------------------------------------------
./rocksdb/util/xxhash.cc
typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess;
static const int one = 1;
----------------------------------------------------------------------------------------------------
./rocksdb/util/bloom.cc
assert(num_lines != 0 &&
(len - FullFilterBitsBuilder::kMetaDataSize) % num_lines == 0);
----------------------------------------------------------------------------------------------------
./rocksdb/util/thread_status_updater.cc
auto* cf_info = iter != cf_info_map_.end() ?
iter->second.get() : nullptr;
----------------------------------------------------------------------------------------------------
./rocksdb/util/dynamic_bloom.h
h = h / (CACHE_LINE_SIZE * 8) +
(h % (CACHE_LINE_SIZE * 8)) * (0x20000000U / CACHE_LINE_SIZE);
h = h / (CACHE_LINE_SIZE * 8) +
(h % (CACHE_LINE_SIZE * 8)) * (0x20000000U / CACHE_LINE_SIZE);
----------------------------------------------------------------------------------------------------
./rocksdb/util/options_builder.cc
int expected_write_amp_level = kEstimatedLevel0FilesInLevelStyle + 2
+ (expected_levels - 2) * kBytesForLevelMultiplier
----------------------------------------------------------------------------------------------------
./rocksdb/util/testutil.h
explicit StringSink(Slice* reader_contents = nullptr) :
WritableFile(),
----------------------------------------------------------------------------------------------------
./rocksdb/memtable/skiplistrep.cc
(memtable_key != nullptr) ?
memtable_key : EncodeKey(&tmp_, internal_key);
----------------------------------------------------------------------------------------------------
./rocksdb/memtable/hash_linklist_rep.cc
(memtable_key != nullptr) ?
memtable_key : EncodeKey(&tmp_, internal_key);
SkipListBucketHeader* new_skip_list_header = new (mem)
SkipListBucketHeader(compare_, allocator_, header->GetNumEntries() + 1);
----------------------------------------------------------------------------------------------------
./rocksdb/memtable/hash_skiplist_rep.cc
(memtable_key != nullptr) ?
memtable_key : EncodeKey(&tmp_, internal_key);
----------------------------------------------------------------------------------------------------
./rocksdb/table/table_reader_bench.cc
std::string file_name = test::TmpDir()
+ "/rocksdb_table_reader_benchmark";
----------------------------------------------------------------------------------------------------
./rocksdb/table/block_based_table_builder.cc
const Slice filter_key = r->filter_key_transformer ?
r->filter_key_transformer->Transform(user_key) : user_key;
r->props.filter_policy_name = r->table_options.filter_policy != nullptr ?
r->table_options.filter_policy->Name() : "";
assert(r->table_options.checksum == kCRC32c ||
r->table_options.format_version != 0);
----------------------------------------------------------------------------------------------------
./rocksdb/table/block_based_table_reader.cc
auto filter_key = rep_->filter_key_transformer ?
rep_->filter_key_transformer->Transform(user_key) : user_key;
----------------------------------------------------------------------------------------------------
./rocksdb/table/flush_block_policy.cc
return (curr_size >= block_size_ || BlockAlmostFull(key, value))
&& data_block_builder_.NumKeys() >= min_keys_per_block_;
----------------------------------------------------------------------------------------------------
./rocksdb/table/table_test.cc
pos != props.end() &&
pos->first.compare(0, prefix.size(), prefix) == 0;
----------------------------------------------------------------------------------------------------
./rocksdb/hdfs/env_hdfs.h
virtual unsigned int GetThreadPoolQueueLen(Priority pri = LOW) const
override {
----------------------------------------------------------------------------------------------------
./rocksdb/db/memtablerep_bench.cc
FLAGS_num_threads <= 1
? 0
----------------------------------------------------------------------------------------------------
./rocksdb/db/forward_iterator.cc
search_right_bound == FileIndexer::kLevelMaxIndex
? static_cast<uint32_t>(level_files.size())
----------------------------------------------------------------------------------------------------
./rocksdb/db/db_impl.cc
fname = ((type == kLogFile) ?
db_options_.wal_dir : dbname_) + "/" + to_delete;
file_info.file_size = file_info.base_file_size +
(file_info.is_split_sst ? table_reader->GetTableProperties()->data_size : 0);
const char* error_format = "%s was added to DB successfully but failed to remove original file "
"link : %s";
read_options.snapshot != nullptr
? reinterpret_cast<const SnapshotImpl*>(
read_options.snapshot != nullptr
? reinterpret_cast<const SnapshotImpl*>(
corruption_messages += "Sst data file size mismatch: " + data_file_path +
". Data size based on total and base size recorded in manifest " +
----------------------------------------------------------------------------------------------------
./rocksdb/db/skiplist.h
int cmp = (next == nullptr || next == last_bigger)
? 1 : compare_(next->key, key);
----------------------------------------------------------------------------------------------------
./rocksdb/db/compaction_job_stats_test.cc
(num_flushes == num_input_units) ?
key_base : key_base * (num_flushes - 1);
----------------------------------------------------------------------------------------------------
./rocksdb/db/internal_stats.cc
(cfd_->ioptions()->compaction_style != kCompactionStyleFIFO)
? vstorage->num_levels() - 1
----------------------------------------------------------------------------------------------------
./rocksdb/db/compaction.cc
int base_level = IsCompactionStyleUniversal()
? -1
----------------------------------------------------------------------------------------------------
./rocksdb/db/db_test.cc
std::atomic<bool>* error_type = (iter == 0)
? &env_->manifest_sync_error_
----------------------------------------------------------------------------------------------------
./rocksdb/db/version_set.cc
auto* state = new (mem)
LevelFileIteratorState(cfd_->table_cache(), read_options, soptions,
(cfd_ == nullptr || cfd_->current() == nullptr)
? nullptr
filemetadata.uncompressed_size = filemetadata.base_size +
file->raw_key_size + file->raw_value_size;
----------------------------------------------------------------------------------------------------
./rocksdb/db/repair.cc
t->meta.fd.total_file_size = base_file_size +
(reader->IsSplitSst() ? reader->GetTableProperties()->data_size : 0);
----------------------------------------------------------------------------------------------------
./rocksdb/db/memtable.cc
nullptr == prefix_bloom_
? false
----------------------------------------------------------------------------------------------------
./rocksdb/db/compaction_job.cc
const bool is_split_sst = sub_compact->compaction->column_family_data()->ioptions()
->table_factory->IsSplitSstForWriteSupported();
----------------------------------------------------------------------------------------------------
./rocksdb/port/win/port_win.cc
tv->tv_usec = static_cast<long>(usNow.count() -
duration_cast<microseconds>(secNow).count());
----------------------------------------------------------------------------------------------------
./consensus/consensus_peers.cc
int64_t commit_index_before = request_.has_committed_index() ?
request_.committed_index().index() : kMinimumOpIdIndex;
int64_t commit_index_after = request_.has_committed_index() ?
request_.committed_index().index() : kMinimumOpIdIndex;
----------------------------------------------------------------------------------------------------
./consensus/consensus_queue.cc
*more_pending = log_cache_.HasOpBeenWritten(peer->next_index) ||
(peer->last_known_committed_idx < queue_state_.committed_index.index());
----------------------------------------------------------------------------------------------------
./consensus/replica_state.cc
const auto lease_status = lease_check_mode != LeaderLeaseCheckMode::DONT_NEED_LEASE
? GetLeaderLeaseStatusUnlocked(&result.remaining_old_leader_lease, now)
----------------------------------------------------------------------------------------------------
./consensus/log_util.cc
int64_t read_up_to = (footer_.IsInitialized() && !footer_was_rebuilt_) ?
file_size() - footer_.ByteSize() - kLogSegmentFooterMagicAndFooterLength :
int64_t read_up_to = (footer_.IsInitialized() && !footer_was_rebuilt_) ?
file_size() - footer_.ByteSize() - kLogSegmentFooterMagicAndFooterLength :
----------------------------------------------------------------------------------------------------
./consensus/raft_consensus.cc
withold_replica_updates_until_ = MonoTime::Now() +
MonoDelta::FromSeconds(FLAGS_follower_reject_update_consensus_requests_seconds);
initial_delta = (state_->GetCommittedConfigUnlocked().peers_size() == 1) ?
MonoDelta::kZero :
int32_t failure_timeout = FLAGS_leader_failure_max_missed_heartbeat_periods *
FLAGS_raft_heartbeat_interval_ms;
----------------------------------------------------------------------------------------------------
./tablet/verifyrows-tablet-test.cc
uint64_t max_rows = this->ClampRowCount(FLAGS_inserts_per_thread * kNumInsertThreads)
/ kNumInsertThreads;
----------------------------------------------------------------------------------------------------
./tablet/tablet_bootstrap.cc
auto wal_path = skip_wal_rewrite_ ? wal_dir :
meta_->fs_manager()->GetTabletWalRecoveryDir(wal_dir);
----------------------------------------------------------------------------------------------------
./tablet/maintenance_manager.cc
: num_threads_(options.num_threads <= 0 ?
FLAGS_maintenance_manager_num_threads : options.num_threads),
(stats.logs_retained_bytes() == most_logs_retained_bytes &&
stats.ram_anchored() > most_logs_retained_bytes_ram_anchored))) {
string msg = StringPrintf("we have exceeded our soft memory limit "
"(current capacity is %.2f%%). However, there are no ops currently "
----------------------------------------------------------------------------------------------------
./tablet/mvcc-test.cc
rnd = RandomUniformInt(-kTargetConcurrency, kTargetConcurrency - 1) +
std::min<int>(kTargetConcurrency, alive.size());
----------------------------------------------------------------------------------------------------
./tablet/operations/snapshot_operation.h
return request_ == nullptr ?
tserver::TabletSnapshotOpRequestPB::UNKNOWN : request_->operation();
----------------------------------------------------------------------------------------------------
./tablet/operations/operation_driver.cc
ts_string = state() && state()->has_hybrid_time()
? state()->hybrid_time().ToString() : "No hybrid_time";
----------------------------------------------------------------------------------------------------
./tablet/tablet.cc
auto hybrid_time = operation_state->request()->has_external_hybrid_time() ?
HybridTime(operation_state->request()->external_hybrid_time()) :
[this, op = operation.release(), session, txn, index_ops = std::move(index_ops)]
(const Status& status) {
auto intents_frontier = intents_db_
? intents_db_->GetMutableMemTableFrontier(rocksdb::UpdateUserValueType::kLargest) : nullptr;
auto read_op = prepare_result.need_read_snapshot
? VERIFY_RESULT(ScopedReadOperation::Create(this, RequireLease::kTrue, read_time))
auto real_read_time = prepare_result.need_read_snapshot
? read_op.read_time()
table_type_ == TableType::REDIS_TABLE_TYPE
? InitMarkerBehavior::kRequired
----------------------------------------------------------------------------------------------------
./tablet/transaction_coordinator.cc
return timeout >= std::chrono::microseconds::max().count()
? std::chrono::microseconds::max()
resend_applying_time_ = now_physical +
std::chrono::microseconds(FLAGS_transaction_resend_applying_interval_usec);
resend_applying_time_ = MonoTime::Now() +
std::chrono::microseconds(FLAGS_transaction_resend_applying_interval_usec);
auto txn_status_with_ht = it != managed_transactions_.end()
? it->GetStatus()
----------------------------------------------------------------------------------------------------
./tools/yb-admin-test.cc
auto client = ASSERT_RESULT(YBClientBuilder()
.add_master_server_addr(master_address)
----------------------------------------------------------------------------------------------------
./tools/insert-generated-rows.cc
auto client = CHECK_RESULT(YBClientBuilder()
.master_server_addrs(addrs)
----------------------------------------------------------------------------------------------------
./tools/yb-admin_client.cc
yb_client_ = VERIFY_RESULT(YBClientBuilder()
.add_master_server_addr(master_addr_list_)
----------------------------------------------------------------------------------------------------
./tools/yb-bulk_load-test.cc
client_ = ASSERT_RESULT(YBClientBuilder()
.add_master_server_addr(cluster_->mini_master()->bound_rpc_addr_str())
----------------------------------------------------------------------------------------------------
./tserver/tablet_service.cc
auto overlimit = sst_files_full_delta > 0
? score + static_cast<double>(sst_files_used_delta) / sst_files_full_delta
Status s = STATUS(NotSupported, "Write Request contains write batch. This field should be "
"used only for post-processed write requests during "
----------------------------------------------------------------------------------------------------
./tserver/tablet_server-test.cc
uint64_t warmup = AllowSlowTests() ?
FLAGS_single_threaded_insert_latency_bench_warmup_rows : 10;
uint64_t max_rows = AllowSlowTests() ?
FLAGS_single_threaded_insert_latency_bench_insert_rows : 100;
----------------------------------------------------------------------------------------------------
./tserver/ts_tablet_manager.cc
tablet_peer->Shutdown((delete_type == TABLET_DATA_DELETED) ?
tablet::IsDropTable::kTrue : tablet::IsDropTable::kFalse);
----------------------------------------------------------------------------------------------------
./tserver/tserver-path-handlers.cc
std::string peer_addr_or_uuid = !peer.last_known_private_addr().empty()
? peer.last_known_private_addr()[0].host()
----------------------------------------------------------------------------------------------------
./tserver/heartbeater.cc
total_file_sizes += (tablet_class)
? tablet_class->GetCurrentVersionSstFilesSize() : 0;
uncompressed_file_sizes += (tablet_class)
? tablet_class->GetCurrentVersionSstFilesUncompressedSize() : 0;
scoped_refptr<Histogram> reads_hist = server_->GetMetricsHistogram
(TabletServerServiceIf::RpcMetricIndexes::kMetricIndexRead);
scoped_refptr<Histogram> writes_hist = server_->GetMetricsHistogram
(TabletServerServiceIf::RpcMetricIndexes::kMetricIndexWrite);
double rops_per_sec = (div > 0 && num_reads > 0) ?
(static_cast<double>(num_reads - prev_reads_) / div) : 0;
double wops_per_sec = (div > 0 && num_writes > 0) ?
(static_cast<double>(num_writes - prev_writes_) / div) : 0;
----------------------------------------------------------------------------------------------------
./tserver/tablet_server_main.cc
pg_process_conf.certs_dir = FLAGS_certs_dir.empty()
? server::DefaultCertsDir(*server->fs_manager())
pg_process_conf.certs_for_client_dir = FLAGS_certs_for_client_dir.empty()
? pg_process_conf.certs_dir
----------------------------------------------------------------------------------------------------
./tserver/remote_bootstrap_service.cc
int64_t client_maxlen = rate_limit == 0
? req->max_length() : std::min(static_cast<uint64_t>(req->max_length()), rate_limit);
----------------------------------------------------------------------------------------------------
./util/memory/memory.h
return additional_memory <= static_cast<int64>(Available())
&& DelegateReallocate(&limit_, requested, requested,
----------------------------------------------------------------------------------------------------
./util/result-test.cc
return *num_func_calls == 1 ?
Status::OK() : STATUS(InternalError, "test_function() returned a error");
----------------------------------------------------------------------------------------------------
./util/bfql/bfunc_convert.h
DSCHECK(target_datatype == DataType::INT8 || target_datatype == DataType::INT16
|| target_datatype == DataType::INT32 || target_datatype == DataType::INT64,
----------------------------------------------------------------------------------------------------
./util/threadpool-test.cc
ThreadPool::ExecutionMode mode = r.Next() % 2 ?
ThreadPool::ExecutionMode::SERIAL :
mode = rng.Next() % 2 ?
ThreadPool::ExecutionMode::SERIAL :
ThreadPool::ExecutionMode mode = rng.Next() % 2 ?
ThreadPool::ExecutionMode::SERIAL :
----------------------------------------------------------------------------------------------------
./util/backoff_waiter.h
int64_t base_delay_ms = attempt_ >= 29
? std::numeric_limits<int32_t>::max()
----------------------------------------------------------------------------------------------------
./util/priority_thread_pool.cc
int priority = tasks_.size() <= max_running_tasks_
? kEmptyQueuePriority
----------------------------------------------------------------------------------------------------
./util/monotime.cc
tv->tv_usec = (nano_delta_ - (tv->tv_sec * MonoTime::kNanosecondsPerSecond))
/ MonoTime::kNanosecondsPerMicrosecond;
----------------------------------------------------------------------------------------------------
./util/shared_mem.cc
std::string temp_file_name = string(kAnonShmFilenamePrefix) + "_"
+ RandomHumanReadableString(kAnonShmFilenameRandomnessSize);
----------------------------------------------------------------------------------------------------
./util/hdr_histogram.cc
return current_ij_count != 0 &&
((visited_sub_bucket_index_ != current_sub_bucket_index_) ||
----------------------------------------------------------------------------------------------------
./util/env-test.cc
slice_size = IOV_MAX * FLAGS_o_direct_block_size_bytes +
rnd.Uniform(10 * FLAGS_o_direct_block_size_bytes);
----------------------------------------------------------------------------------------------------
./util/rle-encoding.h
bool all_repeat = literal_count_ == 0 &&
(repeat_count_ == num_buffered_values_ || num_buffered_values_ == 0);
----------------------------------------------------------------------------------------------------
./util/debug/trace_event_impl.cc
phase == TRACE_EVENT_PHASE_COMPLETE ?
TRACE_EVENT_PHASE_BEGIN : phase,
int thread_id = trace_event ?
trace_event->thread_id() : Thread::UniqueThreadId();
return handle.chunk_seq == thread_shared_chunk_->seq() ?
thread_shared_chunk_->GetEventAt(handle.event_index) : nullptr;
----------------------------------------------------------------------------------------------------
./integration-tests/remote_bootstrap-itest.cc
ts_flags.push_back("--crash_if_remote_bootstrap_sessions_greater_than=" +
std::to_string(kMaxConcurrentTabletRemoteBootstrapSessions + 1));
master_flags.push_back("--load_balancer_max_concurrent_tablet_remote_bootstraps=" +
std::to_string(kMaxConcurrentTabletRemoteBootstrapSessions));
----------------------------------------------------------------------------------------------------
./integration-tests/create-table-stress-test.cc
client_ = ASSERT_RESULT(YBClientBuilder()
.add_master_server_addr(cluster_->mini_master()->bound_rpc_addr_str())
auto hist = METRIC_handler_latency_yb_master_MasterService_GetTableLocations
.Instantiate(ent);
s = table_creator->table_name(table_name)
.schema(&schema_)
----------------------------------------------------------------------------------------------------
./integration-tests/cluster_itest_util.cc
*leader_lease_status = resp.has_leader_lease_status() ?
resp.leader_lease_status() :
----------------------------------------------------------------------------------------------------
./integration-tests/master-partitioned-test.cc
client_ = ASSERT_RESULT(YBClientBuilder()
.add_master_server_addr(cluster_->mini_master(0)->bound_rpc_addr_str())
----------------------------------------------------------------------------------------------------
./integration-tests/kv_table_ts_failover_write_if-test.cc
opts->extra_tserver_flags.push_back("--raft_heartbeat_interval_ms=" +
yb::ToString(ToMilliseconds(kHeartBeatInterval)));
opts->extra_tserver_flags.push_back("--leader_failure_max_missed_heartbeat_periods=" +
yb::ToString(kLeaderFailureMaxMissedHeartbeatPeriods));
----------------------------------------------------------------------------------------------------
./integration-tests/alter_table-test.cc
client_ = CHECK_RESULT(YBClientBuilder()
.add_master_server_addr(cluster_->mini_master()->bound_rpc_addr_str())
----------------------------------------------------------------------------------------------------
./integration-tests/registration-test.cc
auto metrics = cluster_->mini_master()->master()->catalog_manager()->sys_catalog()
->tablet_peer()->shared_tablet()->GetMetricEntity();
----------------------------------------------------------------------------------------------------
./integration-tests/raft_consensus-itest.cc
double sleep_time_usec = 1000 *
((random_.Normal(0, 1) * timeout_msec) / 1.64485);
----------------------------------------------------------------------------------------------------
./common/jsonb.cc
JEntry jentry = (GetOffset(scalar_jsonb->size() - data_begin_offset)) |
GetJEType(original_jentry);
----------------------------------------------------------------------------------------------------
./common/json_util.cc
default:
return STATUS_SUBSTITUTE(
----------------------------------------------------------------------------------------------------
./common/partition.h
return partition_key >= partition_key_start() &&
(partition_key_end().empty() || partition_key < partition_key_end());
----------------------------------------------------------------------------------------------------
./common/wire_protocol.cc
auto code = static_cast<size_t>(status.code()) < kStatusToErrorCode.size()
? kStatusToErrorCode[status.code()] : AppStatusPB::UNKNOWN_ERROR;
----------------------------------------------------------------------------------------------------
./master/encryption_manager.cc
new_key_version_id = req->has_version_id()
? req->version_id()
----------------------------------------------------------------------------------------------------
./master/yql_size_estimates_vtable.cc
uint16_t yb_start_hash = !partition.partition_key_start().empty() ?
PartitionSchema::DecodeMultiColumnHashValue(partition.partition_key_start()) : 0;
uint16_t yb_end_hash = !partition.partition_key_end().empty() ?
PartitionSchema::DecodeMultiColumnHashValue(partition.partition_key_end()) : 0;
----------------------------------------------------------------------------------------------------
./master/sys_catalog.cc
consensus::ConsensusStatePB cstate = context->is_config_locked() ?
consensus->ConsensusStateUnlocked(CONSENSUS_CONFIG_ACTIVE) :
----------------------------------------------------------------------------------------------------
./master/cluster_balance_util.h
return x.placement_cloud() == y.placement_cloud() &&
x.placement_region() == y.placement_region() &&
int placement_num_replicas = placement.num_replicas() > 0 ?
placement.num_replicas() : FLAGS_replication_factor;
----------------------------------------------------------------------------------------------------
./master/ts_descriptor.cc
int64_t latest_seqno = ts_information_
? ts_information_->tserver_instance().instance_seqno()
----------------------------------------------------------------------------------------------------
./master/master_util.cc
return namespace_name == master::kSystemNamespaceName ||
namespace_name == master::kSystemAuthNamespaceName ||
----------------------------------------------------------------------------------------------------
./master/master-path-handlers.cc
ZoneTabletCounts counts = tablet_count_search == tablet_count_map.end()
? ZoneTabletCounts()
const auto keyspace_type = (keyspace_type_arg == arg_end
? GetDefaultDatabaseType(keyspace_arg->second)
----------------------------------------------------------------------------------------------------
./master/catalog_manager-test_base.h
consensus::RaftPeerPB::Role role = is_leader ?
consensus::RaftPeerPB::LEADER :
----------------------------------------------------------------------------------------------------
./gutil/gscoped_ptr.h
value = !base::is_convertible<T*, yb::subtle::RefCountedBase*>::value &&
!base::is_convertible<T*, yb::subtle::RefCountedThreadSafeBase*>::
----------------------------------------------------------------------------------------------------
./gutil/strings/stringpiece.h
return x.data() == y.data() || len <= 0 ||
strings::memeq(x.data(), y.data(), len);
----------------------------------------------------------------------------------------------------
./gutil/strings/escaping.cc
*error = "Value of \\" +
string(octal_start, p + 1 - octal_start) +
*error = "Value of \\" + string(hex_start, p + 1 - hex_start) +
" exceeds 0xff";
*error = "\\u must be followed by 4 hex digits: \\" +
string(hex_start, p + 1 - hex_start);
*error = "\\u must be followed by 4 hex digits: \\" +
string(hex_start, p + 1 - hex_start);
*error = "\\U must be followed by 8 hex digits: \\" +
string(hex_start, p + 1 - hex_start);
*error = "Value of \\" +
string(hex_start, p + 1 - hex_start) +
*error = "\\U must be followed by 8 hex digits: \\" +
string(hex_start, p + 1 - hex_start);
----------------------------------------------------------------------------------------------------
./gutil/hash/hash.h
uint32 a = static_cast<uint32>(Uint128Low64(x)) +
static_cast<uint32>(0x9e3779b9UL);
uint32 b = static_cast<uint32>(Uint128Low64(x) >> 32) +
static_cast<uint32>(0x9e3779b9UL);
----------------------------------------------------------------------------------------------------
./gutil/linux_syscall_support.h
__sc_0 = __NR_##name
LSS_LOADARGS_0(name); \
----------------------------------------------------------------------------------------------------
./gutil/bits.h
return c <= 0x80 ?
((h & (bytes - l * c) & ~bytes) != 0) :
----------------------------------------------------------------------------------------------------
./docdb/conflict_resolution.cc
auto intent_type_set = strength == IntentStrength::kWeak
? StrongToWeak(strong_intent_types) : strong_intent_types;
EnumerateIntentsCallback callback = [&strong_intent_types, resolver]
(IntentStrength intent_strength, Slice, KeyBytes* encoded_key_buffer) {
----------------------------------------------------------------------------------------------------
./docdb/intent_aware_iterator.cc
(resolved_intent_state_ == ResolvedIntentState::kValid
&& iter_.key().compare(resolved_intent_sub_doc_key_encoded_) < 0)
(resolved_intent_state_ == ResolvedIntentState::kValid
&& iter_.key().compare(resolved_intent_sub_doc_key_encoded_) < 0)
auto max_allowed_time = decode_result->same_transaction
? read_time_.in_txn_limit : read_time_.global_limit;
----------------------------------------------------------------------------------------------------
./docdb/docdb-test.cc
const string result_template = init_marker_expired ?
// After the init marker expires, we should not see a tombstone for it. We do not replace
----------------------------------------------------------------------------------------------------
./docdb/value_type.h
return value_type == ValueType::kRedisTS || value_type == ValueType::kObject ||
value_type == ValueType::kRedisSet || value_type == ValueType::kRedisSortedSet ||
----------------------------------------------------------------------------------------------------
./docdb/redis_operation.cc
const MonoDelta ttl = request_.set_request().has_ttl() ?
MonoDelta::FromMilliseconds(request_.set_request().ttl()) : Value::kMaxTtl;
double score_to_add = request_.set_request().sorted_set_options().incr() ?
kv.subkey(i).double_subkey() + subdoc_reverse.GetDouble() :
----------------------------------------------------------------------------------------------------
./docdb/primitive_value.cc
inetaddress_val_ = new InetAddress();
RETURN_NOT_OK(inetaddress_val_->FromSlice(slice_temp));
----------------------------------------------------------------------------------------------------
./docdb/docdb_rocksdb_util.cc
options->compression = rocksdb::Snappy_Supported() && FLAGS_enable_ondisk_compression
? rocksdb::kSnappyCompression : rocksdb::kNoCompression;
----------------------------------------------------------------------------------------------------
./docdb/doc_pgsql_scanspec.cc
bool is_reverse_order = is_forward_scan_ ^ (sortingType == ColumnSchema::kAscending ||
sortingType == ColumnSchema::kAscendingNullsLast);
DocKeyHash min_hash = hash_code_ ?
static_cast<DocKeyHash> (*hash_code_) : std::numeric_limits<DocKeyHash>::min();
DocKeyHash max_hash = max_hash_code_ ?
static_cast<DocKeyHash> (*max_hash_code_) : std::numeric_limits<DocKeyHash>::max();
----------------------------------------------------------------------------------------------------
./docdb/docdb.cc
auto intent_types = strength == IntentStrength::kStrong
? IntentTypeSet({IntentType::kStrongRead})
hybrid_time = kv_pair.has_external_hybrid_time() ?
HybridTime(kv_pair.external_hybrid_time()) : hybrid_time;
----------------------------------------------------------------------------------------------------
./docdb/doc_rowwise_iterator.cc
const bool desc_col = (col_sort_type == ColumnSchema::kDescending ||
col_sort_type == ColumnSchema::kDescendingNullsLast);
----------------------------------------------------------------------------------------------------
./docdb/doc_key.cc
return hash_present_ == other.hash_present_ &&
// Only compare hashes and hashed groups if the hash presence flag is set.
----------------------------------------------------------------------------------------------------
./docdb/ql_rocksdb_storage.cc
auto hash_code = request.has_hash_code() ?
boost::make_optional<int32_t>(request.hash_code()) : boost::none;
auto max_hash_code = request.has_max_hash_code() ?
boost::make_optional<int32_t>(request.max_hash_code()) : boost::none;
auto hash_code = request.has_hash_code() ?
boost::make_optional<int32_t>(request.hash_code()) : boost::none;
auto max_hash_code = request.has_max_hash_code() ?
boost::make_optional<int32_t>(request.max_hash_code()) : boost::none;
----------------------------------------------------------------------------------------------------
./docdb/cql_operation.cc
MonoDelta default_ttl = schema_.table_properties().HasDefaultTimeToLive() ?
MonoDelta::FromMilliseconds(schema_.table_properties().DefaultTimeToLive()) :
const UserTimeMicros user_timestamp = request_.has_user_timestamp_usec() ?
request_.user_timestamp_usec() : Value::kInvalidUserTimestamp;
----------------------------------------------------------------------------------------------------
./rpc/tcp_stream.cc
auto status = fill_result.len != 0
? socket_.Writev(iov, fill_result.len, &written)
----------------------------------------------------------------------------------------------------
./rpc/serialization.cc
size_t header_tot_len = kMsgLengthPrefixLength // Int prefix for the total length.
+ CodedOutputStream::VarintSize32(header_pb_len) // Varint delimiter for header PB.
----------------------------------------------------------------------------------------------------
./rpc/rpc.cc
(kInvalidTaskId != task_id) ||
(RpcRetrierState::kFinished != state && RpcRetrierState::kIdle != state))
----------------------------------------------------------------------------------------------------
./rpc/sending_data-test.cc
// total_consumption += sizeof(uint64);
sending.emplace_back(data_ptr, tracker);
----------------------------------------------------------------------------------------------------
./rpc/connection.cc
handler_latency_outbound_transfer_ = metric_entity ?
METRIC_handler_latency_outbound_transfer.Instantiate(metric_entity) : nullptr;
----------------------------------------------------------------------------------------------------
./rpc/rpc_stub-test.cc
IpAddress local_address = remote.address().is_v6()
? IpAddress(boost::asio::ip::address_v6::loopback())
----------------------------------------------------------------------------------------------------
./rpc/reactor.cc
auto outbound_address = conn_id.remote().address().is_v6()
? messenger_->outbound_address_v6()
----------------------------------------------------------------------------------------------------
./client/async_rpc.cc
auto redis_error_code = status.IsInvalidCommand() || status.IsInvalidArgument() ?
RedisResponsePB_RedisStatusCode_PARSING_ERROR : RedisResponsePB_RedisStatusCode_SERVER_ERROR;
----------------------------------------------------------------------------------------------------
./client/client-test.cc
client_ = ASSERT_RESULT(YBClientBuilder()
.add_master_server_addr(yb::ToString(cluster_->mini_master()->bound_rpc_addr()))
uint64_t expected = implicit_cast<uint64_t>(FLAGS_test_scan_num_rows) *
(0 + (FLAGS_test_scan_num_rows - 1)) / 2;
auto rev_client = ASSERT_RESULT(YBClientBuilder()
.add_master_server_addr(ToString(cluster_->mini_master()->bound_rpc_addr()))
client_ = ASSERT_RESULT(YBClientBuilder()
.add_master_server_addr(yb::ToString(cluster_->mini_master()->bound_rpc_addr()))
Status s = table_creator->table_name(YBTableName(YQL_DATABASE_CQL, kKeyspaceName, "foobar"))
.schema(&schema_)
Status s = table_creator->table_name(YBTableName(YQL_DATABASE_CQL, kKeyspaceName, "foobar"))
.schema(&schema_)
Status s = table_creator->table_name(YBTableName(YQL_DATABASE_CQL, kKeyspaceName, "foobar"))
.schema(&schema_)
Status s = table_creator->table_name(pgsql_table_name)
.table_id(kPgsqlTableId)
s = table_creator->table_name(yql_table_name)
.schema(&schema_)
----------------------------------------------------------------------------------------------------
./client/tablet_rpc.cc
auto retry_status = delay.value().Initialized()
? retrier_->DelayedRetry(command_, *status, delay.value())
----------------------------------------------------------------------------------------------------
./client/ql-transaction-test.cc
YBTransactionPtr write_txn = use_transaction.load(std::memory_order_acquire)
? CreateTransaction() : nullptr;
----------------------------------------------------------------------------------------------------
./client/client-internal.cc
const string keyspace = req.has_namespace_()
? req.namespace_().name()
const YQLDatabase db_type = req.has_namespace_() && req.namespace_().has_database_type()
? req.namespace_().database_type()
string msg = Substitute("Table $0 already exists with a different partition schema. "
"Requested partition schema was: $1, actual partition schema is: $2",
----------------------------------------------------------------------------------------------------
./yql/redis/redisserver/redisserver-test.cc
int idx = is_random ?
RandomUniformInt(0, max_query_subkey) :
----------------------------------------------------------------------------------------------------
./yql/redis/redisserver/redis_commands.cc
uint16_t hash_code = partition_key.size() == 0 ?
0 : PartitionSchema::DecodeMultiColumnHashValue(partition_key);
----------------------------------------------------------------------------------------------------
./yql/redis/redisserver/redis_parser.cc
const auto& key = args[1];
RETURN_NOT_OK(ParseTsSubKeyBound(
----------------------------------------------------------------------------------------------------
./yql/redis/redisserver/redis_constants.h
static constexpr int64_t kRedisMaxTtlMillis = std::numeric_limits<int64_t>::max() /
yb::MonoTime::kNanosecondsPerMillisecond;
static constexpr int64_t kRedisMaxTtlSeconds = kRedisMaxTtlMillis /
yb::MonoTime::kMillisecondsPerSecond;
----------------------------------------------------------------------------------------------------
./yql/cql/cqlserver/cql_rpc.cc
string short_text = statement_ptr->text()
.substr(0, FLAGS_rpcz_max_cql_query_dump_size);
----------------------------------------------------------------------------------------------------
./yql/cql/ql/test/ql-query-test.cc
select_stmt_template = "SELECT * FROM scan_bounds_test WHERE $0(h1, h2) $1 $2 AND $3(h1, h2) "
"$4 $5";
select_stmt_template = "SELECT * FROM scan_bounds_test WHERE "
"h1 = $0 AND h2 = '$1' AND $2(h1, h2) $3 $4";
string key_values = "99, 9999, 999999, 99999999, 'foo bar', 0x12fe9a, "
"'1999-12-01 16:32:44 GMT', 987654.0123, '204.101.0.168', "
string insert_stmt = "INSERT INTO partition_hash_bcall_simple_test (h1, h2, h3, h4, h5, h6, "
"h7, h8, h9, h10, h11, r, v) VALUES ($0, 1, 1);";
----------------------------------------------------------------------------------------------------
./yql/cql/ql/test/ql-datatype-test.cc
auto create_stmt = "CREATE TABLE accounts(name varchar, balance varint, rate double, "
"primary key(name, balance))";
----------------------------------------------------------------------------------------------------
./yql/cql/ql/test/ql-update-table-test.cc
"UPDATE test_table USING TTL $0 SET v1 = 1 WHERE h1 = 0 AND h2 = 'zero' AND r1 = 1 "
"AND r2 = 'r2';", ttl_msec);
----------------------------------------------------------------------------------------------------
./yql/cql/ql/test/ql-semanalyzer-test.cc
string create_stmt = "CREATE TABLE foo (c1 int, c2 int, c3 int, PRIMARY KEY (c1)) WITH "
"default_time_to_live = 1000";
----------------------------------------------------------------------------------------------------
./yql/cql/ql/test/ql-create-table-test.cc
const string table1 = "human_resource1(id int, first_name varchar, last_name varchar, "
"primary key(id, first_name, last_name)) WITH CLUSTERING ORDER BY(first_name ASC);";
const string table2 = "human_resource2(id int, first_name varchar, last_name varchar, "
"primary key(id, first_name, last_name)) WITH CLUSTERING ORDER BY(first_name ASC) AND "
const string table3 = "human_resource3(id int, first_name varchar, last_name varchar, "
"primary key(id, first_name, last_name)) "
const string table4 = "human_resource4(id int, first_name varchar, last_name varchar, "
"primary key(id, last_name, first_name)) "
const string table5 = "human_resource5(id int, first_name varchar, last_name varchar, "
"primary key(id, last_name, first_name)) "
const string table6 = "human_resource6(id int, first_name varchar, last_name varchar, "
"primary key(id, first_name, last_name)) "
const string table7 = "human_resource7(id int, first_name varchar, last_name varchar, "
"primary key(id, first_name, last_name)) "
const string table8 = "human_resource8(id int, first_name varchar, last_name varchar, "
"primary key(id, first_name, last_name)) "
const string table9 = "human_resource9(id int, first_name varchar, last_name varchar, "
"primary key(id, first_name, last_name)) "
const string table10 = "human_resource10(id int, first_name varchar, last_name varchar, "
"primary key(id, last_name, first_name)) "
const string table11 = "human_resource10(id int, first_name varchar, last_name varchar, age int, "
"primary key(id, last_name, first_name)) "
const string table12 = "human_resource10(id int, first_name varchar, last_name varchar, "
"primary key(id, last_name, first_name)) "
const string table1 = "devices(supplier_id INT, device_id DOUBLE, model_year INT, "
"device_name TEXT, PRIMARY KEY((supplier_id, device_id), model_year));";
const string table2 = "descriptions1(supplier_id INT, device_id DOUBLE, description TEXT, "
"PRIMARY KEY((supplier_id, device_id))) with partition scheme of devices;";
const string table3 = "descriptions2(supp_id INT, dev_id DOUBLE, description TEXT, "
"image_id INT, PRIMARY KEY((supp_id, dev_id), image_id)) "
const string table4 = "descriptions3(supplier_id INT, device_id DOUBLE, description TEXT, "
"PRIMARY KEY(supplier_id, device_id)) with partition scheme of devices;";
const string table5 = "descriptions4(supplier_id INT, device_id DOUBLE, model_year INT, "
"description TEXT, PRIMARY KEY((supplier_id, device_id, model_year))) "
const string table6 = "descriptions5(supplier_id INT, device_id DOUBLE, description TEXT, "
"PRIMARY KEY((supplier_id, device_id))) with partition scheme of non_existing_table;";
const string table7 = "descriptions6(supp_id INT, dev_id DOUBLE, description TEXT, "
"image_id INT, PRIMARY KEY((supp_id, description))) with partition scheme of devices;";
const string table8 = "descriptions7(supp_id INT, dev_id DOUBLE, description TEXT, "
"image_id INT, PRIMARY KEY((dev_id, supp_id))) with partition scheme of devices;";
const string table9 = "descriptions8(supp_id INT, dev_id DOUBLE, description TEXT, "
"image_id INT, PRIMARY KEY((supp_id, image_id))) with partition scheme of devices;";
const string table10 = "descriptions9(supp_id INT, dev_id DOUBLE, description TEXT, "
"image_id INT, PRIMARY KEY((description, image_id))) with partition scheme of devices;";
const string table11 = "descriptions10(supp_id INT, dev_id DOUBLE, description TEXT, "
"image_id INT, PRIMARY KEY((supp_id, dev_id))) with partition scheme devices;";
const string table12 = "descriptions11(supp_id INT, dev_id DOUBLE, description TEXT, "
"image_id INT, PRIMARY KEY((supp_id, dev_id))) with partition schema of devices;";
const string table13 = "descriptions12(supp_id INT, dev_id DOUBLE, description TEXT, "
"image_id INT, PRIMARY KEY((supp_id, dev_id))) with partitioning scheme of devices;";
----------------------------------------------------------------------------------------------------
./yql/cql/ql/ptree/sem_context.h
return (table != nullptr && table->opcode() == TreeNodeOpcode::kPTCreateIndex)
? static_cast<PTCreateIndex*>(table) : nullptr;
----------------------------------------------------------------------------------------------------
./yql/cql/ql/ptree/pt_select.cc
return sorting_type == ColumnSchema::SortingType::kDescending ?
PTOrderBy::Direction::kDESC : PTOrderBy::Direction::kASC;
----------------------------------------------------------------------------------------------------
./yql/cql/ql/ptree/pt_dml.h
string label = (col_op->expr()->expected_internal_type() == InternalType::kInt64Value) ?
"token" : "partition_hash";
----------------------------------------------------------------------------------------------------
./yql/cql/ql/ptree/pt_expr.h
virtual string QLName(QLNameOption option = QLNameOption::kUserOriginalName)
const override {
----------------------------------------------------------------------------------------------------
./yql/cql/ql/ptree/pt_update.cc
string key_conditions = " Key Conditions: " +
conditionsToString<MCVector<ColumnOp>>(key_where_ops());
----------------------------------------------------------------------------------------------------
./yql/cql/ql/ptree/pt_delete.cc
string key_conditions = " Key Conditions: " +
conditionsToString<MCVector<ColumnOp>>(key_where_ops());
----------------------------------------------------------------------------------------------------
./yql/cql/ql/ptree/pt_bcall.cc
string err_msg = (s.ToUserMessage() + "CAST " + expr->ql_type()->ToString() + " AS " +
QLType::ToCQLString(formal_types[pindex]) + " failed");
----------------------------------------------------------------------------------------------------
./yql/cql/ql/exec/executor.cc
ErrorCode error_code = (s.code() == Status::kNotSupported ?
ErrorCode::INVALID_REQUEST : ErrorCode::INVALID_ARGUMENTS);
----------------------------------------------------------------------------------------------------
./yql/pggate/pg_txn_manager.cc
IsolationLevel isolation = (isolation_level_ == PgIsolationLevel::SERIALIZABLE) && !read_only_
? IsolationLevel::SERIALIZABLE_ISOLATION : IsolationLevel::SNAPSHOT_ISOLATION;
----------------------------------------------------------------------------------------------------
./yql/pggate/pg_session.cc
Status s = table_creator->table_name(table_name)
.schema(&schema)
----------------------------------------------------------------------------------------------------
./yql/pgwrapper/pg_libpq-test.cc
ASSERT_OK(conn.Execute(isolation == IsolationLevel::SERIALIZABLE_ISOLATION ?
"START TRANSACTION ISOLATION LEVEL SERIALIZABLE" :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment