Skip to content

Commit

Permalink
Switch some usages of LiteralStringRef to use the _sr suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-abeamon committed Sep 30, 2022
1 parent 201eac7 commit e1fe28b
Show file tree
Hide file tree
Showing 17 changed files with 86 additions and 103 deletions.
2 changes: 1 addition & 1 deletion fdbcli/BlobKeyCommand.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ ACTOR Future<bool> blobKeyCommandActor(Database localDb,
version = v;
}

if (key >= LiteralStringRef("\xff")) {
if (key >= "\xff"_sr) {
fmt::print("No blob history for system keyspace\n", key.printable());
return false;
} else {
Expand Down
24 changes: 7 additions & 17 deletions fdbclient/BlobGranuleFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1672,23 +1672,13 @@ TEST_CASE("/blobgranule/files/applyDelta") {
printf("Testing blob granule delta applying\n");
Arena a;

// do this 2 phase arena creation of string refs instead of LiteralStringRef because there is no char* StringRef
// constructor, and valgrind might complain if the stringref data isn't in the arena
std::string sk_a = "A";
std::string sk_ab = "AB";
std::string sk_b = "B";
std::string sk_c = "C";
std::string sk_z = "Z";
std::string sval1 = "1";
std::string sval2 = "2";

StringRef k_a = StringRef(a, sk_a);
StringRef k_ab = StringRef(a, sk_ab);
StringRef k_b = StringRef(a, sk_b);
StringRef k_c = StringRef(a, sk_c);
StringRef k_z = StringRef(a, sk_z);
StringRef val1 = StringRef(a, sval1);
StringRef val2 = StringRef(a, sval2);
StringRef k_a = StringRef(a, "A"_sr);
StringRef k_ab = StringRef(a, "AB"_sr);
StringRef k_b = StringRef(a, "B"_sr);
StringRef k_c = StringRef(a, "C"_sr);
StringRef k_z = StringRef(a, "Z"_sr);
StringRef val1 = StringRef(a, "1"_sr);
StringRef val2 = StringRef(a, "2"_sr);

std::map<KeyRef, ValueRef> data;
data.insert({ k_a, val1 });
Expand Down
2 changes: 1 addition & 1 deletion fdbclient/MonitorLeader.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ TEST_CASE("/fdbclient/MonitorLeader/parseConnectionString/fuzz") {
output += "#";
int charCount = deterministicRandom()->randomInt(0, 20);
for (int i = 0; i < charCount; i++) {
output += deterministicRandom()->randomChoice(LiteralStringRef("asdfzxcv123345:!@#$#$&()<\"\' \t"));
output += deterministicRandom()->randomChoice("asdfzxcv123345:!@#$#$&()<\"\' \t"_sr);
}
output += deterministicRandom()->randomChoice("\n\r"_sr);
}
Expand Down
32 changes: 16 additions & 16 deletions fdbclient/Schemas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "fdbclient/Schemas.h"

// NOTE: also change mr-status-json-schemas.rst.inc
const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema(
const KeyRef JSONSchemas::statusSchema = R"statusSchema(
{
"cluster":{
"storage_wiggler": {
Expand Down Expand Up @@ -1005,9 +1005,9 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema(
"up_to_date":true
}
}
})statusSchema");
})statusSchema"_sr;

const KeyRef JSONSchemas::clusterConfigurationSchema = LiteralStringRef(R"configSchema(
const KeyRef JSONSchemas::clusterConfigurationSchema = R"configSchema(
{
"create":{
"$enum":[
Expand Down Expand Up @@ -1077,9 +1077,9 @@ const KeyRef JSONSchemas::clusterConfigurationSchema = LiteralStringRef(R"config
"auto_logs":3,
"commit_proxies":5,
"grv_proxies":1
})configSchema");
})configSchema"_sr;

const KeyRef JSONSchemas::latencyBandConfigurationSchema = LiteralStringRef(R"configSchema(
const KeyRef JSONSchemas::latencyBandConfigurationSchema = R"configSchema(
{
"get_read_version":{
"bands":[
Expand All @@ -1099,30 +1099,30 @@ const KeyRef JSONSchemas::latencyBandConfigurationSchema = LiteralStringRef(R"co
],
"max_commit_bytes":0
}
})configSchema");
})configSchema"_sr;

const KeyRef JSONSchemas::dataDistributionStatsSchema = LiteralStringRef(R"""(
const KeyRef JSONSchemas::dataDistributionStatsSchema = R"""(
{
"shard_bytes": 1947000
}
)""");
)"""_sr;

const KeyRef JSONSchemas::logHealthSchema = LiteralStringRef(R"""(
const KeyRef JSONSchemas::logHealthSchema = R"""(
{
"log_queue": 156
}
)""");
)"""_sr;

const KeyRef JSONSchemas::storageHealthSchema = LiteralStringRef(R"""(
const KeyRef JSONSchemas::storageHealthSchema = R"""(
{
"cpu_usage": 3.28629447047675,
"disk_usage": 0.19997897369207954,
"storage_durability_lag": 5050809,
"storage_queue": 2030
}
)""");
)"""_sr;

const KeyRef JSONSchemas::aggregateHealthSchema = LiteralStringRef(R"""(
const KeyRef JSONSchemas::aggregateHealthSchema = R"""(
{
"batch_limited": false,
"limiting_storage_durability_lag": 5050809,
Expand All @@ -1132,12 +1132,12 @@ const KeyRef JSONSchemas::aggregateHealthSchema = LiteralStringRef(R"""(
"worst_storage_queue": 2030,
"worst_log_queue": 156
}
)""");
)"""_sr;

const KeyRef JSONSchemas::managementApiErrorSchema = LiteralStringRef(R"""(
const KeyRef JSONSchemas::managementApiErrorSchema = R"""(
{
"retriable": false,
"command": "exclude",
"message": "The reason of the error"
}
)""");
)"""_sr;
2 changes: 1 addition & 1 deletion fdbclient/include/fdbclient/TagThrottle.actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ Future<Void> enableAuto(Reference<DB> db, bool enabled) {
tr->get(tagThrottleAutoEnabledKey);
Optional<Value> value = wait(safeThreadFutureToFuture(valueF));
if (!value.present() || (enabled && value.get() != "1"_sr) || (!enabled && value.get() != "0"_sr)) {
tr->set(tagThrottleAutoEnabledKey, LiteralStringRef(enabled ? "1" : "0"));
tr->set(tagThrottleAutoEnabledKey, enabled ? "1"_sr : "0"_sr);
signalThrottleChange<typename DB::TransactionT>(tr);

wait(safeThreadFutureToFuture(tr->commit()));
Expand Down
16 changes: 8 additions & 8 deletions fdbserver/Coordination.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,16 +489,16 @@ ACTOR Future<Void> leaderRegister(LeaderElectionRegInterface interf, Key key) {
// Generation register values are stored without prefixing in the coordinated state, but always begin with an
// alphanumeric character (they are always derived from a ClusterConnectionString key). Forwarding values are stored in
// this range:
const KeyRangeRef fwdKeys(LiteralStringRef("\xff"
"fwd"),
LiteralStringRef("\xff"
"fwe"));
const KeyRangeRef fwdKeys("\xff"
"fwd"_sr,
"\xff"
"fwe"_sr);

// The time when forwarding was last set is stored in this range:
const KeyRangeRef fwdTimeKeys(LiteralStringRef("\xff"
"fwdTime"),
LiteralStringRef("\xff"
"fwdTimf"));
const KeyRangeRef fwdTimeKeys("\xff"
"fwdTime"_sr,
"\xff"
"fwdTimf"_sr);
struct LeaderRegisterCollection {
// SOMEDAY: Factor this into a generic tool? Extend ActorCollection to support removal actions? What?
ActorCollection actors;
Expand Down
2 changes: 1 addition & 1 deletion fdbserver/KeyValueStoreRocksDB.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ using DB = rocksdb::DB*;
using CF = rocksdb::ColumnFamilyHandle*;

#define PERSIST_PREFIX "\xff\xff"
const KeyRef persistVersion = LiteralStringRef(PERSIST_PREFIX "Version");
const KeyRef persistVersion = PERSIST_PREFIX "Version"_sr;
const StringRef ROCKSDBSTORAGE_HISTOGRAM_GROUP = "RocksDBStorage"_sr;
const StringRef ROCKSDB_COMMIT_LATENCY_HISTOGRAM = "RocksDBCommitLatency"_sr;
const StringRef ROCKSDB_COMMIT_ACTION_HISTOGRAM = "RocksDBCommitAction"_sr;
Expand Down
3 changes: 1 addition & 2 deletions fdbserver/TagThrottler.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ class TagThrottlerImpl {
}
self->autoThrottlingEnabled = SERVER_KNOBS->AUTO_TAG_THROTTLING_ENABLED;
if (!committed)
tr.set(tagThrottleAutoEnabledKey,
LiteralStringRef(self->autoThrottlingEnabled ? "1" : "0"));
tr.set(tagThrottleAutoEnabledKey, self->autoThrottlingEnabled ? "1"_sr : "0"_sr);
}

RkTagThrottleCollection updatedTagThrottles;
Expand Down
1 change: 0 additions & 1 deletion fdbserver/VersionedBTree.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4202,7 +4202,6 @@ std::string toString(BTreeNodeLinkRef id) {
return std::string("BTreePageID") + toString(id.begin(), id.end());
}

#define STR(x) LiteralStringRef(x)
struct RedwoodRecordRef {
typedef uint8_t byte;

Expand Down
47 changes: 21 additions & 26 deletions fdbserver/storageserver.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,46 +159,41 @@ FDB_DECLARE_BOOLEAN_PARAM(UnlimitedCommitBytes);
FDB_DEFINE_BOOLEAN_PARAM(UnlimitedCommitBytes);

// Immutable
static const KeyValueRef persistFormat(LiteralStringRef(PERSIST_PREFIX "Format"), "FoundationDB/StorageServer/1/4"_sr);
static const KeyValueRef persistShardAwareFormat(LiteralStringRef(PERSIST_PREFIX "Format"),
"FoundationDB/StorageServer/1/5"_sr);
static const KeyValueRef persistFormat(PERSIST_PREFIX "Format"_sr, "FoundationDB/StorageServer/1/4"_sr);
static const KeyValueRef persistShardAwareFormat(PERSIST_PREFIX "Format"_sr, "FoundationDB/StorageServer/1/5"_sr);
static const KeyRangeRef persistFormatReadableRange("FoundationDB/StorageServer/1/2"_sr,
"FoundationDB/StorageServer/1/6"_sr);
static const KeyRef persistID = LiteralStringRef(PERSIST_PREFIX "ID");
static const KeyRef persistTssPairID = LiteralStringRef(PERSIST_PREFIX "tssPairID");
static const KeyRef persistSSPairID = LiteralStringRef(PERSIST_PREFIX "ssWithTSSPairID");
static const KeyRef persistTssQuarantine = LiteralStringRef(PERSIST_PREFIX "tssQ");
static const KeyRef persistClusterIdKey = LiteralStringRef(PERSIST_PREFIX "clusterId");
static const KeyRef persistID = PERSIST_PREFIX "ID"_sr;
static const KeyRef persistTssPairID = PERSIST_PREFIX "tssPairID"_sr;
static const KeyRef persistSSPairID = PERSIST_PREFIX "ssWithTSSPairID"_sr;
static const KeyRef persistTssQuarantine = PERSIST_PREFIX "tssQ"_sr;
static const KeyRef persistClusterIdKey = PERSIST_PREFIX "clusterId"_sr;

// (Potentially) change with the durable version or when fetchKeys completes
static const KeyRef persistVersion = LiteralStringRef(PERSIST_PREFIX "Version");
static const KeyRef persistVersion = PERSIST_PREFIX "Version"_sr;
static const KeyRangeRef persistShardAssignedKeys =
KeyRangeRef(LiteralStringRef(PERSIST_PREFIX "ShardAssigned/"), LiteralStringRef(PERSIST_PREFIX "ShardAssigned0"));
KeyRangeRef(PERSIST_PREFIX "ShardAssigned/"_sr, PERSIST_PREFIX "ShardAssigned0"_sr);
static const KeyRangeRef persistShardAvailableKeys =
KeyRangeRef(LiteralStringRef(PERSIST_PREFIX "ShardAvailable/"), LiteralStringRef(PERSIST_PREFIX "ShardAvailable0"));
static const KeyRangeRef persistByteSampleKeys =
KeyRangeRef(LiteralStringRef(PERSIST_PREFIX "BS/"), LiteralStringRef(PERSIST_PREFIX "BS0"));
KeyRangeRef(PERSIST_PREFIX "ShardAvailable/"_sr, PERSIST_PREFIX "ShardAvailable0"_sr);
static const KeyRangeRef persistByteSampleKeys = KeyRangeRef(PERSIST_PREFIX "BS/"_sr, PERSIST_PREFIX "BS0"_sr);
static const KeyRangeRef persistByteSampleSampleKeys =
KeyRangeRef(LiteralStringRef(PERSIST_PREFIX "BS/" PERSIST_PREFIX "BS/"),
LiteralStringRef(PERSIST_PREFIX "BS/" PERSIST_PREFIX "BS0"));
static const KeyRef persistLogProtocol = LiteralStringRef(PERSIST_PREFIX "LogProtocol");
static const KeyRef persistPrimaryLocality = LiteralStringRef(PERSIST_PREFIX "PrimaryLocality");
static const KeyRangeRef persistChangeFeedKeys =
KeyRangeRef(LiteralStringRef(PERSIST_PREFIX "CF/"), LiteralStringRef(PERSIST_PREFIX "CF0"));
static const KeyRangeRef persistTenantMapKeys =
KeyRangeRef(LiteralStringRef(PERSIST_PREFIX "TM/"), LiteralStringRef(PERSIST_PREFIX "TM0"));
KeyRangeRef(PERSIST_PREFIX "BS/"_sr PERSIST_PREFIX "BS/"_sr, PERSIST_PREFIX "BS/"_sr PERSIST_PREFIX "BS0"_sr);
static const KeyRef persistLogProtocol = PERSIST_PREFIX "LogProtocol"_sr;
static const KeyRef persistPrimaryLocality = PERSIST_PREFIX "PrimaryLocality"_sr;
static const KeyRangeRef persistChangeFeedKeys = KeyRangeRef(PERSIST_PREFIX "CF/"_sr, PERSIST_PREFIX "CF0"_sr);
static const KeyRangeRef persistTenantMapKeys = KeyRangeRef(PERSIST_PREFIX "TM/"_sr, PERSIST_PREFIX "TM0"_sr);
// data keys are unmangled (but never start with PERSIST_PREFIX because they are always in allKeys)

static const KeyRangeRef persistStorageServerShardKeys =
KeyRangeRef(LiteralStringRef(PERSIST_PREFIX "StorageServerShard/"),
LiteralStringRef(PERSIST_PREFIX "StorageServerShard0"));
KeyRangeRef(PERSIST_PREFIX "StorageServerShard/"_sr,
PERSIST_PREFIX "StorageServerShard0"_sr);

// Checkpoint related prefixes.
static const KeyRangeRef persistCheckpointKeys =
KeyRangeRef(LiteralStringRef(PERSIST_PREFIX "Checkpoint/"), LiteralStringRef(PERSIST_PREFIX "Checkpoint0"));
KeyRangeRef(PERSIST_PREFIX "Checkpoint/"_sr, PERSIST_PREFIX "Checkpoint0"_sr);
static const KeyRangeRef persistPendingCheckpointKeys =
KeyRangeRef(LiteralStringRef(PERSIST_PREFIX "PendingCheckpoint/"),
LiteralStringRef(PERSIST_PREFIX "PendingCheckpoint0"));
KeyRangeRef(PERSIST_PREFIX "PendingCheckpoint/"_sr,
PERSIST_PREFIX "PendingCheckpoint0"_sr);
static const std::string rocksdbCheckpointDirPrefix = "/rockscheckpoints_";

struct AddingShard : NonCopyable {
Expand Down
2 changes: 1 addition & 1 deletion fdbserver/workloads/ApiCorrectness.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct ApiCorrectnessWorkload : ApiWorkload {
private:
// Enable to track the activity on a particular key
#if CENABLED(0, NOT_IN_CLEAN)
#define targetKey LiteralStringRef( ??? )
#define targetKey "???"_sr

void debugKey(KeyRef key, std::string context) {
if (key == targetKey)
Expand Down
2 changes: 1 addition & 1 deletion fdbserver/workloads/BulkSetup.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct BulkSetupWorkload : TestWorkload {
BulkSetupWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) {
transactionsPerSecond = getOption(options, "transactionsPerSecond"_sr, 5000.0) / clientCount;
nodeCount = getOption(options, "nodeCount"_sr, transactionsPerSecond * clientCount);
keyPrefix = unprintable(getOption(options, "keyPrefix"_sr, LiteralStringRef("")).toString());
keyPrefix = unprintable(getOption(options, "keyPrefix"_sr, ""_sr).toString());
std::vector<std::string> tenants = getOption(options, "tenants"_sr, std::vector<std::string>());
for (std::string tenant : tenants) {
tenantNames.push_back(TenantName(tenant));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct IDDTxnProcessorApiWorkload : TestWorkload {

IDDTxnProcessorApiWorkload(WorkloadContext const& wcx) : TestWorkload(wcx), ddContext(UID()) {
enabled = !clientId && g_network->isSimulated(); // only do this on the "first" client
testDuration = getOption(options, LiteralStringRef("testDuration"), 10.0);
testDuration = getOption(options, "testDuration"_sr, 10.0);
}

std::string description() const override { return desc; }
Expand Down
4 changes: 2 additions & 2 deletions fdbserver/workloads/TaskBucketCorrectness.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ TEST_CASE("/fdbclient/TaskBucket/Subspace") {
t3.append(ghi);
printf("%d==========%s===%d\n", 13, printable(subspace_test5.pack(t3)).c_str(), subspace_test5.pack(t3).size());
ASSERT(subspace_test5.pack(t3) == subspace_test5.get(StringRef()).get(def).pack(ghi));
ASSERT(subspace_test5.pack(t3) == LiteralStringRef("abc\x01user\x00\x15\x7b\x01\x00\x01"
"def\x00\x01ghi\x00"));
ASSERT(subspace_test5.pack(t3) == "abc\x01user\x00\x15\x7b\x01\x00\x01"
"def\x00\x01ghi\x00"_sr);

printf("%d==========%s===%d\n",
14,
Expand Down
28 changes: 14 additions & 14 deletions flow/Platform.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4031,13 +4031,13 @@ TEST_CASE("/flow/Platform/getMemoryInfo") {

std::stringstream memInfoStream(memString);
linux_os::getMemoryInfo(request, memInfoStream);
ASSERT(request[LiteralStringRef("MemTotal:")] == 24733228);
ASSERT(request[LiteralStringRef("MemFree:")] == 2077580);
ASSERT(request[LiteralStringRef("MemAvailable:")] == 0);
ASSERT(request[LiteralStringRef("Buffers:")] == 266940);
ASSERT(request[LiteralStringRef("Cached:")] == 16798292);
ASSERT(request[LiteralStringRef("SwapTotal:")] == 25165820);
ASSERT(request[LiteralStringRef("SwapFree:")] == 23680228);
ASSERT(request["MemTotal:"_sr] == 24733228);
ASSERT(request["MemFree:"_sr] == 2077580);
ASSERT(request["MemAvailable:"_sr] == 0);
ASSERT(request["Buffers:"_sr] == 266940);
ASSERT(request["Cached:"_sr] == 16798292);
ASSERT(request["SwapTotal:"_sr] == 25165820);
ASSERT(request["SwapFree:"_sr] == 23680228);
for (auto& item : request) {
fmt::print("{}:{}\n", item.first.toString().c_str(), item.second);
}
Expand Down Expand Up @@ -4082,13 +4082,13 @@ TEST_CASE("/flow/Platform/getMemoryInfo") {

std::stringstream memInfoStream1(memString1);
linux_os::getMemoryInfo(request, memInfoStream1);
ASSERT(request[LiteralStringRef("MemTotal:")] == 31856496);
ASSERT(request[LiteralStringRef("MemFree:")] == 25492716);
ASSERT(request[LiteralStringRef("MemAvailable:")] == 28470756);
ASSERT(request[LiteralStringRef("Buffers:")] == 313644);
ASSERT(request[LiteralStringRef("Cached:")] == 2956444);
ASSERT(request[LiteralStringRef("SwapTotal:")] == 0);
ASSERT(request[LiteralStringRef("SwapFree:")] == 0);
ASSERT(request["MemTotal:"_sr] == 31856496);
ASSERT(request["MemFree:"_sr] == 25492716);
ASSERT(request["MemAvailable:"_sr] == 28470756);
ASSERT(request["Buffers:"_sr] == 313644);
ASSERT(request["Cached:"_sr] == 2956444);
ASSERT(request["SwapTotal:"_sr] == 0);
ASSERT(request["SwapFree:"_sr] == 0);
for (auto& item : request) {
fmt::print("{}:{}\n", item.first.toString().c_str(), item.second);
}
Expand Down
10 changes: 5 additions & 5 deletions flow/actorcompiler/ActorCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,16 @@ public void Write(TextWriter writer, out int lines)
lines = 0;

writer.WriteLine(memberIndentStr + "template<> struct Descriptor<struct {0}> {{", descr.name);
writer.WriteLine(memberIndentStr + "\tstatic StringRef typeName() {{ return LiteralStringRef(\"{0}\"); }}", descr.name);
writer.WriteLine(memberIndentStr + "\tstatic StringRef typeName() {{ return \"{0}\"_sr; }}", descr.name);
writer.WriteLine(memberIndentStr + "\ttypedef {0} type;", descr.name);
lines += 3;

foreach (var dec in descr.body)
{
writer.WriteLine(memberIndentStr + "\tstruct {0}Descriptor {{", dec.name);
writer.WriteLine(memberIndentStr + "\t\tstatic StringRef name() {{ return LiteralStringRef(\"{0}\"); }}", dec.name);
writer.WriteLine(memberIndentStr + "\t\tstatic StringRef typeName() {{ return LiteralStringRef(\"{0}\"); }}", dec.type);
writer.WriteLine(memberIndentStr + "\t\tstatic StringRef comment() {{ return LiteralStringRef(\"{0}\"); }}", dec.comment);
writer.WriteLine(memberIndentStr + "\t\tstatic StringRef name() {{ return \"{0}\"_sr; }}", dec.name);
writer.WriteLine(memberIndentStr + "\t\tstatic StringRef typeName() {{ return \"{0}\"_sr; }}", dec.type);
writer.WriteLine(memberIndentStr + "\t\tstatic StringRef comment() {{ return \"{0}\"_sr; }}", dec.comment);
writer.WriteLine(memberIndentStr + "\t\ttypedef {0} type;", dec.type);
writer.WriteLine(memberIndentStr + "\t\tstatic inline type get({0}& from);", descr.name);
writer.WriteLine(memberIndentStr + "\t};");
Expand Down Expand Up @@ -1302,7 +1302,7 @@ void WriteConstructor(Function body, TextWriter writer, string fullStateClassNam
constructor.WriteLine("this->lineage.setActorName(\"{0}\");", actor.name);
constructor.WriteLine("LineageScope _(&this->lineage);");
constructor.WriteLine("#endif");
// constructor.WriteLine("getCurrentLineage()->modify(&StackLineage::actorName) = LiteralStringRef(\"{0}\");", actor.name);
// constructor.WriteLine("getCurrentLineage()->modify(&StackLineage::actorName) = \"{0}\"_sr;", actor.name);
constructor.WriteLine("this->{0};", body.call());
ProbeExit(constructor, actor.name);
WriteFunction(writer, constructor, constructor.BodyText);
Expand Down
10 changes: 5 additions & 5 deletions flow/include/flow/TDMetric.actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ inline StringRef metricTypeName() {
#define MAKE_TYPENAME(T, S) \
template <> \
inline StringRef metricTypeName<T>() { \
return LiteralStringRef(S); \
return S; \
}
MAKE_TYPENAME(bool, "Bool")
MAKE_TYPENAME(int64_t, "Int64")
MAKE_TYPENAME(double, "Double")
MAKE_TYPENAME(Standalone<StringRef>, "String")
MAKE_TYPENAME(bool, "Bool"_sr)
MAKE_TYPENAME(int64_t, "Int64"_sr)
MAKE_TYPENAME(double, "Double"_sr)
MAKE_TYPENAME(Standalone<StringRef>, "String"_sr)
#undef MAKE_TYPENAME

struct BaseMetric;
Expand Down

0 comments on commit e1fe28b

Please sign in to comment.