Apply post-merge fixes

This commit is contained in:
gvolfing 2022-12-15 11:04:20 +01:00
parent 14000d727f
commit f36b96744c
2 changed files with 10 additions and 2 deletions

View File

@ -89,7 +89,7 @@ bool PlanPrinter::PreVisit(query::v2::plan::ScanAllByLabelProperty &op) {
bool PlanPrinter::PreVisit(query::v2::plan::ScanAllByPrimaryKey &op) {
WithPrintLn([&](auto &out) {
out << "* ScanAllByPrimaryKey"
<< " (" << op.output_symbol_.name() << " :" << request_manager_->LabelToName(op.label_) << ")";
<< " (" << op.output_symbol_.name() << " :" << request_router_->LabelToName(op.label_) << ")";
});
return true;
}
@ -490,7 +490,7 @@ bool PlanToJsonVisitor::PreVisit(ScanAllByLabelProperty &op) {
bool PlanToJsonVisitor::PreVisit(ScanAllByPrimaryKey &op) {
json self;
self["name"] = "ScanAllByPrimaryKey";
self["label"] = ToJson(op.label_, *request_manager_);
self["label"] = ToJson(op.label_, *request_router_);
self["output_symbol"] = ToJson(op.output_symbol_);
op.input_->Accept(*this);

View File

@ -114,6 +114,10 @@ class RequestRouterInterface {
virtual std::optional<storage::v3::LabelId> MaybeNameToLabel(const std::string &name) const = 0;
virtual bool IsPrimaryLabel(storage::v3::LabelId label) const = 0;
virtual bool IsPrimaryKey(storage::v3::LabelId primary_label, storage::v3::PropertyId property) const = 0;
// TODO - (gvolfing) Implement this function in the mocked class.
virtual std::vector<coordinator::SchemaProperty> GetSchemaForLabel(storage::v3::LabelId label) const {
return std::vector<coordinator::SchemaProperty>{};
};
};
// TODO(kostasrim)rename this class template
@ -232,6 +236,10 @@ class RequestRouter : public RequestRouterInterface {
}) != schema_it->second.end();
}
std::vector<coordinator::SchemaProperty> GetSchemaForLabel(storage::v3::LabelId label) const override {
return shards_map_.schemas.at(label);
}
bool IsPrimaryLabel(storage::v3::LabelId label) const override { return shards_map_.label_spaces.contains(label); }
// TODO(kostasrim) Simplify return result