Skip to content

Commit

Permalink
Clean up include headers of analytical engine (#1546)
Browse files Browse the repository at this point in the history
  • Loading branch information
acezen committed May 17, 2022
1 parent 0aa8c3c commit b8ee7f0
Show file tree
Hide file tree
Showing 81 changed files with 826 additions and 395 deletions.
22 changes: 12 additions & 10 deletions analytical_engine/benchmarks/property_graph_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include "core/loader/arrow_fragment_loader.h"
#include "core/utils/transform_utils.h"

namespace bl = boost::leaf;

using GraphType =
vineyard::ArrowFragment<vineyard::property_graph_types::OID_TYPE,
vineyard::property_graph_types::VID_TYPE>;
Expand Down Expand Up @@ -109,16 +111,16 @@ int main(int argc, char** argv) {
gs::ArrowFragmentLoader<vineyard::property_graph_types::OID_TYPE,
vineyard::property_graph_types::VID_TYPE>>(
client, comm_spec, efiles, vfiles, directed != 0);
fragment_id = boost::leaf::try_handle_all(
[&loader]() { return loader->LoadFragment(); },
[](const vineyard::GSError& e) {
LOG(FATAL) << e.error_msg;
return 0;
},
[](const boost::leaf::error_info& unmatched) {
LOG(FATAL) << "Unmatched error " << unmatched;
return 0;
});
fragment_id =
bl::try_handle_all([&loader]() { return loader->LoadFragment(); },
[](const vineyard::GSError& e) {
LOG(FATAL) << e.error_msg;
return 0;
},
[](const bl::error_info& unmatched) {
LOG(FATAL) << "Unmatched error " << unmatched;
return 0;
});
}

if (comm_spec.worker_id() == 0) {
Expand Down
2 changes: 1 addition & 1 deletion analytical_engine/core/app/app_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "grape/types.h"

#include "core/worker/default_worker.h"
#include "core/worker/default_worker.h" // IWYU pragma: export

namespace gs {

Expand Down
6 changes: 4 additions & 2 deletions analytical_engine/core/app/app_invoker.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
#ifndef ANALYTICAL_ENGINE_CORE_APP_APP_INVOKER_H_
#define ANALYTICAL_ENGINE_CORE_APP_APP_INVOKER_H_

#include <glog/logging.h>

#include <cstdint>
#include <memory>
#include <string>
#include <type_traits>

#include "glog/logging.h"

#ifdef NETWORKX
#include "core/object/dynamic.h"
#endif
Expand All @@ -31,6 +31,8 @@
#include "graphscope/proto/data_types.pb.h"
#include "graphscope/proto/types.pb.h"

namespace bl = boost::leaf;

namespace gs {

/**
Expand Down
2 changes: 1 addition & 1 deletion analytical_engine/core/app/parallel_property_app_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "grape/types.h"

#include "core/worker/parallel_property_worker.h"
#include "core/worker/parallel_property_worker.h" // IWYU pragma: export

namespace gs {

Expand Down
2 changes: 1 addition & 1 deletion analytical_engine/core/app/property_app_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "grape/types.h"

#include "core/parallel/property_message_manager.h"
#include "core/worker/default_property_worker.h"
#include "core/worker/default_property_worker.h" // IWYU pragma: export

namespace gs {

Expand Down
2 changes: 1 addition & 1 deletion analytical_engine/core/app/property_auto_app_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "grape/types.h"

#include "core/worker/property_auto_worker.h"
#include "core/worker/property_auto_worker.h" // IWYU pragma: export

namespace gs {

Expand Down
2 changes: 1 addition & 1 deletion analytical_engine/core/communication/shuffle.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <string>

#include "grape/communication/shuffle.h"
#include "grape/communication/shuffle.h" // IWYU pragma: export
#include "vineyard/graph/utils/string_collection.h"

namespace grape {
Expand Down
8 changes: 2 additions & 6 deletions analytical_engine/core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
#ifndef ANALYTICAL_ENGINE_CORE_CONFIG_H_
#define ANALYTICAL_ENGINE_CORE_CONFIG_H_

#include <cstdint>
#include <cstdint> // IWYU pragma: export

#include "boost/leaf.hpp"

#include "grape/config.h"
#include "grape/config.h" // IWYU pragma: export

namespace gs {
using fid_t = grape::fid_t;

namespace bl = boost::leaf;
} // namespace gs

#endif // ANALYTICAL_ENGINE_CORE_CONFIG_H_
3 changes: 3 additions & 0 deletions analytical_engine/core/context/column.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
#ifndef ANALYTICAL_ENGINE_CORE_CONTEXT_COLUMN_H_
#define ANALYTICAL_ENGINE_CORE_CONTEXT_COLUMN_H_

#include <cstdint>
#include <memory>
#include <string>
#include <type_traits>

#include "vineyard/basic/ds/arrow_utils.h"

#include "core/context/context_protocols.h"

namespace gs {

/**
Expand Down
4 changes: 2 additions & 2 deletions analytical_engine/core/context/context_protocols.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
#ifndef ANALYTICAL_ENGINE_CORE_CONTEXT_CONTEXT_PROTOCOLS_H_
#define ANALYTICAL_ENGINE_CORE_CONTEXT_CONTEXT_PROTOCOLS_H_

#include <memory>
#include <cstdint>
#include <string>

#include "vineyard/graph/utils/context_protocols.h"
#include "vineyard/graph/utils/context_protocols.h" // IWYU pragma: export

namespace gs {

Expand Down
35 changes: 27 additions & 8 deletions analytical_engine/core/context/i_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,46 @@
#ifndef ANALYTICAL_ENGINE_CORE_CONTEXT_I_CONTEXT_H_
#define ANALYTICAL_ENGINE_CORE_CONTEXT_I_CONTEXT_H_

#include <cstdint>
#include <iostream>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "grape/app/context_base.h"
#include "grape/serialization/in_archive.h"
#include "grape/worker/comm_spec.h"
#include "vineyard/client/client.h"
#include "boost/leaf/result.hpp"
#include "vineyard/common/util/uuid.h"
#include "vineyard/graph/fragment/property_graph_types.h"

#include "core/context/context_protocols.h"
#include "core/context/selector.h"
#include "core/error.h"
#include "core/object/gs_object.h"
#include "core/object/i_fragment_wrapper.h"
#include "core/server/rpc_utils.h"

#ifdef ENABLE_JAVA_SDK
#define CONTEXT_TYPE_JAVA_PIE_PROPERTY "java_pie_property"
#define CONTEXT_TYPE_JAVA_PIE_PROJECTED "java_pie_projected"
#endif

namespace bl = boost::leaf;

namespace arrow {
class Array;
}
namespace grape {
class CommSpec;
class InArchive;
} // namespace grape
namespace vineyard {
class Client;
}

namespace gs {
class IFragmentWrapper;
class LabeledSelector;
class Selector;
namespace rpc {
class GSParams;
}

/**
* @brief IContextWrapper is the base class for any kind of ContextWrapper.
Expand Down Expand Up @@ -221,6 +239,7 @@ class ILabeledVertexPropertyContextWrapper : public IContextWrapper {
};

#ifdef ENABLE_JAVA_SDK

/**
* @brief A base class for JavaPropertyDefaultContext. It holds an inner
* ctxWrapper, and redirect function calls to the inner ctxWrapper.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "core/java/javasdk.h"
#include "core/object/i_fragment_wrapper.h"

#define CONTEXT_TYPE_JAVA_PIE_PROJECTED "java_pie_projected"
namespace bl = boost::leaf;

namespace gs {

Expand Down
2 changes: 1 addition & 1 deletion analytical_engine/core/context/java_pie_property_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "core/parallel/parallel_property_message_manager.h"
#include "core/parallel/property_message_manager.h"

#define CONTEXT_TYPE_JAVA_PIE_PROPERTY "java_pie_property"
namespace bl = boost::leaf;

namespace gs {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,24 @@
#include <utility>
#include <vector>

#include "boost/leaf/error.hpp"
#include "boost/leaf/result.hpp"
#include "grape/app/context_base.h"
#include "vineyard/graph/fragment/fragment_traits.h"

#include "core/context/column.h"
#include "core/context/i_context.h"
#include "core/context/selector.h"
#include "core/context/tensor_dataframe_builder.h"
#include "core/utils/mpi_utils.h"
#include "core/utils/transform_utils.h"

#define CONTEXT_TYPE_LABELED_VERTEX_PROPERTY "labeled_vertex_property"

namespace bl = boost::leaf;

namespace gs {
class IFragmentWrapper;

/**
* @brief LabeledVertexPropertyContext can hold any number of columns. The
Expand Down
8 changes: 6 additions & 2 deletions analytical_engine/core/context/mpi_object_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
#ifndef ANALYTICAL_ENGINE_CORE_CONTEXT_MPI_OBJECT_SYNC_H_
#define ANALYTICAL_ENGINE_CORE_CONTEXT_MPI_OBJECT_SYNC_H_

#include <utility>
#include <vector>

#include "grape/communication/sync_comm.h"
#include "grape/worker/comm_spec.h"
#include "vineyard/client/client.h"
#include "vineyard/common/util/uuid.h"

namespace vineyard {
class Client;
}

namespace gs {

Expand Down
11 changes: 8 additions & 3 deletions analytical_engine/core/context/selector.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,28 @@
#ifndef ANALYTICAL_ENGINE_CORE_CONTEXT_SELECTOR_H_
#define ANALYTICAL_ENGINE_CORE_CONTEXT_SELECTOR_H_

#include <glog/logging.h>

#include <regex>
#include <string>
#include <utility>
#include <vector>

#include "boost/algorithm/string.hpp"
#include "boost/algorithm/string/case_conv.hpp"
#include "boost/foreach.hpp"
#include "boost/leaf.hpp"
#include "boost/leaf/error.hpp"
#include "boost/leaf/result.hpp"
#include "boost/lexical_cast.hpp"
#include "boost/property_tree/exceptions.hpp"
#include "boost/property_tree/json_parser.hpp"
#include "boost/property_tree/ptree.hpp"

#include "vineyard/graph/fragment/property_graph_types.h"

#include "core/config.h"
#include "core/error.h"

namespace bl = boost::leaf;

namespace gs {

inline std::string generate_selectors(
Expand Down
22 changes: 17 additions & 5 deletions analytical_engine/core/context/tensor_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,26 @@
#ifndef ANALYTICAL_ENGINE_CORE_CONTEXT_TENSOR_CONTEXT_H_
#define ANALYTICAL_ENGINE_CORE_CONTEXT_TENSOR_CONTEXT_H_

#include <algorithm>
#include <glog/logging.h>
#include <mpi.h>

#include <memory>
#include <ostream>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

#include "arrow/array/builder_binary.h"
#include "boost/leaf/error.hpp"
#include "boost/leaf/result.hpp"
#include "grape/app/context_base.h"
#include "grape/serialization/in_archive.h"
#include "grape/worker/comm_spec.h"
#include "vineyard/basic/ds/dataframe.h"
#include "vineyard/basic/ds/tensor.h"
#include "vineyard/client/client.h"
#include "vineyard/common/util/uuid.h"

#ifdef NETWORKX
#include "core/object/dynamic.h"
Expand All @@ -34,15 +45,14 @@
#include "core/context/i_context.h"
#include "core/context/tensor_dataframe_builder.h"
#include "core/error.h"
#include "core/fragment/arrow_flattened_fragment.h"
#include "core/fragment/arrow_projected_fragment.h"
#include "core/fragment/dynamic_projected_fragment.h"
#include "core/object/i_fragment_wrapper.h"
#include "core/utils/mpi_utils.h"
#include "core/utils/transform_utils.h"
#include "core/utils/trivial_tensor.h"

#define CONTEXT_TYPE_TENSOR "tensor"

namespace bl = boost::leaf;

namespace grape {

template <typename T>
Expand Down Expand Up @@ -86,6 +96,8 @@ inline InArchive& operator<<(
} // namespace grape

namespace gs {
class IFragmentWrapper;

template <typename T>
static bl::result<size_t> get_n_dim(const grape::CommSpec& comm_spec,
const trivial_tensor_t<T>& tensor) {
Expand Down
13 changes: 11 additions & 2 deletions analytical_engine/core/context/tensor_dataframe_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@
#ifndef ANALYTICAL_ENGINE_CORE_CONTEXT_TENSOR_DATAFRAME_BUILDER_H_
#define ANALYTICAL_ENGINE_CORE_CONTEXT_TENSOR_DATAFRAME_BUILDER_H_

#include <mpi.h>

#include <memory>
#include <utility>
#include <vector>

#include "grape/communication/sync_comm.h"
#include "common/util/uuid.h"
#include "grape/worker/comm_spec.h"
#include "vineyard/basic/ds/dataframe.h"
#include "vineyard/basic/ds/tensor.h"
#include "vineyard/client/client.h"
#include "vineyard/client/ds/object_meta.h"
#include "vineyard/common/util/status.h"

#include "core/context/mpi_object_sync.h"

namespace vineyard {
class Object;
}

namespace gs {

/**
Expand Down
Loading

0 comments on commit b8ee7f0

Please sign in to comment.