This is an automated email from the ASF dual-hosted git repository.
SYaoJun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-graphar.git
The following commit(s) were added to refs/heads/main by this push:
new 1fa72ca2 fix: check error status of GraphInfo::Load() in
BenchmarkFixture::SetUp (#940)
1fa72ca2 is described below
commit 1fa72ca28a621beca257c32bda9090d24d83d6e5
Author: Jason <[email protected]>
AuthorDate: Thu Jul 23 19:31:17 2026 +0800
fix: check error status of GraphInfo::Load() in BenchmarkFixture::SetUp
(#940)
Signed-off-by: Jason <[email protected]>
---
cpp/benchmarks/benchmark_util.h | 9 +++++++++
cpp/examples/high_level_reader_example.cc | 4 ++--
cpp/src/graphar/filesystem.cc | 4 ++--
cpp/src/graphar/high-level/graph_reader.cc | 1 -
cpp/src/graphar/high-level/graph_reader.h | 1 -
5 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/cpp/benchmarks/benchmark_util.h b/cpp/benchmarks/benchmark_util.h
index 80dfb008..21987ef1 100644
--- a/cpp/benchmarks/benchmark_util.h
+++ b/cpp/benchmarks/benchmark_util.h
@@ -46,10 +46,19 @@ class BenchmarkFixture : public ::benchmark::Fixture {
}
path_ = std::string(c_root) + "/ldbc_sample/parquet/ldbc_sample.graph.yml";
auto maybe_graph_info = GraphInfo::Load(path_);
+ if (!maybe_graph_info.status().ok()) {
+ throw std::runtime_error("Failed to load graph info from " + path_ +
+ ": " + maybe_graph_info.status().message());
+ }
graph_info_ = maybe_graph_info.value();
second_path_ = std::string(c_root) + "/ldbc/parquet/ldbc.graph.yml";
auto second_maybe_graph_info = GraphInfo::Load(second_path_);
+ if (!second_maybe_graph_info.status().ok()) {
+ throw std::runtime_error(
+ "Failed to load graph info from " + second_path_ + ": " +
+ second_maybe_graph_info.status().message());
+ }
second_graph_info_ = second_maybe_graph_info.value();
}
diff --git a/cpp/examples/high_level_reader_example.cc
b/cpp/examples/high_level_reader_example.cc
index 85faf364..ee4615e5 100644
--- a/cpp/examples/high_level_reader_example.cc
+++ b/cpp/examples/high_level_reader_example.cc
@@ -41,7 +41,7 @@ void vertices_collection(
count++;
// print the first 10 vertices
if (count > 10) {
- continue;
+ break;
}
// access data through iterator directly
std::cout << it.id() << ", id=" << it.property<int64_t>("id").value()
@@ -91,7 +91,7 @@ void edges_collection(const
std::shared_ptr<graphar::GraphInfo>& graph_info) {
count++;
// print the first 10 edges
if (count > 10) {
- continue;
+ break;
}
// access data through iterator directly
std::cout << "src=" << it.source() << ", dst=" << it.destination() << "; ";
diff --git a/cpp/src/graphar/filesystem.cc b/cpp/src/graphar/filesystem.cc
index 69e27208..08cd9edd 100644
--- a/cpp/src/graphar/filesystem.cc
+++ b/cpp/src/graphar/filesystem.cc
@@ -404,10 +404,10 @@ Status FinalizeS3() {
return Status::OK();
}
-/// template specialization for std::string
+// explicit instantiation of the generic binary template for IdType
template Result<IdType> FileSystem::ReadFileToValue<IdType>(
const std::string&) const noexcept;
-/// template specialization for std::string
+// explicit instantiation of the generic binary template for IdType
template Status FileSystem::WriteValueToFile<IdType>(
const IdType&, const std::string&) const noexcept;
} // namespace graphar
diff --git a/cpp/src/graphar/high-level/graph_reader.cc
b/cpp/src/graphar/high-level/graph_reader.cc
index f33b611f..96c7d496 100644
--- a/cpp/src/graphar/high-level/graph_reader.cc
+++ b/cpp/src/graphar/high-level/graph_reader.cc
@@ -982,7 +982,6 @@ Result<std::shared_ptr<EdgesCollection>>
EdgesCollection::Make(
default:
return Status::Invalid("Unknown adj list type.");
}
- return Status::OK();
}
} // namespace graphar
diff --git a/cpp/src/graphar/high-level/graph_reader.h
b/cpp/src/graphar/high-level/graph_reader.h
index 8b9788eb..f0378a14 100644
--- a/cpp/src/graphar/high-level/graph_reader.h
+++ b/cpp/src/graphar/high-level/graph_reader.h
@@ -472,7 +472,6 @@ class VerticesCollection {
static Result<std::shared_ptr<VerticesCollection>> Make(
const std::shared_ptr<GraphInfo>& graph_info, const std::string& type) {
auto vertex_info = graph_info->GetVertexInfo(type);
- auto labels = vertex_info->GetLabels();
if (!vertex_info) {
return Status::KeyError("The vertex ", type, " doesn't exist.");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]