diff --git a/.debug/.gitignore b/.debug/.gitignore deleted file mode 100644 index a5baada1..00000000 --- a/.debug/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore - diff --git a/.github/workflows/cfpages.yml b/.github/workflows/cfpages.yml new file mode 100644 index 00000000..8f448364 --- /dev/null +++ b/.github/workflows/cfpages.yml @@ -0,0 +1,39 @@ +# This workflow uploads documentation to Cloudflare Pages. +# @authors: Runzhi He +# @date: 2024-01-10 + +name: Publish Cloudflare Pages + +on: + push: + branches: [ online-docs ] + workflow_dispatch: # Manually run workflow + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Publish to Cloudflare Pages + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: online-docs + fetch-depth: 0 + + - name: Copy Assets + run: | + mkdir -p temp + cp -rv $(find ./docs -maxdepth 1 -type f) temp + cp -rv ./docs/zh-cn ./docs/help temp + + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CF_API_TOKEN }} + accountId: ${{ secrets.CF_ACCOUNT_ID }} + projectName: ${{ vars.CF_PROJECT_NAME }} + directory: temp + gitHubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..48375baf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,77 @@ +# This workflow runs the test suite, measure coverage, and upload the coverage report to Codecov. +# @authors: Runzhi He +# @date: 2024-01-08 + +name: Build and Test + +on: + push: + # branches: [ master ] # TODO: have a stable default branch + pull_request: + workflow_dispatch: # Manually run workflow + +jobs: + build-and-test: + # Only trigger this workflow on the default branch + # https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable + if: ${{ always() && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }} + # This CI gonna fail if can't build and test on latest Ubuntu LTS + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Test the setup script + - name: Install system dependencies + run: sudo bash scripts/setup-dev.sh + + - name: Setup Conan + run: pip install conan && conan profile detect + + - name: Cache Conan dependencies + uses: actions/cache@v3 + with: + path: | + ~/.conan2/p/ + key: ${{ runner.os }}-conan-${{ hashFiles('conanfile.py') }} + restore-keys: | + ${{ runner.os }}-conan- + + - name: Install conan dependencies + run: conan install . -s "&:build_type=Debug" -s "build_type=Release" --build=missing + + - name: Build + run: | + cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON + ninja prepare + ninja install -v + working-directory: cmake-build-debug + + - name: Sanity Check + run: | + bash scripts/init.sh + (timeout 10s bin/ghttp &) && sleep 3 && bin/gquery -db small -q data/small/small_q0.sql && killall ghttp + + - name: Test + run: ctest -C Debug --output-on-failure --rerun-failed + working-directory: cmake-build-debug + continue-on-error: ${{ vars.CHEAT_IN_CI == 'true' }} + + - name: Generate coverage report + run: ninja coverage + working-directory: cmake-build-debug + + - name: Upload coverage report + uses: actions/upload-artifact@v2 + with: + name: coverage.tar.gz + path: coverage.tar.gz + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false + files: coverage.info + verbose: true \ No newline at end of file diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml new file mode 100644 index 00000000..f9e30837 --- /dev/null +++ b/.github/workflows/publish-docker.yml @@ -0,0 +1,59 @@ +# This workflow will build a new Docker image and push it to Docker Hub whenever a new tag is created. +# @authors: Runzhi He +# @date: 2024-01-08 + +name: Publish Docker + +on: + push: + tags: + - 'v*' + # This line enables manual triggering + workflow_dispatch: + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ${{ vars.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_REPOSITORY }} + + - name: Creating source tarball + run: | + tar -czvf gstore-src.tar.gz "src" "api" "defaults" "tests" "3rdparty" "data" "scripts" "conanfile.py" "CMakeLists.txt" "README.md" "LICENSE" + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + context: . + file: ./Dockerfile + # if triggered by workflow_dispatch, don't push to Docker Hub + push: ${{ github.event_name != 'workflow_dispatch' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 00000000..2b39fed9 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,75 @@ +# This workflow will build and draft a new release whenever a new tag is pushed to the repository. +# @authors: Runzhi He +# @date: 2024-01-08 + +name: Publish Release + +on: + push: + tags: + - 'v*' + # This line enables manual triggering + workflow_dispatch: + +jobs: + build-and-release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Test the setup script + - name: Install system dependencies + run: sudo bash scripts/setup-dev.sh + + - name: Setup Conan + run: pip install conan && conan profile detect + + - name: Install conan dependencies + run: conan install . -s "build_type=Release" --build=missing + + - name: Build + run: | + cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release + ninja prepare + ninja install -v + working-directory: cmake-build-release + + - name: Create Tarball + run: | + ninja -C cmake-build-release tarball + ninja -C cmake-build-release package + + - name: Sanity Check + run: | + bash scripts/init.sh + (timeout 10s bin/ghttp &) && sleep 3 && bin/gquery -db small -q data/small/small_q0.sql && killall ghttp + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '18' + + - name: Generate Changelog + run: | + npm install -g conventional-changelog-cli + conventional-changelog -p angular -i CHANGELOG.md -s + + - name: Create a new Release + uses: ncipollo/release-action@v1 + id: create_release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # https://github.com/ncipollo/release-action for the full list of arguments + artifacts: gstore-*.tar.gz + draft: true # generate a draft release + generateReleaseNotes: false + bodyFile: CHANGELOG.md + # generate a pre-release if 'pre', 'rc', or 'beta' is in the tag name, or triggered manually + prerelease: ${{ github.event_name == 'workflow_dispatch' || contains(github.ref, 'beta') || contains(github.ref, 'rc') || contains(github.ref, 'pre') }} + # use the tag name if it's a tag, otherwise use the commit hash + continue-on-error: true diff --git a/.gitignore b/.gitignore index 29c6f6e2..e6a273e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,38 @@ +# Artifacts and Cache +build/ +include/ +lib/ +bin/ +bin_tests/ +dist/ +cmake-build-*/ +.cmake/ +gstore-*.tar.gz +CMakeUserPresets.json +/Testing/ + +# Runtime directories +.tmp/ +.debug/ +.obj/ +backup/ +logs/ +upload/ +temp/ +fun/ + +# config files +# TODO: add a separate config file folder +/backup.json +/conf.ini +/init.conf +/ipAllow.config +/ipDeny.config +/README.txt +/slog.properties +/slog.stdout.properties +/*.log + # Executables *.pyc *.exe @@ -7,19 +42,20 @@ *.x86_64 *.hex bin/g* -scripts/update_test -scripts/dataset_test +tests/update_test +tests/dataset_test api/cpp/example/example -Parser/Sparql* +src/Parser/Sparql* #result logs *.txt *.log logs +!CMakeLists.txt #backup files -backup.json +defaults/backup.json #download files *.torrent @@ -90,6 +126,7 @@ tags .vs *.iml .idea +.vscode # latex files *.aux diff --git a/.objs/.gitignore b/.objs/.gitignore deleted file mode 100644 index a5baada1..00000000 --- a/.objs/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore - diff --git a/.tmp/.gitignore b/.tmp/.gitignore deleted file mode 100644 index a5baada1..00000000 --- a/.tmp/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore - diff --git a/.tmp/web/.gitignore b/.tmp/web/.gitignore deleted file mode 100644 index a5baada1..00000000 --- a/.tmp/web/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore - diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index a9f5fe19..00000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "configurations": [ - { - "name": "Linux", - "includePath": [ - "${workspaceFolder}/**" - ], - "defines": [], - "compilerPath": "/usr/bin/gcc", - "cStandard": "c17", - "cppStandard": "gnu++14", - "intelliSenseMode": "linux-gcc-x64" - } - ], - "version": 4 -} \ No newline at end of file diff --git a/3rdparty/.gitignore b/3rdparty/.gitignore new file mode 100644 index 00000000..6a0c6d1e --- /dev/null +++ b/3rdparty/.gitignore @@ -0,0 +1,6 @@ +* +!.gitignore +!*.tar* +!*.t[bgx]z +!*.zip +!*.sh \ No newline at end of file diff --git a/3rdparty/antlr4-cpp-runtime-4.sh b/3rdparty/antlr4-cpp-runtime-4.sh new file mode 100644 index 00000000..0b6d1f37 --- /dev/null +++ b/3rdparty/antlr4-cpp-runtime-4.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +mkdir -p ../include/ +rm -rf antlr4-cpp-runtime-4 +tar -xzvf antlr4-cpp-runtime-4.tar.gz; +cd antlr4-cpp-runtime-4 || echo "./antlr4-cpp-runtime-4 not found" +cmake . + +# if GSTORE_USE_DYNAMIC_LIB is defined, then we need to copy the dynamic library to the lib directory +# otherwise, we need to copy the static library to the lib directory +if [ -n "$GSTORE_USE_DYNAMIC_LIB" ]; then + make -j2 antlr4_shared + cp dist/libantlr4-runtime.so* ../../lib/libantlr4-runtime.so + cd ../../lib/ || echo "./lib not found" +else + make -j$(nproc) antlr4_static + cp dist/libantlr4-runtime.a ../../lib/ +fi +cp -r runtime/src/* ../../include/ \ No newline at end of file diff --git a/tools/antlr4-cpp-runtime-4.tar.gz b/3rdparty/antlr4-cpp-runtime-4.tar.gz similarity index 100% rename from tools/antlr4-cpp-runtime-4.tar.gz rename to 3rdparty/antlr4-cpp-runtime-4.tar.gz diff --git a/3rdparty/init.sh b/3rdparty/init.sh new file mode 100644 index 00000000..69d735b1 --- /dev/null +++ b/3rdparty/init.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +BLUE='\033[0;34m' +NC='\033[0m' + +cd $(dirname "${BASH_SOURCE[0]}") + +mkdir -p ../lib ../include + +for f in *.sh; do + if [ "$f" != "init.sh" ]; then + echo "${BLUE}Running $f${NC}" + bash "$f" + if [ $? -ne 0 ]; then + echo "${BLUE}Failed to run $f${NC}" + exit 1 + fi + fi +done + diff --git a/3rdparty/workflow-0.10.3.sh b/3rdparty/workflow-0.10.3.sh new file mode 100644 index 00000000..5ef32227 --- /dev/null +++ b/3rdparty/workflow-0.10.3.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +rm -rf workflow +tar -xzvf workflow-0.10.3.tar.gz +cd ./workflow || echo "./workflow not found" + +make -j$(nproc) +# if GSTORE_USE_DYNAMIC_LIB is defined, then we need to copy the dynamic library to the lib directory +# otherwise, we need to copy the static library to the lib directory + +if [ -n "$GSTORE_USE_DYNAMIC_LIB" ]; then + cp _lib/libworkflow.so* ../../lib/ + cd ../../lib/ || echo "./lib not found" +else + cp _lib/libworkflow.a ../../lib/libworkflow.a +fi +cp _include/workflow ../../include/workflow -r diff --git a/tools/workflow-0.10.3.tar.gz b/3rdparty/workflow-0.10.3.tar.gz similarity index 100% rename from tools/workflow-0.10.3.tar.gz rename to 3rdparty/workflow-0.10.3.tar.gz diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..cfb1a615 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,200 @@ +# SPDX-License-Identifier: BSD-3-Clause +# @authors: Runzhi He +# @date: 2023-12-20 + +cmake_minimum_required(VERSION 3.16) + +project(gStore LANGUAGES CXX) + +# gStore requires gcc 8 or higher +if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8") + message(FATAL_ERROR "gStore requires gcc 8 or higher, got ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") +endif() + +### set compiler flags +# use -O2 for Release +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2") +# ignore unused-result, panic on return-type +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -Werror=return-type") +# check CMAKE_BUILD_TYPE, if not set, set to Release +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) + message(WARNING "Build type not set, default to Release") +endif() +# Check if mold is available and set it as the linker +find_program(MOLD_LINKER mold) +if(MOLD_LINKER) + message(STATUS "mold linker found: ${MOLD_LINKER}, adding -fuse-ld=mold to linker flags") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=mold") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=mold") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fuse-ld=mold") +else() + message(STATUS "mold linker not found, using default linker") +endif() +# coverage settings +if(COVERAGE) + message(STATUS "Enabling coverage reporting") + # halt if the build_type is not Debug + if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + message(FATAL_ERROR "Coverage requires Debug build type") + endif() + # set compiler flags + add_link_options(--coverage) + add_compile_options(--coverage) +endif () + +# print build type and flags +message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") +message(STATUS "CXX Flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}") + +# helper for IDEs to find the include path +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +# Add include/ and lib/ +include_directories(${CMAKE_SOURCE_DIR}/include) +link_directories(${CMAKE_SOURCE_DIR}/lib) +# TODO: The line below is a workaround for millions of relative includes. Remove it when all relative includes are replaced with target_include_directories. +include_directories(${CMAKE_INCLUDE_PATH}) + +# Set output directories (use -DGSTORE_ROOT_DIR=... to override) +SET(GSTORE_ROOT_DIR ${CMAKE_SOURCE_DIR}) +SET(GSTORE_EXE_DIR ${GSTORE_ROOT_DIR}/bin) +SET(GSTORE_LIB_DIR ${GSTORE_ROOT_DIR}/lib) +SET(GSTORE_TEST_DIR ${GSTORE_ROOT_DIR}/bin_tests) + +# if option USE_DYNAMIC_LIB is set, set env var GSTORE_USE_DYNAMIC_LIB to 1 +SET(USE_DYNAMIC_LIB ON CACHE BOOL "Use dynamic libraries") +if(USE_DYNAMIC_LIB OR ENV{GSTORE_USE_DYNAMIC_LIB}) + set(ENV{GSTORE_USE_DYNAMIC_LIB} 1) + # Set rpath so that gStore can find its shared libraries + set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib") +endif() + +### Dependencies managed by conan +# boost-system, boost-regex, boost-thread +find_package(Boost REQUIRED CONFIG COMPONENTS system regex thread) +# minizip: minizip::minizip, minizip/zip.h +find_package(minizip REQUIRED CONFIG) +# openssl: OpenSSL::SSL, OpenSSL::Crypto +find_package(OpenSSL REQUIRED CONFIG) +# indicators: indicators::indicators, indicators/progress_bar.hpp +find_package(indicators REQUIRED CONFIG) +## antlr4-runtime: antlr4_shared, antlr4_static +#find_package(antlr4-runtime REQUIRED CONFIG) +# rapidjson: rapidjson, rapidjson/document.h +find_package(RapidJSON REQUIRED CONFIG) +# logcplus: log4cplus::log4cplus, log4cplus/logger.h +find_package(log4cplus REQUIRED CONFIG) +# curl: CURL::libcurl, curl/curl.h +find_package(CURL REQUIRED CONFIG) + +### Dependencies managed by system package manager +find_package(Threads REQUIRED) +find_package(PkgConfig REQUIRED) +# readline: have to link for license compatibility with GPL-3 +find_library(LIB_READLINE NAMES readline REQUIRED) +# jemalloc +find_library(LIB_JEMALLOC NAMES jemalloc REQUIRED) +# openmp: OpenMP::OpenMP_CXX # the elegance below requires cmake 3.9 or higher +find_package(OpenMP REQUIRED) +# uuid: uuid::uuid (required by antlr4-cppruntime) +find_library(LIB_UUID NAMES uuid REQUIRED) +# Backward: Backward::Backward +find_package(Backward REQUIRED) +# libdwarf: libdwarf::libdwarf +find_package(libdwarf REQUIRED) +# libelf libelf::libelf +find_package(libelf REQUIRED) + +### Prepare unmanaged dependencies +add_custom_target( + prepare + COMMAND [ -d ${CMAKE_SOURCE_DIR}/include ] && [ -d ${CMAKE_SOURCE_DIR}/lib ] || bash ${CMAKE_SOURCE_DIR}/3rdparty/init.sh + COMMENT "Prepare unmanaged dependencies" +) + +add_custom_target( + clean_prepare + COMMAND rm -rvf ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/lib/*.a + COMMAND find ${CMAKE_SOURCE_DIR}/3rdparty -type d -mindepth 1 -maxdepth 1 -exec rm -rvf {} + + COMMENT "Clean unmanaged dependencies" +) + +add_custom_target( + uninstall + # remove all files in bin/, lib/, and scripts/ that are not *.sh or *.py + COMMAND rm -rvf ${GSTORE_EXE_DIR} + COMMAND rm -rvf ${GSTORE_LIB_DIR}/libgcsr.so ${GSTORE_LIB_DIR}/libgpathqueryhandler.so + COMMAND find ${GSTORE_TEST_DIR} -type f -not -name '*.*' -exec rm -v {} + + COMMENT "Clean installed files" +) + +add_custom_target( + tarball + COMMAND cd ../ && ${CMAKE_COMMAND} -E tar "cfzv" "gstore-src.tar.gz" -- + "src" "api" "defaults" "tests" "3rdparty" "data" "scripts" "conanfile.py" "CMakeLists.txt" "README.md" "LICENSE" + COMMENT "Creating source tarball" + VERBATIM +) + +string(TOLOWER "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" GSTORE_PLATFORM_NAME) +add_custom_target( + package + COMMAND cd ../ && ${CMAKE_COMMAND} -E tar "cfzv" "gstore-${GSTORE_PLATFORM_NAME}.tar.gz" -- + "bin" "lib" "defaults" "data/system" "scripts" "README.md" "LICENSE" + COMMENT "Creating binary tarball" + VERBATIM +) + +# ignored files for lcov (*Server* to wildcard all server files) +SET(GSTORE_COVERAGE_IGNORES "*Server*" "*Main*" "*Parser/SPARQL*" "*include/*" "*tests/*") +if (COVERAGE) + add_custom_target( + coverage + COMMAND lcov --capture --directory ${CMAKE_SOURCE_DIR} --output-file ${CMAKE_SOURCE_DIR}/coverage.info + # remove dependencies + COMMAND lcov --remove ${CMAKE_SOURCE_DIR}/coverage.info "/usr/*" "*conan*" --output-file ${CMAKE_SOURCE_DIR}/coverage.info + # remove untested + COMMAND lcov --remove ${CMAKE_SOURCE_DIR}/coverage.info ${GSTORE_COVERAGE_IGNORES} --output-file ${CMAKE_SOURCE_DIR}/coverage.info + COMMAND genhtml ${CMAKE_SOURCE_DIR}/coverage.info --output-directory ${CMAKE_SOURCE_DIR}/temp --demangle-cpp --frames --legend --show-details --title "Code Coverage" + COMMAND lcov --list ${CMAKE_SOURCE_DIR}/coverage.info + COMMAND tar -czf ${CMAKE_SOURCE_DIR}/coverage.tar.gz -C ${CMAKE_SOURCE_DIR}/temp . + COMMENT "Generating code coverage report -> temp/index.html, coverage.tar.gz" + VERBATIM + ) +endif () + +# Add large file support on 32-bit builds +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + add_definitions(-D_FILE_OFFSET_BITS=64) + add_definitions(-D_LARGEFILE_SOURCE) + add_definitions(-D_LARGEFILE64_SOURCE) +endif() + +add_subdirectory(src) +add_subdirectory(tests) + +# rules for ctest +include(CTest) +enable_testing() +add_test(NAME BasicTest COMMAND bash ${CMAKE_SOURCE_DIR}/tests/basic_test.sh && rm -r ${CMAKE_SOURCE_DIR}/system.db && bash ${CMAKE_SOURCE_DIR}/scripts/init.sh) +add_test(NAME ParserTest COMMAND bash ${CMAKE_SOURCE_DIR}/tests/parser_test.sh) +# add_test(NAME DatasetTest COMMAND bin_tests/dataset_test) +add_test(NAME UpdateTest COMMAND bin_tests/update_test 100) +add_test(NAME TransactionTest COMMAND bin_tests/transaction_test) +add_test(NAME RunTransaction COMMAND bash -c "(sleep 1; echo Begin; sleep 1; echo Commit;) | bin_tests/run_transaction small") +add_test(NAME DebugTest COMMAND bin_tests/debug_test) + +set(GSTORE_CI_TESTS + BasicTest + ParserTest + # DatasetTest + UpdateTest + TransactionTest + RunTransaction + DebugTest +) + +foreach (test ${GSTORE_CI_TESTS}) + set_tests_properties(${test} PROPERTIES TIMEOUT 300 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) +endforeach () diff --git a/COVERAGE/readme b/COVERAGE/readme deleted file mode 100644 index e69de29b..00000000 diff --git a/Dockerfile b/Dockerfile index 130819fb..c50262fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause -FROM debian:buster-slim AS builder +FROM ubuntu:22.04 AS builder LABEL vendor="pkumod" LABEL description="gStore RDF Database Engine" @@ -9,62 +9,54 @@ LABEL description="gStore RDF Database Engine" RUN apt-get update && apt-get install -y \ build-essential \ cmake \ - libboost-regex-dev \ - libboost-system-dev \ - libboost-thread-dev \ - libboost-system-dev \ - curl \ - libcurl4 \ - libcurl4-openssl-dev \ - libssl-dev \ - libzmq3-dev \ + ninja-build \ + mold \ + python3-pip \ pkg-config \ - wget \ - zlib1g-dev \ uuid-dev \ libjemalloc-dev \ - libreadline-dev + libreadline-dev \ + libssl-dev RUN mkdir -p /src WORKDIR /usr/src/gstore -# Compile gStore dependencies -COPY tools/ /usr/src/gstore/tools +# Install conan dependencies\ +RUN pip3 install conan && conan profile detect -COPY makefile /usr/src/gstore/ +COPY conanfile.py /usr/src/gstore/ -RUN mkdir -p lib && make pre +RUN conan install . --build=missing -s "build_type=Release" -s "compiler.libcxx=libstdc++11" -s "compiler.cppstd=17" # Copy gStore source code; run `make tarball` to generate this file -ADD gstore.tar.gz /usr/src/gstore +ADD gstore-src.tar.gz /usr/src/gstore -RUN make +RUN cd cmake-build-release && \ + cmake .. -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake \ + -DCMAKE_CXX_FLAGS="-fuse-ld=mold" \ + -DCMAKE_BUILD_TYPE=Release -FROM debian:buster-slim AS runtime +RUN cd cmake-build-release && \ + ninja -v prepare && \ + ninja -v install + +FROM ubuntu:22.04 AS runtime RUN apt-get update && apt-get install -y \ - libboost-regex1.67.0 \ - libboost-system1.67.0 \ - libboost-thread1.67.0 \ - libcurl4 \ - libssl1.1 \ - libzmq5 \ - uuid-runtime \ + libgomp1 \ + libssl3 \ libjemalloc2 \ - libreadline7 \ - libopenmpi3 \ - coreutils \ + libreadline8 \ + libuuid1 \ && rm -rf /var/lib/apt/lists/* -COPY --from=builder /usr/src/gstore/bin/ /usr/local/bin/ - -COPY --from=builder /usr/src/gstore/lib/ /docker-init/lib/ - -COPY backup.json init.conf conf.ini ipAllow.config ipDeny.config slog.properties slog.stdout.properties \ - /docker-init/ -COPY data/ /docker-init/data/ -COPY docker-entrypoint.sh / +COPY --from=builder /usr/src/gstore/bin/ /bin/ +COPY --from=builder /usr/src/gstore/lib/ /lib/ +COPY --from=builder /usr/src/gstore/defaults/ /defaults/ +COPY --from=builder /usr/src/gstore/data/ /data/ +COPY --from=builder /usr/src/gstore/scripts/init.sh /docker-entrypoint.sh WORKDIR /app/ VOLUME [ "/app/" ] @@ -74,6 +66,6 @@ RUN echo "* - nofile 65535" >> /etc/security/limits.conf \ EXPOSE 9000 -ENTRYPOINT [ "sh", "/docker-entrypoint.sh" ] +ENTRYPOINT [ "bash", "/docker-entrypoint.sh" ] -CMD [ "/usr/local/bin/ghttp" ] +CMD [ "/bin/ghttp" ] diff --git a/Parser/SPARQL/SPARQLLexer.tokens b/Parser/SPARQL/SPARQLLexer.tokens deleted file mode 100644 index 05184f17..00000000 --- a/Parser/SPARQL/SPARQLLexer.tokens +++ /dev/null @@ -1,236 +0,0 @@ -T__0=1 -T__1=2 -T__2=3 -T__3=4 -T__4=5 -T__5=6 -T__6=7 -T__7=8 -T__8=9 -T__9=10 -T__10=11 -T__11=12 -T__12=13 -T__13=14 -T__14=15 -T__15=16 -T__16=17 -T__17=18 -T__18=19 -T__19=20 -T__20=21 -T__21=22 -T__22=23 -T__23=24 -T__24=25 -T__25=26 -T__26=27 -T__27=28 -T__28=29 -K_NOW=30 -K_YEAR=31 -K_UNION=32 -K_IF=33 -K_ASK=34 -K_ASC=35 -K_CONCAT=36 -K_IN=37 -K_UNDEF=38 -K_INSERT=39 -K_MONTH=40 -K_DEFAULT=41 -K_SELECT=42 -K_FLOOR=43 -K_TZ=44 -K_COPY=45 -K_CEIL=46 -K_HOURS=47 -K_DATATYPE=48 -K_ISNUMERIC=49 -K_STRUUID=50 -K_CONSTRUCT=51 -K_ADD=52 -K_BOUND=53 -K_NAMED=54 -K_TIMEZONE=55 -K_MIN=56 -K_ISBLANK=57 -K_UUID=58 -K_BIND=59 -K_CLEAR=60 -K_INTO=61 -K_AS=62 -K_ALL=63 -K_IRI=64 -K_BASE=65 -K_BY=66 -K_DROP=67 -K_LOAD=68 -K_WITH=69 -K_BNODE=70 -K_WHERE=71 -K_AVG=72 -K_SAMPLE=73 -K_UCASE=74 -K_SERVICE=75 -K_MINUS=76 -K_SAMETERM=77 -K_STRSTARTS=78 -K_STR=79 -K_MOVE=80 -K_HAVING=81 -K_COALESCE=82 -K_STRBEFORE=83 -K_ABS=84 -K_ISLITERAL=85 -K_STRAFTER=86 -K_STRLEN=87 -K_LANG=88 -K_CREATE=89 -K_DESC=90 -K_MAX=91 -K_FILTER=92 -K_USING=93 -K_NOT=94 -K_STRENDS=95 -K_OFFSET=96 -K_CONTAINS=97 -K_PREFIX=98 -K_MINUTES=99 -K_REPLACE=100 -K_REGEX=101 -K_DELETE=102 -K_SEPARATOR=103 -K_DAY=104 -K_SILENT=105 -K_STRLANG=106 -K_ORDER=107 -K_ROUND=108 -K_GRAPH=109 -K_SECONDS=110 -K_URI=111 -K_DISTINCT=112 -K_EXISTS=113 -K_GROUP=114 -K_SUM=115 -K_REDUCED=116 -K_FROM=117 -K_LANGMATCHES=118 -K_ISURI=119 -K_TO=120 -K_ISIRI=121 -K_RAND=122 -K_STRDT=123 -K_COUNT=124 -K_DESCRIBE=125 -K_VALUES=126 -K_LCASE=127 -K_OPTIONAL=128 -K_LIMIT=129 -K_SUBSTR=130 -K_SIMPLECYCLEPATH=131 -K_SIMPLECYCLEBOOLEAN=132 -K_CYCLEPATH=133 -K_CYCLEBOOLEAN=134 -K_SHORTESTPATH=135 -K_SHORTESTPATHLEN=136 -K_KHOPREACHABLE=137 -K_KHOPENUMERATE=138 -K_KHOPREACHABLEPATH=139 -K_PPR=140 -K_TRIANGLECOUNTING=141 -K_CLOSENESSCENTRALITY=142 -K_BFSCOUNT=143 -K_PR=144 -K_ALPHA=145 -K_MAXITER=146 -K_TOL=147 -K_SSSP=148 -K_SSSPLEN=149 -K_LABELPROP=150 -K_WCC=151 -K_CLUSTERCOEFF=152 -K_MAXIMUMKPLEX=153 -K_CORETRUSS=154 -K_PFN=155 -K_KHOPCOUNT=156 -K_KHOPNEIGHBOR=157 -K_SHORTESTPATHCOUNT=158 -K_LOUVAIN=159 -K_IC14=160 -K_INCREASE=161 -KK_INSERTDATA=162 -KK_DELETEDATA=163 -KK_DELETEWHERE=164 -KK_ENCODE_FOR_URI=165 -KK_MD5=166 -KK_SHA1=167 -KK_SHA256=168 -KK_SHA384=169 -KK_SHA512=170 -KK_GROUP_CONCAT=171 -IRIREF=172 -PNAME_NS=173 -PNAME_LN=174 -BLANK_NODE_LABEL=175 -VAR1=176 -VAR2=177 -LANGTAG=178 -INTEGER=179 -DECIMAL=180 -DOUBLE=181 -INTEGER_POSITIVE=182 -DECIMAL_POSITIVE=183 -DOUBLE_POSITIVE=184 -INTEGER_NEGATIVE=185 -DECIMAL_NEGATIVE=186 -DOUBLE_NEGATIVE=187 -EXPONENT=188 -STRING_LITERAL1=189 -STRING_LITERAL2=190 -STRING_LITERAL_LONG1=191 -STRING_LITERAL_LONG2=192 -ECHAR=193 -NIL=194 -WS=195 -ANON=196 -PN_CHARS_BASE=197 -PN_CHARS_U=198 -VARNAME=199 -PN_CHARS=200 -PN_PREFIX=201 -PN_LOCAL=202 -PLX=203 -PERCENT=204 -HEX=205 -PN_LOCAL_ESC=206 -COMMENT=207 -'*'=1 -'('=2 -')'=3 -'{'=4 -'}'=5 -';'=6 -'.'=7 -','=8 -'a'=9 -'|'=10 -'/'=11 -'^'=12 -'?'=13 -'+'=14 -'!'=15 -'['=16 -']'=17 -'||'=18 -'&&'=19 -'='=20 -'!='=21 -'<'=22 -'>'=23 -'<='=24 -'>='=25 -'-'=26 -'^^'=27 -'true'=28 -'false'=29 diff --git a/Parser/SPARQL/SPARQLVisitor.cpp b/Parser/SPARQL/SPARQLVisitor.cpp deleted file mode 100644 index 0456f60b..00000000 --- a/Parser/SPARQL/SPARQLVisitor.cpp +++ /dev/null @@ -1,7 +0,0 @@ - -// Generated from ./SPARQL.g4 by ANTLR 4.7.2 - - -#include "SPARQLVisitor.h" - - diff --git a/README.md b/README.md index be226589..980e6661 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,21 @@ + +
+ gStore logo +
+ + + +
+ GitHub commit activity + GitHub contributors + GitHub Actions Workflow Status + + Docker Image Version (latest semver) + Static Badge +
+ # gStore System gStore System(also called gStore) is a graph database engine for managing large graph-structured data, which is open-source and targets at Linux operation systems. The whole project is written in C++, with the help of some libraries such as readline, antlr, and so on. Only source tarballs are provided currently, which means you have to compile the source code if you want to use our system. diff --git a/Server/web/logo.png b/Server/web/logo.png deleted file mode 100644 index 1689bd4d..00000000 Binary files a/Server/web/logo.png and /dev/null differ diff --git a/api/http/cpp/example/Benchmark b/api/http/cpp/example/Benchmark deleted file mode 100755 index 3b8a2376..00000000 Binary files a/api/http/cpp/example/Benchmark and /dev/null differ diff --git a/api/http/cpp/example/GET-example b/api/http/cpp/example/GET-example deleted file mode 100755 index f88052cf..00000000 Binary files a/api/http/cpp/example/GET-example and /dev/null differ diff --git a/api/http/cpp/example/POST-example b/api/http/cpp/example/POST-example deleted file mode 100755 index 259dfb9d..00000000 Binary files a/api/http/cpp/example/POST-example and /dev/null differ diff --git a/api/http/cpp/example/Transaction-example b/api/http/cpp/example/Transaction-example deleted file mode 100755 index ade8c25e..00000000 Binary files a/api/http/cpp/example/Transaction-example and /dev/null differ diff --git a/api/http/cpp/src/.gitignore b/api/http/cpp/src/.gitignore new file mode 100644 index 00000000..d1638636 --- /dev/null +++ b/api/http/cpp/src/.gitignore @@ -0,0 +1 @@ +build/ \ No newline at end of file diff --git a/api/http/cpp/src/CMakeLists.txt b/api/http/cpp/src/CMakeLists.txt new file mode 100644 index 00000000..011a49d9 --- /dev/null +++ b/api/http/cpp/src/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.4) + +project(gStoreConnector) +# try to find curl by conan +if (NOT CURL_FOUND) + find_package(CURL QUIET) +endif () +# if can't find curl by conan, try to find libcurl by pkg-config +if (NOT CURL_FOUND) + find_package(PkgConfig REQUIRED) + pkg_search_module(CURL REQUIRED) +endif() + +set(CONNECTOR_SOURCES GstoreConnector.cpp) + +add_library(gstore_connector OBJECT GstoreConnector.cpp) + +add_library(gstore_connector_static STATIC $) +target_link_libraries(gstore_connector_static ${CURL_LIBRARIES}) \ No newline at end of file diff --git a/backup.json b/backup.json deleted file mode 100644 index a86f7145..00000000 --- a/backup.json +++ /dev/null @@ -1 +0,0 @@ -{"db_name": "system","backup_timer": "600"} diff --git a/backups/.gitkeep b/backups/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/backups/logs/logs b/backups/logs/logs deleted file mode 100644 index 8b137891..00000000 --- a/backups/logs/logs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/bin/.gitignore b/bin/.gitignore deleted file mode 100644 index a5baada1..00000000 --- a/bin/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore - diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 00000000..5759e195 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,56 @@ +from conan import ConanFile + +class GStore(ConanFile): + ### Project Attributes ### + # references: https://docs.conan.io/2/reference/conanfile/attributes.html + name = "gstore" + version = "1.2" + license = "BSD-3-Clause" + homepage = "https://gstore.cn" + url = "https://github.com/pkumod/gStore" + + ### Dependencies ### + # available packages: https://conconan.io/center/recipes + # usage reference: https://github.com/conan-io/conan-center-index/blob/master/recipes/{PACKAGE_NAME}/all + requires = ( + "log4cplus/2.1.0", + "zlib/1.3", + "indicators/2.3", + "rapidjson/1.1.0", + "libcurl/8.5.0", + "openssl/3.2.0", + "minizip/1.2.13", + "backward-cpp/1.6", + ) + build_policy = "missing" + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + + def configure(self): + # set the project to use C++17 + self.settings.compiler.cppstd = "17" + # set log4cplus to use char instead of wchar_t + self.options["log4cplus"].unicode = False + # remove boost from requirements if on loongarch64 + + def requirements(self): + if self.settings.get_safe("arch") != "loongarch64": + self.requires("boost/1.83.0") + else: + self.output.warning("The official Boost wheel (1.83.0) is yet to be fixed on loongarch. " + "Please install boost from your system package manager.") + + def package_info(self): + self.output.info("PackageInfo!: Cppstd version: %s!" % self.settings.compiler.cppstd) + + def layout(self): + # basically a trimmed down version of the basic_layout function + _build_type = self.settings.get_safe("build_type") + if _build_type: + self.folders.build = "cmake-build-{}".format(str(_build_type).lower()) + else: + self.folders.build = "cmake-build" + self.folders.source = "." + self.folders.generators = self.folders.build + self.cpp.build.bindirs = ["bin", "bin_tests"] + self.cpp.build.libdirs = ["lib"] \ No newline at end of file diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 00000000..74e5b1d3 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1 @@ +!* \ No newline at end of file diff --git a/scripts/bfs_test/bbug/bbug1.sql b/data/bfs_test/bbug/bbug1.sql similarity index 100% rename from scripts/bfs_test/bbug/bbug1.sql rename to data/bfs_test/bbug/bbug1.sql diff --git a/scripts/bfs_test/bbug/bbug1r.txt b/data/bfs_test/bbug/bbug1r.txt similarity index 100% rename from scripts/bfs_test/bbug/bbug1r.txt rename to data/bfs_test/bbug/bbug1r.txt diff --git a/scripts/bfs_test/bbug/bbug3.sql b/data/bfs_test/bbug/bbug3.sql similarity index 100% rename from scripts/bfs_test/bbug/bbug3.sql rename to data/bfs_test/bbug/bbug3.sql diff --git a/scripts/bfs_test/bbug/bbug3r.txt b/data/bfs_test/bbug/bbug3r.txt similarity index 100% rename from scripts/bfs_test/bbug/bbug3r.txt rename to data/bfs_test/bbug/bbug3r.txt diff --git a/scripts/bfs_test/bbug/bbug4.sql b/data/bfs_test/bbug/bbug4.sql similarity index 100% rename from scripts/bfs_test/bbug/bbug4.sql rename to data/bfs_test/bbug/bbug4.sql diff --git a/scripts/bfs_test/bbug/bbug4r.txt b/data/bfs_test/bbug/bbug4r.txt similarity index 100% rename from scripts/bfs_test/bbug/bbug4r.txt rename to data/bfs_test/bbug/bbug4r.txt diff --git a/scripts/bfs_test/bbug/bbug5.sql b/data/bfs_test/bbug/bbug5.sql similarity index 100% rename from scripts/bfs_test/bbug/bbug5.sql rename to data/bfs_test/bbug/bbug5.sql diff --git a/scripts/bfs_test/bbug/bbug5r.txt b/data/bfs_test/bbug/bbug5r.txt similarity index 100% rename from scripts/bfs_test/bbug/bbug5r.txt rename to data/bfs_test/bbug/bbug5r.txt diff --git a/scripts/bfs_test/lubm/lubm_p0.sql b/data/bfs_test/lubm/lubm_p0.sql similarity index 100% rename from scripts/bfs_test/lubm/lubm_p0.sql rename to data/bfs_test/lubm/lubm_p0.sql diff --git a/scripts/bfs_test/lubm/lubm_p0r.txt b/data/bfs_test/lubm/lubm_p0r.txt similarity index 100% rename from scripts/bfs_test/lubm/lubm_p0r.txt rename to data/bfs_test/lubm/lubm_p0r.txt diff --git a/scripts/bfs_test/lubm/lubm_p2.sql b/data/bfs_test/lubm/lubm_p2.sql similarity index 100% rename from scripts/bfs_test/lubm/lubm_p2.sql rename to data/bfs_test/lubm/lubm_p2.sql diff --git a/scripts/bfs_test/lubm/lubm_p2r.txt b/data/bfs_test/lubm/lubm_p2r.txt similarity index 100% rename from scripts/bfs_test/lubm/lubm_p2r.txt rename to data/bfs_test/lubm/lubm_p2r.txt diff --git a/scripts/bfs_test/lubm/lubm_p3.sql b/data/bfs_test/lubm/lubm_p3.sql similarity index 100% rename from scripts/bfs_test/lubm/lubm_p3.sql rename to data/bfs_test/lubm/lubm_p3.sql diff --git a/scripts/bfs_test/lubm/lubm_p3r.txt b/data/bfs_test/lubm/lubm_p3r.txt similarity index 100% rename from scripts/bfs_test/lubm/lubm_p3r.txt rename to data/bfs_test/lubm/lubm_p3r.txt diff --git a/scripts/bfs_test/lubm/lubm_p4.sql b/data/bfs_test/lubm/lubm_p4.sql similarity index 100% rename from scripts/bfs_test/lubm/lubm_p4.sql rename to data/bfs_test/lubm/lubm_p4.sql diff --git a/scripts/bfs_test/lubm/lubm_p4r.txt b/data/bfs_test/lubm/lubm_p4r.txt similarity index 100% rename from scripts/bfs_test/lubm/lubm_p4r.txt rename to data/bfs_test/lubm/lubm_p4r.txt diff --git a/scripts/bfs_test/lubm/lubm_q0.sql b/data/bfs_test/lubm/lubm_q0.sql similarity index 100% rename from scripts/bfs_test/lubm/lubm_q0.sql rename to data/bfs_test/lubm/lubm_q0.sql diff --git a/scripts/bfs_test/lubm/lubm_q0r.txt b/data/bfs_test/lubm/lubm_q0r.txt similarity index 100% rename from scripts/bfs_test/lubm/lubm_q0r.txt rename to data/bfs_test/lubm/lubm_q0r.txt diff --git a/scripts/bfs_test/lubm/lubm_q1.sql b/data/bfs_test/lubm/lubm_q1.sql similarity index 100% rename from scripts/bfs_test/lubm/lubm_q1.sql rename to data/bfs_test/lubm/lubm_q1.sql diff --git a/scripts/bfs_test/lubm/lubm_q1r.txt b/data/bfs_test/lubm/lubm_q1r.txt similarity index 100% rename from scripts/bfs_test/lubm/lubm_q1r.txt rename to data/bfs_test/lubm/lubm_q1r.txt diff --git a/scripts/bfs_test/lubm/lubm_q2.sql b/data/bfs_test/lubm/lubm_q2.sql similarity index 100% rename from scripts/bfs_test/lubm/lubm_q2.sql rename to data/bfs_test/lubm/lubm_q2.sql diff --git a/scripts/bfs_test/lubm/lubm_q2r.txt b/data/bfs_test/lubm/lubm_q2r.txt similarity index 100% rename from scripts/bfs_test/lubm/lubm_q2r.txt rename to data/bfs_test/lubm/lubm_q2r.txt diff --git a/scripts/bfs_test/lubm/lubm_q3.sql b/data/bfs_test/lubm/lubm_q3.sql similarity index 100% rename from scripts/bfs_test/lubm/lubm_q3.sql rename to data/bfs_test/lubm/lubm_q3.sql diff --git a/scripts/bfs_test/lubm/lubm_q3r.txt b/data/bfs_test/lubm/lubm_q3r.txt similarity index 100% rename from scripts/bfs_test/lubm/lubm_q3r.txt rename to data/bfs_test/lubm/lubm_q3r.txt diff --git a/scripts/bfs_test/lubm/lubm_q4.sql b/data/bfs_test/lubm/lubm_q4.sql similarity index 100% rename from scripts/bfs_test/lubm/lubm_q4.sql rename to data/bfs_test/lubm/lubm_q4.sql diff --git a/scripts/bfs_test/lubm/lubm_q4r.txt b/data/bfs_test/lubm/lubm_q4r.txt similarity index 100% rename from scripts/bfs_test/lubm/lubm_q4r.txt rename to data/bfs_test/lubm/lubm_q4r.txt diff --git a/scripts/bfs_test/lubm/lubm_q5.sql b/data/bfs_test/lubm/lubm_q5.sql similarity index 100% rename from scripts/bfs_test/lubm/lubm_q5.sql rename to data/bfs_test/lubm/lubm_q5.sql diff --git a/scripts/bfs_test/lubm/lubm_q5r.txt b/data/bfs_test/lubm/lubm_q5r.txt similarity index 100% rename from scripts/bfs_test/lubm/lubm_q5r.txt rename to data/bfs_test/lubm/lubm_q5r.txt diff --git a/scripts/bfs_test/num/num3.sql b/data/bfs_test/num/num3.sql similarity index 100% rename from scripts/bfs_test/num/num3.sql rename to data/bfs_test/num/num3.sql diff --git a/scripts/bfs_test/num/num3r.txt b/data/bfs_test/num/num3r.txt similarity index 100% rename from scripts/bfs_test/num/num3r.txt rename to data/bfs_test/num/num3r.txt diff --git a/scripts/bfs_test/small/small_p0.sql b/data/bfs_test/small/small_p0.sql similarity index 100% rename from scripts/bfs_test/small/small_p0.sql rename to data/bfs_test/small/small_p0.sql diff --git a/scripts/bfs_test/small/small_p0r.txt b/data/bfs_test/small/small_p0r.txt similarity index 100% rename from scripts/bfs_test/small/small_p0r.txt rename to data/bfs_test/small/small_p0r.txt diff --git a/scripts/bfs_test/small/small_p1.sql b/data/bfs_test/small/small_p1.sql similarity index 100% rename from scripts/bfs_test/small/small_p1.sql rename to data/bfs_test/small/small_p1.sql diff --git a/scripts/bfs_test/small/small_p1r.txt b/data/bfs_test/small/small_p1r.txt similarity index 100% rename from scripts/bfs_test/small/small_p1r.txt rename to data/bfs_test/small/small_p1r.txt diff --git a/scripts/bfs_test/small/small_p2.sql b/data/bfs_test/small/small_p2.sql similarity index 100% rename from scripts/bfs_test/small/small_p2.sql rename to data/bfs_test/small/small_p2.sql diff --git a/scripts/bfs_test/small/small_p2r.txt b/data/bfs_test/small/small_p2r.txt similarity index 100% rename from scripts/bfs_test/small/small_p2r.txt rename to data/bfs_test/small/small_p2r.txt diff --git a/scripts/bfs_test/small/small_p3.sql b/data/bfs_test/small/small_p3.sql similarity index 100% rename from scripts/bfs_test/small/small_p3.sql rename to data/bfs_test/small/small_p3.sql diff --git a/scripts/bfs_test/small/small_p3r.txt b/data/bfs_test/small/small_p3r.txt similarity index 100% rename from scripts/bfs_test/small/small_p3r.txt rename to data/bfs_test/small/small_p3r.txt diff --git a/scripts/bfs_test/small/small_q0.sql b/data/bfs_test/small/small_q0.sql similarity index 100% rename from scripts/bfs_test/small/small_q0.sql rename to data/bfs_test/small/small_q0.sql diff --git a/scripts/bfs_test/small/small_q0r.txt b/data/bfs_test/small/small_q0r.txt similarity index 100% rename from scripts/bfs_test/small/small_q0r.txt rename to data/bfs_test/small/small_q0r.txt diff --git a/scripts/bfs_test/small/small_q1.sql b/data/bfs_test/small/small_q1.sql similarity index 100% rename from scripts/bfs_test/small/small_q1.sql rename to data/bfs_test/small/small_q1.sql diff --git a/scripts/bfs_test/small/small_q1r.txt b/data/bfs_test/small/small_q1r.txt similarity index 100% rename from scripts/bfs_test/small/small_q1r.txt rename to data/bfs_test/small/small_q1r.txt diff --git a/scripts/bfs_test/small/small_q2.sql b/data/bfs_test/small/small_q2.sql similarity index 100% rename from scripts/bfs_test/small/small_q2.sql rename to data/bfs_test/small/small_q2.sql diff --git a/scripts/bfs_test/small/small_q2r.txt b/data/bfs_test/small/small_q2r.txt similarity index 100% rename from scripts/bfs_test/small/small_q2r.txt rename to data/bfs_test/small/small_q2r.txt diff --git a/scripts/bfs_test/small/small_q3.sql b/data/bfs_test/small/small_q3.sql similarity index 100% rename from scripts/bfs_test/small/small_q3.sql rename to data/bfs_test/small/small_q3.sql diff --git a/scripts/bfs_test/small/small_q3r.txt b/data/bfs_test/small/small_q3r.txt similarity index 100% rename from scripts/bfs_test/small/small_q3r.txt rename to data/bfs_test/small/small_q3r.txt diff --git a/scripts/bfs_test/small/small_s0.sql b/data/bfs_test/small/small_s0.sql similarity index 100% rename from scripts/bfs_test/small/small_s0.sql rename to data/bfs_test/small/small_s0.sql diff --git a/scripts/bfs_test/small/small_s0r.txt b/data/bfs_test/small/small_s0r.txt similarity index 100% rename from scripts/bfs_test/small/small_s0r.txt rename to data/bfs_test/small/small_s0r.txt diff --git a/scripts/bfs_test/small/small_s1.sql b/data/bfs_test/small/small_s1.sql similarity index 100% rename from scripts/bfs_test/small/small_s1.sql rename to data/bfs_test/small/small_s1.sql diff --git a/scripts/bfs_test/small/small_s1r.txt b/data/bfs_test/small/small_s1r.txt similarity index 100% rename from scripts/bfs_test/small/small_s1r.txt rename to data/bfs_test/small/small_s1r.txt diff --git a/scripts/dfs_test/bbug/bbug1.sql b/data/dfs_test/bbug/bbug1.sql similarity index 100% rename from scripts/dfs_test/bbug/bbug1.sql rename to data/dfs_test/bbug/bbug1.sql diff --git a/scripts/dfs_test/bbug/bbug3.sql b/data/dfs_test/bbug/bbug3.sql similarity index 100% rename from scripts/dfs_test/bbug/bbug3.sql rename to data/dfs_test/bbug/bbug3.sql diff --git a/scripts/dfs_test/bbug/bbug4.sql b/data/dfs_test/bbug/bbug4.sql similarity index 100% rename from scripts/dfs_test/bbug/bbug4.sql rename to data/dfs_test/bbug/bbug4.sql diff --git a/scripts/dfs_test/bbug/bbug5.sql b/data/dfs_test/bbug/bbug5.sql similarity index 100% rename from scripts/dfs_test/bbug/bbug5.sql rename to data/dfs_test/bbug/bbug5.sql diff --git a/scripts/dfs_test/lubm/lubm_p0.sql b/data/dfs_test/lubm/lubm_p0.sql similarity index 100% rename from scripts/dfs_test/lubm/lubm_p0.sql rename to data/dfs_test/lubm/lubm_p0.sql diff --git a/scripts/dfs_test/lubm/lubm_p2.sql b/data/dfs_test/lubm/lubm_p2.sql similarity index 100% rename from scripts/dfs_test/lubm/lubm_p2.sql rename to data/dfs_test/lubm/lubm_p2.sql diff --git a/scripts/dfs_test/lubm/lubm_p3.sql b/data/dfs_test/lubm/lubm_p3.sql similarity index 100% rename from scripts/dfs_test/lubm/lubm_p3.sql rename to data/dfs_test/lubm/lubm_p3.sql diff --git a/scripts/dfs_test/lubm/lubm_p4.sql b/data/dfs_test/lubm/lubm_p4.sql similarity index 100% rename from scripts/dfs_test/lubm/lubm_p4.sql rename to data/dfs_test/lubm/lubm_p4.sql diff --git a/scripts/dfs_test/lubm/lubm_q0.sql b/data/dfs_test/lubm/lubm_q0.sql similarity index 100% rename from scripts/dfs_test/lubm/lubm_q0.sql rename to data/dfs_test/lubm/lubm_q0.sql diff --git a/scripts/dfs_test/lubm/lubm_q1.sql b/data/dfs_test/lubm/lubm_q1.sql similarity index 100% rename from scripts/dfs_test/lubm/lubm_q1.sql rename to data/dfs_test/lubm/lubm_q1.sql diff --git a/scripts/dfs_test/lubm/lubm_q2.sql b/data/dfs_test/lubm/lubm_q2.sql similarity index 100% rename from scripts/dfs_test/lubm/lubm_q2.sql rename to data/dfs_test/lubm/lubm_q2.sql diff --git a/scripts/dfs_test/lubm/lubm_q3.sql b/data/dfs_test/lubm/lubm_q3.sql similarity index 100% rename from scripts/dfs_test/lubm/lubm_q3.sql rename to data/dfs_test/lubm/lubm_q3.sql diff --git a/scripts/dfs_test/lubm/lubm_q4.sql b/data/dfs_test/lubm/lubm_q4.sql similarity index 100% rename from scripts/dfs_test/lubm/lubm_q4.sql rename to data/dfs_test/lubm/lubm_q4.sql diff --git a/scripts/dfs_test/lubm/lubm_q5.sql b/data/dfs_test/lubm/lubm_q5.sql similarity index 100% rename from scripts/dfs_test/lubm/lubm_q5.sql rename to data/dfs_test/lubm/lubm_q5.sql diff --git a/scripts/dfs_test/num/num3.sql b/data/dfs_test/num/num3.sql similarity index 100% rename from scripts/dfs_test/num/num3.sql rename to data/dfs_test/num/num3.sql diff --git a/scripts/dfs_test/small/small_p0.sql b/data/dfs_test/small/small_p0.sql similarity index 100% rename from scripts/dfs_test/small/small_p0.sql rename to data/dfs_test/small/small_p0.sql diff --git a/scripts/dfs_test/small/small_p1.sql b/data/dfs_test/small/small_p1.sql similarity index 100% rename from scripts/dfs_test/small/small_p1.sql rename to data/dfs_test/small/small_p1.sql diff --git a/scripts/dfs_test/small/small_p2.sql b/data/dfs_test/small/small_p2.sql similarity index 100% rename from scripts/dfs_test/small/small_p2.sql rename to data/dfs_test/small/small_p2.sql diff --git a/scripts/dfs_test/small/small_p3.sql b/data/dfs_test/small/small_p3.sql similarity index 100% rename from scripts/dfs_test/small/small_p3.sql rename to data/dfs_test/small/small_p3.sql diff --git a/scripts/dfs_test/small/small_q0.sql b/data/dfs_test/small/small_q0.sql similarity index 100% rename from scripts/dfs_test/small/small_q0.sql rename to data/dfs_test/small/small_q0.sql diff --git a/scripts/dfs_test/small/small_q1.sql b/data/dfs_test/small/small_q1.sql similarity index 100% rename from scripts/dfs_test/small/small_q1.sql rename to data/dfs_test/small/small_q1.sql diff --git a/scripts/dfs_test/small/small_q2.sql b/data/dfs_test/small/small_q2.sql similarity index 100% rename from scripts/dfs_test/small/small_q2.sql rename to data/dfs_test/small/small_q2.sql diff --git a/scripts/dfs_test/small/small_q3.sql b/data/dfs_test/small/small_q3.sql similarity index 100% rename from scripts/dfs_test/small/small_q3.sql rename to data/dfs_test/small/small_q3.sql diff --git a/scripts/dfs_test/small/small_s0.sql b/data/dfs_test/small/small_s0.sql similarity index 100% rename from scripts/dfs_test/small/small_s0.sql rename to data/dfs_test/small/small_s0.sql diff --git a/scripts/dfs_test/small/small_s1.sql b/data/dfs_test/small/small_s1.sql similarity index 100% rename from scripts/dfs_test/small/small_s1.sql rename to data/dfs_test/small/small_s1.sql diff --git a/scripts/parser_test/parser_d1.ttl b/data/parser_test/parser_d1.ttl similarity index 100% rename from scripts/parser_test/parser_d1.ttl rename to data/parser_test/parser_d1.ttl diff --git a/scripts/parser_test/parser_d10.ttl b/data/parser_test/parser_d10.ttl similarity index 100% rename from scripts/parser_test/parser_d10.ttl rename to data/parser_test/parser_d10.ttl diff --git a/scripts/parser_test/parser_d11.ttl b/data/parser_test/parser_d11.ttl similarity index 100% rename from scripts/parser_test/parser_d11.ttl rename to data/parser_test/parser_d11.ttl diff --git a/scripts/parser_test/parser_d12.ttl b/data/parser_test/parser_d12.ttl similarity index 100% rename from scripts/parser_test/parser_d12.ttl rename to data/parser_test/parser_d12.ttl diff --git a/scripts/parser_test/parser_d13.ttl b/data/parser_test/parser_d13.ttl similarity index 100% rename from scripts/parser_test/parser_d13.ttl rename to data/parser_test/parser_d13.ttl diff --git a/scripts/parser_test/parser_d14.ttl b/data/parser_test/parser_d14.ttl similarity index 100% rename from scripts/parser_test/parser_d14.ttl rename to data/parser_test/parser_d14.ttl diff --git a/scripts/parser_test/parser_d15.ttl b/data/parser_test/parser_d15.ttl similarity index 100% rename from scripts/parser_test/parser_d15.ttl rename to data/parser_test/parser_d15.ttl diff --git a/scripts/parser_test/parser_d16.ttl b/data/parser_test/parser_d16.ttl similarity index 100% rename from scripts/parser_test/parser_d16.ttl rename to data/parser_test/parser_d16.ttl diff --git a/scripts/parser_test/parser_d17.ttl b/data/parser_test/parser_d17.ttl similarity index 100% rename from scripts/parser_test/parser_d17.ttl rename to data/parser_test/parser_d17.ttl diff --git a/scripts/parser_test/parser_d18.ttl b/data/parser_test/parser_d18.ttl similarity index 100% rename from scripts/parser_test/parser_d18.ttl rename to data/parser_test/parser_d18.ttl diff --git a/scripts/parser_test/parser_d19.ttl b/data/parser_test/parser_d19.ttl similarity index 100% rename from scripts/parser_test/parser_d19.ttl rename to data/parser_test/parser_d19.ttl diff --git a/scripts/parser_test/parser_d2.ttl b/data/parser_test/parser_d2.ttl similarity index 100% rename from scripts/parser_test/parser_d2.ttl rename to data/parser_test/parser_d2.ttl diff --git a/scripts/parser_test/parser_d20.ttl b/data/parser_test/parser_d20.ttl similarity index 100% rename from scripts/parser_test/parser_d20.ttl rename to data/parser_test/parser_d20.ttl diff --git a/scripts/parser_test/parser_d21.ttl b/data/parser_test/parser_d21.ttl similarity index 100% rename from scripts/parser_test/parser_d21.ttl rename to data/parser_test/parser_d21.ttl diff --git a/scripts/parser_test/parser_d22.ttl b/data/parser_test/parser_d22.ttl similarity index 100% rename from scripts/parser_test/parser_d22.ttl rename to data/parser_test/parser_d22.ttl diff --git a/scripts/parser_test/parser_d23.ttl b/data/parser_test/parser_d23.ttl similarity index 100% rename from scripts/parser_test/parser_d23.ttl rename to data/parser_test/parser_d23.ttl diff --git a/scripts/parser_test/parser_d24.ttl b/data/parser_test/parser_d24.ttl similarity index 100% rename from scripts/parser_test/parser_d24.ttl rename to data/parser_test/parser_d24.ttl diff --git a/scripts/parser_test/parser_d25.ttl b/data/parser_test/parser_d25.ttl similarity index 100% rename from scripts/parser_test/parser_d25.ttl rename to data/parser_test/parser_d25.ttl diff --git a/scripts/parser_test/parser_d26.ttl b/data/parser_test/parser_d26.ttl similarity index 100% rename from scripts/parser_test/parser_d26.ttl rename to data/parser_test/parser_d26.ttl diff --git a/scripts/parser_test/parser_d27.ttl b/data/parser_test/parser_d27.ttl similarity index 100% rename from scripts/parser_test/parser_d27.ttl rename to data/parser_test/parser_d27.ttl diff --git a/scripts/parser_test/parser_d28.ttl b/data/parser_test/parser_d28.ttl similarity index 100% rename from scripts/parser_test/parser_d28.ttl rename to data/parser_test/parser_d28.ttl diff --git a/scripts/parser_test/parser_d29.ttl b/data/parser_test/parser_d29.ttl similarity index 100% rename from scripts/parser_test/parser_d29.ttl rename to data/parser_test/parser_d29.ttl diff --git a/scripts/parser_test/parser_d3.ttl b/data/parser_test/parser_d3.ttl similarity index 100% rename from scripts/parser_test/parser_d3.ttl rename to data/parser_test/parser_d3.ttl diff --git a/scripts/parser_test/parser_d30.ttl b/data/parser_test/parser_d30.ttl similarity index 100% rename from scripts/parser_test/parser_d30.ttl rename to data/parser_test/parser_d30.ttl diff --git a/scripts/parser_test/parser_d31.ttl b/data/parser_test/parser_d31.ttl similarity index 100% rename from scripts/parser_test/parser_d31.ttl rename to data/parser_test/parser_d31.ttl diff --git a/scripts/parser_test/parser_d32.ttl b/data/parser_test/parser_d32.ttl similarity index 100% rename from scripts/parser_test/parser_d32.ttl rename to data/parser_test/parser_d32.ttl diff --git a/scripts/parser_test/parser_d33.ttl b/data/parser_test/parser_d33.ttl similarity index 100% rename from scripts/parser_test/parser_d33.ttl rename to data/parser_test/parser_d33.ttl diff --git a/scripts/parser_test/parser_d34.ttl b/data/parser_test/parser_d34.ttl similarity index 100% rename from scripts/parser_test/parser_d34.ttl rename to data/parser_test/parser_d34.ttl diff --git a/scripts/parser_test/parser_d35.ttl b/data/parser_test/parser_d35.ttl similarity index 100% rename from scripts/parser_test/parser_d35.ttl rename to data/parser_test/parser_d35.ttl diff --git a/scripts/parser_test/parser_d36.ttl b/data/parser_test/parser_d36.ttl similarity index 100% rename from scripts/parser_test/parser_d36.ttl rename to data/parser_test/parser_d36.ttl diff --git a/scripts/parser_test/parser_d37.ttl b/data/parser_test/parser_d37.ttl similarity index 100% rename from scripts/parser_test/parser_d37.ttl rename to data/parser_test/parser_d37.ttl diff --git a/scripts/parser_test/parser_d38.ttl b/data/parser_test/parser_d38.ttl similarity index 100% rename from scripts/parser_test/parser_d38.ttl rename to data/parser_test/parser_d38.ttl diff --git a/scripts/parser_test/parser_d39.ttl b/data/parser_test/parser_d39.ttl similarity index 100% rename from scripts/parser_test/parser_d39.ttl rename to data/parser_test/parser_d39.ttl diff --git a/scripts/parser_test/parser_d4.ttl b/data/parser_test/parser_d4.ttl similarity index 100% rename from scripts/parser_test/parser_d4.ttl rename to data/parser_test/parser_d4.ttl diff --git a/scripts/parser_test/parser_d40.ttl b/data/parser_test/parser_d40.ttl similarity index 100% rename from scripts/parser_test/parser_d40.ttl rename to data/parser_test/parser_d40.ttl diff --git a/scripts/parser_test/parser_d41.ttl b/data/parser_test/parser_d41.ttl similarity index 100% rename from scripts/parser_test/parser_d41.ttl rename to data/parser_test/parser_d41.ttl diff --git a/scripts/parser_test/parser_d42.ttl b/data/parser_test/parser_d42.ttl similarity index 100% rename from scripts/parser_test/parser_d42.ttl rename to data/parser_test/parser_d42.ttl diff --git a/scripts/parser_test/parser_d43.ttl b/data/parser_test/parser_d43.ttl similarity index 100% rename from scripts/parser_test/parser_d43.ttl rename to data/parser_test/parser_d43.ttl diff --git a/scripts/parser_test/parser_d44.ttl b/data/parser_test/parser_d44.ttl similarity index 100% rename from scripts/parser_test/parser_d44.ttl rename to data/parser_test/parser_d44.ttl diff --git a/scripts/parser_test/parser_d45.ttl b/data/parser_test/parser_d45.ttl similarity index 100% rename from scripts/parser_test/parser_d45.ttl rename to data/parser_test/parser_d45.ttl diff --git a/scripts/parser_test/parser_d46.ttl b/data/parser_test/parser_d46.ttl similarity index 100% rename from scripts/parser_test/parser_d46.ttl rename to data/parser_test/parser_d46.ttl diff --git a/scripts/parser_test/parser_d47.ttl b/data/parser_test/parser_d47.ttl similarity index 100% rename from scripts/parser_test/parser_d47.ttl rename to data/parser_test/parser_d47.ttl diff --git a/scripts/parser_test/parser_d48.ttl b/data/parser_test/parser_d48.ttl similarity index 100% rename from scripts/parser_test/parser_d48.ttl rename to data/parser_test/parser_d48.ttl diff --git a/scripts/parser_test/parser_d49.ttl b/data/parser_test/parser_d49.ttl similarity index 100% rename from scripts/parser_test/parser_d49.ttl rename to data/parser_test/parser_d49.ttl diff --git a/scripts/parser_test/parser_d5.ttl b/data/parser_test/parser_d5.ttl similarity index 100% rename from scripts/parser_test/parser_d5.ttl rename to data/parser_test/parser_d5.ttl diff --git a/scripts/parser_test/parser_d50.ttl b/data/parser_test/parser_d50.ttl similarity index 100% rename from scripts/parser_test/parser_d50.ttl rename to data/parser_test/parser_d50.ttl diff --git a/scripts/parser_test/parser_d6.ttl b/data/parser_test/parser_d6.ttl similarity index 100% rename from scripts/parser_test/parser_d6.ttl rename to data/parser_test/parser_d6.ttl diff --git a/scripts/parser_test/parser_d7.ttl b/data/parser_test/parser_d7.ttl similarity index 100% rename from scripts/parser_test/parser_d7.ttl rename to data/parser_test/parser_d7.ttl diff --git a/scripts/parser_test/parser_d8.ttl b/data/parser_test/parser_d8.ttl similarity index 100% rename from scripts/parser_test/parser_d8.ttl rename to data/parser_test/parser_d8.ttl diff --git a/scripts/parser_test/parser_d9.ttl b/data/parser_test/parser_d9.ttl similarity index 100% rename from scripts/parser_test/parser_d9.ttl rename to data/parser_test/parser_d9.ttl diff --git a/scripts/parser_test/parser_q1.sql b/data/parser_test/parser_q1.sql similarity index 100% rename from scripts/parser_test/parser_q1.sql rename to data/parser_test/parser_q1.sql diff --git a/scripts/parser_test/parser_q10.sql b/data/parser_test/parser_q10.sql similarity index 100% rename from scripts/parser_test/parser_q10.sql rename to data/parser_test/parser_q10.sql diff --git a/scripts/parser_test/parser_q11.sql b/data/parser_test/parser_q11.sql similarity index 100% rename from scripts/parser_test/parser_q11.sql rename to data/parser_test/parser_q11.sql diff --git a/scripts/parser_test/parser_q12.sql b/data/parser_test/parser_q12.sql similarity index 100% rename from scripts/parser_test/parser_q12.sql rename to data/parser_test/parser_q12.sql diff --git a/scripts/parser_test/parser_q13.sql b/data/parser_test/parser_q13.sql similarity index 100% rename from scripts/parser_test/parser_q13.sql rename to data/parser_test/parser_q13.sql diff --git a/scripts/parser_test/parser_q14.sql b/data/parser_test/parser_q14.sql similarity index 100% rename from scripts/parser_test/parser_q14.sql rename to data/parser_test/parser_q14.sql diff --git a/scripts/parser_test/parser_q15.sql b/data/parser_test/parser_q15.sql similarity index 100% rename from scripts/parser_test/parser_q15.sql rename to data/parser_test/parser_q15.sql diff --git a/scripts/parser_test/parser_q16.sql b/data/parser_test/parser_q16.sql similarity index 100% rename from scripts/parser_test/parser_q16.sql rename to data/parser_test/parser_q16.sql diff --git a/scripts/parser_test/parser_q17.sql b/data/parser_test/parser_q17.sql similarity index 100% rename from scripts/parser_test/parser_q17.sql rename to data/parser_test/parser_q17.sql diff --git a/scripts/parser_test/parser_q18.sql b/data/parser_test/parser_q18.sql similarity index 100% rename from scripts/parser_test/parser_q18.sql rename to data/parser_test/parser_q18.sql diff --git a/scripts/parser_test/parser_q19.sql b/data/parser_test/parser_q19.sql similarity index 100% rename from scripts/parser_test/parser_q19.sql rename to data/parser_test/parser_q19.sql diff --git a/scripts/parser_test/parser_q2.sql b/data/parser_test/parser_q2.sql similarity index 100% rename from scripts/parser_test/parser_q2.sql rename to data/parser_test/parser_q2.sql diff --git a/scripts/parser_test/parser_q20.sql b/data/parser_test/parser_q20.sql similarity index 100% rename from scripts/parser_test/parser_q20.sql rename to data/parser_test/parser_q20.sql diff --git a/scripts/parser_test/parser_q21.sql b/data/parser_test/parser_q21.sql similarity index 100% rename from scripts/parser_test/parser_q21.sql rename to data/parser_test/parser_q21.sql diff --git a/scripts/parser_test/parser_q22.sql b/data/parser_test/parser_q22.sql similarity index 100% rename from scripts/parser_test/parser_q22.sql rename to data/parser_test/parser_q22.sql diff --git a/scripts/parser_test/parser_q23.sql b/data/parser_test/parser_q23.sql similarity index 100% rename from scripts/parser_test/parser_q23.sql rename to data/parser_test/parser_q23.sql diff --git a/scripts/parser_test/parser_q24.sql b/data/parser_test/parser_q24.sql similarity index 100% rename from scripts/parser_test/parser_q24.sql rename to data/parser_test/parser_q24.sql diff --git a/scripts/parser_test/parser_q25.sql b/data/parser_test/parser_q25.sql similarity index 100% rename from scripts/parser_test/parser_q25.sql rename to data/parser_test/parser_q25.sql diff --git a/scripts/parser_test/parser_q26.sql b/data/parser_test/parser_q26.sql similarity index 100% rename from scripts/parser_test/parser_q26.sql rename to data/parser_test/parser_q26.sql diff --git a/scripts/parser_test/parser_q27.sql b/data/parser_test/parser_q27.sql similarity index 100% rename from scripts/parser_test/parser_q27.sql rename to data/parser_test/parser_q27.sql diff --git a/scripts/parser_test/parser_q28.sql b/data/parser_test/parser_q28.sql similarity index 100% rename from scripts/parser_test/parser_q28.sql rename to data/parser_test/parser_q28.sql diff --git a/scripts/parser_test/parser_q29.sql b/data/parser_test/parser_q29.sql similarity index 100% rename from scripts/parser_test/parser_q29.sql rename to data/parser_test/parser_q29.sql diff --git a/scripts/parser_test/parser_q3.sql b/data/parser_test/parser_q3.sql similarity index 100% rename from scripts/parser_test/parser_q3.sql rename to data/parser_test/parser_q3.sql diff --git a/scripts/parser_test/parser_q30.sql b/data/parser_test/parser_q30.sql similarity index 100% rename from scripts/parser_test/parser_q30.sql rename to data/parser_test/parser_q30.sql diff --git a/scripts/parser_test/parser_q31.sql b/data/parser_test/parser_q31.sql similarity index 100% rename from scripts/parser_test/parser_q31.sql rename to data/parser_test/parser_q31.sql diff --git a/scripts/parser_test/parser_q32.sql b/data/parser_test/parser_q32.sql similarity index 100% rename from scripts/parser_test/parser_q32.sql rename to data/parser_test/parser_q32.sql diff --git a/scripts/parser_test/parser_q33.sql b/data/parser_test/parser_q33.sql similarity index 100% rename from scripts/parser_test/parser_q33.sql rename to data/parser_test/parser_q33.sql diff --git a/scripts/parser_test/parser_q34.sql b/data/parser_test/parser_q34.sql similarity index 100% rename from scripts/parser_test/parser_q34.sql rename to data/parser_test/parser_q34.sql diff --git a/scripts/parser_test/parser_q35.sql b/data/parser_test/parser_q35.sql similarity index 100% rename from scripts/parser_test/parser_q35.sql rename to data/parser_test/parser_q35.sql diff --git a/scripts/parser_test/parser_q36.sql b/data/parser_test/parser_q36.sql similarity index 100% rename from scripts/parser_test/parser_q36.sql rename to data/parser_test/parser_q36.sql diff --git a/scripts/parser_test/parser_q37.sql b/data/parser_test/parser_q37.sql similarity index 100% rename from scripts/parser_test/parser_q37.sql rename to data/parser_test/parser_q37.sql diff --git a/scripts/parser_test/parser_q38.sql b/data/parser_test/parser_q38.sql similarity index 100% rename from scripts/parser_test/parser_q38.sql rename to data/parser_test/parser_q38.sql diff --git a/scripts/parser_test/parser_q39.sql b/data/parser_test/parser_q39.sql similarity index 100% rename from scripts/parser_test/parser_q39.sql rename to data/parser_test/parser_q39.sql diff --git a/scripts/parser_test/parser_q4.sql b/data/parser_test/parser_q4.sql similarity index 100% rename from scripts/parser_test/parser_q4.sql rename to data/parser_test/parser_q4.sql diff --git a/scripts/parser_test/parser_q40.sql b/data/parser_test/parser_q40.sql similarity index 100% rename from scripts/parser_test/parser_q40.sql rename to data/parser_test/parser_q40.sql diff --git a/scripts/parser_test/parser_q41.sql b/data/parser_test/parser_q41.sql similarity index 100% rename from scripts/parser_test/parser_q41.sql rename to data/parser_test/parser_q41.sql diff --git a/scripts/parser_test/parser_q42.sql b/data/parser_test/parser_q42.sql similarity index 100% rename from scripts/parser_test/parser_q42.sql rename to data/parser_test/parser_q42.sql diff --git a/scripts/parser_test/parser_q43.sql b/data/parser_test/parser_q43.sql similarity index 100% rename from scripts/parser_test/parser_q43.sql rename to data/parser_test/parser_q43.sql diff --git a/scripts/parser_test/parser_q44.sql b/data/parser_test/parser_q44.sql similarity index 100% rename from scripts/parser_test/parser_q44.sql rename to data/parser_test/parser_q44.sql diff --git a/scripts/parser_test/parser_q45.sql b/data/parser_test/parser_q45.sql similarity index 100% rename from scripts/parser_test/parser_q45.sql rename to data/parser_test/parser_q45.sql diff --git a/scripts/parser_test/parser_q46.sql b/data/parser_test/parser_q46.sql similarity index 100% rename from scripts/parser_test/parser_q46.sql rename to data/parser_test/parser_q46.sql diff --git a/scripts/parser_test/parser_q47.sql b/data/parser_test/parser_q47.sql similarity index 100% rename from scripts/parser_test/parser_q47.sql rename to data/parser_test/parser_q47.sql diff --git a/scripts/parser_test/parser_q48.sql b/data/parser_test/parser_q48.sql similarity index 100% rename from scripts/parser_test/parser_q48.sql rename to data/parser_test/parser_q48.sql diff --git a/scripts/parser_test/parser_q49.sql b/data/parser_test/parser_q49.sql similarity index 100% rename from scripts/parser_test/parser_q49.sql rename to data/parser_test/parser_q49.sql diff --git a/scripts/parser_test/parser_q5.sql b/data/parser_test/parser_q5.sql similarity index 100% rename from scripts/parser_test/parser_q5.sql rename to data/parser_test/parser_q5.sql diff --git a/scripts/parser_test/parser_q50.sql b/data/parser_test/parser_q50.sql similarity index 100% rename from scripts/parser_test/parser_q50.sql rename to data/parser_test/parser_q50.sql diff --git a/scripts/parser_test/parser_q6.sql b/data/parser_test/parser_q6.sql similarity index 100% rename from scripts/parser_test/parser_q6.sql rename to data/parser_test/parser_q6.sql diff --git a/scripts/parser_test/parser_q7.sql b/data/parser_test/parser_q7.sql similarity index 100% rename from scripts/parser_test/parser_q7.sql rename to data/parser_test/parser_q7.sql diff --git a/scripts/parser_test/parser_q8.sql b/data/parser_test/parser_q8.sql similarity index 100% rename from scripts/parser_test/parser_q8.sql rename to data/parser_test/parser_q8.sql diff --git a/scripts/parser_test/parser_q9.sql b/data/parser_test/parser_q9.sql similarity index 100% rename from scripts/parser_test/parser_q9.sql rename to data/parser_test/parser_q9.sql diff --git a/scripts/parser_test/parser_r1.txt b/data/parser_test/parser_r1.txt similarity index 100% rename from scripts/parser_test/parser_r1.txt rename to data/parser_test/parser_r1.txt diff --git a/scripts/parser_test/parser_r10.txt b/data/parser_test/parser_r10.txt similarity index 100% rename from scripts/parser_test/parser_r10.txt rename to data/parser_test/parser_r10.txt diff --git a/scripts/parser_test/parser_r11.txt b/data/parser_test/parser_r11.txt similarity index 100% rename from scripts/parser_test/parser_r11.txt rename to data/parser_test/parser_r11.txt diff --git a/scripts/parser_test/parser_r12.txt b/data/parser_test/parser_r12.txt similarity index 100% rename from scripts/parser_test/parser_r12.txt rename to data/parser_test/parser_r12.txt diff --git a/scripts/parser_test/parser_r13.txt b/data/parser_test/parser_r13.txt similarity index 100% rename from scripts/parser_test/parser_r13.txt rename to data/parser_test/parser_r13.txt diff --git a/scripts/parser_test/parser_r14.txt b/data/parser_test/parser_r14.txt similarity index 100% rename from scripts/parser_test/parser_r14.txt rename to data/parser_test/parser_r14.txt diff --git a/scripts/parser_test/parser_r15.txt b/data/parser_test/parser_r15.txt similarity index 100% rename from scripts/parser_test/parser_r15.txt rename to data/parser_test/parser_r15.txt diff --git a/scripts/parser_test/parser_r16.txt b/data/parser_test/parser_r16.txt similarity index 100% rename from scripts/parser_test/parser_r16.txt rename to data/parser_test/parser_r16.txt diff --git a/scripts/parser_test/parser_r17.txt b/data/parser_test/parser_r17.txt similarity index 100% rename from scripts/parser_test/parser_r17.txt rename to data/parser_test/parser_r17.txt diff --git a/scripts/parser_test/parser_r18.txt b/data/parser_test/parser_r18.txt similarity index 100% rename from scripts/parser_test/parser_r18.txt rename to data/parser_test/parser_r18.txt diff --git a/scripts/parser_test/parser_r19.txt b/data/parser_test/parser_r19.txt similarity index 100% rename from scripts/parser_test/parser_r19.txt rename to data/parser_test/parser_r19.txt diff --git a/scripts/parser_test/parser_r2.txt b/data/parser_test/parser_r2.txt similarity index 100% rename from scripts/parser_test/parser_r2.txt rename to data/parser_test/parser_r2.txt diff --git a/scripts/parser_test/parser_r20.txt b/data/parser_test/parser_r20.txt similarity index 100% rename from scripts/parser_test/parser_r20.txt rename to data/parser_test/parser_r20.txt diff --git a/scripts/parser_test/parser_r21.txt b/data/parser_test/parser_r21.txt similarity index 100% rename from scripts/parser_test/parser_r21.txt rename to data/parser_test/parser_r21.txt diff --git a/scripts/parser_test/parser_r22.txt b/data/parser_test/parser_r22.txt similarity index 100% rename from scripts/parser_test/parser_r22.txt rename to data/parser_test/parser_r22.txt diff --git a/scripts/parser_test/parser_r23.txt b/data/parser_test/parser_r23.txt similarity index 100% rename from scripts/parser_test/parser_r23.txt rename to data/parser_test/parser_r23.txt diff --git a/scripts/parser_test/parser_r24.txt b/data/parser_test/parser_r24.txt similarity index 100% rename from scripts/parser_test/parser_r24.txt rename to data/parser_test/parser_r24.txt diff --git a/scripts/parser_test/parser_r25.txt b/data/parser_test/parser_r25.txt similarity index 100% rename from scripts/parser_test/parser_r25.txt rename to data/parser_test/parser_r25.txt diff --git a/scripts/parser_test/parser_r26.txt b/data/parser_test/parser_r26.txt similarity index 100% rename from scripts/parser_test/parser_r26.txt rename to data/parser_test/parser_r26.txt diff --git a/scripts/parser_test/parser_r27.txt b/data/parser_test/parser_r27.txt similarity index 100% rename from scripts/parser_test/parser_r27.txt rename to data/parser_test/parser_r27.txt diff --git a/scripts/parser_test/parser_r28.txt b/data/parser_test/parser_r28.txt similarity index 100% rename from scripts/parser_test/parser_r28.txt rename to data/parser_test/parser_r28.txt diff --git a/scripts/parser_test/parser_r29.txt b/data/parser_test/parser_r29.txt similarity index 100% rename from scripts/parser_test/parser_r29.txt rename to data/parser_test/parser_r29.txt diff --git a/scripts/parser_test/parser_r3.txt b/data/parser_test/parser_r3.txt similarity index 100% rename from scripts/parser_test/parser_r3.txt rename to data/parser_test/parser_r3.txt diff --git a/scripts/parser_test/parser_r30.txt b/data/parser_test/parser_r30.txt similarity index 100% rename from scripts/parser_test/parser_r30.txt rename to data/parser_test/parser_r30.txt diff --git a/scripts/parser_test/parser_r31.txt b/data/parser_test/parser_r31.txt similarity index 100% rename from scripts/parser_test/parser_r31.txt rename to data/parser_test/parser_r31.txt diff --git a/scripts/parser_test/parser_r32.txt b/data/parser_test/parser_r32.txt similarity index 100% rename from scripts/parser_test/parser_r32.txt rename to data/parser_test/parser_r32.txt diff --git a/scripts/parser_test/parser_r33.txt b/data/parser_test/parser_r33.txt similarity index 100% rename from scripts/parser_test/parser_r33.txt rename to data/parser_test/parser_r33.txt diff --git a/scripts/parser_test/parser_r34.txt b/data/parser_test/parser_r34.txt similarity index 100% rename from scripts/parser_test/parser_r34.txt rename to data/parser_test/parser_r34.txt diff --git a/scripts/parser_test/parser_r35.txt b/data/parser_test/parser_r35.txt similarity index 100% rename from scripts/parser_test/parser_r35.txt rename to data/parser_test/parser_r35.txt diff --git a/scripts/parser_test/parser_r36.txt b/data/parser_test/parser_r36.txt similarity index 100% rename from scripts/parser_test/parser_r36.txt rename to data/parser_test/parser_r36.txt diff --git a/scripts/parser_test/parser_r37.txt b/data/parser_test/parser_r37.txt similarity index 100% rename from scripts/parser_test/parser_r37.txt rename to data/parser_test/parser_r37.txt diff --git a/scripts/parser_test/parser_r38.txt b/data/parser_test/parser_r38.txt similarity index 100% rename from scripts/parser_test/parser_r38.txt rename to data/parser_test/parser_r38.txt diff --git a/scripts/parser_test/parser_r39.txt b/data/parser_test/parser_r39.txt similarity index 100% rename from scripts/parser_test/parser_r39.txt rename to data/parser_test/parser_r39.txt diff --git a/scripts/parser_test/parser_r4.txt b/data/parser_test/parser_r4.txt similarity index 100% rename from scripts/parser_test/parser_r4.txt rename to data/parser_test/parser_r4.txt diff --git a/scripts/parser_test/parser_r40.txt b/data/parser_test/parser_r40.txt similarity index 100% rename from scripts/parser_test/parser_r40.txt rename to data/parser_test/parser_r40.txt diff --git a/scripts/parser_test/parser_r41.txt b/data/parser_test/parser_r41.txt similarity index 100% rename from scripts/parser_test/parser_r41.txt rename to data/parser_test/parser_r41.txt diff --git a/scripts/parser_test/parser_r42.txt b/data/parser_test/parser_r42.txt similarity index 100% rename from scripts/parser_test/parser_r42.txt rename to data/parser_test/parser_r42.txt diff --git a/scripts/parser_test/parser_r43.txt b/data/parser_test/parser_r43.txt similarity index 100% rename from scripts/parser_test/parser_r43.txt rename to data/parser_test/parser_r43.txt diff --git a/scripts/parser_test/parser_r44.txt b/data/parser_test/parser_r44.txt similarity index 100% rename from scripts/parser_test/parser_r44.txt rename to data/parser_test/parser_r44.txt diff --git a/scripts/parser_test/parser_r45.txt b/data/parser_test/parser_r45.txt similarity index 100% rename from scripts/parser_test/parser_r45.txt rename to data/parser_test/parser_r45.txt diff --git a/scripts/parser_test/parser_r46.txt b/data/parser_test/parser_r46.txt similarity index 100% rename from scripts/parser_test/parser_r46.txt rename to data/parser_test/parser_r46.txt diff --git a/scripts/parser_test/parser_r47.txt b/data/parser_test/parser_r47.txt similarity index 100% rename from scripts/parser_test/parser_r47.txt rename to data/parser_test/parser_r47.txt diff --git a/scripts/parser_test/parser_r48.txt b/data/parser_test/parser_r48.txt similarity index 100% rename from scripts/parser_test/parser_r48.txt rename to data/parser_test/parser_r48.txt diff --git a/scripts/parser_test/parser_r49.txt b/data/parser_test/parser_r49.txt similarity index 100% rename from scripts/parser_test/parser_r49.txt rename to data/parser_test/parser_r49.txt diff --git a/scripts/parser_test/parser_r5.txt b/data/parser_test/parser_r5.txt similarity index 100% rename from scripts/parser_test/parser_r5.txt rename to data/parser_test/parser_r5.txt diff --git a/scripts/parser_test/parser_r50.txt b/data/parser_test/parser_r50.txt similarity index 100% rename from scripts/parser_test/parser_r50.txt rename to data/parser_test/parser_r50.txt diff --git a/scripts/parser_test/parser_r6.txt b/data/parser_test/parser_r6.txt similarity index 100% rename from scripts/parser_test/parser_r6.txt rename to data/parser_test/parser_r6.txt diff --git a/scripts/parser_test/parser_r7.txt b/data/parser_test/parser_r7.txt similarity index 100% rename from scripts/parser_test/parser_r7.txt rename to data/parser_test/parser_r7.txt diff --git a/scripts/parser_test/parser_r8.txt b/data/parser_test/parser_r8.txt similarity index 100% rename from scripts/parser_test/parser_r8.txt rename to data/parser_test/parser_r8.txt diff --git a/scripts/parser_test/parser_r9.txt b/data/parser_test/parser_r9.txt similarity index 100% rename from scripts/parser_test/parser_r9.txt rename to data/parser_test/parser_r9.txt diff --git a/conf.ini b/defaults/conf.ini similarity index 100% rename from conf.ini rename to defaults/conf.ini diff --git a/init.conf b/defaults/init.conf similarity index 100% rename from init.conf rename to defaults/init.conf diff --git a/ipAllow.config b/defaults/ipAllow.config similarity index 100% rename from ipAllow.config rename to defaults/ipAllow.config diff --git a/ipDeny.config b/defaults/ipDeny.config similarity index 100% rename from ipDeny.config rename to defaults/ipDeny.config diff --git a/slog.properties b/defaults/slog.properties similarity index 100% rename from slog.properties rename to defaults/slog.properties diff --git a/slog.stdout.properties b/defaults/slog.stdout.properties similarity index 100% rename from slog.stdout.properties rename to defaults/slog.stdout.properties diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh deleted file mode 100644 index f668f93c..00000000 --- a/docker-entrypoint.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -BLUE='\033[0;34m' -RED='\033[0;31m' -NC='\033[0m' - -if [ ! -f /app/init.conf ]; then - echo "${BLUE}[INIT] No init.conf file found. Copying default...${NC}" - cp -r /docker-init/* /app/ - - # Check if GSTORE_ROOT_PASSWORD is set - if [ -z "$GSTORE_ROOT_PASSWORD" ]; then - echo "${RED}[INIT] GSTORE_ROOT_PASSWORD is not set. We strongly recommend setting a strong password.${NC}" - else - echo "${BLUE}[INIT] Setting root password...${NC}" - # Replace the line in the file - sed -i -e "s/^#\\?\\s*root_password=.*/root_password=${GSTORE_ROOT_PASSWORD}/" init.conf - fi - -fi - -if [ ! -d /app/bin ]; then - echo "${BLUE}[INIT] Creating directories...${NC}" - mkdir -p bin lib backups data logs .tmp -fi - -if [ ! -d /app/system.db ]; then - echo "${BLUE}[INIT] Creating system.db...${NC}" - /usr/local/bin/ginit --make - - # list all directories in /app/data - for dir in /app/data/*; do - # get the directory name - dir_name=$(basename "$dir") - if [ $dir_name != "system" ] && [ -d "data/$dir_name" ] && [ -f "data/$dir_name/$dir_name.nt" ] ; then - # create the database - echo "${BLUE}[INIT] Creating $dir_name...${NC}" - /usr/local/bin/gbuild -db "$dir_name" -f "data/$dir_name/$dir_name.nt" - fi - done -fi - -echo "${BLUE}[INIT] Command: $@${NC}" - -exec "$@" \ No newline at end of file diff --git a/docs/gStore_help.html b/docs/gStore_help.html index 893dc961..1cbe8bd4 100644 --- a/docs/gStore_help.html +++ b/docs/gStore_help.html @@ -1,4 +1,4 @@ - + diff --git a/docs/gStore_help.md b/docs/gStore_help.md index 909975ed..82c8c272 100644 --- a/docs/gStore_help.md +++ b/docs/gStore_help.md @@ -1,4 +1,4 @@ -# Gstore System +# Gstore System gStore, a graph-based RDF triple store, is a joint research project by Peking University, University of Waterloo and Hong Kong University of Science and Technology. The system is developed and maintained by the database group in Institute of Computer Science and Technology, Peking University, China. A detailed description of gStore can be found at our papers [Zou et al., VLDB 11] and [Zou et al., VLDB Journal 14] in the [Publication](#chapter07) section. This HELP document includes system installment, usage, API, use cases and FAQ. gStore is a open-source project in github under the BSD license. You are welcome to use gStore, report bugs or suggestions, or join us to make gStore better. It is also allowed for you to build all kinds of applications based on gStore, while respecting our work. diff --git a/lib/.gitignore b/lib/.gitignore deleted file mode 100644 index a5baada1..00000000 --- a/lib/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore - diff --git a/logs/.gitignore b/logs/.gitignore deleted file mode 100644 index 397b4a76..00000000 --- a/logs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.log diff --git a/logs/endpoint/README b/logs/endpoint/README deleted file mode 100644 index e69de29b..00000000 diff --git a/makefile b/makefile deleted file mode 100644 index 02f57721..00000000 --- a/makefile +++ /dev/null @@ -1,809 +0,0 @@ -#help for make -#http://www.cnblogs.com/wang_yb/p/3990952.html -#https://segmentfault.com/a/1190000000349917 -#http://blog.csdn.net/cuiyifang/article/details/7910268 - -#to use gprof to analyse efficience of the program: -#http://blog.chinaunix.net/uid-25194149-id-3215487.html - -#to use gcov and lcov -#Notice that optimization should not be used here -#http://blog.163.com/bobile45@126/blog/static/96061992201382025729313/ -#gcov -a main.cpp -#lcov --directory . --capture --output-file dig.info -#genhtml --output-directory . --frames --show-details dig.info - -#to use doxygen+graphviz+htmlhelp to generate document from source code: -#http://www.doxygen.nl/ -#(also include good comments norm) -#http://blog.csdn.net/u010740725/article/details/51387810 - -#CXX=$(shell which clang 2>/dev/null || which gcc) -#ccache, readline, gcov lcov -#http://blog.csdn.net/u012421852/article/details/52138960 -# -# How to speed up the compilation -# https://blog.csdn.net/a_little_a_day/article/details/78251928 -# use make -j4, if error then use make utilizing only one thread -#use -j8 or higher may cause error -#http://blog.csdn.net/cscrazybing/article/details/50789482 -#http://blog.163.com/liuhonggaono1@126/blog/static/10497901201210254622141/ - -#compile parameters - -# WARN: maybe difficult to install ccache in some systems -#CXX = ccache g++ -CXX = g++ -CC = gcc - -#the optimazition level of gcc/g++ -#http://blog.csdn.net/hit_090420216/article/details/44900215 -#NOTICE: -O2 is recommended, while -O3(add loop-unroll and inline-function) is dangerous -#when developing, not use -O because it will disturb the normal -#routine. use it for test and release. -CFLAGS = -c -Wall -O2 -pthread -std=c++11 -Werror=return-type -EXEFLAG = -O2 -pthread -std=c++11 -Werror=return-type -#-coverage for debugging -#CFLAGS = -c -Wall -pthread -O0 -g3 -std=c++11 -gdwarf-2 -#EXEFLAG = -pthread -O0 -g3 -std=c++11 -gdwarf-2 -#-coverage for debugging and with performance -# CFLAGS = -c -Wall -pthread -g3 -std=c++11 -gdwarf-2 -pg -# EXEFLAG = -pthread -g3 -std=c++11 -gdwarf-2 -pg - -#add -lreadline [-ltermcap] if using readline or objs contain readline -# library = -lreadline -L./lib -L/usr/local/lib -lantlr -lgcov -lboost_thread -lboost_filesystem -lboost_system -lboost_regex -lpthread -I/usr/local/include/boost -lcurl -#library = -lreadline -L./lib -L/usr/local/lib -L/usr/lib/ -L./workflow-nossl/_lib -L./workflow-nossl/_include -lantlr4-runtime -lgcov -lboost_thread -lboost_filesystem -lboost_system -lboost_regex -lpthread -I/usr/local/include/boost -lcurl -lworkflow -llog4cplus -#library = -lreadline -L./lib -L/usr/local/lib -L/usr/lib/ -L./tools/workflow-master/_lib -L./tools/workflow-master/_include -lantlr4-runtime -lgcov -lboost_thread -lboost_filesystem -lboost_system -lboost_regex -lpthread -I/usr/local/include/boost -lcurl -llog4cplus -lworkflow -#library = -lreadline -L./lib -L/usr/local/lib -L/usr/lib/ -lantlr4-runtime -lgcov -lboost_thread -lboost_filesystem -lboost_system -lboost_regex -lpthread -I/usr/local/include/boost -lcurl -llog4cplus -Wl,-rpath='/usr/local/lib' -library = -L/usr/lib64 -L./lib -L/usr/local/lib -L/usr/lib -I/usr/local/include/boost -ljemalloc -lreadline -lantlr4-runtime -lgcov -lboost_thread -lboost_system -lboost_regex -lpthread -lcurl -llog4cplus -lz -lminizip -#used for parallelsort -march = -march=native -openmp = -fopenmp ${march} -# library = -ltermcap -lreadline -L./lib -lantlr -lgcov -def64IO = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -# load dynamic lib -ldl = -ldl - -FIRST_BUILD ?= %.o -# paths - -objdir = .objs/ - -exedir = bin/ - -testdir = scripts/ - -lib_antlr = lib/libantlr4-runtime.a - -lib_rpc = lib/libworkflow.a - -lib_log = lib/liblog4cplus.a - -api_cpp = api/http/cpp/lib/libgstoreconnector.a - -api_socket = api/socket/cpp/lib/libclient.a - -# objects - -sitreeobj = $(objdir)SITree.o $(objdir)SIStorage.o $(objdir)SINode.o $(objdir)SIIntlNode.o $(objdir)SILeafNode.o $(objdir)SIHeap.o -ivarrayobj = $(objdir)IVArray.o $(objdir)IVEntry.o $(objdir)IVBlockManager.o -isarrayobj = $(objdir)ISArray.o $(objdir)ISEntry.o $(objdir)ISBlockManager.o - -kvstoreobj = $(objdir)KVstore.o $(sitreeobj) $(ivarrayobj) $(isarrayobj) - -utilobj = $(objdir)Slog.o $(objdir)Util.o $(objdir)Bstr.o $(objdir)Stream.o $(objdir)Triple.o $(objdir)VList.o \ - $(objdir)EvalMultitypeValue.o $(objdir)IDTriple.o $(objdir)Version.o $(objdir)Transaction.o $(objdir)Latch.o $(objdir)IPWhiteList.o \ - $(objdir)IPBlackList.o $(objdir)SpinLock.o $(objdir)GraphLock.o $(objdir)WebUrl.o $(objdir)INIParser.o $(objdir)OrderedVector.o \ - $(objdir)CompressFileUtil.o - -topkobj = $(objdir)DynamicTrie.o $(objdir)OrderedList.o $(objdir)Pool.o $(objdir)TopKUtil.o $(objdir)DPBTopKUtil.o $(objdir)TopKSearchPlan.o - -queryobj = $(objdir)SPARQLquery.o $(objdir)BasicQuery.o $(objdir)ResultSet.o $(objdir)IDList.o $(objdir)DFSPlan.o\ - $(objdir)Varset.o $(objdir)QueryTree.o $(objdir)TempResult.o $(objdir)QueryCache.o $(objdir)GeneralEvaluation.o \ - $(objdir)PathQueryHandler.o $(objdir)BGPQuery.o $(objdir)FilterPlan.o - -#signatureobj = $(objdir)SigEntry.o $(objdir)Signature.o - -#vstreeobj = $(objdir)VSTree.o $(objdir)EntryBuffer.o $(objdir)LRUCache.o $(objdir)VNode.o - -stringindexobj = $(objdir)StringIndex.o - -parserobj = $(objdir)RDFParser.o $(objdir)SPARQLParser.o \ - $(objdir)SPARQLLexer.o $(objdir)TurtleParser.o $(objdir)QueryParser.o - -serverobj = $(objdir)Operation.o $(objdir)Server.o $(objdir)Socket.o - -grpcobj = $(objdir)grpc_server.o $(objdir)grpc_server_task.o $(objdir)grpc_message.o \ - $(objdir)grpc_router.o $(objdir)grpc_routetable.o $(objdir)grpc_content.o \ - $(objdir)grpc_status_code.o $(objdir)grpc_multipart_parser.o ${objdir}APIUtil.o - -databaseobj = $(objdir)Database.o $(objdir)Join.o \ - $(objdir)CSR.o $(objdir)Txn_manager.o $(objdir)TableOperator.o $(objdir)PlanTree.o \ - $(objdir)PlanGenerator.o $(objdir)Executor.o $(objdir)Optimizer.o - -trieobj = $(objdir)Trie.o $(objdir)TrieNode.o - -objfile = $(kvstoreobj) $(stringindexobj) $(parserobj) $(serverobj) $(databaseobj) \ - $(utilobj) $(topkobj) $(queryobj) $(trieobj) - -inc = -I./tools/antlr4-cpp-runtime-4/runtime/src -inc_rpc = -I./tools/workflow/_include -inc_log = -I./tools/log4cplus/include -inc_zlib= -I./tools/zlib-1.3/include -#auto generate dependencies -# http://blog.csdn.net/gmpy_tiger/article/details/51849474 -# http://blog.csdn.net/jeffrey0000/article/details/12421317 - -#gtest - -TARGET = $(exedir)gexport $(exedir)gbuild $(exedir)gserver $(exedir)gserver_backup_scheduler \ - $(exedir)gquery $(exedir)gadd $(exedir)gsub $(exedir)ghttp $(exedir)gmonitor \ - $(exedir)gshow $(exedir)shutdown $(exedir)ginit $(exedir)gdrop $(exedir)gbackup \ - $(exedir)grestore $(exedir)gpara $(exedir)rollback $(exedir)grpc $(exedir)gconsole -# TestTarget = $(testdir)update_test $(testdir)dataset_test $(testdir)transaction_test \ - $(testdir)run_transaction $(testdir)workload $(testdir)debug_test -# TARGET = $(exedir)gbuild $(exedir)gdrop $(exedir)gquery $(exedir)ginit - -all: $(TARGET) - @echo "Compilation ends successfully!" - @bash scripts/init.sh - -#BETTER: use for loop to reduce the lines -#NOTICE: g++ -MM will run error if linking failed, like Database.h/../SparlParser.h/../antlr3.h - -#executables begin - -#NOTICE:not include g*.o in objfile due to multiple definitions of main() - -$(exedir)gexport: $(lib_antlr) $(objdir)gexport.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gexport $(objdir)gexport.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)gdrop: $(lib_antlr) $(objdir)gdrop.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gdrop $(objdir)gdrop.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)ginit: $(lib_antlr) $(objdir)ginit.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)ginit $(objdir)ginit.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)shutdown: $(lib_antlr) $(objdir)shutdown.o $(objfile) $(api_cpp) - $(CXX) $(EXEFLAG) -o $(exedir)shutdown $(objdir)shutdown.o $(objfile) $(openmp) -L./api/http/cpp/lib -lgstoreconnector $(library) ${ldl} - -$(exedir)gmonitor: $(lib_antlr) $(objdir)gmonitor.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gmonitor $(objdir)gmonitor.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)gshow: $(lib_antlr) $(objdir)gshow.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gshow $(objdir)gshow.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)gbuild: $(lib_antlr) $(objdir)gbuild.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gbuild $(objdir)gbuild.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)gquery: $(lib_antlr) $(objdir)gquery.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gquery $(objdir)gquery.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)gserver: $(lib_antlr) $(objdir)gserver.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gserver $(objdir)gserver.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)gserver_backup_scheduler: $(lib_antlr) $(objdir)gserver_backup_scheduler.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gserver_backup_scheduler $(objdir)gserver_backup_scheduler.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)ghttp: $(lib_antlr) $(objdir)ghttp.o ./Server/server_http.hpp ./Server/client_http.hpp ./Server/MultipartParser.hpp $(objfile) ${objdir}APIUtil.o - $(CXX) $(EXEFLAG) -o $(exedir)ghttp $(objdir)ghttp.o $(objfile) ${objdir}APIUtil.o $(library) $(inc) $(openmp) ${ldl} - -#$(exedir)gapiserver: $(lib_antlr) $(lib_workflow) $(objdir)gapiserver.o $(objfile) -# $(CXX) $(EXEFLAG) -o $(exedir)gapiserver $(objdir)gapiserver.o $(objfile) $(library) $(openmp) - -$(exedir)grpc: $(lib_antlr) $(lib_rpc) $(objdir)grpc.o $(grpcobj) $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)grpc $(objdir)grpc.o ${grpcobj} $(objfile) $(library) $(inc) ${inc_rpc} -lworkflow -lssl -lcrypto $(openmp) ${ldl} - -$(exedir)gbackup: $(lib_antlr) $(objdir)gbackup.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gbackup $(objdir)gbackup.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)grestore: $(lib_antlr) $(objdir)grestore.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)grestore $(objdir)grestore.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)gpara: $(lib_antlr) $(objdir)gpara.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gpara $(objdir)gpara.o $(objfile) $(library) $(openmp) -L./api/http/cpp/lib -lgstoreconnector $(library) ${ldl} - -$(exedir)rollback: $(lib_antlr) $(objdir)rollback.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)rollback $(objdir)rollback.o $(objfile) $(library) $(openmp) -L./api/http/cpp/lib -lgstoreconnector $(library) ${ldl} - -$(testdir)update_test: $(lib_antlr) $(objdir)update_test.o $(objfile) - $(CXX) $(EXEFLAG) -o $(testdir)update_test $(objdir)update_test.o $(objfile) $(library) $(openmp) ${ldl} - -$(testdir)dataset_test: $(lib_antlr) $(objdir)dataset_test.o $(objfile) - $(CXX) $(EXEFLAG) -o $(testdir)dataset_test $(objdir)dataset_test.o $(objfile) $(library) $(openmp) ${ldl} - -$(testdir)transaction_test: $(lib_antlr) $(objdir)transaction_test.o $(objfile) - $(CXX) $(EXEFLAG) -o $(testdir)transaction_test $(objdir)transaction_test.o $(objfile) $(library) $(openmp) ${ldl} - -$(testdir)run_transaction: $(lib_antlr) $(objdir)run_transaction.o $(objfile) - $(CXX) $(EXEFLAG) -o $(testdir)run_transaction $(objdir)run_transaction.o $(objfile) $(library) $(openmp) -L./api/http/cpp/lib -lgstoreconnector $(library) ${ldl} - -$(testdir)workload: $(lib_antlr) $(objdir)workload.o $(objfile) - $(CXX) $(EXEFLAG) -o $(testdir)workload $(objdir)workload.o $(objfile) $(library) $(openmp) ${ldl} - -$(testdir)debug_test: $(lib_antlr) $(objdir)debug_test.o $(objfile) - $(CXX) $(EXEFLAG) -o $(testdir)debug_test $(objdir)debug_test.o $(objfile) $(library) $(openmp) ${ldl} - -$(exedir)gconsole: $(lib_antlr) $(objdir)gconsole.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gconsole $(objdir)gconsole.o $(objfile) $(library) $(openmp) ${ldl} - -#executables end - - -#objects in Main/ begin - -$(objdir)gexport.o: Main/gexport.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/gexport.cpp $(inc) $(inc_log) -o $(objdir)gexport.o $(openmp) - -$(objdir)gdrop.o: Main/gdrop.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/gdrop.cpp $(inc) $(inc_log) -o $(objdir)gdrop.o $(openmp) - -$(objdir)ginit.o: Main/ginit.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/ginit.cpp $(inc) $(inc_log) -o $(objdir)ginit.o $(openmp) - -$(objdir)shutdown.o: Main/shutdown.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/shutdown.cpp $(inc) $(inc_log) -o $(objdir)shutdown.o $(openmp) - -$(objdir)gmonitor.o: Main/gmonitor.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/gmonitor.cpp $(inc) $(inc_log) -o $(objdir)gmonitor.o $(openmp) - -$(objdir)gshow.o: Main/gshow.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/gshow.cpp $(inc) $(inc_log) -o $(objdir)gshow.o $(openmp) - -$(objdir)gbuild.o: Main/gbuild.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/gbuild.cpp $(inc) $(inc_log) -o $(objdir)gbuild.o $(openmp) - -$(objdir)gquery.o: Main/gquery.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/gquery.cpp $(inc) $(inc_log) -o $(objdir)gquery.o $(openmp) #-DREADLINE_ON - #add -DREADLINE_ON if using readline - -$(objdir)gserver.o: Main/gserver.cpp Server/Server.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/gserver.cpp $(inc) $(inc_log) -o $(objdir)gserver.o $(openmp) - -$(objdir)gserver_backup_scheduler.o: Main/gserver_backup_scheduler.cpp Server/Server.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/gserver_backup_scheduler.cpp $(inc) $(inc_log) -o $(objdir)gserver_backup_scheduler.o $(openmp) - -$(objdir)ghttp.o: Main/ghttp.cpp Server/server_http.hpp Server/client_http.hpp Server/MultipartParser.hpp Database/Database.h Database/Txn_manager.h Util/Util.h Util/IPWhiteList.h Util/IPBlackList.h Util/CompressFileUtil.h $(lib_antlr) Util/INIParser.h Util/WebUrl.h GRPC/APIUtil.h - $(CXX) $(CFLAGS) Main/ghttp.cpp $(inc) $(inc_log) $(inc_zlib) -o $(objdir)ghttp.o $(def64IO) $(openmp) - -#$(objdir)gapiserver.o: Main/gapiserver.cpp Database/Database.h Database/Txn_manager.h Util/Util.h Util/Util_New.h Util/IPWhiteList.h Util/IPBlackList.h Util/WebUrl.h $(lib_antlr) $(lib_workflow) -# $(CXX) $(CFLAGS) Main/gapiserver.cpp $(inc) $(inc_workflow) -o $(objdir)gapiserver.o $(openmp) - -$(objdir)grpc.o: Main/grpc.cpp GRPC/grpc_server.h GRPC/grpc_status_code.h GRPC/grpc_operation.h GRPC/APIUtil.h Util/CompressFileUtil.h Database/Database.h Database/Txn_manager.h Util/Util.h $(lib_antlr) $(lib_rpc) - $(CXX) $(CFLAGS) Main/grpc.cpp $(inc) $(inc_log) $(inc_rpc) $(inc_zlib) -o $(objdir)grpc.o $(def64IO) $(openmp) - -$(objdir)gbackup.o: Main/gbackup.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/gbackup.cpp $(inc) $(inc_log) -o $(objdir)gbackup.o $(openmp) - -$(objdir)grestore.o: Main/grestore.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/grestore.cpp $(inc) $(inc_log) -o $(objdir)grestore.o $(openmp) - -$(objdir)gpara.o: Main/gpara.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/gpara.cpp $(inc) $(inc_log) -o $(objdir)gpara.o $(openmp) - -$(objdir)rollback.o: Main/rollback.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/rollback.cpp $(inc) $(inc_log) -o $(objdir)rollback.o $(openmp) - -$(objdir)gconsole.o: Main/gconsole.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) Main/gconsole.cpp $(inc) $(inc_log) -o $(objdir)gconsole.o $(openmp) -#objects in Main/ end - -#objects in scripts/ begin - -$(objdir)update_test.o: $(testdir)update_test.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) $(testdir)update_test.cpp $(inc) $(inc_log) -o $(objdir)update_test.o $(openmp) - -$(objdir)dataset_test.o: $(testdir)dataset_test.cpp Database/Database.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) $(testdir)dataset_test.cpp $(inc) $(inc_log) -o $(objdir)dataset_test.o $(openmp) - -$(objdir)transaction_test.o: $(testdir)transaction_test.cpp Database/Database.h Database/Txn_manager.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) $(testdir)transaction_test.cpp $(inc) $(inc_log) -o $(objdir)transaction_test.o $(openmp) - -$(objdir)run_transaction.o: $(testdir)run_transaction.cpp Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) $(testdir)run_transaction.cpp $(inc) $(inc_log) -o $(objdir)run_transaction.o $(openmp) - -$(objdir)workload.o: $(testdir)workload.cpp Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) $(testdir)workload.cpp $(inc) $(inc_log) -o $(objdir)workload.o $(openmp) - -$(objdir)debug_test.o: $(testdir)debug_test.cpp Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) $(testdir)debug_test.cpp $(inc) $(inc_log) -o $(objdir)debug_test.o $(openmp) - -#objects in scripts/ end - - -#objects in kvstore/ begin - -#objects in sitree/ begin -$(objdir)SITree.o: KVstore/SITree/SITree.cpp KVstore/SITree/SITree.h $(filter $(FIRST_BUILD),$(objdir)Stream.o) - @echo $(FAST_DEPENDENCY_FLAG) - $(CXX) $(CFLAGS) KVstore/SITree/SITree.cpp $(inc_log) -o $(objdir)SITree.o $(openmp) - -$(objdir)SIStorage.o: KVstore/SITree/storage/SIStorage.cpp KVstore/SITree/storage/SIStorage.h $(filter $(FIRST_BUILD),$(objdir)Util.o) - $(CXX) $(CFLAGS) KVstore/SITree/storage/SIStorage.cpp $(inc_log) -o $(objdir)SIStorage.o $(def64IO) $(openmp) - -$(objdir)SINode.o: KVstore/SITree/node/SINode.cpp KVstore/SITree/node/SINode.h $(filter $(FIRST_BUILD),$(objdir)Util.o) - $(CXX) $(CFLAGS) KVstore/SITree/node/SINode.cpp $(inc_log) -o $(objdir)SINode.o $(openmp) - -$(objdir)SIIntlNode.o: KVstore/SITree/node/SIIntlNode.cpp KVstore/SITree/node/SIIntlNode.h - $(CXX) $(CFLAGS) KVstore/SITree/node/SIIntlNode.cpp $(inc_log) -o $(objdir)SIIntlNode.o $(openmp) - -$(objdir)SILeafNode.o: KVstore/SITree/node/SILeafNode.cpp KVstore/SITree/node/SILeafNode.h - $(CXX) $(CFLAGS) KVstore/SITree/node/SILeafNode.cpp $(inc_log) -o $(objdir)SILeafNode.o $(openmp) - -$(objdir)SIHeap.o: KVstore/SITree/heap/SIHeap.cpp KVstore/SITree/heap/SIHeap.h $(filter $(FIRST_BUILD),$(objdir)Util.o) - $(CXX) $(CFLAGS) KVstore/SITree/heap/SIHeap.cpp $(inc_log) -o $(objdir)SIHeap.o $(openmp) -#objects in sitree/ end - -#objects in isarray/ begin -$(objdir)ISArray.o: KVstore/ISArray/ISArray.cpp KVstore/ISArray/ISArray.h $(filter $(FIRST_BUILD),$(objdir)VList.o) - $(CXX) $(CFLAGS) KVstore/ISArray/ISArray.cpp $(inc_log) -o $(objdir)ISArray.o - -$(objdir)ISBlockManager.o: KVstore/ISArray/ISBlockManager.cpp KVstore/ISArray/ISBlockManager.h - $(CXX) $(CFLAGS) KVstore/ISArray/ISBlockManager.cpp $(inc_log) -o $(objdir)ISBlockManager.o - -$(objdir)ISEntry.o: KVstore/ISArray/ISEntry.cpp KVstore/ISArray/ISEntry.h - $(CXX) $(CFLAGS) KVstore/ISArray/ISEntry.cpp $(inc_log) -o $(objdir)ISEntry.o -#objects in isarray/ end - -#objects in ivarray/ begin -$(objdir)IVArray.o: KVstore/IVArray/IVArray.cpp KVstore/IVArray/IVArray.h $(filter $(FIRST_BUILD),$(objdir)VList.o) \ - $(filter $(FIRST_BUILD),$(objdir)Transaction.o) - $(CXX) $(CFLAGS) KVstore/IVArray/IVArray.cpp $(inc_log) -o $(objdir)IVArray.o - -$(objdir)IVBlockManager.o: KVstore/IVArray/IVBlockManager.cpp KVstore/IVArray/IVBlockManager.h - $(CXX) $(CFLAGS) KVstore/IVArray/IVBlockManager.cpp $(inc_log) -o $(objdir)IVBlockManager.o - -$(objdir)IVEntry.o: KVstore/IVArray/IVEntry.cpp KVstore/IVArray/IVEntry.h $(filter $(FIRST_BUILD),$(objdir)Version.o) \ - $(filter $(FIRST_BUILD),$(objdir)GraphLock.o) - $(CXX) $(CFLAGS) KVstore/IVArray/IVEntry.cpp $(inc_log) -o $(objdir)IVEntry.o - -#objects in ivarray/ end - -$(objdir)KVstore.o: KVstore/KVstore.cpp KVstore/KVstore.h KVstore/Tree.h - $(CXX) $(CFLAGS) KVstore/KVstore.cpp $(inc) $(inc_log) -o $(objdir)KVstore.o $(openmp) - -#objects in kvstore/ end - - -#objects in Database/ begin - - -$(objdir)Database.o: Database/Database.cpp Database/Database.h $(filter $(FIRST_BUILD),$(objdir)RDFParser.o) \ - $(filter $(FIRST_BUILD),$(objdir)GeneralEvaluation.o) $(filter $(FIRST_BUILD),$(objdir)StringIndex.o) \ - $(filter $(FIRST_BUILD),$(objdir)Transaction.o) - $(CXX) $(CFLAGS) Database/Database.cpp $(inc) $(inc_log) -o $(objdir)Database.o $(openmp) - -$(objdir)Join.o: Database/Join.cpp Database/Join.h $(filter $(FIRST_BUILD),$(objdir)IDList.o) \ - $(filter $(FIRST_BUILD),$(objdir)KVstore.o) $(filter $(FIRST_BUILD),$(objdir)SPARQLquery.o) $(filter $(FIRST_BUILD),$(objdir)Transaction.o) - $(CXX) $(CFLAGS) Database/Join.cpp $(inc) $(inc_log) -o $(objdir)Join.o $(openmp) - -$(objdir)CSR.o: Database/CSR.cpp Database/CSR.h - $(CXX) $(CFLAGS) Database/CSR.cpp $(inc) -o $(objdir)CSR.o $(openmp) - $(CXX) -std=c++11 -fPIC -shared Database/CSR.cpp -o lib/libgcsr.so - -$(objdir)TableOperator.o: Database/TableOperator.cpp Database/TableOperator.h $(filter $(FIRST_BUILD),$(objdir)BGPQuery.o) - $(CXX) $(CFLAGS) Database/TableOperator.cpp $(inc) $(inc_log) -o $(objdir)TableOperator.o $(openmp) - -#$(objdir)ResultTrigger.o: Database/ResultTrigger.cpp Database/ResultTrigger.h $(objdir)Util.o -# $(CXX) $(CFLAGS) Database/ResultTrigger.cpp $(inc) -o $(objdir)ResultTrigger.o $(openmp) - -$(objdir)PlanTree.o: Database/PlanTree.cpp Database/PlanTree.h $(filter $(FIRST_BUILD),$(objdir)TableOperator.o) - $(CXX) $(CFLAGS) Database/PlanTree.cpp $(inc) $(inc_log) -o $(objdir)PlanTree.o $(openmp) - -$(objdir)PlanGenerator.o: Database/PlanGenerator.cpp Database/PlanGenerator.h \ - $(filter $(FIRST_BUILD),$(objdir)IDList.o) $(filter $(FIRST_BUILD),$(objdir)PlanTree.o) \ - $(filter $(FIRST_BUILD),$(objdir)OrderedVector.o) - $(CXX) $(CFLAGS) Database/PlanGenerator.cpp $(inc) $(inc_log) -o $(objdir)PlanGenerator.o $(openmp) - -$(objdir)Executor.o: Database/Executor.cpp Database/Executor.h $(filter $(FIRST_BUILD),$(objdir)IDList.o) \ - $(filter $(FIRST_BUILD),$(objdir)Join.o) $(filter $(FIRST_BUILD),$(objdir)Transaction.o) \ - $(filter $(FIRST_BUILD),$(objdir)TableOperator.o) $(filter $(FIRST_BUILD), $(objdir)DPBTopKUtil.o) - $(CXX) $(CFLAGS) Database/Executor.cpp $(inc) $(inc_log) -o $(objdir)Executor.o $(openmp) ${ldl} - -$(objdir)Optimizer.o: Database/Optimizer.cpp Database/Optimizer.h Database/OptimizerDebug.h \ - $(filter $(FIRST_BUILD), $(objdir)Executor.o) $(filter $(FIRST_BUILD),$(objdir)DFSPlan.o) \ - $(filter $(FIRST_BUILD),$(objdir)PlanGenerator.o) $(filter $(FIRST_BUILD),$(objdir)DPBTopKUtil.o) \ - $(filter $(FIRST_BUILD),$(objdir)FilterPlan.o) - $(CXX) $(CFLAGS) Database/Optimizer.cpp $(inc) $(inc_log) -o $(objdir)Optimizer.o $(openmp) ${ldl} - -$(objdir)Txn_manager.o: Database/Txn_manager.cpp Database/Txn_manager.h $(filter $(FIRST_BUILD),$(objdir)Util.o) \ - $(filter $(FIRST_BUILD),$(objdir)Transaction.o) $(filter $(FIRST_BUILD),$(objdir)Database.o) - $(CXX) $(CFLAGS) Database/Txn_manager.cpp $(inc) $(inc_log) -o $(objdir)Txn_manager.o $(openmp) - -#objects in Database/ end - - -#objects in Query/ begin - -$(objdir)IDList.o: Query/IDList.cpp Query/IDList.h - $(CXX) $(CFLAGS) Query/IDList.cpp $(inc) $(inc_log) -o $(objdir)IDList.o $(openmp) - -$(objdir)SPARQLquery.o: Query/SPARQLquery.cpp Query/SPARQLquery.h $(filter $(FIRST_BUILD),$(objdir)BasicQuery.o) - $(CXX) $(CFLAGS) Query/SPARQLquery.cpp $(inc) $(inc_log) -o $(objdir)SPARQLquery.o $(openmp) - -$(objdir)BasicQuery.o: Query/BasicQuery.cpp Query/BasicQuery.h - $(CXX) $(CFLAGS) Query/BasicQuery.cpp $(inc) $(inc_log) -o $(objdir)BasicQuery.o $(openmp) - -$(objdir)ResultSet.o: Query/ResultSet.cpp Query/ResultSet.h $(filter $(FIRST_BUILD),$(objdir)Stream.o) - $(CXX) $(CFLAGS) Query/ResultSet.cpp $(inc) $(inc_log) -o $(objdir)ResultSet.o $(openmp) - -$(objdir)Varset.o: Query/Varset.cpp Query/Varset.h - $(CXX) $(CFLAGS) Query/Varset.cpp $(inc) $(inc_log) -o $(objdir)Varset.o $(openmp) - -$(objdir)DFSPlan.o: Query/DFSPlan.cpp Query/DFSPlan.h $(filter $(FIRST_BUILD),$(objdir)TableOperator.o) - $(CXX) $(CFLAGS) Query/DFSPlan.cpp $(inc) $(inc_log) -o $(objdir)DFSPlan.o $(openmp) - -$(objdir)QueryTree.o: Query/QueryTree.cpp Query/QueryTree.h $(filter $(FIRST_BUILD),$(objdir)Varset.o) - $(CXX) $(CFLAGS) Query/QueryTree.cpp $(inc) $(inc_log) -o $(objdir)QueryTree.o $(openmp) - -$(objdir)TempResult.o: Query/TempResult.cpp Query/TempResult.h Query/RegexExpression.h \ - $(filter $(FIRST_BUILD),$(objdir)StringIndex.o) $(filter $(FIRST_BUILD),$(objdir)QueryTree.o) \ - $(filter $(FIRST_BUILD),$(objdir)EvalMultitypeValue.o) - $(CXX) $(CFLAGS) Query/TempResult.cpp $(inc) $(inc_log) -o $(objdir)TempResult.o $(openmp) - -$(objdir)QueryCache.o: Query/QueryCache.cpp Query/QueryCache.h $(filter $(FIRST_BUILD),$(objdir)TempResult.o) - $(CXX) $(CFLAGS) Query/QueryCache.cpp $(inc) $(inc_log) -o $(objdir)QueryCache.o $(openmp) - -$(objdir)PathQueryHandler.o: Query/PathQueryHandler.cpp Query/PathQueryHandler.h $(filter $(FIRST_BUILD),$(objdir)CSR.o) - $(CXX) $(CFLAGS) Query/PathQueryHandler.cpp $(inc) -o $(objdir)PathQueryHandler.o $(openmp) ${ldl} - $(CXX) -std=c++11 -fPIC -shared Query/PathQueryHandler.cpp -o lib/libgpathqueryhandler.so lib/libgcsr.so - -$(objdir)BGPQuery.o: Query/BGPQuery.cpp Query/BGPQuery.h $(filter $(FIRST_BUILD),$(objdir)Util.o) \ - $(filter $(FIRST_BUILD),$(objdir)Triple.o) $(filter $(FIRST_BUILD),$(objdir)KVstore.o) - $(CXX) $(CFLAGS) Query/BGPQuery.cpp $(inc) $(inc_log) -o $(objdir)BGPQuery.o $(openmp) - -$(objdir)FilterPlan.o: Query/FilterPlan.cpp Query/FilterPlan.h $(filter $(FIRST_BUILD),$(objdir)TableOperator.o) - $(CXX) $(CFLAGS) Query/FilterPlan.cpp $(inc) $(inc_log) -o $(objdir)FilterPlan.o $(openmp) - -#objects in Query/topk/ begin - -$(objdir)Pool.o: Query/topk/DPB/Pool.cpp Query/topk/DPB/Pool.h $(filter $(FIRST_BUILD),$(objdir)Util.o) - $(CXX) $(CFLAGS) Query/topk/DPB/Pool.cpp $(inc) $(inc_log) -o $(objdir)Pool.o $(openmp) - -$(objdir)DynamicTrie.o: Query/topk/DPB/DynamicTrie.cpp Query/topk/DPB/DynamicTrie.h \ - $(filter $(FIRST_BUILD),$(objdir)Util.o) $(filter $(FIRST_BUILD),$(objdir)Pool.o) - $(CXX) $(CFLAGS) Query/topk/DPB/DynamicTrie.cpp $(inc) $(inc_log) -o $(objdir)DynamicTrie.o $(openmp) - -$(objdir)OrderedList.o: Query/topk/DPB/OrderedList.cpp Query/topk/DPB/OrderedList.h \ - $(filter $(FIRST_BUILD),$(objdir)Util.o) $(filter $(FIRST_BUILD),$(objdir)Pool.o) \ - $(filter $(FIRST_BUILD),$(objdir)DynamicTrie.o) - $(CXX) $(CFLAGS) Query/topk/DPB/OrderedList.cpp $(inc) $(inc_log) -o $(objdir)OrderedList.o $(openmp) - -$(objdir)TopKSearchPlan.o: Query/topk/TopKSearchPlan.cpp Query/topk/TopKSearchPlan.h \ - $(filter $(FIRST_BUILD),$(objdir)OrderedList.o) $(filter $(FIRST_BUILD),$(objdir)QueryTree.o) $(filter $(FIRST_BUILD),$(objdir)PlanGenerator.o) - $(CXX) $(CFLAGS) Query/topk/TopKSearchPlan.cpp $(inc) $(inc_log) -o $(objdir)TopKSearchPlan.o $(openmp) - -$(objdir)TopKUtil.o: Query/topk/TopKUtil.cpp Query/topk/TopKUtil.h $(filter $(FIRST_BUILD),$(objdir)TopKSearchPlan.o) - $(CXX) $(CFLAGS) Query/topk/TopKUtil.cpp $(inc) $(inc_log) -o $(objdir)TopKUtil.o $(openmp) - -$(objdir)DPBTopKUtil.o: Query/topk/DPBTopKUtil.cpp Query/topk/DPBTopKUtil.h $(filter $(FIRST_BUILD),$(objdir)TopKUtil.o) - $(CXX) $(CFLAGS) Query/topk/DPBTopKUtil.cpp $(inc) $(inc_log) -o $(objdir)DPBTopKUtil.o $(openmp) - -#objects in Query/topk/ end - - -#no more using $(objdir)Database.o -$(objdir)GeneralEvaluation.o: Query/GeneralEvaluation.cpp Query/GeneralEvaluation.h Query/RegexExpression.h \ - $(filter $(FIRST_BUILD),$(objdir)StringIndex.o) $(filter $(FIRST_BUILD),$(objdir)QueryParser.o) \ - $(filter $(FIRST_BUILD),$(objdir)EvalMultitypeValue.o) $(filter $(FIRST_BUILD),$(objdir)SPARQLquery.o) \ - $(filter $(FIRST_BUILD),$(objdir)QueryCache.o) $(filter $(FIRST_BUILD),$(objdir)ResultSet.o) \ - $(filter $(FIRST_BUILD),$(objdir)PathQueryHandler.o) $(filter $(FIRST_BUILD),$(objdir)Optimizer.o) - $(CXX) $(CFLAGS) Query/GeneralEvaluation.cpp $(inc) $(inc_log) -o $(objdir)GeneralEvaluation.o $(openmp) ${ldl} - -#objects in Query/ end - - -#objects in Signature/ begin - -#$(objdir)SigEntry.o: Signature/SigEntry.cpp Signature/SigEntry.h $(objdir)Signature.o -# $(CXX) $(CFLAGS) Signature/SigEntry.cpp $(inc) -o $(objdir)SigEntry.o $(openmp) -# -#$(objdir)Signature.o: Signature/Signature.cpp Signature/Signature.h -# $(CXX) $(CFLAGS) Signature/Signature.cpp $(inc) -o $(objdir)Signature.o $(openmp) - -#objects in Signature/ end - - -#objects in Util/ begin - -$(objdir)Util.o: Util/Util.cpp Util/Util.h $(objdir)Slog.o - $(CXX) $(CFLAGS) Util/Util.cpp $(inc_log) -o $(objdir)Util.o $(openmp) - -$(objdir)WebUrl.o: Util/WebUrl.cpp Util/WebUrl.h - $(CXX) $(CFLAGS) Util/WebUrl.cpp -o $(objdir)WebUrl.o $(openmp) - - - -$(objdir)INIParser.o: Util/INIParser.cpp Util/INIParser.h - $(CXX) $(CFLAGS) Util/INIParser.cpp -o $(objdir)INIParser.o $(openmp) - -$(objdir)Slog.o: Util/Slog.cpp Util/Slog.h $(lib_log) - $(CXX) $(CFLAGS) Util/Slog.cpp $(inc_log) -o $(objdir)Slog.o $(openmp) - -#$(objdir)grpc.srpc.o: GRPC/grpc.srpc.h $(lib_workflow) -# $(CXX) $(CFLAGS) GRPC/grpc.srpc.h -o $(objdir)grpc.srpc.o $(openmp) - -$(objdir)Stream.o: Util/Stream.cpp Util/Stream.h $(filter $(FIRST_BUILD),$(objdir)Util.o) $(filter $(FIRST_BUILD),$(objdir)Bstr.o) - $(CXX) $(CFLAGS) Util/Stream.cpp $(inc_log) -o $(objdir)Stream.o $(def64IO) $(openmp) - -$(objdir)Bstr.o: Util/Bstr.cpp Util/Bstr.h $(filter $(FIRST_BUILD),$(objdir)Util.o) - $(CXX) $(CFLAGS) Util/Bstr.cpp $(inc_log) -o $(objdir)Bstr.o $(openmp) - -$(objdir)Triple.o: Util/Triple.cpp Util/Triple.h $(filter $(FIRST_BUILD),$(objdir)Util.o) - $(CXX) $(CFLAGS) Util/Triple.cpp $(inc_log) -o $(objdir)Triple.o $(openmp) - -$(objdir)VList.o: Util/VList.cpp Util/VList.h - $(CXX) $(CFLAGS) Util/VList.cpp $(inc_log) -o $(objdir)VList.o $(openmp) - -$(objdir)EvalMultitypeValue.o: Util/EvalMultitypeValue.cpp Util/EvalMultitypeValue.h - $(CXX) $(CFLAGS) Util/EvalMultitypeValue.cpp $(inc_log) -o $(objdir)EvalMultitypeValue.o $(openmp) - -$(objdir)Version.o: Util/Version.cpp Util/Version.h - $(CXX) $(CFLAGS) Util/Version.cpp $(inc_log) -o $(objdir)Version.o $(openmp) - -$(objdir)SpinLock.o: Util/SpinLock.h Util/SpinLock.cpp - $(CXX) $(CFLAGS) Util/SpinLock.cpp -o $(objdir)SpinLock.o $(openmp) - -$(objdir)GraphLock.o: Util/GraphLock.h Util/GraphLock.cpp - $(CXX) $(CFLAGS) Util/GraphLock.cpp -o $(objdir)GraphLock.o $(openmp) - -$(objdir)Transaction.o: Util/Transaction.cpp Util/Transaction.h $(filter $(FIRST_BUILD),$(objdir)Util.o) $(filter $(FIRST_BUILD),$(objdir)IDTriple.o) - $(CXX) $(CFLAGS) Util/Transaction.cpp $(inc) $(inc_log) -o $(objdir)Transaction.o $(openmp) - -$(objdir)IDTriple.o: Util/IDTriple.cpp Util/IDTriple.h - $(CXX) $(CFLAGS) Util/IDTriple.cpp $(inc_log) -o $(objdir)IDTriple.o $(openmp) - -$(objdir)Latch.o: Util/Latch.cpp Util/Latch.h - $(CXX) $(CFLAGS) Util/Latch.cpp -o $(objdir)Latch.o $(openmp) - -$(objdir)IPWhiteList.o: Util/IPWhiteList.cpp Util/IPWhiteList.h $(filter $(FIRST_BUILD),$(objdir)Util.o) - $(CXX) $(CFLAGS) Util/IPWhiteList.cpp $(inc_log) -o $(objdir)IPWhiteList.o $(def64IO) $(openmp) - -$(objdir)IPBlackList.o: Util/IPBlackList.cpp Util/IPBlackList.h $(filter $(FIRST_BUILD),$(objdir)Util.o) - $(CXX) $(CFLAGS) Util/IPBlackList.cpp $(inc_log) -o $(objdir)IPBlackList.o $(def64IO) $(openmp) - -$(objdir)OrderedVector.o: Util/OrderedVector.cpp Util/OrderedVector.h - $(CXX) $(CFLAGS) Util/OrderedVector.cpp -o $(objdir)OrderedVector.o $(openmp) - -#objects in util/ end - - -#objects in VSTree/ begin - -#$(objdir)VSTree.o: VSTree/VSTree.cpp VSTree/VSTree.h $(objdir)EntryBuffer.o $(objdir)LRUCache.o $(objdir)VNode.o -# $(CXX) $(CFLAGS) VSTree/VSTree.cpp $(inc) -o $(objdir)VSTree.o $(def64IO) $(openmp) -# -#$(objdir)EntryBuffer.o: VSTree/EntryBuffer.cpp VSTree/EntryBuffer.h Signature/SigEntry.h -# $(CXX) $(CFLAGS) VSTree/EntryBuffer.cpp $(inc) -o $(objdir)EntryBuffer.o $(def64IO) $(openmp) -# -#$(objdir)LRUCache.o: VSTree/LRUCache.cpp VSTree/LRUCache.h VSTree/VNode.h -# $(CXX) $(CFLAGS) VSTree/LRUCache.cpp $(inc) -o $(objdir)LRUCache.o $(def64IO) $(openmp) -# -#$(objdir)VNode.o: VSTree/VNode.cpp VSTree/VNode.h -# $(CXX) $(CFLAGS) VSTree/VNode.cpp $(inc) -o $(objdir)VNode.o $(def64IO) $(openmp) - -#objects in VSTree/ end - - -#objects in StringIndex/ begin -$(objdir)StringIndex.o: StringIndex/StringIndex.cpp StringIndex/StringIndex.h \ - $(filter $(FIRST_BUILD),$(objdir)KVstore.o) $(filter $(FIRST_BUILD),$(objdir)Util.o) - $(CXX) $(CFLAGS) StringIndex/StringIndex.cpp $(inc) $(inc_log) -o $(objdir)StringIndex.o $(def64IO) $(openmp) -#objects in StringIndex/ end - - -#objects in Parser/ begin - -$(objdir)SPARQLParser.o: Parser/SPARQL/SPARQLParser.cpp Parser/SPARQL/SPARQLParser.h - $(CXX) $(CFLAGS) Parser/SPARQL/SPARQLParser.cpp $(inc) -o $(objdir)SPARQLParser.o $(openmp) - -$(objdir)SPARQLLexer.o: Parser/SPARQL/SPARQLLexer.cpp Parser/SPARQL/SPARQLLexer.h - $(CXX) $(CFLAGS) Parser/SPARQL/SPARQLLexer.cpp $(inc) -o $(objdir)SPARQLLexer.o $(openmp) - -$(objdir)TurtleParser.o: Parser/TurtleParser.cpp Parser/TurtleParser.h Parser/Type.h - $(CXX) $(CFLAGS) Parser/TurtleParser.cpp $(inc) $(inc_log) -o $(objdir)TurtleParser.o $(openmp) - -$(objdir)RDFParser.o: Parser/RDFParser.cpp Parser/RDFParser.h $(filter $(FIRST_BUILD),$(objdir)TurtleParser.o) $(filter $(FIRST_BUILD),$(objdir)Triple.o) - $(CXX) $(CFLAGS) Parser/RDFParser.cpp $(inc) $(inc_log) -o $(objdir)RDFParser.o $(openmp) - -$(objdir)QueryParser.o: Parser/QueryParser.cpp Parser/QueryParser.h $(filter $(FIRST_BUILD),$(objdir)SPARQLParser.o) \ - $(filter $(FIRST_BUILD),$(objdir)SPARQLLexer.o) $(filter $(FIRST_BUILD),$(objdir)QueryTree.o) - $(CXX) $(CFLAGS) Parser/QueryParser.cpp $(inc) $(inc_log) -o $(objdir)QueryParser.o $(openmp) - -#objects in Parser/ end - -#objects in Trie/ begin - -$(objdir)TrieNode.o: Trie/TrieNode.cpp Trie/TrieNode.h - $(CXX) $(CFLAGS) Trie/TrieNode.cpp -o $(objdir)TrieNode.o - -$(objdir)Trie.o: Trie/Trie.cpp Trie/Trie.h $(filter $(FIRST_BUILD),$(objdir)TrieNode.o) $(filter $(FIRST_BUILD),$(objdir)Triple.o) $(filter $(FIRST_BUILD),$(objdir)RDFParser.o) - $(CXX) $(CFLAGS) Trie/Trie.cpp $(inc) $(inc_log) -o $(objdir)Trie.o - -#objects in Server/ begin - -$(objdir)Operation.o: Server/Operation.cpp Server/Operation.h - $(CXX) $(CFLAGS) Server/Operation.cpp $(inc) $(inc_log) -o $(objdir)Operation.o $(openmp) - -$(objdir)Socket.o: Server/Socket.cpp Server/Socket.h - $(CXX) $(CFLAGS) Server/Socket.cpp $(inc) $(inc_log) -o $(objdir)Socket.o $(openmp) - -$(objdir)Server.o: Server/Server.cpp Server/Server.h $(filter $(FIRST_BUILD),$(objdir)Socket.o) \ - $(filter $(FIRST_BUILD),$(objdir)Database.o) $(filter $(FIRST_BUILD),$(objdir)Operation.o) - $(CXX) $(CFLAGS) Server/Server.cpp $(inc) $(inc_log) -o $(objdir)Server.o $(openmp) - -$(objdir)CompressFileUtil.o: Util/CompressFileUtil.cpp Util/CompressFileUtil.h Util/Util.h - $(CXX) $(CFLAGS) Util/CompressFileUtil.cpp $(inc) $(inc_log) $(inc_zlib) -o $(objdir)CompressFileUtil.o $(def64IO) $(openmp) - -# $(objdir)client_http.o: Server/client_http.hpp -# $(CXX) $(CFLAGS) Server/client_http.hpp $(inc) -o $(objdir)client_http.o - -# $(objdir)server_http.o: Server/server_http.hpp -# $(CXX) $(CFLAGS) Server/server_http.hpp $(inc) -o $(objdir)server_http.o - -#objects in Server/ end - -#objects in GRPC/ begin - -$(objdir)APIUtil.o: GRPC/APIUtil.cpp GRPC/APIUtil.h Database/Database.h Database/Txn_manager.h Util/Util.h $(lib_antlr) - $(CXX) $(CFLAGS) GRPC/APIUtil.cpp $(inc) $(inc_log) -o $(objdir)APIUtil.o $(def64IO) $(openmp) - -$(objdir)grpc_status_code.o: GRPC/grpc_status_code.cpp GRPC/grpc_status_code.h $(lib_antlr) $(lib_rpc) - $(CXX) $(CFLAGS) GRPC/grpc_status_code.cpp $(inc) $(inc_rpc) -o $(objdir)grpc_status_code.o $(def64IO) $(openmp) - -$(objdir)grpc_multipart_parser.o: GRPC/grpc_multipart_parser.cpp GRPC/grpc_multipart_parser.h $(lib_antlr) $(lib_rpc) - $(CXX) $(CFLAGS) GRPC/grpc_multipart_parser.cpp $(inc) $(inc_rpc) -o $(objdir)grpc_multipart_parser.o $(def64IO) $(openmp) - -$(objdir)grpc_content.o: GRPC/grpc_content.cpp GRPC/grpc_content.h GRPC/grpc_stringpiece.h $(objdir)grpc_multipart_parser.o $(lib_antlr) $(lib_rpc) - $(CXX) $(CFLAGS) GRPC/grpc_content.cpp $(inc) $(inc_rpc) -o $(objdir)grpc_content.o $(def64IO) $(openmp) - -$(objdir)grpc_message.o: GRPC/grpc_message.cpp GRPC/grpc_message.h GRPC/grpc_noncopyable.h $(objdir)grpc_content.o $(lib_antlr) $(lib_rpc) - $(CXX) $(CFLAGS) GRPC/grpc_message.cpp $(inc) $(inc_rpc) $(inc_log) -o $(objdir)grpc_message.o $(def64IO) $(openmp) - -$(objdir)grpc_server_task.o: GRPC/grpc_server_task.cpp GRPC/grpc_server_task.h $(objdir)grpc_message.o GRPC/grpc_noncopyable.h $(lib_antlr) $(lib_rpc) - $(CXX) $(CFLAGS) GRPC/grpc_server_task.cpp $(inc) $(inc_rpc) $(inc_log) -o $(objdir)grpc_server_task.o $(def64IO) $(openmp) - -$(objdir)grpc_routetable.o: GRPC/grpc_routetable.cpp GRPC/grpc_routetable.h GRPC/grpc_request_handler.h GRPC/grpc_noncopyable.h GRPC/grpc_stringpiece.h $(lib_antlr) $(lib_rpc) - $(CXX) $(CFLAGS) GRPC/grpc_routetable.cpp $(inc) $(inc_rpc) $(inc_log) -o $(objdir)grpc_routetable.o $(def64IO) $(openmp) - -$(objdir)grpc_router.o: GRPC/grpc_router.cpp GRPC/grpc_router.h $(objdir)grpc_routetable.o GRPC/grpc_noncopyable.h $(objdir)grpc_server_task.o $(lib_antlr) $(lib_rpc) - $(CXX) $(CFLAGS) GRPC/grpc_router.cpp $(inc) $(inc_rpc) $(inc_log) -o $(objdir)grpc_router.o $(def64IO) $(openmp) - -$(objdir)grpc_server.o: GRPC/grpc_server.cpp GRPC/grpc_server.h $(objdir)grpc_message.o $(objdir)grpc_router.o $(lib_antlr) $(lib_rpc) - $(CXX) $(CFLAGS) GRPC/grpc_server.cpp $(inc) $(inc_rpc) $(inc_log) -o $(objdir)grpc_server.o $(def64IO) $(openmp) - -#objects in GRPC/ end - -# your gcc g++ v5.4 path -# in ./bashrc CXX should be gcc, otherwise, make pre2 will error -# see https://blog.csdn.net/weixin_34268610/article/details/89085852 -#pre1:export CXX=/usr/local/gcc-5.4.0/bin/gcc -#pre1:export CXX=/usr/local/gcc-5.4.0/bin/g++ -#pre1: -# cd tools; tar -xvf log4cplus-1.2.0.tar;cd log4cplus-1.2.0;./configure;make;sudo make install; - -pre: - rm -rf tools/rapidjson/ - rm -rf tools/antlr4-cpp-runtime-4/ - rm -rf tools/workflow - rm -rf tools/log4cplus - rm -rf tools/indicators - rm -rf tools/zlib-1.3 - rm -rf lib/libantlr4-runtime.a lib/libworkflow.a lib/liblog4cplus.a - rm -rf lib/libminizip.a; - cd tools; tar -xzvf rapidjson.tar.gz; - cd tools; tar -xzvf antlr4-cpp-runtime-4.tar.gz; - cd tools; tar -xvf indicators.tar; - cd tools; tar -xzvf workflow-0.10.3.tar.gz; - cd tools; tar -xzvf log4cplus-2.0.8.tar.gz; - cd tools; tar -xzvf zlib-1.3.tar.gz; - cd tools/antlr4-cpp-runtime-4/; cmake .; make; cp dist/libantlr4-runtime.a ../../lib/; - cd tools/workflow; make; cp _lib/libworkflow.a ../../lib/; - cd tools/log4cplus; ./configure --enable-static; make; cp .libs/liblog4cplus.a ../../lib/; - cd tools/zlib-1.3; ./configure; make; cp *.h ./include/; cd contrib/minizip; make; cp *.h ../../include/; cp libminizip.a ../../../../lib/; - -$(api_cpp): $(objdir)Socket.o - $(MAKE) -C api/http/cpp/src - -$(api_socket): $(objdir)Socket.o - $(MAKE) -C api/socket/cpp/src - - -.PHONY: clean dist tarball api_example gtest sumlines contribution test - -test: $(TARGET) $(testdir)update_test - @echo "basic build/query/add/sub/drop test......" - @bash scripts/basic_test.sh - @echo "repeatedly insertion/deletion test......" - @scripts/update_test > /dev/null - @echo "parser test......" - @bash scripts/parser_test.sh - -clean: - #rm -rf lib/libantlr4-runtime.a - $(MAKE) -C api/socket/cpp/src clean - $(MAKE) -C api/socket/cpp/example clean - $(MAKE) -C api/http/cpp/src clean - $(MAKE) -C api/http/cpp/example clean - $(MAKE) -C api/http/java/src clean - $(MAKE) -C api/http/java/example clean - #$(MAKE) -C KVstore clean - rm -rf $(exedir)g* $(objdir)*.o $(exedir).gserver* $(exedir)shutdown $(exedir)rollback - rm -rf bin/*.class - rm -rf $(testdir)update_test $(testdir)dataset_test $(testdir)transaction_test $(testdir)run_transaction $(testdir)workload $(testdir)debug_test - #rm -rf .project .cproject .settings just for eclipse - rm -rf logs/*.log - rm -rf *.out # gmon.out for gprof with -pg - rm -rf lib/libgcsr.so lib/libgpathqueryhandler.so - - -dist: clean - rm -rf *.nt *.n3 .debug/*.log .tmp/*.dat *.txt *.db - rm -rf lib/libantlr4-runtime.a - rm -rf cscope* .cproject .settings tags - rm -rf *.info - rm -rf backups/*.db - -tarball: - tar -czvf gstore.tar.gz api backups bin lib tools .debug .tmp .objs scripts data logs \ - Main Database KVstore Util Query Signature Parser Server StringIndex Trie GRPC COVERAGE \ - makefile init.conf conf.ini backup.json ipAllow.config ipDeny.config slog.properties slog.stdout.properties \ - README.md LICENSE - -APIexample: $(api_cpp) $(api_socket) - $(MAKE) -C api/http/cpp/example - $(MAKE) -C api/socket/cpp/example - -gtest: $(objdir)gtest.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gtest $(objdir)gtest.o $(objfile) $(library) $(openmp) ${ldl} - -$(objdir)gtest.o: scripts/gtest.cpp - $(CXX) $(CFLAGS) scripts/gtest.cpp $(inc) $(inc_log) -o $(objdir)gtest.o $(openmp) - -$(exedir)gadd: $(objdir)gadd.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gadd $(objdir)gadd.o $(objfile) lib/libantlr4-runtime.a $(library) $(openmp) ${ldl} - -$(objdir)gadd.o: Main/gadd.cpp - $(CXX) $(CFLAGS) Main/gadd.cpp $(inc) $(inc_log) -o $(objdir)gadd.o $(openmp) - -#$(objdir)HttpConnector: $(objdir)HttpConnector.o $(objfile) - #$(CXX) $(CFLAGS) -o $(exedir)HttpConnector $(objdir)HttpConnector.o $(objfile) lib/libantlr4-runtime.a $(library) $(inc) - -#$(objdir)HttpConnector.o: Main/HttpConnector.cpp - #$(CXX) $(CFLAGS) Main/HttpConnector.cpp $(inc) -o $(objdir)HttpConnector.o $(library) - -$(exedir)gsub: $(objdir)gsub.o $(objfile) - $(CXX) $(EXEFLAG) -o $(exedir)gsub $(objdir)gsub.o $(objfile) lib/libantlr4-runtime.a $(library) $(openmp) ${ldl} - -$(objdir)gsub.o: Main/gsub.cpp - $(CXX) $(CFLAGS) Main/gsub.cpp $(inc) $(inc_log) -o $(objdir)gsub.o $(openmp) - -sumlines: - @bash scripts/sumline.sh - -tag: - ctags -R - -idx: - find `realpath .` -name "*.h" -o -name "*.c" -o -name "*.cpp" > cscope.files - cscope -bkq #-i cscope.files - -cover: - bash scripts/cover.sh - -fulltest: - #NOTICE:compile gstore with -O2 only - #setup new virtuoso and configure it - cp scripts/full_test.sh ~ - cd ~ - bash full_test.sh - -#test the efficience of kvstore, insert/delete/search, use dbpedia170M by default -test-kvstore: - # test/kvstore_test.cpp - echo "TODO" - -# https://segmentfault.com/a/1190000008542123 -contribution: - bash scripts/contribution.sh - diff --git a/package.json b/package.json deleted file mode 100644 index fe9e70c4..00000000 --- a/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "config": { - "ghooks": { - "commit-msg": "validate-commit-msg" - } - }, - - "scripts": { - "changelog-all": "conventional-changelog -p angular -i CHANGELOG.md -w -r 0", - "changelog": "conventional-changelog -p angular -i CHANGELOG.md -w" - } -} diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 00000000..411859ca --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1,3 @@ +* +!*.* +!*/ \ No newline at end of file diff --git a/scripts/contribution.sh b/scripts/contribution.sh deleted file mode 100644 index 1e563c63..00000000 --- a/scripts/contribution.sh +++ /dev/null @@ -1,3 +0,0 @@ -# NOTICE: we adopts the scoring strategy that the lines added and subtracted by one should be accumulated as his contribution -git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 + $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done -#git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done diff --git a/scripts/init.sh b/scripts/init.sh index 15fa01ff..34fc91b4 100644 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -1,13 +1,56 @@ #!/bin/bash -### - # @Author: your name - # @Date: 2021-09-10 09:55:24 - # @LastEditTime: 2021-09-10 09:56:38 - # @LastEditors: Please set LastEditors - # @Description: In User Settings Edit - # @FilePath: /gstore/scripts/init.sh -### -#set -v -#initialize system.db -#"bin/ginit" "-make" >& /dev/null -"bin/ginit" "--make" \ No newline at end of file + +# Exit on error +set -e + +# Get the directory name of the current script +ROOT_DIR=$(dirname "${BASH_SOURCE[0]}") + +BLUE='\033[0;34m' +RED='\033[0;31m' +NC='\033[0m' + +if [ ! -d ./.tmp ]; then + echo -e "${BLUE} [INIT] Creating directories... ${NC}" + mkdir -p bin lib backups logs .tmp .debug +fi + +if [ ! -f ./init.conf ]; then + echo -e "${BLUE} [INIT] No init.conf file found. Copying default... ${NC}" + cp -n -r "${ROOT_DIR}"/../defaults/* "./" + cp -n -r "${ROOT_DIR}"/../lib/*.so* "./lib/" + if [ -d /data ] && [ ! -d ./data/system ]; then + echo -e "${BLUE} [INIT] Creating symlink... ${NC}" + ln -s /data ./data + fi + + + # Check if GSTORE_ROOT_PASSWORD is set + if [ -z "$GSTORE_ROOT_PASSWORD" ]; then + echo -e "${RED} [INIT] GSTORE_ROOT_PASSWORD is not set. We strongly recommend setting a strong password. ${NC}" + else + echo -e "${BLUE} [INIT] Setting root password... ${NC}" + # Replace the line in the file + sed -i -e "s/^#\\?\\s*root_password=.*/root_password=${GSTORE_ROOT_PASSWORD}/" init.conf + fi +fi + +if [ ! -d ./system.db ]; then + echo -e "${BLUE} [INIT] Creating system.db... ${NC}" + "${ROOT_DIR}/../bin/ginit" --make + + # list all directories in /app/data + for dir in "${ROOT_DIR}"/../data/*; do + # get the directory name + dir_name=$(basename "$dir") + if [ "$dir_name" != "system" ] && [ -d "data/$dir_name" ] && [ -f "data/$dir_name/$dir_name.nt" ] ; then + # create the database + echo -e "${BLUE} [INIT] Creating $dir_name... ${NC}" + "${ROOT_DIR}/../bin/gbuild" -db "$dir_name" -f "data/$dir_name/$dir_name.nt" + fi + done +fi + +echo -e "${BLUE} [INIT] Command:" "$@" "${NC}" + +exec "$@" \ No newline at end of file diff --git a/scripts/setup-dev.sh b/scripts/setup-dev.sh new file mode 100644 index 00000000..86416d2e --- /dev/null +++ b/scripts/setup-dev.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# Test if we are root +if [ "$(id -u)" != "0" ]; then + echo -e "\033[1;31mThis script must be run as root.\033[0m" + exit 1 +fi + +# Function to install packages using apt +install_apt_packages() { + apt-get update + apt-get install -y build-essential cmake ninja-build mold python3-pip \ + pkg-config uuid-dev libjemalloc-dev libreadline-dev libssl-dev lcov +} + +# Function to install packages using yum +install_rhel_packages() { + \$1 update + \$1 install -y @'Development Tools' cmake ninja-build python3-pip \ + pkgconfig uuid-devel jemalloc-devel readline-devel openssl-devel lcov + echo -e "\033[1;33mNote: Mold is not available in the official repositories of CentOS and RHEL.\033[0m" + echo -e "\033[1;33m You can install it manually from https://github.com/rui314/mold/releases.\033[0m" +} + +# Function to install packages using pacman +install_pacman_packages() { + pacman -Syu --needed base-devel cmake ninja mold python-pip \ + pkgconf util-linux jemalloc readline openssl lcov + # Note: In Arch Linux, 'base-devel' group includes tools similar to 'build-essential' +} + +# Check for the presence of each package manager and install packages accordingly +if command -v apt &> /dev/null; then + install_apt_packages +elif command -v dnf &> /dev/null; then + install_rhel_packages dnf +elif command -v yum &> /dev/null; then + install_rhel_packages yum +elif command -v pacman &> /dev/null; then + install_pacman_packages +else + echo "No known package manager found. Are you sure this is a supported Linux distribution?" + exit 1 +fi + +echo "Setting limits..." +echo "* - nofile 65535" | tee -a /etc/security/limits.conf +echo "* - noproc 65535" | tee -a /etc/security/limits.conf + +echo "Installation completed." \ No newline at end of file diff --git a/scripts/setup-run.sh b/scripts/setup-run.sh new file mode 100644 index 00000000..1e4991c3 --- /dev/null +++ b/scripts/setup-run.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Test if we are root +if [ "$(id -u)" != "0" ]; then + echo -e "\033[1;31mThis script must be run as root.\033[0m" + exit 1 +fi + +# Function to install packages using apt (for Ubuntu and Debian) +install_apt_packages() { + apt update + apt install -y libgomp1 libssl3 libjemalloc2 libreadline8 libuuid1 +} + +# Function to install packages using yum or dnf (for CentOS and RHEL) +install_rhel_packages() { + \$1 update + \$1 install -y libgomp openssl jemalloc readline libuuid + # Note: The versions of these libraries may differ from those in Debian/Ubuntu. +} + +# Function to install packages using pacman (for Arch Linux) +install_pacman_packages() { + pacman -Syu --needed gcc-libs openssl jemalloc readline util-linux + # Note: gcc-libs provides libgomp, and util-linux provides libuuid. +} + +# Check for the presence of each package manager and install packages accordingly +if command -v apt &> /dev/null; then + install_apt_packages +elif command -v dnf &> /dev/null; then + install_rhel_packages dnf +elif command -v yum &> /dev/null; then + install_rhel_packages yum +elif command -v pacman &> /dev/null; then + install_pacman_packages +else + echo "No known package manager found. Are you sure this is a supported Linux distribution?" + exit 1 +fi + +echo "Setting limits..." +echo "* - nofile 65535" | tee -a /etc/security/limits.conf +echo "* - noproc 65535" | tee -a /etc/security/limits.conf + +echo "Installation completed." diff --git a/scripts/setup/setup_archlinux.sh b/scripts/setup/setup_archlinux.sh deleted file mode 100644 index 58d42b75..00000000 --- a/scripts/setup/setup_archlinux.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -echo -e "\033[43;35m run this script in bash using root priviledge \033[0m \n" -#echo -e "\033[43;35m please place this script in the home directory of the gStore repository \033[0m \n" -# TODO: check versions of system software, disk size and memory -sleep 5s - -pacman -S --noconfirm gcc gcc -echo -e "g++ installed \n" - -pacman -S --noconfirm make -echo -e "make installed \n" - -#pacman -S --noconfirm jdk8-openjdk -#echo -e "openjdk 8 installed \n" - -pacman -S --noconfirm readline -echo -e "readline-devel installed \n" - -pacman -S --noconfirm boost boost-libs -echo -e "boost-libs installed \n" - -pacman -S --noconfirm curl -echo -e "libcurl-devel installed \n" - -pacman -S --noconfirm cmake -echo -e "cmake installed \n" - -pacman -S --noconfirm pkgconf -echo -e "pkgconf installed \n" - -pacman -S --noconfirm uuid -echo -e "uuid installed \n" - -echo -e "Optional: requests for python api, pthreads and curl-devel for php api, realpath for gconsole, ccache for faster compilation\n" -echo -e "For help: https://github.com/pkumod/gStore/blob/master/docs/DEMAND.md \n" -sleep 5s - -ldconfig -v -echo -e "dynamic libraries path set \n" -echo -e "\033[43;35m Please run [ldconfig -v] again if you install other softwares \033[0m \n" -sleep 5s - -#NOTICE: in Linux both threads and processes are created by vfork() in kernel with different sharing options. -#As a result, thread will consume PID and must be counted in the noproc number -echo "* - nofile 65535" >> /etc/security/limits.conf -echo "* - noproc 65535" >> /etc/security/limits.conf -#* means [for all users],noproc means [maximum prcess number],nofile means [maximum number of open files] -#- means [restrictions on both soft and hard] -echo -e "system environment variables set \n" - -echo -e "when running program if you get a [can not find -lxxx] prompt, please search this dynamic library by [ldconfig -p|grep xxx] \n" - -#sleep 5s -# compile the gStore system here -#logout # exit from root account -#exit -#make - - -# colored output: https://blog.csdn.net/david_dai_1108/article/details/70478826 - diff --git a/scripts/setup/setup_centos.sh b/scripts/setup/setup_centos.sh deleted file mode 100644 index f45fe452..00000000 --- a/scripts/setup/setup_centos.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -echo -e "\033[43;35m run this script in bash using root priviledge \033[0m \n" -#echo -e "\033[43;35m please place this script in the home directory of the gStore repository \033[0m \n" -# TODO: check versions of system software, disk size and memory -sleep 5s - -yum install -y gcc gcc-c++ -echo -e "g++ installed \n" - -yum install -y make -echo -e "make installed \n" - -#yum install -y java-1.8.0-openjdk-devel -#echo -e "openjdk 8 installed \n" - -yum install -y readline readline-devel -echo -e "readline-devel installed \n" - -yum install -y libcurl-devel openssl-devel -echo -e "libcurl-devel installed \n" - -yum install pkgconfig.x86_64 -echo -e "pkg-config installed \n" - -yum install libuuid-devel -echo -e "uuid installed \n" - -# boost-devel 1.54(or larger) can not be installed by `yum`, so we install it from source code. -#echo -e "\033[43;35m Please install boost-devel 1.54(or larger by yourself) \033[0m \n" -mkdir boost -cd boost -wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz -tar -xzvf boost_1_66_0.tar.gz && cd boost_1_66_0 -#./bootstrap.sh --prefix=/home/usrname/boost_1_43_0/boost_install -# by default: /usr/local/include and /usr/local/lib -./bootstrap.sh -./b2 -./b2 install -echo "/usr/local/lib" >> /etc/ld.so.conf -cd ../.. -rm -rf boost -echo -e "boost-devel 1.54 installed \n" -sleep 5s - -mkdir cmake -cd cmake -wget https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz -tar -xvf cmake-3.6.2.tar.gz && cd cmake-3.6.2/ -./bootstrap -make -make install -echo -e "cmake 3.6.2 installed \n" -cd ../.. -rm -rf cmake -sleep 5s - -echo -e "Optional: requests for python api, pthreads and curl-devel for php api, realpath for gconsole, ccache for faster compilation\n" -echo -e "For help: https://github.com/pkumod/gStore/blob/master/docs/DEMAND.md \n" -sleep 5s - -ldconfig -v -echo -e "dynamic libraries path set \n" -echo -e "\033[43;35m Please run [ldconfig -v] again if you install other softwares \033[0m \n" -sleep 5s - -#NOTICE: in Linux both threads and processes are created by vfork() in kernel with different sharing options. -#As a result, thread will consume PID and must be counted in the noproc number -echo "* - nofile 65535" >> /etc/security/limits.conf -echo "* - noproc 65535" >> /etc/security/limits.conf -#* means [for all users],noproc means [maximum prcess number],nofile means [maximum number of open files] -#- means [restrictions on both soft and hard] -echo -e "system environment variables set \n" - -echo -e "when running program if you get a [can not find -lxxx] prompt, please search this dynamic library by [ldconfig -p|grep xxx] \n" - - -#sleep 5s -# compile the gStore system here -#logout # exit from root account -#exit -#make - - -# colored output: https://blog.csdn.net/david_dai_1108/article/details/70478826 - diff --git a/scripts/setup/setup_ubuntu.sh b/scripts/setup/setup_ubuntu.sh deleted file mode 100644 index 807b4269..00000000 --- a/scripts/setup/setup_ubuntu.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -echo -e "\033[43;35m run this script in bash using root priviledge \033[0m \n" -#echo -e "\033[43;35m please place this script in the home directory of the gStore repository \033[0m \n" -# TODO: check versions of system software, disk size and memory -sleep 5s - -apt install -y aptitude -echo -e "aptitude installed to search softwares conveniently \n" - -apt install -y gcc g++ -echo -e "g++ installed \n" - -apt install -y make -echo -e "make installed \n" - -#apt install -y openjdk-8-jdk -#echo -e "openjdk 8 installed \n" - -apt install -y libreadline-dev -echo -e "readline-devel installed \n" - -apt install -y libboost-all-dev -echo -e "libboost-all-dev installed \n" - -apt install -y curl libcurl4 libcurl4-openssl-dev libssl-dev -echo -e "libcurl-devel installed \n" - -apt install -y cmake -echo -e "cmake installed \n" - -apt install -y pkg-config -echo -e "pkg-config installed \n" - -apt install -y uuid-dev -echo -e "uuid installed \n" - -echo -e "Optional: requests for python api, pthreads and curl-devel for php api, realpath for gconsole, ccache for faster compilation\n" -echo -e "For help: https://github.com/pkumod/gStore/blob/master/docs/DEMAND.md \n" -sleep 5s - -ldconfig -v -echo -e "dynamic libraries path set \n" -echo -e "\033[43;35m Please run [ldconfig -v] again if you install other softwares \033[0m \n" -sleep 5s - -#NOTICE: in Linux both threads and processes are created by vfork() in kernel with different sharing options. -#As a result, thread will consume PID and must be counted in the noproc number -echo "* - nofile 65535" >> /etc/security/limits.conf -echo "* - noproc 65535" >> /etc/security/limits.conf -#* means [for all users],noproc means [maximum prcess number],nofile means [maximum number of open files] -#- means [restrictions on both soft and hard] -echo -e "system environment variables set \n" - -echo -e "when running program if you get a [can not find -lxxx] prompt, please search this dynamic library by [ldconfig -p|grep xxx] \n" - -#sleep 5s -# compile the gStore system here -#logout # exit from root account -#exit -#make - - -# colored output: https://blog.csdn.net/david_dai_1108/article/details/70478826 - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..c5e2c311 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,12 @@ +add_subdirectory(Connector) +add_subdirectory(Database) +add_subdirectory(GRPC) +add_subdirectory(KVstore) +add_subdirectory(Main) +add_subdirectory(Parser) +add_subdirectory(Query) +add_subdirectory(Server) +add_subdirectory(Signature) +add_subdirectory(StringIndex) +add_subdirectory(Trie) +add_subdirectory(Util) \ No newline at end of file diff --git a/src/Connector b/src/Connector new file mode 120000 index 00000000..7185be3a --- /dev/null +++ b/src/Connector @@ -0,0 +1 @@ +../api/http/cpp/src/ \ No newline at end of file diff --git a/src/Database/CMakeLists.txt b/src/Database/CMakeLists.txt new file mode 100644 index 00000000..d4e1a6c6 --- /dev/null +++ b/src/Database/CMakeLists.txt @@ -0,0 +1,19 @@ +add_library(gstore_database OBJECT + Database.cpp + Join.cpp + CSR.cpp + TableOperator.cpp + PlanTree.cpp + PlanGenerator.cpp + Executor.cpp + Optimizer.cpp + Txn_manager.cpp +) + +add_library(gcsr SHARED + CSR.cpp +) +# set fPIC for gscr +set_property(TARGET gcsr PROPERTY POSITION_INDEPENDENT_CODE ON) +add_dependencies(gcsr prepare) +install(TARGETS gcsr DESTINATION ${GSTORE_LIB_DIR}) \ No newline at end of file diff --git a/Database/CSR.cpp b/src/Database/CSR.cpp similarity index 100% rename from Database/CSR.cpp rename to src/Database/CSR.cpp diff --git a/Database/CSR.h b/src/Database/CSR.h similarity index 100% rename from Database/CSR.h rename to src/Database/CSR.h diff --git a/Database/Database.cpp b/src/Database/Database.cpp similarity index 100% rename from Database/Database.cpp rename to src/Database/Database.cpp diff --git a/Database/Database.h b/src/Database/Database.h similarity index 100% rename from Database/Database.h rename to src/Database/Database.h diff --git a/Database/Executor.cpp b/src/Database/Executor.cpp similarity index 100% rename from Database/Executor.cpp rename to src/Database/Executor.cpp diff --git a/Database/Executor.h b/src/Database/Executor.h similarity index 100% rename from Database/Executor.h rename to src/Database/Executor.h diff --git a/Database/Join.cpp b/src/Database/Join.cpp similarity index 100% rename from Database/Join.cpp rename to src/Database/Join.cpp diff --git a/Database/Join.h b/src/Database/Join.h similarity index 100% rename from Database/Join.h rename to src/Database/Join.h diff --git a/Database/Optimizer.cpp b/src/Database/Optimizer.cpp similarity index 100% rename from Database/Optimizer.cpp rename to src/Database/Optimizer.cpp diff --git a/Database/Optimizer.h b/src/Database/Optimizer.h similarity index 100% rename from Database/Optimizer.h rename to src/Database/Optimizer.h diff --git a/Database/OptimizerDebug.h b/src/Database/OptimizerDebug.h similarity index 100% rename from Database/OptimizerDebug.h rename to src/Database/OptimizerDebug.h diff --git a/Database/PlanGenerator.cpp b/src/Database/PlanGenerator.cpp similarity index 99% rename from Database/PlanGenerator.cpp rename to src/Database/PlanGenerator.cpp index 95888fea..1688491f 100644 --- a/Database/PlanGenerator.cpp +++ b/src/Database/PlanGenerator.cpp @@ -1222,6 +1222,7 @@ PlanTree *PlanGenerator::GetPlan(bool use_binary_join) { default: cout << "Error in PlanGenerator::get_plan, query strategy error!" << endl; assert(false); + return nullptr; // never reach here } } diff --git a/Database/PlanGenerator.h b/src/Database/PlanGenerator.h similarity index 100% rename from Database/PlanGenerator.h rename to src/Database/PlanGenerator.h diff --git a/Database/PlanTree.cpp b/src/Database/PlanTree.cpp similarity index 100% rename from Database/PlanTree.cpp rename to src/Database/PlanTree.cpp diff --git a/Database/PlanTree.h b/src/Database/PlanTree.h similarity index 100% rename from Database/PlanTree.h rename to src/Database/PlanTree.h diff --git a/Database/ResultTrigger.cpp b/src/Database/ResultTrigger.cpp similarity index 100% rename from Database/ResultTrigger.cpp rename to src/Database/ResultTrigger.cpp diff --git a/Database/ResultTrigger.h b/src/Database/ResultTrigger.h similarity index 100% rename from Database/ResultTrigger.h rename to src/Database/ResultTrigger.h diff --git a/Database/Strategy.cpp b/src/Database/Strategy.cpp similarity index 100% rename from Database/Strategy.cpp rename to src/Database/Strategy.cpp diff --git a/Database/Strategy.h b/src/Database/Strategy.h similarity index 100% rename from Database/Strategy.h rename to src/Database/Strategy.h diff --git a/Database/TableOperator.cpp b/src/Database/TableOperator.cpp similarity index 100% rename from Database/TableOperator.cpp rename to src/Database/TableOperator.cpp diff --git a/Database/TableOperator.h b/src/Database/TableOperator.h similarity index 100% rename from Database/TableOperator.h rename to src/Database/TableOperator.h diff --git a/Database/Txn_manager.cpp b/src/Database/Txn_manager.cpp similarity index 100% rename from Database/Txn_manager.cpp rename to src/Database/Txn_manager.cpp diff --git a/Database/Txn_manager.h b/src/Database/Txn_manager.h similarity index 100% rename from Database/Txn_manager.h rename to src/Database/Txn_manager.h diff --git a/GRPC/APIUtil.cpp b/src/GRPC/APIUtil.cpp similarity index 100% rename from GRPC/APIUtil.cpp rename to src/GRPC/APIUtil.cpp diff --git a/GRPC/APIUtil.h b/src/GRPC/APIUtil.h similarity index 100% rename from GRPC/APIUtil.h rename to src/GRPC/APIUtil.h diff --git a/src/GRPC/CMakeLists.txt b/src/GRPC/CMakeLists.txt new file mode 100644 index 00000000..d365c80f --- /dev/null +++ b/src/GRPC/CMakeLists.txt @@ -0,0 +1,11 @@ +add_library(gstore_grpc OBJECT + APIUtil.cpp + grpc_status_code.cpp + grpc_multipart_parser.cpp + grpc_content.cpp + grpc_message.cpp + grpc_server_task.cpp + grpc_routetable.cpp + grpc_router.cpp + grpc_server.cpp +) \ No newline at end of file diff --git a/GRPC/grpc_content.cpp b/src/GRPC/grpc_content.cpp similarity index 100% rename from GRPC/grpc_content.cpp rename to src/GRPC/grpc_content.cpp diff --git a/GRPC/grpc_content.h b/src/GRPC/grpc_content.h similarity index 100% rename from GRPC/grpc_content.h rename to src/GRPC/grpc_content.h diff --git a/GRPC/grpc_message.cpp b/src/GRPC/grpc_message.cpp similarity index 100% rename from GRPC/grpc_message.cpp rename to src/GRPC/grpc_message.cpp diff --git a/GRPC/grpc_message.h b/src/GRPC/grpc_message.h similarity index 97% rename from GRPC/grpc_message.h rename to src/GRPC/grpc_message.h index 84934642..3be079d1 100644 --- a/GRPC/grpc_message.h +++ b/src/GRPC/grpc_message.h @@ -4,9 +4,9 @@ #include "workflow/HttpMessage.h" #include "workflow/WFTaskFactory.h" -#include "../tools/rapidjson/document.h" -#include "../tools/rapidjson/writer.h" -#include "../tools/rapidjson/stringbuffer.h" +#include "rapidjson/document.h" +#include "rapidjson/writer.h" +#include "rapidjson/stringbuffer.h" #include "grpc_noncopyable.h" #include "grpc_content.h" diff --git a/GRPC/grpc_multipart_parser.cpp b/src/GRPC/grpc_multipart_parser.cpp similarity index 100% rename from GRPC/grpc_multipart_parser.cpp rename to src/GRPC/grpc_multipart_parser.cpp diff --git a/GRPC/grpc_multipart_parser.h b/src/GRPC/grpc_multipart_parser.h similarity index 100% rename from GRPC/grpc_multipart_parser.h rename to src/GRPC/grpc_multipart_parser.h diff --git a/GRPC/grpc_noncopyable.h b/src/GRPC/grpc_noncopyable.h similarity index 100% rename from GRPC/grpc_noncopyable.h rename to src/GRPC/grpc_noncopyable.h diff --git a/GRPC/grpc_operation.h b/src/GRPC/grpc_operation.h similarity index 100% rename from GRPC/grpc_operation.h rename to src/GRPC/grpc_operation.h diff --git a/GRPC/grpc_request_handler.h b/src/GRPC/grpc_request_handler.h similarity index 100% rename from GRPC/grpc_request_handler.h rename to src/GRPC/grpc_request_handler.h diff --git a/GRPC/grpc_router.cpp b/src/GRPC/grpc_router.cpp similarity index 100% rename from GRPC/grpc_router.cpp rename to src/GRPC/grpc_router.cpp diff --git a/GRPC/grpc_router.h b/src/GRPC/grpc_router.h similarity index 100% rename from GRPC/grpc_router.h rename to src/GRPC/grpc_router.h diff --git a/GRPC/grpc_routetable.cpp b/src/GRPC/grpc_routetable.cpp similarity index 100% rename from GRPC/grpc_routetable.cpp rename to src/GRPC/grpc_routetable.cpp diff --git a/GRPC/grpc_routetable.h b/src/GRPC/grpc_routetable.h similarity index 100% rename from GRPC/grpc_routetable.h rename to src/GRPC/grpc_routetable.h diff --git a/GRPC/grpc_server.cpp b/src/GRPC/grpc_server.cpp similarity index 100% rename from GRPC/grpc_server.cpp rename to src/GRPC/grpc_server.cpp diff --git a/GRPC/grpc_server.h b/src/GRPC/grpc_server.h similarity index 100% rename from GRPC/grpc_server.h rename to src/GRPC/grpc_server.h diff --git a/GRPC/grpc_server_task.cpp b/src/GRPC/grpc_server_task.cpp similarity index 100% rename from GRPC/grpc_server_task.cpp rename to src/GRPC/grpc_server_task.cpp diff --git a/GRPC/grpc_server_task.h b/src/GRPC/grpc_server_task.h similarity index 100% rename from GRPC/grpc_server_task.h rename to src/GRPC/grpc_server_task.h diff --git a/GRPC/grpc_status_code.cpp b/src/GRPC/grpc_status_code.cpp similarity index 100% rename from GRPC/grpc_status_code.cpp rename to src/GRPC/grpc_status_code.cpp diff --git a/GRPC/grpc_status_code.h b/src/GRPC/grpc_status_code.h similarity index 100% rename from GRPC/grpc_status_code.h rename to src/GRPC/grpc_status_code.h diff --git a/GRPC/grpc_stringpiece.h b/src/GRPC/grpc_stringpiece.h similarity index 100% rename from GRPC/grpc_stringpiece.h rename to src/GRPC/grpc_stringpiece.h diff --git a/src/KVstore/CMakeLists.txt b/src/KVstore/CMakeLists.txt new file mode 100644 index 00000000..5336a858 --- /dev/null +++ b/src/KVstore/CMakeLists.txt @@ -0,0 +1,36 @@ +add_library(gstore_isarray OBJECT + ISArray/ISArray.cpp + ISArray/ISBlockManager.cpp + ISArray/ISEntry.cpp +) + +add_library(gstore_ivarray OBJECT + IVArray/IVArray.cpp + IVArray/IVBlockManager.cpp + IVArray/IVEntry.cpp +) + +add_library(gstore_sitree OBJECT + SITree/SITree.cpp + SITree/storage/SIStorage.cpp + SITree/heap/SIHeap.cpp + SITree/node/SIIntlNode.cpp + SITree/node/SILeafNode.cpp + SITree/node/SINode.cpp +) + +add_library(gstore_kvstore OBJECT + KVstore.cpp + SITree/SITree.cpp + SITree/storage/SIStorage.cpp + SITree/heap/SIHeap.cpp + SITree/node/SIIntlNode.cpp + SITree/node/SILeafNode.cpp + SITree/node/SINode.cpp + ISArray/ISArray.cpp + ISArray/ISBlockManager.cpp + ISArray/ISEntry.cpp + IVArray/IVArray.cpp + IVArray/IVBlockManager.cpp + IVArray/IVEntry.cpp +) \ No newline at end of file diff --git a/KVstore/ISArray/ISArray.cpp b/src/KVstore/ISArray/ISArray.cpp similarity index 100% rename from KVstore/ISArray/ISArray.cpp rename to src/KVstore/ISArray/ISArray.cpp diff --git a/KVstore/ISArray/ISArray.h b/src/KVstore/ISArray/ISArray.h similarity index 100% rename from KVstore/ISArray/ISArray.h rename to src/KVstore/ISArray/ISArray.h diff --git a/KVstore/ISArray/ISBlockManager.cpp b/src/KVstore/ISArray/ISBlockManager.cpp similarity index 100% rename from KVstore/ISArray/ISBlockManager.cpp rename to src/KVstore/ISArray/ISBlockManager.cpp diff --git a/KVstore/ISArray/ISBlockManager.h b/src/KVstore/ISArray/ISBlockManager.h similarity index 100% rename from KVstore/ISArray/ISBlockManager.h rename to src/KVstore/ISArray/ISBlockManager.h diff --git a/KVstore/ISArray/ISEntry.cpp b/src/KVstore/ISArray/ISEntry.cpp similarity index 100% rename from KVstore/ISArray/ISEntry.cpp rename to src/KVstore/ISArray/ISEntry.cpp diff --git a/KVstore/ISArray/ISEntry.h b/src/KVstore/ISArray/ISEntry.h similarity index 100% rename from KVstore/ISArray/ISEntry.h rename to src/KVstore/ISArray/ISEntry.h diff --git a/KVstore/ISTree/ISTree.cpp b/src/KVstore/ISTree/ISTree.cpp similarity index 100% rename from KVstore/ISTree/ISTree.cpp rename to src/KVstore/ISTree/ISTree.cpp diff --git a/KVstore/ISTree/ISTree.h b/src/KVstore/ISTree/ISTree.h similarity index 100% rename from KVstore/ISTree/ISTree.h rename to src/KVstore/ISTree/ISTree.h diff --git a/KVstore/ISTree/heap/ISHeap.cpp b/src/KVstore/ISTree/heap/ISHeap.cpp similarity index 100% rename from KVstore/ISTree/heap/ISHeap.cpp rename to src/KVstore/ISTree/heap/ISHeap.cpp diff --git a/KVstore/ISTree/heap/ISHeap.h b/src/KVstore/ISTree/heap/ISHeap.h similarity index 100% rename from KVstore/ISTree/heap/ISHeap.h rename to src/KVstore/ISTree/heap/ISHeap.h diff --git a/KVstore/ISTree/node/ISIntlNode.cpp b/src/KVstore/ISTree/node/ISIntlNode.cpp similarity index 100% rename from KVstore/ISTree/node/ISIntlNode.cpp rename to src/KVstore/ISTree/node/ISIntlNode.cpp diff --git a/KVstore/ISTree/node/ISIntlNode.h b/src/KVstore/ISTree/node/ISIntlNode.h similarity index 100% rename from KVstore/ISTree/node/ISIntlNode.h rename to src/KVstore/ISTree/node/ISIntlNode.h diff --git a/KVstore/ISTree/node/ISLeafNode.cpp b/src/KVstore/ISTree/node/ISLeafNode.cpp similarity index 100% rename from KVstore/ISTree/node/ISLeafNode.cpp rename to src/KVstore/ISTree/node/ISLeafNode.cpp diff --git a/KVstore/ISTree/node/ISLeafNode.h b/src/KVstore/ISTree/node/ISLeafNode.h similarity index 100% rename from KVstore/ISTree/node/ISLeafNode.h rename to src/KVstore/ISTree/node/ISLeafNode.h diff --git a/KVstore/ISTree/node/ISNode.cpp b/src/KVstore/ISTree/node/ISNode.cpp similarity index 100% rename from KVstore/ISTree/node/ISNode.cpp rename to src/KVstore/ISTree/node/ISNode.cpp diff --git a/KVstore/ISTree/node/ISNode.h b/src/KVstore/ISTree/node/ISNode.h similarity index 100% rename from KVstore/ISTree/node/ISNode.h rename to src/KVstore/ISTree/node/ISNode.h diff --git a/KVstore/ISTree/storage/ISStorage.cpp b/src/KVstore/ISTree/storage/ISStorage.cpp similarity index 100% rename from KVstore/ISTree/storage/ISStorage.cpp rename to src/KVstore/ISTree/storage/ISStorage.cpp diff --git a/KVstore/ISTree/storage/ISStorage.h b/src/KVstore/ISTree/storage/ISStorage.h similarity index 100% rename from KVstore/ISTree/storage/ISStorage.h rename to src/KVstore/ISTree/storage/ISStorage.h diff --git a/KVstore/IVArray/IVArray.cpp b/src/KVstore/IVArray/IVArray.cpp similarity index 100% rename from KVstore/IVArray/IVArray.cpp rename to src/KVstore/IVArray/IVArray.cpp diff --git a/KVstore/IVArray/IVArray.h b/src/KVstore/IVArray/IVArray.h similarity index 100% rename from KVstore/IVArray/IVArray.h rename to src/KVstore/IVArray/IVArray.h diff --git a/KVstore/IVArray/IVBlockManager.cpp b/src/KVstore/IVArray/IVBlockManager.cpp similarity index 100% rename from KVstore/IVArray/IVBlockManager.cpp rename to src/KVstore/IVArray/IVBlockManager.cpp diff --git a/KVstore/IVArray/IVBlockManager.h b/src/KVstore/IVArray/IVBlockManager.h similarity index 100% rename from KVstore/IVArray/IVBlockManager.h rename to src/KVstore/IVArray/IVBlockManager.h diff --git a/KVstore/IVArray/IVCacheManager.cpp b/src/KVstore/IVArray/IVCacheManager.cpp similarity index 100% rename from KVstore/IVArray/IVCacheManager.cpp rename to src/KVstore/IVArray/IVCacheManager.cpp diff --git a/KVstore/IVArray/IVCacheManager.h b/src/KVstore/IVArray/IVCacheManager.h similarity index 100% rename from KVstore/IVArray/IVCacheManager.h rename to src/KVstore/IVArray/IVCacheManager.h diff --git a/KVstore/IVArray/IVEntry.cpp b/src/KVstore/IVArray/IVEntry.cpp similarity index 100% rename from KVstore/IVArray/IVEntry.cpp rename to src/KVstore/IVArray/IVEntry.cpp diff --git a/KVstore/IVArray/IVEntry.h b/src/KVstore/IVArray/IVEntry.h similarity index 100% rename from KVstore/IVArray/IVEntry.h rename to src/KVstore/IVArray/IVEntry.h diff --git a/KVstore/IVTree/IVTree.cpp b/src/KVstore/IVTree/IVTree.cpp similarity index 100% rename from KVstore/IVTree/IVTree.cpp rename to src/KVstore/IVTree/IVTree.cpp diff --git a/KVstore/IVTree/IVTree.h b/src/KVstore/IVTree/IVTree.h similarity index 100% rename from KVstore/IVTree/IVTree.h rename to src/KVstore/IVTree/IVTree.h diff --git a/KVstore/IVTree/heap/IVHeap.cpp b/src/KVstore/IVTree/heap/IVHeap.cpp similarity index 100% rename from KVstore/IVTree/heap/IVHeap.cpp rename to src/KVstore/IVTree/heap/IVHeap.cpp diff --git a/KVstore/IVTree/heap/IVHeap.h b/src/KVstore/IVTree/heap/IVHeap.h similarity index 100% rename from KVstore/IVTree/heap/IVHeap.h rename to src/KVstore/IVTree/heap/IVHeap.h diff --git a/KVstore/IVTree/node/IVIntlNode.cpp b/src/KVstore/IVTree/node/IVIntlNode.cpp similarity index 100% rename from KVstore/IVTree/node/IVIntlNode.cpp rename to src/KVstore/IVTree/node/IVIntlNode.cpp diff --git a/KVstore/IVTree/node/IVIntlNode.h b/src/KVstore/IVTree/node/IVIntlNode.h similarity index 100% rename from KVstore/IVTree/node/IVIntlNode.h rename to src/KVstore/IVTree/node/IVIntlNode.h diff --git a/KVstore/IVTree/node/IVLeafNode.cpp b/src/KVstore/IVTree/node/IVLeafNode.cpp similarity index 100% rename from KVstore/IVTree/node/IVLeafNode.cpp rename to src/KVstore/IVTree/node/IVLeafNode.cpp diff --git a/KVstore/IVTree/node/IVLeafNode.h b/src/KVstore/IVTree/node/IVLeafNode.h similarity index 100% rename from KVstore/IVTree/node/IVLeafNode.h rename to src/KVstore/IVTree/node/IVLeafNode.h diff --git a/KVstore/IVTree/node/IVNode.cpp b/src/KVstore/IVTree/node/IVNode.cpp similarity index 100% rename from KVstore/IVTree/node/IVNode.cpp rename to src/KVstore/IVTree/node/IVNode.cpp diff --git a/KVstore/IVTree/node/IVNode.h b/src/KVstore/IVTree/node/IVNode.h similarity index 100% rename from KVstore/IVTree/node/IVNode.h rename to src/KVstore/IVTree/node/IVNode.h diff --git a/KVstore/IVTree/storage/IVStorage.cpp b/src/KVstore/IVTree/storage/IVStorage.cpp similarity index 100% rename from KVstore/IVTree/storage/IVStorage.cpp rename to src/KVstore/IVTree/storage/IVStorage.cpp diff --git a/KVstore/IVTree/storage/IVStorage.h b/src/KVstore/IVTree/storage/IVStorage.h similarity index 100% rename from KVstore/IVTree/storage/IVStorage.h rename to src/KVstore/IVTree/storage/IVStorage.h diff --git a/KVstore/KVstore.cpp b/src/KVstore/KVstore.cpp similarity index 100% rename from KVstore/KVstore.cpp rename to src/KVstore/KVstore.cpp diff --git a/KVstore/KVstore.h b/src/KVstore/KVstore.h similarity index 100% rename from KVstore/KVstore.h rename to src/KVstore/KVstore.h diff --git a/KVstore/SITree/SITree.cpp b/src/KVstore/SITree/SITree.cpp similarity index 100% rename from KVstore/SITree/SITree.cpp rename to src/KVstore/SITree/SITree.cpp diff --git a/KVstore/SITree/SITree.h b/src/KVstore/SITree/SITree.h similarity index 100% rename from KVstore/SITree/SITree.h rename to src/KVstore/SITree/SITree.h diff --git a/KVstore/SITree/heap/SIHeap.cpp b/src/KVstore/SITree/heap/SIHeap.cpp similarity index 100% rename from KVstore/SITree/heap/SIHeap.cpp rename to src/KVstore/SITree/heap/SIHeap.cpp diff --git a/KVstore/SITree/heap/SIHeap.h b/src/KVstore/SITree/heap/SIHeap.h similarity index 100% rename from KVstore/SITree/heap/SIHeap.h rename to src/KVstore/SITree/heap/SIHeap.h diff --git a/KVstore/SITree/node/SIIntlNode.cpp b/src/KVstore/SITree/node/SIIntlNode.cpp similarity index 100% rename from KVstore/SITree/node/SIIntlNode.cpp rename to src/KVstore/SITree/node/SIIntlNode.cpp diff --git a/KVstore/SITree/node/SIIntlNode.h b/src/KVstore/SITree/node/SIIntlNode.h similarity index 100% rename from KVstore/SITree/node/SIIntlNode.h rename to src/KVstore/SITree/node/SIIntlNode.h diff --git a/KVstore/SITree/node/SILeafNode.cpp b/src/KVstore/SITree/node/SILeafNode.cpp similarity index 100% rename from KVstore/SITree/node/SILeafNode.cpp rename to src/KVstore/SITree/node/SILeafNode.cpp diff --git a/KVstore/SITree/node/SILeafNode.h b/src/KVstore/SITree/node/SILeafNode.h similarity index 100% rename from KVstore/SITree/node/SILeafNode.h rename to src/KVstore/SITree/node/SILeafNode.h diff --git a/KVstore/SITree/node/SINode.cpp b/src/KVstore/SITree/node/SINode.cpp similarity index 100% rename from KVstore/SITree/node/SINode.cpp rename to src/KVstore/SITree/node/SINode.cpp diff --git a/KVstore/SITree/node/SINode.h b/src/KVstore/SITree/node/SINode.h similarity index 100% rename from KVstore/SITree/node/SINode.h rename to src/KVstore/SITree/node/SINode.h diff --git a/KVstore/SITree/storage/SIStorage.cpp b/src/KVstore/SITree/storage/SIStorage.cpp similarity index 100% rename from KVstore/SITree/storage/SIStorage.cpp rename to src/KVstore/SITree/storage/SIStorage.cpp diff --git a/KVstore/SITree/storage/SIStorage.h b/src/KVstore/SITree/storage/SIStorage.h similarity index 100% rename from KVstore/SITree/storage/SIStorage.h rename to src/KVstore/SITree/storage/SIStorage.h diff --git a/KVstore/Tree.h b/src/KVstore/Tree.h similarity index 100% rename from KVstore/Tree.h rename to src/KVstore/Tree.h diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt new file mode 100644 index 00000000..b645da78 --- /dev/null +++ b/src/Main/CMakeLists.txt @@ -0,0 +1,128 @@ +set(LIB_EXE + # Conan Deps + Boost::system + Boost::regex + Boost::thread + minizip::minizip + OpenSSL::SSL + OpenSSL::Crypto + indicators::indicators + rapidjson + log4cplus::log4cplus + CURL::libcurl + # System Deps + OpenMP::OpenMP_CXX + ${LIB_JEMALLOC} + ${LIB_READLINE} + Threads::Threads + # Unmanaged Deps + antlr4-runtime + workflow + Backward::Backward +) + +# set definition if has debug info +if (CMAKE_BUILD_TYPE MATCHES "Deb") + LIST(APPEND LIB_EXE + libdwarf::libdwarf + libelf::libelf + ) +endif () + +set(OBJ_EXE + $ + $ + $ + $ + $ + $ + $ + $ + $ +) + +add_executable(gadd gadd.cpp ${OBJ_EXE}) +target_link_libraries(gadd ${LIB_EXE}) + +add_executable(gsub gsub.cpp ${OBJ_EXE}) +target_link_libraries(gsub ${LIB_EXE}) + +add_executable(gexport gexport.cpp ${OBJ_EXE}) +target_link_libraries(gexport ${LIB_EXE}) + +add_executable(gdrop gdrop.cpp ${OBJ_EXE}) +target_link_libraries(gdrop ${LIB_EXE}) + +add_executable(ginit ginit.cpp ${OBJ_EXE}) +target_link_libraries(ginit ${LIB_EXE}) + +add_executable(shutdown shutdown.cpp $ $) +target_link_libraries(shutdown ${LIB_EXE}) + +add_executable(gmonitor gmonitor.cpp ${OBJ_EXE}) +target_link_libraries(gmonitor ${LIB_EXE}) + +add_executable(gshow gshow.cpp ${OBJ_EXE}) +target_link_libraries(gshow ${LIB_EXE}) + +add_executable(gbuild gbuild.cpp ${OBJ_EXE}) +target_link_libraries(gbuild ${LIB_EXE}) + +add_executable(gquery gquery.cpp ${OBJ_EXE}) +# seems gquery does need readline +target_compile_definitions(gquery PRIVATE READLINE_ON) +target_link_libraries(gquery ${LIB_EXE}) + +add_executable(gserver gserver.cpp ${OBJ_EXE}) +target_link_libraries(gserver ${LIB_EXE}) + +add_executable(gserver_backup_scheduler gserver_backup_scheduler.cpp ${OBJ_EXE}) +target_link_libraries(gserver_backup_scheduler ${LIB_EXE}) + +add_executable(ghttp ghttp.cpp ${OBJ_EXE} $ $) +target_link_libraries(ghttp ${LIB_EXE}) + +add_executable(grpc grpc.cpp ${OBJ_EXE} $) +target_link_libraries(grpc ${LIB_EXE} workflow OpenSSL::SSL OpenSSL::Crypto) + +add_executable(gbackup gbackup.cpp ${OBJ_EXE}) +target_link_libraries(gbackup ${LIB_EXE}) + +add_executable(grestore grestore.cpp ${OBJ_EXE}) +target_link_libraries(grestore ${LIB_EXE}) + +add_executable(gpara gpara.cpp ${OBJ_EXE} $) +target_link_libraries(gpara ${LIB_EXE}) + +add_executable(rollback rollback.cpp ${OBJ_EXE} $) +target_link_libraries(rollback ${LIB_EXE}) + +add_executable(gconsole gconsole.cpp ${OBJ_EXE}) +target_link_libraries(gconsole ${LIB_EXE}) + +SET(gstore_binaries + gadd + gsub + gexport + gdrop + ginit + shutdown + gmonitor + gshow + gbuild + gquery + gserver + gserver_backup_scheduler + ghttp + grpc + gbackup + grestore + gpara + rollback + gconsole +) + +foreach (gstore_binary ${gstore_binaries}) + add_dependencies(${gstore_binary} prepare) + install(TARGETS ${gstore_binary} DESTINATION ${GSTORE_EXE_DIR}) +endforeach () \ No newline at end of file diff --git a/Main/gadd.cpp b/src/Main/gadd.cpp similarity index 100% rename from Main/gadd.cpp rename to src/Main/gadd.cpp diff --git a/Main/gapiserver.cpp b/src/Main/gapiserver.cpp similarity index 94% rename from Main/gapiserver.cpp rename to src/Main/gapiserver.cpp index 5131eeda..bd0a28b4 100644 --- a/Main/gapiserver.cpp +++ b/src/Main/gapiserver.cpp @@ -25,27 +25,36 @@ #include #include #include -#include "workflow/HttpMessage.h" -#include "workflow/HttpUtil.h" -#include "workflow/WFServer.h" -#include "workflow/WFHttpServer.h" -#include "workflow/WFFacilities.h" -#include "../Util/WebUrl.h" #include +#include + +#include "../Util/WebUrl.h" + #include "../Util/Util_New.h" #include "../Database/Database.h" #include "../Database/Txn_manager.h" #include "../Util/Util.h" -#include "../tools/rapidjson/document.h" -#include "../tools/rapidjson/prettywriter.h" -#include "../tools/rapidjson/writer.h" -#include "../tools/rapidjson/stringbuffer.h" -#include +// #include "../tools/rapidjson/document.h" +// #include "../tools/rapidjson/prettywriter.h" +// #include "../tools/rapidjson/writer.h" +// #include "../tools/rapidjson/stringbuffer.h" + #include "../Util/IPWhiteList.h" #include "../Util/IPBlackList.h" //#include "../../Util/IPWhiteList.h" //#include "../../Util/IPBlackList.h" +// 3rd party dependencies managed by Conan +#include "rapidjson/document.h" +#include "rapidjson/prettywriter.h" +#include "rapidjson/writer.h" +#include "rapidjson/stringbuffer.h" +#include "workflow/HttpMessage.h" +#include "workflow/HttpUtil.h" +#include "workflow/WFServer.h" +#include "workflow/WFHttpServer.h" +#include "workflow/WFFacilities.h" + #define THREAD_NUM 30 #define MAX_DATABASE_NUM 100 #define MAX_USER_NUM 1000 @@ -498,13 +507,13 @@ string getArgValue(int argc, char* argv[], string argname, string default_value) } /// -/// API Server apiserver -p 9999 -ipallow y -ipdeny y -db lubm -advanced y -/// в£ -/// -p)˿ -/// -db(ѡ):ĬΪsystem -/// -ipallow(ѡ):ip -/// -ipdeny(ѡ):ip -/// -advanced(ѡ):Ƿø߼ܣload CSR) +/// ����API Server �������� apiserver -p 9999 -ipallow y -ipdeny y -db lubm -advanced y +/// ���в������£� +/// -p������)���˿� +/// -db(��ѡ):Ĭ��Ϊsystem +/// -ipallow(��ѡ):ip������ +/// -ipdeny(��ѡ):ip������ +/// -advanced(��ѡ):�Ƿ����ø߼����ܣ�load CSR) /// /// /// diff --git a/Main/gbackup.cpp b/src/Main/gbackup.cpp similarity index 100% rename from Main/gbackup.cpp rename to src/Main/gbackup.cpp diff --git a/Main/gbuild.cpp b/src/Main/gbuild.cpp similarity index 100% rename from Main/gbuild.cpp rename to src/Main/gbuild.cpp diff --git a/Main/gclient.cpp b/src/Main/gclient.cpp similarity index 100% rename from Main/gclient.cpp rename to src/Main/gclient.cpp diff --git a/Main/gconsole.cpp b/src/Main/gconsole.cpp similarity index 100% rename from Main/gconsole.cpp rename to src/Main/gconsole.cpp diff --git a/Main/gdrop.cpp b/src/Main/gdrop.cpp similarity index 100% rename from Main/gdrop.cpp rename to src/Main/gdrop.cpp diff --git a/Main/gexport.cpp b/src/Main/gexport.cpp similarity index 96% rename from Main/gexport.cpp rename to src/Main/gexport.cpp index 08a508d5..e67a722a 100644 --- a/Main/gexport.cpp +++ b/src/Main/gexport.cpp @@ -1,211 +1,211 @@ -/*============================================================================= -# Filename: gexport.cpp -# Author: suxunbin,liwenjie -# Last Modified: 2021-8-15 23:15:16 -# Description: export a database to get .nt file -=============================================================================*/ - -#include "../Database/Database.h" -#include "../Util/Util.h" -#include "../Util/CompressFileUtil.h" -//#include "../Util/Slog.h" -using namespace std; - -int -main(int argc, char * argv[]) -{ - Util util; - //Log.init("slog.properties"); - string _db_home = util.getConfigureValue("db_home"); - string _db_suffix = util.getConfigureValue("db_suffix"); - size_t _len_suffix = _db_suffix.length(); - string db_name; - string filepath; - if (argc < 2) - { - /*cout << "please input the complete command:\t" << endl; - cout << "\t bin/gadd -h" << endl;*/ - cout<<"Invalid arguments! Input \"bin/gexport -h\" for help."< _len_suffix && db_name.substr(len - _len_suffix, _len_suffix) == _db_suffix) - { - cout<<"The database name can not end with " + _db_suffix + "! Input \"bin/gexport -h\" for help." << endl; - return 0; - } - filepath= Util::getArgValue(argc, argv, "f", "file"); - std::string zip_path; - if (filepath.empty()) - { - filepath = db_name + "_" + Util::get_timestamp() + ".nt"; - zip_path = db_name + "_" + Util::get_timestamp() + ".zip"; - } - else - { - if (filepath[filepath.length() - 1] != '/') - filepath = filepath + "/"; - if (!Util::dir_exist(filepath)) - Util::create_dirs(filepath); - zip_path = filepath + db_name + "_" + Util::get_timestamp() + ".zip"; - filepath = filepath + db_name + "_" + Util::get_timestamp() + ".nt"; - } - cout << "gexport..." << endl; - - Database system_db("system"); - system_db.load(); - - string sparql = "ASK WHERE{<" + db_name + "> \"already_built\".}"; - ResultSet ask_rs; - FILE* ask_ofp = stdout; - // todo: check this return value - system_db.query(sparql, ask_rs, ask_ofp); - // int ret = system_db.query(sparql, ask_rs, ask_ofp); - if (ask_rs.answer[0][0] == "\"false\"^^") - { - cout<<"The database does not exist."< 3 && db_name.substr(len - 3, 3) == ".db") - { - cout << "The database name can not end with .db" << endl; - return 0; - } - filepath = db_name + ".nt"; - } - else if (argc == 3) - { - db_name = argv[1]; - int len = db_name.length(); - if (db_name.length() > 3 && db_name.substr(len - 3, 3) == ".db") - { - cout << "The database name can not end with .db" << endl; - return 0; - } - filepath = argv[2]; - if(filepath[filepath.length()-1] != '/') - filepath = filepath + "/"; - if(!boost::filesystem::exists(filepath)) - boost::filesystem::create_directories(filepath); - filepath = filepath + db_name + ".nt"; - } - - cout << "gexport..." << endl; - - Database system_db("system"); - system_db.load(); - - string sparql = "ASK WHERE{<" + db_name + "> \"already_built\".}"; - ResultSet ask_rs; - FILE* ask_ofp = stdout; - int ret = system_db.query(sparql, ask_rs, ask_ofp); - if (ask_rs.answer[0][0] == "\"false\"^^") - { - cout << "The database does not exist." << endl; - return 0; - } - - cout << "start exporting the database......" << endl; - Database _db(db_name); - _db.load(); - cout << "finish loading" << endl; - - FILE* ofp = fopen(filepath.c_str(), "w"); - _db.export_db(ofp); - fflush(ofp); - fclose(ofp); - ofp = NULL; - cout << "finish exporting the database." << endl; - - return 0;*/ -} +/*============================================================================= +# Filename: gexport.cpp +# Author: suxunbin,liwenjie +# Last Modified: 2021-8-15 23:15:16 +# Description: export a database to get .nt file +=============================================================================*/ + +#include "../Database/Database.h" +#include "../Util/Util.h" +#include "../Util/CompressFileUtil.h" +//#include "../Util/Slog.h" +using namespace std; + +int +main(int argc, char * argv[]) +{ + Util util; + //Log.init("slog.properties"); + string _db_home = util.getConfigureValue("db_home"); + string _db_suffix = util.getConfigureValue("db_suffix"); + size_t _len_suffix = _db_suffix.length(); + string db_name; + string filepath; + if (argc < 2) + { + /*cout << "please input the complete command:\t" << endl; + cout << "\t bin/gadd -h" << endl;*/ + cout<<"Invalid arguments! Input \"bin/gexport -h\" for help."< _len_suffix && db_name.substr(len - _len_suffix, _len_suffix) == _db_suffix) + { + cout<<"The database name can not end with " + _db_suffix + "! Input \"bin/gexport -h\" for help." << endl; + return 0; + } + filepath= Util::getArgValue(argc, argv, "f", "file"); + std::string zip_path; + if (filepath.empty()) + { + filepath = db_name + "_" + Util::get_timestamp() + ".nt"; + zip_path = db_name + "_" + Util::get_timestamp() + ".zip"; + } + else + { + if (filepath[filepath.length() - 1] != '/') + filepath = filepath + "/"; + if (!Util::dir_exist(filepath)) + Util::create_dirs(filepath); + zip_path = filepath + db_name + "_" + Util::get_timestamp() + ".zip"; + filepath = filepath + db_name + "_" + Util::get_timestamp() + ".nt"; + } + cout << "gexport..." << endl; + + Database system_db("system"); + system_db.load(); + + string sparql = "ASK WHERE{<" + db_name + "> \"already_built\".}"; + ResultSet ask_rs; + FILE* ask_ofp = stdout; + // todo: check this return value + system_db.query(sparql, ask_rs, ask_ofp); + // int ret = system_db.query(sparql, ask_rs, ask_ofp); + if (ask_rs.answer[0][0] == "\"false\"^^") + { + cout<<"The database does not exist."< 3 && db_name.substr(len - 3, 3) == ".db") + { + cout << "The database name can not end with .db" << endl; + return 0; + } + filepath = db_name + ".nt"; + } + else if (argc == 3) + { + db_name = argv[1]; + int len = db_name.length(); + if (db_name.length() > 3 && db_name.substr(len - 3, 3) == ".db") + { + cout << "The database name can not end with .db" << endl; + return 0; + } + filepath = argv[2]; + if(filepath[filepath.length()-1] != '/') + filepath = filepath + "/"; + if(!boost::filesystem::exists(filepath)) + boost::filesystem::create_directories(filepath); + filepath = filepath + db_name + ".nt"; + } + + cout << "gexport..." << endl; + + Database system_db("system"); + system_db.load(); + + string sparql = "ASK WHERE{<" + db_name + "> \"already_built\".}"; + ResultSet ask_rs; + FILE* ask_ofp = stdout; + int ret = system_db.query(sparql, ask_rs, ask_ofp); + if (ask_rs.answer[0][0] == "\"false\"^^") + { + cout << "The database does not exist." << endl; + return 0; + } + + cout << "start exporting the database......" << endl; + Database _db(db_name); + _db.load(); + cout << "finish loading" << endl; + + FILE* ofp = fopen(filepath.c_str(), "w"); + _db.export_db(ofp); + fflush(ofp); + fclose(ofp); + ofp = NULL; + cout << "finish exporting the database." << endl; + + return 0;*/ +} diff --git a/Main/ghttp.cpp b/src/Main/ghttp.cpp similarity index 99% rename from Main/ghttp.cpp rename to src/Main/ghttp.cpp index 89ed7f0b..feb71885 100644 --- a/Main/ghttp.cpp +++ b/src/Main/ghttp.cpp @@ -2265,8 +2265,6 @@ void query_thread_new(const shared_ptr &request, const shar *response << buffer; } free(compress_); - apiUtil->unlock_database(db_name); - SLOG_DEBUG("query complete!"); return; } else diff --git a/Main/ginit.cpp b/src/Main/ginit.cpp similarity index 100% rename from Main/ginit.cpp rename to src/Main/ginit.cpp diff --git a/Main/gmonitor.cpp b/src/Main/gmonitor.cpp similarity index 100% rename from Main/gmonitor.cpp rename to src/Main/gmonitor.cpp diff --git a/Main/gpara.cpp b/src/Main/gpara.cpp similarity index 100% rename from Main/gpara.cpp rename to src/Main/gpara.cpp diff --git a/Main/gquery.cpp b/src/Main/gquery.cpp similarity index 100% rename from Main/gquery.cpp rename to src/Main/gquery.cpp diff --git a/Main/grestore.cpp b/src/Main/grestore.cpp similarity index 100% rename from Main/grestore.cpp rename to src/Main/grestore.cpp diff --git a/Main/grpc.cpp b/src/Main/grpc.cpp similarity index 99% rename from Main/grpc.cpp rename to src/Main/grpc.cpp index 58eef9af..23e01ef5 100644 --- a/Main/grpc.cpp +++ b/src/Main/grpc.cpp @@ -406,7 +406,7 @@ void shutdown(const GRPCReq *request, GRPCResp *response) if (request->contentType() == APPLICATION_JSON) //for application/json { Json &json = request->json(); - json_data.CopyFrom(json, allocator, true); + json_data.CopyFrom(json, allocator); } else if (request->contentType() == APPLICATION_URLENCODED) //for applicaiton/x-www-form-urlencoded { @@ -743,7 +743,7 @@ void api(const GRPCReq *request, GRPCResp *response) if (request->contentType() == APPLICATION_JSON) //for application/json { Json &json = request->json(); - json_data.CopyFrom(json, allocator, true); + json_data.CopyFrom(json, allocator); } else if (request->contentType() == APPLICATION_URLENCODED) //for applicaiton/x-www-form-urlencoded { diff --git a/Main/gserver.cpp b/src/Main/gserver.cpp similarity index 100% rename from Main/gserver.cpp rename to src/Main/gserver.cpp diff --git a/Main/gserver_backup_scheduler.cpp b/src/Main/gserver_backup_scheduler.cpp similarity index 100% rename from Main/gserver_backup_scheduler.cpp rename to src/Main/gserver_backup_scheduler.cpp diff --git a/Main/gshow.cpp b/src/Main/gshow.cpp similarity index 100% rename from Main/gshow.cpp rename to src/Main/gshow.cpp diff --git a/Main/gsub.cpp b/src/Main/gsub.cpp similarity index 100% rename from Main/gsub.cpp rename to src/Main/gsub.cpp diff --git a/Main/rollback.cpp b/src/Main/rollback.cpp similarity index 100% rename from Main/rollback.cpp rename to src/Main/rollback.cpp diff --git a/Main/shutdown.cpp b/src/Main/shutdown.cpp similarity index 99% rename from Main/shutdown.cpp rename to src/Main/shutdown.cpp index 3b9506e8..efbbde24 100644 --- a/Main/shutdown.cpp +++ b/src/Main/shutdown.cpp @@ -6,7 +6,7 @@ # Description: used to stop the ghttp server =============================================================================*/ -#include "../api/http/cpp/src/GstoreConnector.h" +#include "../Connector/GstoreConnector.h" #include "../Util/Util.h" using namespace std; diff --git a/src/Parser/CMakeLists.txt b/src/Parser/CMakeLists.txt new file mode 100644 index 00000000..f93ebb3d --- /dev/null +++ b/src/Parser/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(gstore_parser OBJECT + SPARQL/SPARQLParser.cpp + SPARQL/SPARQLLexer.cpp + TurtleParser.cpp + RDFParser.cpp + QueryParser.cpp +) diff --git a/Parser/QueryParser.cpp b/src/Parser/QueryParser.cpp similarity index 100% rename from Parser/QueryParser.cpp rename to src/Parser/QueryParser.cpp diff --git a/Parser/QueryParser.h b/src/Parser/QueryParser.h similarity index 100% rename from Parser/QueryParser.h rename to src/Parser/QueryParser.h diff --git a/Parser/RDFParser.cpp b/src/Parser/RDFParser.cpp similarity index 99% rename from Parser/RDFParser.cpp rename to src/Parser/RDFParser.cpp index 9d21dd18..c5bf99f8 100644 --- a/Parser/RDFParser.cpp +++ b/src/Parser/RDFParser.cpp @@ -3,7 +3,7 @@ # Author: Yue Pang # Mail: michelle.py@pku.edu.cn # Last Modified: 2021-08-03 15:28 CST -# Description: implements the class for parsing RDF data during build based on +# Description: implements the class for parsing RDF data during build based on RDF-3X's TurtleParser =============================================================================*/ #include "RDFParser.h" diff --git a/Parser/RDFParser.h b/src/Parser/RDFParser.h similarity index 98% rename from Parser/RDFParser.h rename to src/Parser/RDFParser.h index 92799b44..8a80762f 100644 --- a/Parser/RDFParser.h +++ b/src/Parser/RDFParser.h @@ -3,7 +3,7 @@ # Author: Yue Pang # Mail: michelle.py@pku.edu.cn # Last Modified: 2021-08-03 15:28 CST -# Description: defines the class for parsing RDF data during build based on +# Description: defines the class for parsing RDF data during build based on RDF-3X's TurtleParser =============================================================================*/ diff --git a/Parser/SPARQL/SPARQL.g4 b/src/Parser/SPARQL/SPARQL.g4 similarity index 100% rename from Parser/SPARQL/SPARQL.g4 rename to src/Parser/SPARQL/SPARQL.g4 diff --git a/Parser/SPARQL/SPARQL.interp b/src/Parser/SPARQL/SPARQL.interp similarity index 100% rename from Parser/SPARQL/SPARQL.interp rename to src/Parser/SPARQL/SPARQL.interp diff --git a/Parser/SPARQL/SPARQL.tokens b/src/Parser/SPARQL/SPARQL.tokens similarity index 100% rename from Parser/SPARQL/SPARQL.tokens rename to src/Parser/SPARQL/SPARQL.tokens diff --git a/Parser/SPARQL/SPARQLBaseListener.cpp b/src/Parser/SPARQL/SPARQLBaseListener.cpp similarity index 100% rename from Parser/SPARQL/SPARQLBaseListener.cpp rename to src/Parser/SPARQL/SPARQLBaseListener.cpp diff --git a/Parser/SPARQL/SPARQLBaseListener.h b/src/Parser/SPARQL/SPARQLBaseListener.h similarity index 100% rename from Parser/SPARQL/SPARQLBaseListener.h rename to src/Parser/SPARQL/SPARQLBaseListener.h diff --git a/Parser/SPARQL/SPARQLBaseVisitor.cpp b/src/Parser/SPARQL/SPARQLBaseVisitor.cpp similarity index 100% rename from Parser/SPARQL/SPARQLBaseVisitor.cpp rename to src/Parser/SPARQL/SPARQLBaseVisitor.cpp diff --git a/Parser/SPARQL/SPARQLBaseVisitor.h b/src/Parser/SPARQL/SPARQLBaseVisitor.h similarity index 100% rename from Parser/SPARQL/SPARQLBaseVisitor.h rename to src/Parser/SPARQL/SPARQLBaseVisitor.h diff --git a/Parser/SPARQL/SPARQLLexer.cpp b/src/Parser/SPARQL/SPARQLLexer.cpp similarity index 100% rename from Parser/SPARQL/SPARQLLexer.cpp rename to src/Parser/SPARQL/SPARQLLexer.cpp diff --git a/Parser/SPARQL/SPARQLLexer.h b/src/Parser/SPARQL/SPARQLLexer.h similarity index 100% rename from Parser/SPARQL/SPARQLLexer.h rename to src/Parser/SPARQL/SPARQLLexer.h diff --git a/Parser/SPARQL/SPARQLLexer.interp b/src/Parser/SPARQL/SPARQLLexer.interp similarity index 100% rename from Parser/SPARQL/SPARQLLexer.interp rename to src/Parser/SPARQL/SPARQLLexer.interp diff --git a/Parser/SPARQL/SPARQLListener.cpp b/src/Parser/SPARQL/SPARQLListener.cpp similarity index 100% rename from Parser/SPARQL/SPARQLListener.cpp rename to src/Parser/SPARQL/SPARQLListener.cpp diff --git a/Parser/SPARQL/SPARQLListener.h b/src/Parser/SPARQL/SPARQLListener.h similarity index 100% rename from Parser/SPARQL/SPARQLListener.h rename to src/Parser/SPARQL/SPARQLListener.h diff --git a/Parser/SPARQL/SPARQLParser.cpp b/src/Parser/SPARQL/SPARQLParser.cpp similarity index 100% rename from Parser/SPARQL/SPARQLParser.cpp rename to src/Parser/SPARQL/SPARQLParser.cpp diff --git a/Parser/SPARQL/SPARQLParser.h b/src/Parser/SPARQL/SPARQLParser.h similarity index 100% rename from Parser/SPARQL/SPARQLParser.h rename to src/Parser/SPARQL/SPARQLParser.h diff --git a/Parser/SPARQL/SPARQLVisitor.h b/src/Parser/SPARQL/SPARQLVisitor.h similarity index 100% rename from Parser/SPARQL/SPARQLVisitor.h rename to src/Parser/SPARQL/SPARQLVisitor.h diff --git a/Parser/TurtleParser.cpp b/src/Parser/TurtleParser.cpp similarity index 100% rename from Parser/TurtleParser.cpp rename to src/Parser/TurtleParser.cpp diff --git a/Parser/TurtleParser.h b/src/Parser/TurtleParser.h similarity index 100% rename from Parser/TurtleParser.h rename to src/Parser/TurtleParser.h diff --git a/Parser/Type.h b/src/Parser/Type.h similarity index 100% rename from Parser/Type.h rename to src/Parser/Type.h diff --git a/Query/BGPQuery.cpp b/src/Query/BGPQuery.cpp similarity index 100% rename from Query/BGPQuery.cpp rename to src/Query/BGPQuery.cpp diff --git a/Query/BGPQuery.h b/src/Query/BGPQuery.h similarity index 100% rename from Query/BGPQuery.h rename to src/Query/BGPQuery.h diff --git a/Query/BasicQuery.cpp b/src/Query/BasicQuery.cpp similarity index 100% rename from Query/BasicQuery.cpp rename to src/Query/BasicQuery.cpp diff --git a/Query/BasicQuery.h b/src/Query/BasicQuery.h similarity index 99% rename from Query/BasicQuery.h rename to src/Query/BasicQuery.h index f150d63e..b02a87c2 100644 --- a/Query/BasicQuery.h +++ b/src/Query/BasicQuery.h @@ -272,7 +272,7 @@ class BasicQuery bool isReady(int _var) const; void setReady(int _var); - // encode relative signature data of the query graph + // encode relative signature data of the query graph bool encodeBasicQuery(KVstore* _p_kvstore, const std::vector& _query_var); bool getEncodeBasicQueryResult() const; diff --git a/src/Query/CMakeLists.txt b/src/Query/CMakeLists.txt new file mode 100644 index 00000000..80537e45 --- /dev/null +++ b/src/Query/CMakeLists.txt @@ -0,0 +1,33 @@ +add_library(gstore_topk OBJECT + topk/DPB/DynamicTrie.cpp + topk/DPB/OrderedList.cpp + topk/DPB/Pool.cpp + topk/DPBTopKUtil.cpp + topk/TopKSearchPlan.cpp + topk/TopKUtil.cpp +) + +add_library(gstore_query OBJECT + SPARQLquery.cpp + BasicQuery.cpp + ResultSet.cpp + IDList.cpp + DFSPlan.cpp + Varset.cpp + QueryTree.cpp + TempResult.cpp + QueryCache.cpp + GeneralEvaluation.cpp + PathQueryHandler.cpp + BGPQuery.cpp + FilterPlan.cpp +) + +add_library(gpathqueryhandler SHARED + PathQueryHandler.cpp +) +# set fPIC +set_property(TARGET gpathqueryhandler PROPERTY POSITION_INDEPENDENT_CODE ON) +target_link_libraries(gpathqueryhandler gcsr) +add_dependencies(gpathqueryhandler gcsr prepare) +install(TARGETS gpathqueryhandler DESTINATION ${GSTORE_LIB_DIR}) \ No newline at end of file diff --git a/Query/DFSPlan.cpp b/src/Query/DFSPlan.cpp similarity index 100% rename from Query/DFSPlan.cpp rename to src/Query/DFSPlan.cpp diff --git a/Query/DFSPlan.h b/src/Query/DFSPlan.h similarity index 100% rename from Query/DFSPlan.h rename to src/Query/DFSPlan.h diff --git a/Query/FilterPlan.cpp b/src/Query/FilterPlan.cpp similarity index 100% rename from Query/FilterPlan.cpp rename to src/Query/FilterPlan.cpp diff --git a/Query/FilterPlan.h b/src/Query/FilterPlan.h similarity index 100% rename from Query/FilterPlan.h rename to src/Query/FilterPlan.h diff --git a/Query/GeneralEvaluation.cpp b/src/Query/GeneralEvaluation.cpp similarity index 100% rename from Query/GeneralEvaluation.cpp rename to src/Query/GeneralEvaluation.cpp diff --git a/Query/GeneralEvaluation.h b/src/Query/GeneralEvaluation.h similarity index 100% rename from Query/GeneralEvaluation.h rename to src/Query/GeneralEvaluation.h diff --git a/Query/IDList.cpp b/src/Query/IDList.cpp similarity index 100% rename from Query/IDList.cpp rename to src/Query/IDList.cpp diff --git a/Query/IDList.h b/src/Query/IDList.h similarity index 100% rename from Query/IDList.h rename to src/Query/IDList.h diff --git a/Query/PathQueryHandler.cpp b/src/Query/PathQueryHandler.cpp similarity index 100% rename from Query/PathQueryHandler.cpp rename to src/Query/PathQueryHandler.cpp diff --git a/Query/PathQueryHandler.h b/src/Query/PathQueryHandler.h similarity index 100% rename from Query/PathQueryHandler.h rename to src/Query/PathQueryHandler.h diff --git a/Query/QueryCache.cpp b/src/Query/QueryCache.cpp similarity index 100% rename from Query/QueryCache.cpp rename to src/Query/QueryCache.cpp diff --git a/Query/QueryCache.h b/src/Query/QueryCache.h similarity index 100% rename from Query/QueryCache.h rename to src/Query/QueryCache.h diff --git a/Query/QueryTree.cpp b/src/Query/QueryTree.cpp similarity index 100% rename from Query/QueryTree.cpp rename to src/Query/QueryTree.cpp diff --git a/Query/QueryTree.h b/src/Query/QueryTree.h similarity index 100% rename from Query/QueryTree.h rename to src/Query/QueryTree.h diff --git a/Query/RegexExpression.h b/src/Query/RegexExpression.h similarity index 100% rename from Query/RegexExpression.h rename to src/Query/RegexExpression.h diff --git a/Query/ResultFilter.cpp b/src/Query/ResultFilter.cpp similarity index 100% rename from Query/ResultFilter.cpp rename to src/Query/ResultFilter.cpp diff --git a/Query/ResultFilter.h b/src/Query/ResultFilter.h similarity index 100% rename from Query/ResultFilter.h rename to src/Query/ResultFilter.h diff --git a/Query/ResultSet.cpp b/src/Query/ResultSet.cpp similarity index 100% rename from Query/ResultSet.cpp rename to src/Query/ResultSet.cpp diff --git a/Query/ResultSet.h b/src/Query/ResultSet.h similarity index 100% rename from Query/ResultSet.h rename to src/Query/ResultSet.h diff --git a/Query/SPARQLquery.cpp b/src/Query/SPARQLquery.cpp similarity index 100% rename from Query/SPARQLquery.cpp rename to src/Query/SPARQLquery.cpp diff --git a/Query/SPARQLquery.h b/src/Query/SPARQLquery.h similarity index 100% rename from Query/SPARQLquery.h rename to src/Query/SPARQLquery.h diff --git a/Query/TempResult.cpp b/src/Query/TempResult.cpp similarity index 100% rename from Query/TempResult.cpp rename to src/Query/TempResult.cpp diff --git a/Query/TempResult.h b/src/Query/TempResult.h similarity index 100% rename from Query/TempResult.h rename to src/Query/TempResult.h diff --git a/Query/Varset.cpp b/src/Query/Varset.cpp similarity index 100% rename from Query/Varset.cpp rename to src/Query/Varset.cpp diff --git a/Query/Varset.h b/src/Query/Varset.h similarity index 100% rename from Query/Varset.h rename to src/Query/Varset.h diff --git a/Query/topk/DPB/DynamicTrie.cpp b/src/Query/topk/DPB/DynamicTrie.cpp similarity index 100% rename from Query/topk/DPB/DynamicTrie.cpp rename to src/Query/topk/DPB/DynamicTrie.cpp diff --git a/Query/topk/DPB/DynamicTrie.h b/src/Query/topk/DPB/DynamicTrie.h similarity index 100% rename from Query/topk/DPB/DynamicTrie.h rename to src/Query/topk/DPB/DynamicTrie.h diff --git a/Query/topk/DPB/OrderedList.cpp b/src/Query/topk/DPB/OrderedList.cpp similarity index 100% rename from Query/topk/DPB/OrderedList.cpp rename to src/Query/topk/DPB/OrderedList.cpp diff --git a/Query/topk/DPB/OrderedList.h b/src/Query/topk/DPB/OrderedList.h similarity index 100% rename from Query/topk/DPB/OrderedList.h rename to src/Query/topk/DPB/OrderedList.h diff --git a/Query/topk/DPB/Pool.cpp b/src/Query/topk/DPB/Pool.cpp similarity index 100% rename from Query/topk/DPB/Pool.cpp rename to src/Query/topk/DPB/Pool.cpp diff --git a/Query/topk/DPB/Pool.h b/src/Query/topk/DPB/Pool.h similarity index 100% rename from Query/topk/DPB/Pool.h rename to src/Query/topk/DPB/Pool.h diff --git a/Query/topk/DPBTopKUtil.cpp b/src/Query/topk/DPBTopKUtil.cpp similarity index 100% rename from Query/topk/DPBTopKUtil.cpp rename to src/Query/topk/DPBTopKUtil.cpp diff --git a/Query/topk/DPBTopKUtil.h b/src/Query/topk/DPBTopKUtil.h similarity index 100% rename from Query/topk/DPBTopKUtil.h rename to src/Query/topk/DPBTopKUtil.h diff --git a/Query/topk/MinMaxHeap.hpp b/src/Query/topk/MinMaxHeap.hpp similarity index 100% rename from Query/topk/MinMaxHeap.hpp rename to src/Query/topk/MinMaxHeap.hpp diff --git a/Query/topk/TopKSearchPlan.cpp b/src/Query/topk/TopKSearchPlan.cpp similarity index 100% rename from Query/topk/TopKSearchPlan.cpp rename to src/Query/topk/TopKSearchPlan.cpp diff --git a/Query/topk/TopKSearchPlan.h b/src/Query/topk/TopKSearchPlan.h similarity index 100% rename from Query/topk/TopKSearchPlan.h rename to src/Query/topk/TopKSearchPlan.h diff --git a/Query/topk/TopKUtil.cpp b/src/Query/topk/TopKUtil.cpp similarity index 100% rename from Query/topk/TopKUtil.cpp rename to src/Query/topk/TopKUtil.cpp diff --git a/Query/topk/TopKUtil.h b/src/Query/topk/TopKUtil.h similarity index 100% rename from Query/topk/TopKUtil.h rename to src/Query/topk/TopKUtil.h diff --git a/Server/APIServer.h b/src/Server/APIServer.h similarity index 100% rename from Server/APIServer.h rename to src/Server/APIServer.h diff --git a/src/Server/CMakeLists.txt b/src/Server/CMakeLists.txt new file mode 100644 index 00000000..f726d0b1 --- /dev/null +++ b/src/Server/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(gstore_server OBJECT + Operation.cpp + Server.cpp + Socket.cpp +) \ No newline at end of file diff --git a/Server/LICENSE b/src/Server/LICENSE similarity index 100% rename from Server/LICENSE rename to src/Server/LICENSE diff --git a/Server/MultipartParser.hpp b/src/Server/MultipartParser.hpp similarity index 100% rename from Server/MultipartParser.hpp rename to src/Server/MultipartParser.hpp diff --git a/Server/Operation.cpp b/src/Server/Operation.cpp similarity index 100% rename from Server/Operation.cpp rename to src/Server/Operation.cpp diff --git a/Server/Operation.h b/src/Server/Operation.h similarity index 100% rename from Server/Operation.h rename to src/Server/Operation.h diff --git a/Server/README.md b/src/Server/README.md similarity index 100% rename from Server/README.md rename to src/Server/README.md diff --git a/Server/Server.cpp b/src/Server/Server.cpp similarity index 100% rename from Server/Server.cpp rename to src/Server/Server.cpp diff --git a/Server/Server.h b/src/Server/Server.h similarity index 100% rename from Server/Server.h rename to src/Server/Server.h diff --git a/Server/Socket.cpp b/src/Server/Socket.cpp similarity index 100% rename from Server/Socket.cpp rename to src/Server/Socket.cpp diff --git a/Server/Socket.h b/src/Server/Socket.h similarity index 87% rename from Server/Socket.h rename to src/Server/Socket.h index 8acdd2d9..c68bbf6d 100644 --- a/Server/Socket.h +++ b/src/Server/Socket.h @@ -9,11 +9,17 @@ #define _SERVER_SOCKET_H #include "../Util/Util.h" -#include "../tools/rapidjson/document.h" -#include "../tools/rapidjson/prettywriter.h" -#include "../tools/rapidjson/writer.h" -#include "../tools/rapidjson/stringbuffer.h" -#include "../tools/rapidjson/error/en.h" + +// #include "../tools/rapidjson/document.h" +// #include "../tools/rapidjson/prettywriter.h" +// #include "../tools/rapidjson/writer.h" +// #include "../tools/rapidjson/stringbuffer.h" +// #include "../tools/rapidjson/error/en.h" +#include "rapidjson/document.h" +#include "rapidjson/prettywriter.h" +#include "rapidjson/writer.h" +#include "rapidjson/stringbuffer.h" +#include "rapidjson/error/en.h" #define BUFFER_SIZE 131072 /**< The socket send/recv buffer size. */ diff --git a/Server/client_http.hpp b/src/Server/client_http.hpp similarity index 100% rename from Server/client_http.hpp rename to src/Server/client_http.hpp diff --git a/Server/server_http.hpp b/src/Server/server_http.hpp similarity index 100% rename from Server/server_http.hpp rename to src/Server/server_http.hpp diff --git a/Server/web/PHPAPIExample.php b/src/Server/web/PHPAPIExample.php similarity index 100% rename from Server/web/PHPAPIExample.php rename to src/Server/web/PHPAPIExample.php diff --git a/Server/web/admin.html b/src/Server/web/admin.html similarity index 100% rename from Server/web/admin.html rename to src/Server/web/admin.html diff --git a/Server/web/admin.js b/src/Server/web/admin.js similarity index 100% rename from Server/web/admin.js rename to src/Server/web/admin.js diff --git a/Server/web/admin_root.html b/src/Server/web/admin_root.html similarity index 100% rename from Server/web/admin_root.html rename to src/Server/web/admin_root.html diff --git a/Server/web/api.html b/src/Server/web/api.html similarity index 99% rename from Server/web/api.html rename to src/Server/web/api.html index 29ec8b65..61775386 100644 Binary files a/Server/web/api.html and b/src/Server/web/api.html differ diff --git a/Server/web/css/bootstrap.min.css b/src/Server/web/css/bootstrap.min.css similarity index 100% rename from Server/web/css/bootstrap.min.css rename to src/Server/web/css/bootstrap.min.css diff --git a/Server/web/css/cateIns.css b/src/Server/web/css/cateIns.css similarity index 100% rename from Server/web/css/cateIns.css rename to src/Server/web/css/cateIns.css diff --git a/Server/web/css/d3-context-menu.css b/src/Server/web/css/d3-context-menu.css similarity index 100% rename from Server/web/css/d3-context-menu.css rename to src/Server/web/css/d3-context-menu.css diff --git a/Server/web/css/material-design-color-palette.min.css b/src/Server/web/css/material-design-color-palette.min.css similarity index 100% rename from Server/web/css/material-design-color-palette.min.css rename to src/Server/web/css/material-design-color-palette.min.css diff --git a/Server/web/css/spinner.scss b/src/Server/web/css/spinner.scss similarity index 100% rename from Server/web/css/spinner.scss rename to src/Server/web/css/spinner.scss diff --git a/Server/web/css/typeaheadjs.css b/src/Server/web/css/typeaheadjs.css similarity index 100% rename from Server/web/css/typeaheadjs.css rename to src/Server/web/css/typeaheadjs.css diff --git a/Server/web/dbpedia/index.html b/src/Server/web/dbpedia/index.html similarity index 100% rename from Server/web/dbpedia/index.html rename to src/Server/web/dbpedia/index.html diff --git a/Server/web/dbpedia/index.js b/src/Server/web/dbpedia/index.js similarity index 100% rename from Server/web/dbpedia/index.js rename to src/Server/web/dbpedia/index.js diff --git a/Server/web/favicon.ico b/src/Server/web/favicon.ico similarity index 100% rename from Server/web/favicon.ico rename to src/Server/web/favicon.ico diff --git a/Server/web/freebase/index.html b/src/Server/web/freebase/index.html similarity index 100% rename from Server/web/freebase/index.html rename to src/Server/web/freebase/index.html diff --git a/Server/web/freebase/index.js b/src/Server/web/freebase/index.js similarity index 100% rename from Server/web/freebase/index.js rename to src/Server/web/freebase/index.js diff --git a/Server/web/index.html b/src/Server/web/index.html similarity index 100% rename from Server/web/index.html rename to src/Server/web/index.html diff --git a/Server/web/index.js b/src/Server/web/index.js similarity index 100% rename from Server/web/index.js rename to src/Server/web/index.js diff --git a/Server/web/js/bootstrap.min.js b/src/Server/web/js/bootstrap.min.js similarity index 100% rename from Server/web/js/bootstrap.min.js rename to src/Server/web/js/bootstrap.min.js diff --git a/Server/web/js/categoryInstance.js b/src/Server/web/js/categoryInstance.js similarity index 100% rename from Server/web/js/categoryInstance.js rename to src/Server/web/js/categoryInstance.js diff --git a/Server/web/js/comm_hz.js b/src/Server/web/js/comm_hz.js similarity index 100% rename from Server/web/js/comm_hz.js rename to src/Server/web/js/comm_hz.js diff --git a/Server/web/js/d3-context-menu.js b/src/Server/web/js/d3-context-menu.js similarity index 100% rename from Server/web/js/d3-context-menu.js rename to src/Server/web/js/d3-context-menu.js diff --git a/Server/web/js/d3.min.js b/src/Server/web/js/d3.min.js similarity index 100% rename from Server/web/js/d3.min.js rename to src/Server/web/js/d3.min.js diff --git a/Server/web/js/entityTriple.js b/src/Server/web/js/entityTriple.js similarity index 100% rename from Server/web/js/entityTriple.js rename to src/Server/web/js/entityTriple.js diff --git a/Server/web/js/handlebars.js b/src/Server/web/js/handlebars.js similarity index 99% rename from Server/web/js/handlebars.js rename to src/Server/web/js/handlebars.js index 1c64ca50..f72da56e 100644 --- a/Server/web/js/handlebars.js +++ b/src/Server/web/js/handlebars.js @@ -42,7 +42,7 @@ var __module4__ = (function() { return __exports__; })(); -// handlebars/utils.js +// handlebars/scripts.js var __module3__ = (function(__dependency1__) { "use strict"; var __exports__ = {}; diff --git a/Server/web/js/jquery.min.js b/src/Server/web/js/jquery.min.js similarity index 100% rename from Server/web/js/jquery.min.js rename to src/Server/web/js/jquery.min.js diff --git a/Server/web/js/progressbar.js b/src/Server/web/js/progressbar.js similarity index 99% rename from Server/web/js/progressbar.js rename to src/Server/web/js/progressbar.js index d3ffd0f7..029deadb 100644 --- a/Server/web/js/progressbar.js +++ b/src/Server/web/js/progressbar.js @@ -1659,7 +1659,7 @@ var Tweenable = (function () { // Circle shaped progress bar var Shape = require('./shape'); -var utils = require('./utils'); +var utils = require('./scripts'); var Circle = function Circle(container, options) { // Use two arcs to form a circle @@ -1701,7 +1701,7 @@ module.exports = Circle; // Line shaped progress bar var Shape = require('./shape'); -var utils = require('./utils'); +var utils = require('./scripts'); var Line = function Line(container, options) { this._pathTemplate = 'M 0,{center} L 100,{center}'; @@ -1743,15 +1743,15 @@ module.exports = { // Undocumented. Shape: require('./shape'), - // Internal utils, undocumented. - utils: require('./utils') + // Internal scripts, undocumented. + utils: require('./scripts') }; },{"./circle":2,"./line":3,"./path":5,"./semicircle":6,"./shape":7,"./utils":8}],5:[function(require,module,exports){ // Lower level API to animate any kind of svg path var Tweenable = require('shifty'); -var utils = require('./utils'); +var utils = require('./scripts'); var EASING_ALIASES = { easeIn: 'easeInCubic', @@ -1921,7 +1921,7 @@ module.exports = Path; var Shape = require('./shape'); var Circle = require('./circle'); -var utils = require('./utils'); +var utils = require('./scripts'); var SemiCircle = function SemiCircle(container, options) { // Use one arc to form a SemiCircle @@ -1970,7 +1970,7 @@ module.exports = SemiCircle; // Base object for different progress bar shapes var Path = require('./path'); -var utils = require('./utils'); +var utils = require('./scripts'); var DESTROYED_ERROR = 'Object is destroyed'; diff --git a/Server/web/js/search_typeahead.js b/src/Server/web/js/search_typeahead.js similarity index 100% rename from Server/web/js/search_typeahead.js rename to src/Server/web/js/search_typeahead.js diff --git a/Server/web/js/typeahead.bundle.js b/src/Server/web/js/typeahead.bundle.js similarity index 100% rename from Server/web/js/typeahead.bundle.js rename to src/Server/web/js/typeahead.bundle.js diff --git a/Server/web/json/database.php b/src/Server/web/json/database.php similarity index 100% rename from Server/web/json/database.php rename to src/Server/web/json/database.php diff --git a/Server/web/json/getCateInsJson.php b/src/Server/web/json/getCateInsJson.php similarity index 100% rename from Server/web/json/getCateInsJson.php rename to src/Server/web/json/getCateInsJson.php diff --git a/Server/web/json/getEntityCatesJson.php b/src/Server/web/json/getEntityCatesJson.php similarity index 100% rename from Server/web/json/getEntityCatesJson.php rename to src/Server/web/json/getEntityCatesJson.php diff --git a/Server/web/json/getImage.php b/src/Server/web/json/getImage.php similarity index 100% rename from Server/web/json/getImage.php rename to src/Server/web/json/getImage.php diff --git a/Server/web/json/getTripleJson.php b/src/Server/web/json/getTripleJson.php similarity index 100% rename from Server/web/json/getTripleJson.php rename to src/Server/web/json/getTripleJson.php diff --git a/Server/web/json/getTypeaheadCateNames.php b/src/Server/web/json/getTypeaheadCateNames.php similarity index 100% rename from Server/web/json/getTypeaheadCateNames.php rename to src/Server/web/json/getTypeaheadCateNames.php diff --git a/Server/web/json/getTypeaheadEntityNames.php b/src/Server/web/json/getTypeaheadEntityNames.php similarity index 100% rename from Server/web/json/getTypeaheadEntityNames.php rename to src/Server/web/json/getTypeaheadEntityNames.php diff --git a/Server/web/json/php_db_com.php b/src/Server/web/json/php_db_com.php similarity index 100% rename from Server/web/json/php_db_com.php rename to src/Server/web/json/php_db_com.php diff --git a/Server/web/login.html b/src/Server/web/login.html similarity index 100% rename from Server/web/login.html rename to src/Server/web/login.html diff --git a/Server/web/login.js b/src/Server/web/login.js similarity index 100% rename from Server/web/login.js rename to src/Server/web/login.js diff --git a/Server/web/openkg.html b/src/Server/web/openkg.html similarity index 100% rename from Server/web/openkg.html rename to src/Server/web/openkg.html diff --git a/Server/web/openkg/breastcancer0/index.html b/src/Server/web/openkg/breastcancer0/index.html similarity index 100% rename from Server/web/openkg/breastcancer0/index.html rename to src/Server/web/openkg/breastcancer0/index.html diff --git a/Server/web/openkg/breastcancer0/index.js b/src/Server/web/openkg/breastcancer0/index.js similarity index 100% rename from Server/web/openkg/breastcancer0/index.js rename to src/Server/web/openkg/breastcancer0/index.js diff --git a/Server/web/openkg/breastcancer1/index.html b/src/Server/web/openkg/breastcancer1/index.html similarity index 100% rename from Server/web/openkg/breastcancer1/index.html rename to src/Server/web/openkg/breastcancer1/index.html diff --git a/Server/web/openkg/breastcancer1/index.js b/src/Server/web/openkg/breastcancer1/index.js similarity index 100% rename from Server/web/openkg/breastcancer1/index.js rename to src/Server/web/openkg/breastcancer1/index.js diff --git a/Server/web/openkg/breastcancer2/index.html b/src/Server/web/openkg/breastcancer2/index.html similarity index 100% rename from Server/web/openkg/breastcancer2/index.html rename to src/Server/web/openkg/breastcancer2/index.html diff --git a/Server/web/openkg/breastcancer2/index.js b/src/Server/web/openkg/breastcancer2/index.js similarity index 100% rename from Server/web/openkg/breastcancer2/index.js rename to src/Server/web/openkg/breastcancer2/index.js diff --git a/Server/web/openkg/breastcancer3/index.html b/src/Server/web/openkg/breastcancer3/index.html similarity index 100% rename from Server/web/openkg/breastcancer3/index.html rename to src/Server/web/openkg/breastcancer3/index.html diff --git a/Server/web/openkg/breastcancer3/index.js b/src/Server/web/openkg/breastcancer3/index.js similarity index 100% rename from Server/web/openkg/breastcancer3/index.js rename to src/Server/web/openkg/breastcancer3/index.js diff --git a/Server/web/openkg/breastcancer4/index.html b/src/Server/web/openkg/breastcancer4/index.html similarity index 100% rename from Server/web/openkg/breastcancer4/index.html rename to src/Server/web/openkg/breastcancer4/index.html diff --git a/Server/web/openkg/breastcancer4/index.js b/src/Server/web/openkg/breastcancer4/index.js similarity index 100% rename from Server/web/openkg/breastcancer4/index.js rename to src/Server/web/openkg/breastcancer4/index.js diff --git a/Server/web/openkg/clinga/index.html b/src/Server/web/openkg/clinga/index.html similarity index 100% rename from Server/web/openkg/clinga/index.html rename to src/Server/web/openkg/clinga/index.html diff --git a/Server/web/openkg/clinga/index.js b/src/Server/web/openkg/clinga/index.js similarity index 100% rename from Server/web/openkg/clinga/index.js rename to src/Server/web/openkg/clinga/index.js diff --git a/Server/web/openkg/emergency/index.html b/src/Server/web/openkg/emergency/index.html similarity index 100% rename from Server/web/openkg/emergency/index.html rename to src/Server/web/openkg/emergency/index.html diff --git a/Server/web/openkg/emergency/index.js b/src/Server/web/openkg/emergency/index.js similarity index 100% rename from Server/web/openkg/emergency/index.js rename to src/Server/web/openkg/emergency/index.js diff --git a/Server/web/openkg/music/index.html b/src/Server/web/openkg/music/index.html similarity index 100% rename from Server/web/openkg/music/index.html rename to src/Server/web/openkg/music/index.html diff --git a/Server/web/openkg/music/index.js b/src/Server/web/openkg/music/index.js similarity index 100% rename from Server/web/openkg/music/index.js rename to src/Server/web/openkg/music/index.js diff --git a/Server/web/openkg/tourist/index.html b/src/Server/web/openkg/tourist/index.html similarity index 100% rename from Server/web/openkg/tourist/index.html rename to src/Server/web/openkg/tourist/index.html diff --git a/Server/web/openkg/tourist/index.js b/src/Server/web/openkg/tourist/index.js similarity index 100% rename from Server/web/openkg/tourist/index.js rename to src/Server/web/openkg/tourist/index.js diff --git a/Server/web/style.css b/src/Server/web/style.css similarity index 100% rename from Server/web/style.css rename to src/Server/web/style.css diff --git a/Server/web/test.html b/src/Server/web/test.html similarity index 100% rename from Server/web/test.html rename to src/Server/web/test.html diff --git a/Server/web/test.js b/src/Server/web/test.js similarity index 100% rename from Server/web/test.js rename to src/Server/web/test.js diff --git a/Server/web/view.css b/src/Server/web/view.css similarity index 100% rename from Server/web/view.css rename to src/Server/web/view.css diff --git a/Server/web/view.js b/src/Server/web/view.js similarity index 100% rename from Server/web/view.js rename to src/Server/web/view.js diff --git a/src/Signature/CMakeLists.txt b/src/Signature/CMakeLists.txt new file mode 100644 index 00000000..7eb38dff --- /dev/null +++ b/src/Signature/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library(gstore_signature OBJECT + SigEntry.cpp + Signature.cpp +) \ No newline at end of file diff --git a/Signature/SigEntry.cpp b/src/Signature/SigEntry.cpp similarity index 100% rename from Signature/SigEntry.cpp rename to src/Signature/SigEntry.cpp diff --git a/Signature/SigEntry.h b/src/Signature/SigEntry.h similarity index 100% rename from Signature/SigEntry.h rename to src/Signature/SigEntry.h diff --git a/Signature/Signature.cpp b/src/Signature/Signature.cpp similarity index 100% rename from Signature/Signature.cpp rename to src/Signature/Signature.cpp diff --git a/Signature/Signature.h b/src/Signature/Signature.h similarity index 100% rename from Signature/Signature.h rename to src/Signature/Signature.h diff --git a/src/StringIndex/CMakeLists.txt b/src/StringIndex/CMakeLists.txt new file mode 100644 index 00000000..34a716d1 --- /dev/null +++ b/src/StringIndex/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(gstore_stringindex OBJECT + StringIndex.cpp +) \ No newline at end of file diff --git a/StringIndex/StringIndex.cpp b/src/StringIndex/StringIndex.cpp similarity index 99% rename from StringIndex/StringIndex.cpp rename to src/StringIndex/StringIndex.cpp index fcb264f4..fe147731 100644 --- a/StringIndex/StringIndex.cpp +++ b/src/StringIndex/StringIndex.cpp @@ -344,6 +344,7 @@ unsigned StringIndex::getNum(StringIndexFile::StringIndexFileType _type) if (_type == StringIndexFile::Predicate) return this->predicate.getNum(); assert(false); + return -1; // never reach here } void StringIndex::save(KVstore &kv_store) diff --git a/StringIndex/StringIndex.h b/src/StringIndex/StringIndex.h similarity index 100% rename from StringIndex/StringIndex.h rename to src/StringIndex/StringIndex.h diff --git a/src/Trie/CMakeLists.txt b/src/Trie/CMakeLists.txt new file mode 100644 index 00000000..e0908c4f --- /dev/null +++ b/src/Trie/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library(gstore_trie OBJECT + Trie.cpp + TrieNode.cpp +) \ No newline at end of file diff --git a/Trie/Trie.cpp b/src/Trie/Trie.cpp similarity index 100% rename from Trie/Trie.cpp rename to src/Trie/Trie.cpp diff --git a/Trie/Trie.h b/src/Trie/Trie.h similarity index 100% rename from Trie/Trie.h rename to src/Trie/Trie.h diff --git a/Trie/TrieNode.cpp b/src/Trie/TrieNode.cpp similarity index 100% rename from Trie/TrieNode.cpp rename to src/Trie/TrieNode.cpp diff --git a/Trie/TrieNode.h b/src/Trie/TrieNode.h similarity index 100% rename from Trie/TrieNode.h rename to src/Trie/TrieNode.h diff --git a/src/Util/Backward.cpp b/src/Util/Backward.cpp new file mode 100644 index 00000000..12d2d9e1 --- /dev/null +++ b/src/Util/Backward.cpp @@ -0,0 +1,40 @@ +// Pick your poison. +// +// On GNU/Linux, you have few choices to get the most out of your stack trace. +// +// By default you get: +// - object filename +// - function name +// +// In order to add: +// - source filename +// - line and column numbers +// - source code snippet (assuming the file is accessible) + +// Install one of the following libraries then uncomment one of the macro (or +// better, add the detection of the lib and the macro definition in your build +// system) + +// - apt-get install libdw-dev ... +// - g++/clang++ -ldw ... +// #define BACKWARD_HAS_DW 1 + +// - apt-get install binutils-dev ... +// - g++/clang++ -lbfd ... +// #define BACKWARD_HAS_BFD 1 + +// - apt-get install libdwarf-dev ... +// - g++/clang++ -ldwarf ... +// #define BACKWARD_HAS_DWARF 1 + +// Regardless of the library you choose to read the debug information, +// for potentially more detailed stack traces you can use libunwind +// - apt-get install libunwind-dev +// - g++/clang++ -lunwind +// #define BACKWARD_HAS_LIBUNWIND 1 + +#include "backward.hpp" + +namespace backward { + backward::SignalHandling sh; +} \ No newline at end of file diff --git a/Util/Bstr.cpp b/src/Util/Bstr.cpp similarity index 100% rename from Util/Bstr.cpp rename to src/Util/Bstr.cpp diff --git a/Util/Bstr.h b/src/Util/Bstr.h similarity index 100% rename from Util/Bstr.h rename to src/Util/Bstr.h diff --git a/src/Util/CMakeLists.txt b/src/Util/CMakeLists.txt new file mode 100644 index 00000000..90194f94 --- /dev/null +++ b/src/Util/CMakeLists.txt @@ -0,0 +1,27 @@ +add_library(gstore_util OBJECT + Util.cpp + WebUrl.cpp + INIParser.cpp + Slog.cpp + Stream.cpp + Bstr.cpp + Triple.cpp + VList.cpp + EvalMultitypeValue.cpp + Version.cpp + SpinLock.cpp + GraphLock.cpp + Transaction.cpp + IDTriple.cpp + Latch.cpp + IPWhiteList.cpp + IPBlackList.cpp + OrderedVector.cpp + CompressFileUtil.cpp + Backward.cpp +) + +# set definition if has debug info +if (CMAKE_BUILD_TYPE MATCHES "Deb") + target_compile_definitions(gstore_util PRIVATE BACKWARD_HAS_DWARF=1) +endif () \ No newline at end of file diff --git a/Util/ClassForVlistCache.h b/src/Util/ClassForVlistCache.h similarity index 100% rename from Util/ClassForVlistCache.h rename to src/Util/ClassForVlistCache.h diff --git a/Util/CompressFileUtil.cpp b/src/Util/CompressFileUtil.cpp similarity index 100% rename from Util/CompressFileUtil.cpp rename to src/Util/CompressFileUtil.cpp diff --git a/Util/CompressFileUtil.h b/src/Util/CompressFileUtil.h similarity index 93% rename from Util/CompressFileUtil.h rename to src/Util/CompressFileUtil.h index e43e7cca..c2782c86 100644 --- a/Util/CompressFileUtil.h +++ b/src/Util/CompressFileUtil.h @@ -5,15 +5,17 @@ #include #include #include -#include -#include -#include "../tools/zlib-1.3/include/unzip.h" -#include "../tools/zlib-1.3/include/zip.h" +#include "../Util/Util.h" + +#include "minizip/unzip.h" +#include "minizip/zip.h" #define WRITEBUFFERSIZE (8192) #define MAXFILENAME (512) #define MAXWBITS 15 #define GZIPENCODING 16 +#define MAXWBITS 15 +#define GZIPENCODING 16 using namespace std; typedef std::function foreach_cb; diff --git a/Util/EvalMultitypeValue.cpp b/src/Util/EvalMultitypeValue.cpp similarity index 100% rename from Util/EvalMultitypeValue.cpp rename to src/Util/EvalMultitypeValue.cpp diff --git a/Util/EvalMultitypeValue.h b/src/Util/EvalMultitypeValue.h similarity index 100% rename from Util/EvalMultitypeValue.h rename to src/Util/EvalMultitypeValue.h diff --git a/Util/GraphLock.cpp b/src/Util/GraphLock.cpp similarity index 100% rename from Util/GraphLock.cpp rename to src/Util/GraphLock.cpp diff --git a/Util/GraphLock.h b/src/Util/GraphLock.h similarity index 100% rename from Util/GraphLock.h rename to src/Util/GraphLock.h diff --git a/Util/IDTriple.cpp b/src/Util/IDTriple.cpp similarity index 95% rename from Util/IDTriple.cpp rename to src/Util/IDTriple.cpp index 77276958..8ffbbb99 100644 --- a/Util/IDTriple.cpp +++ b/src/Util/IDTriple.cpp @@ -16,6 +16,7 @@ bool IDTriple::operator < (const IDTriple& a) const } } assert(false); + return false; // never reach here } diff --git a/Util/IDTriple.h b/src/Util/IDTriple.h similarity index 100% rename from Util/IDTriple.h rename to src/Util/IDTriple.h diff --git a/Util/INIParser.cpp b/src/Util/INIParser.cpp similarity index 100% rename from Util/INIParser.cpp rename to src/Util/INIParser.cpp diff --git a/Util/INIParser.h b/src/Util/INIParser.h similarity index 100% rename from Util/INIParser.h rename to src/Util/INIParser.h diff --git a/Util/IPBlackList.cpp b/src/Util/IPBlackList.cpp similarity index 100% rename from Util/IPBlackList.cpp rename to src/Util/IPBlackList.cpp diff --git a/Util/IPBlackList.h b/src/Util/IPBlackList.h similarity index 100% rename from Util/IPBlackList.h rename to src/Util/IPBlackList.h diff --git a/Util/IPWhiteList.cpp b/src/Util/IPWhiteList.cpp similarity index 100% rename from Util/IPWhiteList.cpp rename to src/Util/IPWhiteList.cpp diff --git a/Util/IPWhiteList.h b/src/Util/IPWhiteList.h similarity index 100% rename from Util/IPWhiteList.h rename to src/Util/IPWhiteList.h diff --git a/Util/Latch.cpp b/src/Util/Latch.cpp similarity index 100% rename from Util/Latch.cpp rename to src/Util/Latch.cpp diff --git a/Util/Latch.h b/src/Util/Latch.h similarity index 100% rename from Util/Latch.h rename to src/Util/Latch.h diff --git a/Util/MD5.h b/src/Util/MD5.h similarity index 100% rename from Util/MD5.h rename to src/Util/MD5.h diff --git a/Util/OrderedVector.cpp b/src/Util/OrderedVector.cpp similarity index 100% rename from Util/OrderedVector.cpp rename to src/Util/OrderedVector.cpp diff --git a/Util/OrderedVector.h b/src/Util/OrderedVector.h similarity index 100% rename from Util/OrderedVector.h rename to src/Util/OrderedVector.h diff --git a/Util/PrettyPrint.h b/src/Util/PrettyPrint.h similarity index 100% rename from Util/PrettyPrint.h rename to src/Util/PrettyPrint.h diff --git a/Util/Slog.cpp b/src/Util/Slog.cpp similarity index 100% rename from Util/Slog.cpp rename to src/Util/Slog.cpp diff --git a/Util/Slog.h b/src/Util/Slog.h similarity index 100% rename from Util/Slog.h rename to src/Util/Slog.h diff --git a/Util/SpinLock.cpp b/src/Util/SpinLock.cpp similarity index 100% rename from Util/SpinLock.cpp rename to src/Util/SpinLock.cpp diff --git a/Util/SpinLock.h b/src/Util/SpinLock.h similarity index 100% rename from Util/SpinLock.h rename to src/Util/SpinLock.h diff --git a/Util/Stream.cpp b/src/Util/Stream.cpp similarity index 100% rename from Util/Stream.cpp rename to src/Util/Stream.cpp diff --git a/Util/Stream.h b/src/Util/Stream.h similarity index 100% rename from Util/Stream.h rename to src/Util/Stream.h diff --git a/Util/Transaction.cpp b/src/Util/Transaction.cpp similarity index 100% rename from Util/Transaction.cpp rename to src/Util/Transaction.cpp diff --git a/Util/Transaction.h b/src/Util/Transaction.h similarity index 100% rename from Util/Transaction.h rename to src/Util/Transaction.h diff --git a/Util/Triple.cpp b/src/Util/Triple.cpp similarity index 100% rename from Util/Triple.cpp rename to src/Util/Triple.cpp diff --git a/Util/Triple.h b/src/Util/Triple.h similarity index 100% rename from Util/Triple.h rename to src/Util/Triple.h diff --git a/Util/Util.cpp b/src/Util/Util.cpp similarity index 100% rename from Util/Util.cpp rename to src/Util/Util.cpp diff --git a/Util/Util.h b/src/Util/Util.h similarity index 98% rename from Util/Util.h rename to src/Util/Util.h index faca7f2e..1f9994fc 100644 --- a/Util/Util.h +++ b/src/Util/Util.h @@ -107,22 +107,26 @@ in the sparql query can point to the same node in data graph) #include #include #include - - -//Added for __gnu_parallel::sort #include #include -#include "../tools/rapidjson/document.h" -#include "../tools/rapidjson/prettywriter.h" -#include "../tools/rapidjson/writer.h" -#include "../tools/rapidjson/stringbuffer.h" -#include "INIParser.h" -#include "../tools/indicators/progress_bar.hpp" + +// #include "../tools/rapidjson/document.h" +// #include "../tools/rapidjson/prettywriter.h" +// #include "../tools/rapidjson/writer.h" +// #include "../tools/rapidjson/stringbuffer.h" +// #include "../tools/indicators/progress_bar.hpp" + +#include "rapidjson/document.h" +#include "rapidjson/prettywriter.h" +#include "rapidjson/writer.h" +#include "rapidjson/stringbuffer.h" +#include "indicators/progress_bar.hpp" #include "Latch.h" #include "Slog.h" #include "MD5.h" #include "PrettyPrint.h" +#include "INIParser.h" #define thread_num 1 //below is used to control if using the parallelable sort() diff --git a/Util/Util_New.cpp b/src/Util/Util_New.cpp similarity index 95% rename from Util/Util_New.cpp rename to src/Util/Util_New.cpp index 1264b661..7dfcc1bd 100644 --- a/Util/Util_New.cpp +++ b/src/Util/Util_New.cpp @@ -20,7 +20,7 @@ static string Util_New::getCurrentRootPath() char pwd[255]; char* wd; - //ҲԽbufferΪ + //也可以将buffer作为输出参数 if ((buffer = getcwd(NULL, 0)) == NULL) { perror("getcwd error"); diff --git a/Util/Util_New.h b/src/Util/Util_New.h similarity index 100% rename from Util/Util_New.h rename to src/Util/Util_New.h diff --git a/Util/VList.cpp b/src/Util/VList.cpp similarity index 99% rename from Util/VList.cpp rename to src/Util/VList.cpp index 3fab2dc3..42566e0c 100644 --- a/Util/VList.cpp +++ b/src/Util/VList.cpp @@ -340,7 +340,7 @@ VList::readBstr(char*& _str, unsigned& _len, unsigned* _next) j = 4 - j; fseek(valfp, j, SEEK_CUR); - //NOTICE+DEBUG: I think no need to align here, later no data to read + //NOTICE+DEBUG: I think no need to align here, later no data to read //(if need to read, then fseek again to find a new value) //this->ReadAlign(_next); @@ -376,7 +376,7 @@ VList::writeBstr(const char* _str, unsigned _len, unsigned* _curnum) j = 4 - j; fseek(valfp, j, SEEK_CUR); - //NOTICE+DEBUG: I think no need to align here, later no data to write + //NOTICE+DEBUG: I think no need to align here, later no data to write //(if need to write, then fseek again to write a new value) //this->WriteAlign(_curnum); fseek(valfp, Address(*_curnum), SEEK_SET); diff --git a/Util/VList.h b/src/Util/VList.h similarity index 100% rename from Util/VList.h rename to src/Util/VList.h diff --git a/Util/Version.cpp b/src/Util/Version.cpp similarity index 100% rename from Util/Version.cpp rename to src/Util/Version.cpp diff --git a/Util/Version.h b/src/Util/Version.h similarity index 100% rename from Util/Version.h rename to src/Util/Version.h diff --git a/Util/WebUrl.cpp b/src/Util/WebUrl.cpp similarity index 100% rename from Util/WebUrl.cpp rename to src/Util/WebUrl.cpp diff --git a/Util/WebUrl.h b/src/Util/WebUrl.h similarity index 100% rename from Util/WebUrl.h rename to src/Util/WebUrl.h diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 00000000..e2ee4346 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +!*.sh \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..b3378b32 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,71 @@ +set(LIB_TESTS + # Conan Deps + Boost::system + Boost::regex + Boost::thread + minizip::minizip + OpenSSL::SSL + OpenSSL::Crypto + indicators::indicators + rapidjson + log4cplus::log4cplus + CURL::libcurl + Backward::Backward + libdwarf::libdwarf + libelf::libelf + # System Deps + OpenMP::OpenMP_CXX + ${LIB_JEMALLOC} + ${LIB_READLINE} + Threads::Threads + # Unmanaged Deps + antlr4-runtime + workflow +) + +# set definition if has debug info +if (CMAKE_BUILD_TYPE MATCHES "Deb") + LIST(APPEND LIB_TESTS + libdwarf::libdwarf + libelf::libelf + ) +endif () + +set(OBJ_TESTS + $ + $ + $ + $ + $ + $ + $ + $ + $ +) + +add_executable(update_test update_test.cpp ${OBJ_TESTS}) +target_link_libraries(update_test ${LIB_TESTS}) + +add_executable(dataset_test dataset_test.cpp ${OBJ_TESTS}) +target_link_libraries(dataset_test ${LIB_TESTS}) + +add_executable(transaction_test transaction_test.cpp ${OBJ_TESTS}) +target_link_libraries(transaction_test ${LIB_TESTS}) + +add_executable(run_transaction run_transaction.cpp ${OBJ_TESTS} $) +target_link_libraries(run_transaction ${LIB_TESTS}) + +add_executable(workload workload.cpp ${OBJ_TESTS}) +target_link_libraries(workload ${LIB_TESTS}) + +add_executable(debug_test debug_test.cpp ${OBJ_TESTS}) +target_link_libraries(debug_test ${LIB_TESTS}) + +add_executable(gtest gtest.cpp ${OBJ_TESTS}) +target_link_libraries(gtest ${LIB_TESTS}) + +get_directory_property(gstore_tests DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} BUILDSYSTEM_TARGETS) +foreach (test ${gstore_tests}) + add_dependencies(${test} prepare) + install(TARGETS ${test} DESTINATION ${GSTORE_TEST_DIR}) +endforeach () \ No newline at end of file diff --git a/scripts/PyTest/FormatHelper.py b/tests/PyTest/FormatHelper.py similarity index 100% rename from scripts/PyTest/FormatHelper.py rename to tests/PyTest/FormatHelper.py diff --git a/scripts/PyTest/ResultChecker.py b/tests/PyTest/ResultChecker.py similarity index 100% rename from scripts/PyTest/ResultChecker.py rename to tests/PyTest/ResultChecker.py diff --git a/scripts/PyTest/auto_test.py b/tests/PyTest/auto_test.py similarity index 94% rename from scripts/PyTest/auto_test.py rename to tests/PyTest/auto_test.py index acc3eccd..aff3ce57 100644 --- a/scripts/PyTest/auto_test.py +++ b/tests/PyTest/auto_test.py @@ -39,7 +39,7 @@ def TestCase(db_name: str, case_name: str, query_path: str, def ParseTest(): query_num = 50 - data_dir = "scripts/parser_test/" + data_dir = "data/parser_test/" all_passed = True db_name = "parser_test" os.system("bin/gdrop -db " + db_name + " > /dev/null") @@ -49,6 +49,11 @@ def ParseTest(): query_path = data_dir + "parser_q" + str(i) + ".sql" result_path = data_dir + "parser_r" + str(i) + ".txt" + for _f in data_path, query_path, result_path: + if not os.path.exists(_f): + print("File %s not exists" % _f) + return False + os.system("bin/gbuild -db " + db_name + " -f " + data_path + " > /dev/null") case_passed = TestCase(db_name, cast_name, query_path, result_path) all_passed = all_passed and case_passed @@ -61,7 +66,7 @@ def ParseTest(): def BFSTest(): data_set = ['bbug', 'lubm', 'num'] - data_dir = "scripts/bfs_test/" + data_dir = "data/bfs_test/" all_passed = True db_name_gstore = "bfs_test" os.system("bin/gdrop -db " + db_name_gstore + " > /dev/null") @@ -88,8 +93,8 @@ def BFSTest(): def DFSTest(): data_set = ['bbug', 'lubm', 'num'] - data_dir = "scripts/dfs_test/" - full_data_dir = "scripts/bfs_test/" + data_dir = "data/dfs_test/" + full_data_dir = "data/bfs_test/" all_passed = True db_name_gstore = "dfs_test" os.system("bin/gdrop -db " + db_name_gstore + " > /dev/null") diff --git a/scripts/PyTest/standard_result.py b/tests/PyTest/standard_result.py similarity index 100% rename from scripts/PyTest/standard_result.py rename to tests/PyTest/standard_result.py diff --git a/scripts/basic_test.sh b/tests/basic_test.sh similarity index 98% rename from scripts/basic_test.sh rename to tests/basic_test.sh index a11f02b1..20c6b359 100644 --- a/scripts/basic_test.sh +++ b/tests/basic_test.sh @@ -43,7 +43,7 @@ do continue else echo -e "\033[43;35m build ${db[$i]}.db fails \033[0m" - exit + exit 1 fi done @@ -64,7 +64,7 @@ do echo ${ans} echo -e "\033[43;35m update triples in ${db[$i]}.db has errors \033[0m" # "rm" "1.txt" - exit + exit 2 else echo "update triples in ${db[$i]}.db ok" fi @@ -85,7 +85,7 @@ do then echo -e "\033[43;35m query ${db[0]}${bbug_sql[$i]}.sql in ${db[0]}.db has errors \033[0m" "rm" "1.txt" - exit + exit 3 else echo "query ${db[0]}${bbug_sql[$i]}.sql in ${db[0]}.db ok" fi @@ -103,7 +103,7 @@ do then echo -e "\033[43;35m query ${db[1]}${lubm_sql[$i]}.sql in ${db[1]}.db has errors \033[0m" "rm" "1.txt" - exit + exit 4 else echo "query ${db[1]}${lubm_sql[$i]}.sql in ${db[1]}.db ok" fi @@ -120,7 +120,7 @@ do then echo -e "\033[43;35m query ${db[2]}${num_sql[$i]}.sql in ${db[2]}.db has errors \033[0m" "rm" "1.txt" - exit + exit 5 else echo "query ${db[2]}${num_sql[$i]}.sql in ${db[2]}.db ok" fi @@ -137,7 +137,7 @@ do then echo -e "\033[43;35m query ${db[3]}${small_sql[$i]}.sql in ${db[3]}.db has errors \033[0m" "rm" "1.txt" - exit + exit 6 else echo "query ${db[3]}${small_sql[$i]}.sql in ${db[3]}.db ok" fi @@ -156,7 +156,7 @@ if [[ ${ans:18:${#ans}-18} -ne ${triple_num[4]} ]] then echo -e "\033[43;35m update triples in ${db[3]}.db has errors \033[0m" "rm" "1.txt" - exit + exit 7 else echo "add triples in ${db[3]}.db ok" fi @@ -171,7 +171,7 @@ if [[ ${ans:18:${#ans}-18} -ne ${triple_num[3]} ]] then echo -e "\033[43;35m update triples in ${db[3]}.db has errors \033[0m" "rm" "1.txt" - exit + exit 8 else echo "sub triples in ${db[3]}.db ok" fi diff --git a/scripts/dataset_test.cpp b/tests/dataset_test.cpp similarity index 94% rename from scripts/dataset_test.cpp rename to tests/dataset_test.cpp index b2a9af65..1a7392c8 100644 --- a/scripts/dataset_test.cpp +++ b/tests/dataset_test.cpp @@ -6,13 +6,18 @@ # Description: used for size test =============================================================================*/ -#include "../Util/Util.h" -#include "../Database/Database.h" +#include "../src/Util/Util.h" +#include "../src/Database/Database.h" using namespace std; int main(int argc, char * argv[]) { + if (argc < 5) + { + cerr << "Usage: " << argv[0] << " " << endl; + return -1; + } Util util; Database* db; string db_name = string(argv[1]); diff --git a/scripts/debug_test.cpp b/tests/debug_test.cpp similarity index 98% rename from scripts/debug_test.cpp rename to tests/debug_test.cpp index 316c0414..9af3ded5 100644 --- a/scripts/debug_test.cpp +++ b/tests/debug_test.cpp @@ -16,7 +16,8 @@ #include #include #include -#include "../Database/Txn_manager.h" + +#include "../src/Database/Txn_manager.h" void preload4bug(vector& adds, vector& subs, const int _nums) { diff --git a/scripts/demo/full.sh b/tests/demo/full.sh similarity index 100% rename from scripts/demo/full.sh rename to tests/demo/full.sh diff --git a/scripts/demo/lubm.sh b/tests/demo/lubm.sh similarity index 100% rename from scripts/demo/lubm.sh rename to tests/demo/lubm.sh diff --git a/scripts/full_test.sh b/tests/full_test.sh similarity index 100% rename from scripts/full_test.sh rename to tests/full_test.sh diff --git a/scripts/gtest.cpp b/tests/gtest.cpp similarity index 99% rename from scripts/gtest.cpp rename to tests/gtest.cpp index dd386f49..8ad23057 100644 --- a/scripts/gtest.cpp +++ b/tests/gtest.cpp @@ -16,8 +16,8 @@ //#include //#include //#include -#include "../Database/Database.h" -#include "../Util/Util.h" +#include "../src/Database/Database.h" +#include "../src/Util/Util.h" using namespace std; diff --git a/scripts/parser_test.sh b/tests/parser_test.sh similarity index 88% rename from scripts/parser_test.sh rename to tests/parser_test.sh index 7ec111fc..e69462ba 100644 --- a/scripts/parser_test.sh +++ b/tests/parser_test.sh @@ -2,7 +2,7 @@ query_num=50 # query_num=1 -data_dir="scripts/parser_test/" +data_dir="data/parser_test/" gbuild='bin/gbuild ' gquery='bin/gquery ' gdrop='bin/gdrop ' @@ -27,10 +27,12 @@ do # "sed" "-i" "\$d" "tmp.txt" "grep" "." "tmp.txt" | "sort" > "result_b.txt" - "diff" "result_a.txt" "result_b.txt" > "equal.txt" + "diff" -w "result_a.txt" "result_b.txt" > "equal.txt" if [ -s "equal.txt" ]; then + cat "equal.txt" echo -e "\033[43;35m parser test #"$i" failed \033[0m" all_passed=false + exit 1 # exit with error code else echo "parser test #"$i" passed" fi diff --git a/scripts/run.sh b/tests/run.sh similarity index 100% rename from scripts/run.sh rename to tests/run.sh diff --git a/scripts/run1.sh b/tests/run1.sh similarity index 100% rename from scripts/run1.sh rename to tests/run1.sh diff --git a/scripts/run2.sh b/tests/run2.sh similarity index 100% rename from scripts/run2.sh rename to tests/run2.sh diff --git a/scripts/run3.sh b/tests/run3.sh similarity index 100% rename from scripts/run3.sh rename to tests/run3.sh diff --git a/scripts/run4.sh b/tests/run4.sh similarity index 100% rename from scripts/run4.sh rename to tests/run4.sh diff --git a/scripts/run_dbpedia.sh b/tests/run_dbpedia.sh similarity index 100% rename from scripts/run_dbpedia.sh rename to tests/run_dbpedia.sh diff --git a/scripts/run_lubm.sh b/tests/run_lubm.sh similarity index 100% rename from scripts/run_lubm.sh rename to tests/run_lubm.sh diff --git a/scripts/run_transaction.cpp b/tests/run_transaction.cpp similarity index 97% rename from scripts/run_transaction.cpp rename to tests/run_transaction.cpp index 12c92358..0ca8a7fc 100644 --- a/scripts/run_transaction.cpp +++ b/tests/run_transaction.cpp @@ -1,6 +1,7 @@ -#include "../api/http/cpp/src/GstoreConnector.h" #include -#include "../Util/Util.h" + +#include "../src/Util/Util.h" +#include "../src/Connector/GstoreConnector.h" using namespace std; using namespace rapidjson; diff --git a/scripts/run_watdiv.sh b/tests/run_watdiv.sh similarity index 100% rename from scripts/run_watdiv.sh rename to tests/run_watdiv.sh diff --git a/scripts/test.py b/tests/test.py similarity index 100% rename from scripts/test.py rename to tests/test.py diff --git a/scripts/transaction_test.cpp b/tests/transaction_test.cpp similarity index 97% rename from scripts/transaction_test.cpp rename to tests/transaction_test.cpp index 9542b64d..563c27a4 100644 --- a/scripts/transaction_test.cpp +++ b/tests/transaction_test.cpp @@ -1,6 +1,7 @@ -#include "../Database/Txn_manager.h" -#include "../Util/Util.h" -#include "../Database/Database.h" +#include "../src/Database/Txn_manager.h" +#include "../src/Util/Util.h" +#include "../src/Database/Database.h" + bool do_query(Database* db, string sparql) { int ret_val; diff --git a/scripts/update_test.cpp b/tests/update_test.cpp similarity index 98% rename from scripts/update_test.cpp rename to tests/update_test.cpp index 2a16a08a..8e49ee68 100644 --- a/scripts/update_test.cpp +++ b/tests/update_test.cpp @@ -6,8 +6,8 @@ # Description: used to test the correctness of update triples =============================================================================*/ -#include "../Util/Util.h" -#include "../Database/Database.h" +#include "../src/Util/Util.h" +#include "../src/Database/Database.h" using namespace std; @@ -218,6 +218,7 @@ int main(int argc, char * argv[]) update_triples.insert(temp); for (int i = 0; i < test_group_num; i++) { + std::cerr << "test_group " << i << " of " << test_group_num << std::endl; int a = rand() % test_group_size + 1; int b = rand() % test_group_size + 1; for (int j = 0; j < a; j++) diff --git a/scripts/workload.cpp b/tests/workload.cpp similarity index 98% rename from scripts/workload.cpp rename to tests/workload.cpp index 96d69ed5..9c476efb 100644 --- a/scripts/workload.cpp +++ b/tests/workload.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "../Database/Txn_manager.h" +#include "../src/Database/Txn_manager.h" using namespace std; @@ -683,8 +683,8 @@ void create_versions(Txn_manager& txn_m) void no_txn_update(Database &db) { - const string insert_filename = "./scripts/insert.nt"; - const string delete_filename = "./scripts/delete.nt"; + const string insert_filename = "./tests/insert.nt"; + const string delete_filename = "./tests/delete.nt"; fstream in; string line, sparql, res; @@ -713,7 +713,7 @@ bool single_txn(int threads_num, Txn_manager& txn_m) txn_id_t TID = txn_m.Begin(static_cast(3)); ifstream in; string line, sparql, res; - in.open("./scripts/insert.nt", ios::in); + in.open("./tests/insert.nt", ios::in); int num = 0; while(getline(in, line)) { @@ -729,7 +729,7 @@ bool single_txn(int threads_num, Txn_manager& txn_m) //if(ret != 0) cerr << "wrong answer!" << endl; } in.close(); - in.open("./scripts/delete.nt", ios::in); + in.open("./tests/delete.nt", ios::in); while(getline(in, line)) { sparql = "delete data{" + line + "}"; @@ -748,7 +748,7 @@ void check_results(int threads_num, Txn_manager& txn_m) { txn_id_t TID = txn_m.Begin(); ifstream in; - in.open("./scripts/insert.nt", ios::in); + in.open("./tests/insert.nt", ios::in); for(int i = 0; i < threads_num; i++) { string line, sparql, res; @@ -764,7 +764,7 @@ void check_results(int threads_num, Txn_manager& txn_m) cout << res << endl; } in.close(); - in.open("./scripts/delete.nt", ios::in); + in.open("./tests/delete.nt", ios::in); for(int i = 0; i < threads_num; i++) { string line, sparql, query, res; @@ -812,7 +812,7 @@ int main(int argc, char* argv[]) Txn_manager txn_m(&_db, string("lubm_1M")); - TID = txn_m.Begin(2); + auto TID = txn_m.Begin(IsolationLevelType::SNAPSHOT); string res; int ret = txn_m.Query(TID, "select ?x where { ?x .}", res); @@ -829,7 +829,7 @@ int main(int argc, char* argv[]) insert data { .} select ?x where { ?x .} */ - return; + return 0; //threads_num = thread::hardware_concurrency()-1; vector pool(threads_num); diff --git a/tools/.gitignore b/tools/.gitignore deleted file mode 100644 index 36cbf1d3..00000000 --- a/tools/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -* -!.gitignore -!libantlr3c-3.4.tar.gz -!rapidjson.tar.gz -!workflow-0.10.3.tar.gz -!log4cplus-2.0.8.tar.gz -!zlib-1.3.tar.gz \ No newline at end of file diff --git a/tools/indicators.tar b/tools/indicators.tar deleted file mode 100644 index 5d74833c..00000000 Binary files a/tools/indicators.tar and /dev/null differ diff --git a/tools/log4cplus-2.0.8.tar.gz b/tools/log4cplus-2.0.8.tar.gz deleted file mode 100644 index 5fbd2252..00000000 Binary files a/tools/log4cplus-2.0.8.tar.gz and /dev/null differ diff --git a/tools/rapidjson.tar.gz b/tools/rapidjson.tar.gz deleted file mode 100644 index a8057c79..00000000 Binary files a/tools/rapidjson.tar.gz and /dev/null differ diff --git a/tools/sparql.tar.gz b/tools/sparql.tar.gz deleted file mode 100644 index 24bb4b04..00000000 Binary files a/tools/sparql.tar.gz and /dev/null differ diff --git a/tools/zlib-1.3.tar.gz b/tools/zlib-1.3.tar.gz deleted file mode 100644 index 193e628d..00000000 Binary files a/tools/zlib-1.3.tar.gz and /dev/null differ