Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
Committed-by: xiaolei.zl from Dev container
  • Loading branch information
zhanglei1949 committed Oct 25, 2024
2 parents fbe8941 + 95a3d1e commit b66fab4
Show file tree
Hide file tree
Showing 56 changed files with 1,224 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/interactive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
INTERACTIVE_WORKSPACE: /tmp/interactive_workspace
run: |
cd ${GITHUB_WORKSPACE}/flex/tests/hqps
bash hqps_robust_test.sh ${INTERACTIVE_WORKSPACE} ./interactive_config_test.yaml
bash hqps_robust_test.sh ${INTERACTIVE_WORKSPACE} ./interactive_config_test.yaml ./interactive_config_test_cbo.yaml
- name: Sample Query test
env:
Expand Down
4 changes: 2 additions & 2 deletions charts/graphscope-store/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ version: 0.29.0
dependencies:
- condition: kafka.enabled
name: kafka
repository: https://charts.bitnami.com/bitnami
repository: oci://registry-1.docker.io/bitnamicharts
version: "20.0.6"
- name: common
repository: https://charts.bitnami.com/bitnami
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.x.x
2 changes: 2 additions & 0 deletions docs/interactive_engine/neo4j/supported_cypher.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ Note that some Aggregator operators, such as `max()`, we listed here are impleme
| User Defined Functions | get start node from an edge | startNode(edge) | gs.function.startNode(edge) | <input type="checkbox" disabled checked /> | |
| User Defined Functions | get end node from an edge | endNode(edge) | gs.function.endNode(edge) | <input type="checkbox" disabled checked /> | |
| User Defined Functions | convert integer value to datetime | datetime(1287230400000) | gs.function.datetime(1287230400000) | <input type="checkbox" disabled checked /> | |
| Path Modifier | get any shortest path between two endpoints | SHORTEST | SHORTESTPATH | <input type="checkbox" disabled checked /> | |
| Path Modifier | get all shortest paths between two endpoints | ALL SHORTEST | ALL SHORTESTPATH | <input type="checkbox" disabled checked /> |

## Clause
A notable limitation for now is that we do not
Expand Down
8 changes: 6 additions & 2 deletions flex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,17 @@ if (NOT Arrow_FOUND)
else ()
include_directories(SYSTEM ${ARROW_INCLUDE_DIR})
if (USE_STATIC_ARROW)
if (TARGET arrow_static)
if (TARGET Arrow::arrow_static)
set(ARROW_LIB Arrow::arrow_static)
elseif (TARGET arrow_static) # For backward compatibility, see https://arrow.apache.org/docs/cpp/build_system.html#available-variables-and-targets
set(ARROW_LIB arrow_static)
else()
message(FATAL_ERROR "Building with USE_STATIC_ARROW=ON, but arrow_static target not found")
endif()
else ()
if (TARGET arrow_shared)
if (TARGET Arrow::arrow_shared)
set(ARROW_LIB Arrow::arrow_shared)
elseif (TARGET arrow_shared) # For backward compatibility
set(ARROW_LIB arrow_shared)
else()
message(FATAL_ERROR "Building with USE_STATIC_ARROW=OFF, but arrow_shared target not found")
Expand Down
14 changes: 9 additions & 5 deletions flex/engines/graph_db/database/graph_db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,8 @@ void GraphDB::Close() {
std::fill(app_factories_.begin(), app_factories_.end(), nullptr);
}

ReadTransaction GraphDB::GetReadTransaction() {
uint32_t ts = version_manager_.acquire_read_timestamp();
return {graph_, version_manager_, ts};
ReadTransaction GraphDB::GetReadTransaction(int thread_id) {
return contexts_[thread_id].session.GetReadTransaction();
}

InsertTransaction GraphDB::GetInsertTransaction(int thread_id) {
Expand Down Expand Up @@ -473,9 +472,14 @@ void GraphDB::initApps(
size_t valid_plugins = 0;
for (auto& path_and_index : plugins) {
auto path = path_and_index.second.first;
auto name = path_and_index.first;
auto index = path_and_index.second.second;
if (registerApp(path, index)) {
++valid_plugins;
if (!Schema::IsBuiltinPlugin(name)) {
if (registerApp(path, index)) {
++valid_plugins;
}
} else {
valid_plugins++;
}
}
LOG(INFO) << "Successfully registered stored procedures : " << valid_plugins
Expand Down
2 changes: 1 addition & 1 deletion flex/engines/graph_db/database/graph_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class GraphDB {
*
* @return graph_dir The directory of graph data.
*/
ReadTransaction GetReadTransaction();
ReadTransaction GetReadTransaction(int thread_id = 0);

/** @brief Create a transaction to insert vertices and edges with a default
* allocator.
Expand Down
11 changes: 10 additions & 1 deletion flex/engines/graph_db/database/graph_db_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace gs {

ReadTransaction GraphDBSession::GetReadTransaction() const {
uint32_t ts = db_.version_manager_.acquire_read_timestamp();
return ReadTransaction(db_.graph_, db_.version_manager_, ts);
return ReadTransaction(*this, db_.graph_, db_.version_manager_, ts);
}

InsertTransaction GraphDBSession::GetInsertTransaction() {
Expand Down Expand Up @@ -214,6 +214,15 @@ double GraphDBSession::eval_duration() const {

int64_t GraphDBSession::query_num() const { return query_num_.load(); }

AppBase* GraphDBSession::GetApp(const std::string& app_name) {
auto& app_name_to_path_index = db_.schema().GetPlugins();
if (app_name_to_path_index.count(app_name) <= 0) {
LOG(ERROR) << "Query name is not registered: " << app_name;
return nullptr;
}
return GetApp(app_name_to_path_index.at(app_name).second);
}

#define likely(x) __builtin_expect(!!(x), 1)

AppBase* GraphDBSession::GetApp(int type) {
Expand Down
2 changes: 2 additions & 0 deletions flex/engines/graph_db/database/graph_db_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ class GraphDBSession {

AppBase* GetApp(int idx);

AppBase* GetApp(const std::string& name);

// Ingest wals from a string, the input string is a serialized wal.
// We will convert it to a transaction and apply it to the graph.
Result<std::string> IngestWals(const std::string_view& input);
Expand Down
7 changes: 5 additions & 2 deletions flex/engines/graph_db/database/read_transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@

namespace gs {

ReadTransaction::ReadTransaction(const MutablePropertyFragment& graph,
ReadTransaction::ReadTransaction(const GraphDBSession& session,
const MutablePropertyFragment& graph,
VersionManager& vm, timestamp_t timestamp)
: graph_(graph), vm_(vm), timestamp_(timestamp) {}
: session_(session), graph_(graph), vm_(vm), timestamp_(timestamp) {}
ReadTransaction::~ReadTransaction() { release(); }

timestamp_t ReadTransaction::timestamp() const { return timestamp_; }
Expand Down Expand Up @@ -135,4 +136,6 @@ void ReadTransaction::release() {
}
}

const GraphDBSession& ReadTransaction::GetSession() const { return session_; }

} // namespace gs
7 changes: 6 additions & 1 deletion flex/engines/graph_db/database/read_transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
namespace gs {

class MutablePropertyFragment;
class GraphDBSession;
class VersionManager;
template <typename EDATA_T>
class AdjListView {
Expand Down Expand Up @@ -276,7 +277,8 @@ class SingleImmutableGraphView<std::string_view> {

class ReadTransaction {
public:
ReadTransaction(const MutablePropertyFragment& graph, VersionManager& vm,
ReadTransaction(const GraphDBSession& session,
const MutablePropertyFragment& graph, VersionManager& vm,
timestamp_t timestamp);
~ReadTransaction();

Expand Down Expand Up @@ -429,9 +431,12 @@ class ReadTransaction {
return SingleImmutableGraphView<EDATA_T>(*csr);
}

const GraphDBSession& GetSession() const;

private:
void release();

const GraphDBSession& session_;
const MutablePropertyFragment& graph_;
VersionManager& vm_;
timestamp_t timestamp_;
Expand Down
5 changes: 5 additions & 0 deletions flex/engines/graph_db/runtime/adhoc/operators/operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ bl::result<Context> eval_join(const physical::Join& opr, Context&& ctx,

bl::result<Context> eval_limit(const algebra::Limit& opr, Context&& ctx);

bl::result<Context> eval_procedure_call(const std::vector<int32_t>& alias,
const physical::ProcedureCall& opr,
const ReadTransaction& txn,
Context&& ctx);

void eval_sink(const Context& ctx, const ReadTransaction& txn, Encoder& output);

} // namespace runtime
Expand Down
Loading

0 comments on commit b66fab4

Please sign in to comment.