MCPcopy Create free account
hub / github.com/bytedance/bolt / toString

Method toString

bolt/exec/Driver.cpp:1082–1120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1080}
1081
1082std::string Driver::toString() const {
1083 std::stringstream out;
1084 out << "{Driver." << driverCtx()->pipelineId << "." << driverCtx()->driverId
1085 << ": ";
1086 if (state_.isTerminated) {
1087 out << "terminated, ";
1088 }
1089 if (state_.hasBlockingFuture) {
1090 std::string blockedOp = (blockedOperatorId_ < operators_.size())
1091 ? operators_[blockedOperatorId_]->toString()
1092 : "<unknown op>";
1093 out << "blocked (" << blockingReasonToString(blockingReason_) << " "
1094 << blockedOp << "), ";
1095 } else if (state_.isEnqueued) {
1096 out << "enqueued ";
1097 } else if (state_.isOnThread()) {
1098 out << "running ";
1099 } else {
1100 out << "unknown state";
1101 }
1102
1103 out << "{Operators: ";
1104 std::vector<std::string> opStrs;
1105 opStrs.reserve(operators_.size());
1106 std::ranges::transform(
1107 operators_, std::back_inserter(opStrs), [](const auto& op) {
1108 return op->toString();
1109 });
1110 out << folly::join(", ", opStrs);
1111 out << "}";
1112 const auto ocs = opCallStatus();
1113 if (!ocs.empty()) {
1114 out << "{OpCallStatus: executing "
1115 << ocs.formatCall(findOperatorNoThrow(ocs.opId), ocs.method) << " for "
1116 << ocs.callDuration() << "ms}";
1117 }
1118 out << "}";
1119 return out.str();
1120}
1121
1122folly::dynamic Driver::toJson() const {
1123 folly::dynamic obj = folly::dynamic::object;

Callers 4

addContextOnExceptionFunction · 0.45
pushdownFiltersMethod · 0.45
canPushdownFiltersMethod · 0.45

Calls 8

blockingReasonToStringFunction · 0.85
formatCallMethod · 0.80
callDurationMethod · 0.80
strMethod · 0.80
sizeMethod · 0.45
isOnThreadMethod · 0.45
reserveMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected