From 5d4d6e869bf665729e6e17f32f9d61b7037ab2a4 Mon Sep 17 00:00:00 2001 From: Mohamed Ishad Date: Sun, 28 May 2023 20:57:14 +0530 Subject: [PATCH 01/45] Fix build failure only after merging pull requests Copy source code from branch which originate pull request to build docker image --- .github/workflows/build.yml | 14 +++++++++----- docker/Dockerfile => Dockerfile | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) rename docker/Dockerfile => Dockerfile (97%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d35e52d5..d27fa53b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,10 @@ name: Build -on: [push, pull_request] +on: + push: + branches: [master] + pull_request: + branches: [master] env: # Customize the build type here (Release, Debug, RelWithDebInfo, etc.) @@ -12,9 +16,9 @@ jobs: steps: - uses: actions/checkout@v2 - + with: + ref: ${{github.head_ref}} + fetch-depth: 0 - name: Build # Build JasmineGraph docker image - run: | - cd docker - docker build -t jasminegraph . + run: docker build -t jasminegraph . \ No newline at end of file diff --git a/docker/Dockerfile b/Dockerfile similarity index 97% rename from docker/Dockerfile rename to Dockerfile index c410a2885..cea04965e 100644 --- a/docker/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM miyurud/jasminegraph WORKDIR /home/ubuntu/software RUN apt-get update -RUN git clone https://github.com/miyurud/jasminegraph.git +COPY . jasminegraph/ ENV HOME="/home/ubuntu" RUN mkdir -p /var/tmp/nmon WORKDIR /home/ubuntu/software/jasminegraph From b3fd47940a75874270364a8e951f864311c99785 Mon Sep 17 00:00:00 2001 From: Mohamed Ishad Date: Mon, 5 Jun 2023 22:13:30 +0530 Subject: [PATCH 02/45] Fix to get content from forked repositories --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d27fa53b8..38152626a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,10 +15,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: ${{github.head_ref}} fetch-depth: 0 + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} - name: Build # Build JasmineGraph docker image run: docker build -t jasminegraph . \ No newline at end of file From b788f3dc7cffb84328e7e9ce2ba052171daf324e Mon Sep 17 00:00:00 2001 From: Chandima301 Date: Tue, 6 Jun 2023 14:35:38 +0530 Subject: [PATCH 03/45] FENNEL Partitioner changes --- src/partitioner/stream/JasmineGraphIncrementalStore.h | 1 - src/partitioner/stream/Partition.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/partitioner/stream/JasmineGraphIncrementalStore.h b/src/partitioner/stream/JasmineGraphIncrementalStore.h index ca282aa0f..cafee65d8 100644 --- a/src/partitioner/stream/JasmineGraphIncrementalStore.h +++ b/src/partitioner/stream/JasmineGraphIncrementalStore.h @@ -15,7 +15,6 @@ #include #include #include -#include #ifndef JASMINE_PARTITION #define JASMINE_PARTITION diff --git a/src/partitioner/stream/Partition.h b/src/partitioner/stream/Partition.h index d37d3c76e..f2ff8ff9b 100644 --- a/src/partitioner/stream/Partition.h +++ b/src/partitioner/stream/Partition.h @@ -15,7 +15,6 @@ #include #include #include -#include #ifndef JASMINE_PARTITION #define JASMINE_PARTITION From 85fe76bc3182e9504f8a5b08ac7d863489082782 Mon Sep 17 00:00:00 2001 From: Chandima301 Date: Tue, 6 Jun 2023 15:04:56 +0530 Subject: [PATCH 04/45] FENNEL Partitioner changes --- src/partitioner/stream/JasmineGraphIncrementalStore.h | 1 + src/partitioner/stream/Partition.h | 1 + src/partitioner/stream/Partitioner.h | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/partitioner/stream/JasmineGraphIncrementalStore.h b/src/partitioner/stream/JasmineGraphIncrementalStore.h index cafee65d8..ca282aa0f 100644 --- a/src/partitioner/stream/JasmineGraphIncrementalStore.h +++ b/src/partitioner/stream/JasmineGraphIncrementalStore.h @@ -15,6 +15,7 @@ #include #include #include +#include #ifndef JASMINE_PARTITION #define JASMINE_PARTITION diff --git a/src/partitioner/stream/Partition.h b/src/partitioner/stream/Partition.h index f2ff8ff9b..d37d3c76e 100644 --- a/src/partitioner/stream/Partition.h +++ b/src/partitioner/stream/Partition.h @@ -15,6 +15,7 @@ #include #include #include +#include #ifndef JASMINE_PARTITION #define JASMINE_PARTITION diff --git a/src/partitioner/stream/Partitioner.h b/src/partitioner/stream/Partitioner.h index 3c3a5d6af..0b66626ef 100644 --- a/src/partitioner/stream/Partitioner.h +++ b/src/partitioner/stream/Partitioner.h @@ -14,7 +14,7 @@ #define JASMINE_PARTITIONER_HEADER #include -#include "../../nativestore/NodeManager.h" +#include "../../centralstore/incremental/NodeManager.h" #include "./Partition.h" typedef std::vector> partitionedEdge; From d74674da804f2cbbb99864139b102beac99b4c48 Mon Sep 17 00:00:00 2001 From: kandeeban15 <88717578+kandeeban15@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:56:08 +0530 Subject: [PATCH 05/45] Update CMake file for python version update --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a9a5c302..3002dbfd1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ add_executable(JasmineGraph main.cpp src/server/JasmineGraphServer.cpp src/serve src/frontend/core/factory/ExecutorFactory.cpp src/frontend/core/factory/ExecutorFactory.h src/frontend/core/CoreConstants.cpp src/frontend/core/CoreConstants.h) -target_compile_options(JasmineGraph PRIVATE -std=c++11 -I/usr/include/python3.5) +target_compile_options(JasmineGraph PRIVATE -std=c++11 -I/usr/include/python3.11) if(CMAKE_ENABLE_DEBUG) message(STATUS "DEBUG enabled") @@ -64,17 +64,17 @@ include_directories("$ENV{HOME}/software/cppkafka/include") include_directories("$ENV{HOME}/software/nlohmann_json/include") #target_link_libraries(JasmineGraph /usr/local/lib/libmetis.a) -#target_link_libraries(JasmineGraph $ENV{HOME}/software/xerces-c-3.2.2/lib/libxerces-c.so) +#target_link_libraries(JasmineGraph $ENV{HOME}/software/xerces-c-3.2.3/lib/libxerces-c.so) target_link_libraries(JasmineGraph $ENV{HOME}/software/flatbuffers/libflatbuffers.a) -include_directories("$ENV{HOME}/software/xerces-c-3.2.2/include") +include_directories("$ENV{HOME}/software/xerces-c-3.2.3/include") target_link_libraries(JasmineGraph $ENV{HOME}/software/jsoncpp/build/debug/src/lib_json/libjsoncpp.a) target_link_libraries(JasmineGraph /usr/local/lib/libcppkafka.so) -set(PYTHON_EXECUTABLE "/usr/bin/python3.5") -set(PYTHON_INCLUDE_DIR "/usr/include/python3.5m") -set(PYTHON_LIBRARIES "/usr/lib/x86_64-linux-gnu/libpython3.5m.so") +set(PYTHON_EXECUTABLE "/usr/local/bin/python3.11") +set(PYTHON_INCLUDE_DIRS "/usr/local/include/python3.11") +set(PYTHON_LIBRARIES "/usr/local/lib/libpython3.11.so") include_directories(${PYTHON_INCLUDE_DIRS}) include_directories(${PYTHON_DIRECTORIES}) target_link_libraries(JasmineGraph ${PYTHON_LIBRARIES}) -target_link_libraries(JasmineGraph m) \ No newline at end of file +target_link_libraries(JasmineGraph m) From bf4fdb1493f0d40d01c15406cb73e12ca45c6df5 Mon Sep 17 00:00:00 2001 From: kandeeban15 <88717578+kandeeban15@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:56:59 +0530 Subject: [PATCH 06/45] Update requirements file for python version update --- GraphSAGE/requirements | 48 ++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/GraphSAGE/requirements b/GraphSAGE/requirements index d2d729308..55793c4a2 100644 --- a/GraphSAGE/requirements +++ b/GraphSAGE/requirements @@ -1,25 +1,23 @@ -absl-py==0.2.2 -astor==0.6.2 -backports.weakref==1.0.post1 -bleach==1.5.0 -decorator==4.3.0 -enum34==1.1.6 -funcsigs==1.0.2 -futures==3.2.0 -gast==0.2.0 -grpcio==1.12.1 -html5lib==0.9999999 -Markdown==2.6.11 -mock==2.0.0 -networkx==1.11 -numpy==1.14.5 -pbr==4.0.4 -protobuf==3.6.0 -scikit-learn==0.19.1 -scipy==1.1.0 -six==1.11.0 -sklearn==0.0 -tensorboard==1.8.0 -tensorflow==1.8.0 -termcolor==1.1.0 -Werkzeug==0.14.1 +absl-py-1.4.0 +astor-0.8.1 +backports.weakref-1.0.post1 +bleach-6.0.0 +decorator-5.1.1 +enum34-1.1.10 +funcsigs-1.0.2 +gast-0.4.0 +grpcio-1.56.0 +html5lib-1.1 +Markdown-3.4.3 +mock-5.1.0 +networkx-3.1 +numpy-1.24.3 +pbr-5.11.1 +protobuf-4.23.4 +scikit-learn-1.3.0 +scipy-1.11.1 +six-1.16.0 +tensorboard-2.13.0 +tensorflow-2.13.0 +termcolor-2.3.0 +Werkzeug-2.3.6 From 9ab111c024cb5aed3f20a1de174b527df33c4e4e Mon Sep 17 00:00:00 2001 From: = Date: Tue, 25 Jul 2023 12:32:12 +0530 Subject: [PATCH 07/45] Update docker file && fix build failures --- CMakeLists.txt | 18 ++------- Dockerfile | 60 +++++++++++++++++++--------- README.md | 1 - src/partitioner/local/JSONParser.cpp | 2 +- 4 files changed, 46 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a9a5c302..4baca2a40 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,26 +48,16 @@ if(CMAKE_ENABLE_DEBUG) target_compile_options(JasmineGraph PRIVATE -g) endif() -target_link_libraries(JasmineGraph /usr/local/lib/libmetis.so) -target_link_libraries(JasmineGraph /usr/local/lib/libxerces-c-3.2.so) #TODO: Need to install the library separately target_link_libraries(JasmineGraph sqlite3) target_link_libraries(JasmineGraph pthread) target_link_libraries(JasmineGraph rdkafka) -#target_link_libraries(JasmineGraph cppkafka) target_link_libraries(JasmineGraph Threads::Threads) -include_directories("$ENV{HOME}/software/flatbuffers/include") -include_directories("$ENV{HOME}/software/xerces/include") -include_directories("$ENV{HOME}/software/spdlog/include") -include_directories("$ENV{HOME}/software/jsoncpp/include") -include_directories("$ENV{HOME}/software/cppkafka/include") -include_directories("$ENV{HOME}/software/nlohmann_json/include") +#include_directories("$ENV{HOME}/software/cppkafka/include") -#target_link_libraries(JasmineGraph /usr/local/lib/libmetis.a) -#target_link_libraries(JasmineGraph $ENV{HOME}/software/xerces-c-3.2.2/lib/libxerces-c.so) -target_link_libraries(JasmineGraph $ENV{HOME}/software/flatbuffers/libflatbuffers.a) -include_directories("$ENV{HOME}/software/xerces-c-3.2.2/include") -target_link_libraries(JasmineGraph $ENV{HOME}/software/jsoncpp/build/debug/src/lib_json/libjsoncpp.a) +target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libxerces-c.so) +target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libflatbuffers.a) +target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libjsoncpp.a) target_link_libraries(JasmineGraph /usr/local/lib/libcppkafka.so) set(PYTHON_EXECUTABLE "/usr/bin/python3.5") diff --git a/Dockerfile b/Dockerfile index cea04965e..0b08ba801 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,47 @@ -FROM miyurud/jasminegraph +FROM ubuntu:focal +WORKDIR /home/ubuntu +RUN mkdir software WORKDIR /home/ubuntu/software + RUN apt-get update -COPY . jasminegraph/ +RUN apt-get install -y apt-transport-https +RUN apt-get update +RUN apt-get install -y curl gnupg2 ca-certificates software-properties-common nlohmann-json3-dev +RUN apt-get install -y git cmake build-essential sqlite3 libsqlite3-dev libssl-dev librdkafka-dev libboost-all-dev libtool libxerces-c-dev libflatbuffers-dev python3-pip +RUN add-apt-repository ppa:deadsnakes/ppa +RUN apt-get install -y python3.5-dev +RUN apt-get install -y libjsoncpp-dev libspdlog-dev pigz + +RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - +RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" +RUN apt-get update +RUN apt-get install -y docker-ce-cli + +RUN git clone https://github.com/chinthakarukshan/metis.git +RUN git clone https://github.com/mfontanini/cppkafka.git + +WORKDIR /home/ubuntu/software/metis +RUN tar -xzf metis-5.1.0.tar.gz +WORKDIR /home/ubuntu/software/metis/metis-5.1.0 +RUN sed -i '/#define IDXTYPEWIDTH 32/c\#define IDXTYPEWIDTH 64' include/metis.h +RUN make config shared=1 cc=gcc +RUN make -j4 install + +RUN mkdir /home/ubuntu/software/cppkafka/build +WORKDIR /home/ubuntu/software/cppkafka/build +RUN cmake .. +RUN make -j4 +RUN make install + ENV HOME="/home/ubuntu" -RUN mkdir -p /var/tmp/nmon -WORKDIR /home/ubuntu/software/jasminegraph -RUN apt-get update && \ - sed -i '/target_link_libraries(JasmineGraph \/usr\/local\/lib\/libmetis.so)/c\target_link_libraries(JasmineGraph \/usr\/local\/lib\/libmetis.so)' CMakeLists.txt && \ - sed -i '/target_link_libraries(JasmineGraph \/usr\/local\/lib\/libxerces-c-3.2.so)/c\target_link_libraries(JasmineGraph \/usr\/local\/lib\/libxerces-c-3.2.so)' CMakeLists.txt && \ - sed -i '/target_link_libraries(JasmineGraph \/usr\/local\/lib\/libmetis.a)/c\#target_link_libraries(JasmineGraph \/usr\/local\/lib\/libmetis.a)' CMakeLists.txt && \ - sed -i '/target_link_libraries(JasmineGraph $ENV{HOME}\/software\/xerces-c-3.2.2\/lib\/libxerces-c.so)/c\#target_link_libraries(JasmineGraph $ENV{HOME}\/software\/xerces-c-3.2.2\/lib\/libxerces-c.so)' CMakeLists.txt && \ - sed -i '/target_link_libraries(JasmineGraph \/opt\/lib\/libxerces-c.a)/c\#target_link_libraries(JasmineGraph \/opt\/lib\/libxerces-c.a)' CMakeLists.txt && \ - sed -i '/target_link_libraries(JasmineGraph $ENV{HOME}\/software\/cppkafka\/build\/usr\/local\/lib\/libcppkafka.so)/c\target_link_libraries(JasmineGraph \/usr\/local\/lib\/libcppkafka.so)' CMakeLists.txt && \ - sed -i '/namespace JasminGraph.Edgestore;/c\namespace JasmineGraph.Edgestore;' src/util/dbutil/edgestore.fbs && \ - sed -i '/org.jasminegraph.partitioner.metis.bin=home\/ubuntu\/software\/metis-5.1.0\/bin/c\org.jasminegraph.partitioner.metis.bin=\/home\/ubuntu\/software\/metis\/metis-5.1.0\/bin' conf/jasminegraph-server.properties -WORKDIR /home/ubuntu/software/flatbuffers -RUN ./flatc --cpp -o /home/ubuntu/software/jasminegraph/src/util/dbutil /home/ubuntu/software/jasminegraph/src/util/dbutil/edgestore.fbs && \ - ./flatc --cpp -o /home/ubuntu/software/jasminegraph/src/util/dbutil /home/ubuntu/software/jasminegraph/src/util/dbutil/attributestore.fbs && \ - ./flatc --cpp -o /home/ubuntu/software/jasminegraph/src/util/dbutil /home/ubuntu/software/jasminegraph/src/util/dbutil/partedgemapstore.fbs -WORKDIR /home/ubuntu/software/jasminegraph ENV JASMINEGRAPH_HOME="/home/ubuntu/software/jasminegraph" +RUN mkdir /home/ubuntu/software/jasminegraph +WORKDIR /home/ubuntu/software/jasminegraph +RUN pip install tensorflow==2.5.3 +RUN pip install -U scikit-learn +COPY . . +RUN pip install -r ./GraphSAGE/requirements + RUN sh build.sh ENTRYPOINT ["/home/ubuntu/software/jasminegraph/run-docker.sh"] -CMD ["bash"] +CMD ["bash"] \ No newline at end of file diff --git a/README.md b/README.md index f4c7acbb0..9d9c01f85 100755 --- a/README.md +++ b/README.md @@ -84,7 +84,6 @@ JasmineGraph can be run by executing the run.sh script. This will start master o ## 4. Building and Running JasmineGraph on Docker JasmineGraph can be run inside a docker image. After cloning the project, build the image as follows: - cd docker docker build -t jasminegraph . diff --git a/src/partitioner/local/JSONParser.cpp b/src/partitioner/local/JSONParser.cpp index b854dc141..13ea0541b 100644 --- a/src/partitioner/local/JSONParser.cpp +++ b/src/partitioner/local/JSONParser.cpp @@ -20,7 +20,7 @@ limitations under the License. #include #include -#include "json/json.h" +#include #include #include #include From 2d119a369b19cf3281b10e731dcb40a92c2d5564 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 25 Jul 2023 12:59:05 +0530 Subject: [PATCH 08/45] Remove conflicting transitive dependencies from graphsage requirements --- GraphSAGE/requirements | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/GraphSAGE/requirements b/GraphSAGE/requirements index d2d729308..3cc3d78ae 100644 --- a/GraphSAGE/requirements +++ b/GraphSAGE/requirements @@ -1,25 +1,5 @@ -absl-py==0.2.2 -astor==0.6.2 -backports.weakref==1.0.post1 -bleach==1.5.0 -decorator==4.3.0 -enum34==1.1.6 -funcsigs==1.0.2 -futures==3.2.0 -gast==0.2.0 -grpcio==1.12.1 -html5lib==0.9999999 -Markdown==2.6.11 -mock==2.0.0 networkx==1.11 -numpy==1.14.5 -pbr==4.0.4 -protobuf==3.6.0 -scikit-learn==0.19.1 -scipy==1.1.0 -six==1.11.0 -sklearn==0.0 -tensorboard==1.8.0 -tensorflow==1.8.0 -termcolor==1.1.0 -Werkzeug==0.14.1 +numpy==1.17.3 +scipy==1.4.1 +joblib==1.1.1 +threadpoolctl==2.0.0 \ No newline at end of file From 307e8a411c14ef36dc7227f03995b4897381ba35 Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Tue, 25 Jul 2023 17:02:29 +0530 Subject: [PATCH 09/45] Fixed some compiler warnings --- build.sh | 2 +- src/backend/JasmineGraphBackend.cpp | 8 +- src/frontend/JasmineGraphFrontEnd.cpp | 57 +-- .../executor/impl/TriangleCountExecutor.cpp | 18 +- .../executor/impl/TriangleCountExecutor.h | 2 +- src/frontend/core/scheduler/JobScheduler.cpp | 1 + .../JasmineGraphIncrementalLocalStore.cpp | 4 +- .../JasmineGraphIncrementalLocalStore.h | 2 +- src/metadb/SQLiteDBInterface.cpp | 6 +- .../trainer/JasminGraphTrainingInitiator.cpp | 14 +- src/partitioner/local/RDFParser.cpp | 2 +- src/partitioner/local/RDFParser.h | 2 +- src/performance/metrics/PerformanceUtil.cpp | 24 +- src/performance/metrics/PerformanceUtil.h | 10 +- .../metrics/StatisticCollector.cpp | 2 + .../PerformanceSQLiteDBInterface.cpp | 5 +- .../JasminGraphLinkPredictor.cpp | 4 +- .../linkprediction/JasminGraphLinkPredictor.h | 2 +- src/server/JasmineGraphInstance.cpp | 19 +- ...asmineGraphInstanceFileTransferService.cpp | 9 +- .../JasmineGraphInstanceFileTransferService.h | 2 +- src/server/JasmineGraphInstanceService.cpp | 325 +++++++++--------- src/server/JasmineGraphInstanceService.h | 2 +- src/server/JasmineGraphServer.cpp | 38 +- src/server/JasmineGraphServer.h | 2 +- src/util/kafka/KafkaCC.cpp | 1 + 26 files changed, 296 insertions(+), 267 deletions(-) diff --git a/build.sh b/build.sh index 21ed4a133..02bb6c372 100755 --- a/build.sh +++ b/build.sh @@ -4,4 +4,4 @@ if [ "$1" == "--debug" ]; then else cmake clean . fi -cmake --build . --target JasmineGraph -- -j 2 +cmake --build . --target JasmineGraph -- -j 4 diff --git a/src/backend/JasmineGraphBackend.cpp b/src/backend/JasmineGraphBackend.cpp index dfefb7db0..39e08531f 100644 --- a/src/backend/JasmineGraphBackend.cpp +++ b/src/backend/JasmineGraphBackend.cpp @@ -27,7 +27,7 @@ void *backendservicesesion(void *dummyPt) { int connFd = sessionargs->connFd; SQLiteDBInterface sqLiteDbInterface = sessionargs->sqlite; backend_logger.log("Thread No: " + to_string(pthread_self()), "info"); - char data[300]; + char data[301]; bzero(data, 301); bool loop = false; while (!loop) { @@ -46,7 +46,7 @@ void *backendservicesesion(void *dummyPt) { write(connFd, HANDSHAKE_OK.c_str(), HANDSHAKE_OK.size()); write(connFd, "\r\n", 2); - char host[300]; + char host[301]; bzero(host, 301); read(connFd, host, 300); string hostname(host); @@ -66,7 +66,7 @@ void *backendservicesesion(void *dummyPt) { } // We get the name and the path to graph as a pair separated by |. - char worker_info_data[300]; + char worker_info_data[301]; bzero(worker_info_data, 301); string name = ""; @@ -92,6 +92,7 @@ void *backendservicesesion(void *dummyPt) { } backend_logger.log("Closing thread " + to_string(pthread_self()) + " and connection", "info"); close(connFd); + return NULL; } JasmineGraphBackend::JasmineGraphBackend(SQLiteDBInterface db, int numberOfWorkers) { @@ -170,4 +171,5 @@ int JasmineGraphBackend::run() { for (int i = 0; i < noThread; i++) { pthread_join(threadA[i], NULL); } + return 1; } diff --git a/src/frontend/JasmineGraphFrontEnd.cpp b/src/frontend/JasmineGraphFrontEnd.cpp index 383bfccdb..5dd3f46ae 100755 --- a/src/frontend/JasmineGraphFrontEnd.cpp +++ b/src/frontend/JasmineGraphFrontEnd.cpp @@ -103,7 +103,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface PerformanceSQLiteDBInterface perfSqlite, JobScheduler jobScheduler) { frontend_logger.log("Thread No: " + to_string(pthread_self()), "info"); frontend_logger.log("Master IP: " + masterIP, "info"); - char data[FRONTEND_DATA_LENGTH]; + char data[FRONTEND_DATA_LENGTH+1]; bzero(data, FRONTEND_DATA_LENGTH + 1); Utils utils; vector workerList = utils.getWorkerList(sqlite); @@ -240,7 +240,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_data[FRONTEND_DATA_LENGTH]; + char graph_data[FRONTEND_DATA_LENGTH+1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); string name = ""; string path = ""; @@ -316,8 +316,8 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_data[FRONTEND_DATA_LENGTH]; - char partition_count[FRONTEND_DATA_LENGTH]; + char graph_data[FRONTEND_DATA_LENGTH+1]; + char partition_count[FRONTEND_DATA_LENGTH + 1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); string name = ""; string path = ""; @@ -405,7 +405,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface write(connFd, SEND.c_str(), FRONTEND_COMMAND_LENGTH); write(connFd, "\r\n", 2); - char graph_data[FRONTEND_DATA_LENGTH]; + char graph_data[FRONTEND_DATA_LENGTH + 1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); string name = ""; string path = ""; @@ -503,7 +503,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char type[20]; + char type[21]; bzero(type, 21); read(connFd, type, 20); string graphType(type); @@ -537,7 +537,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - char graph_data[FRONTEND_DATA_LENGTH]; + char graph_data[FRONTEND_DATA_LENGTH+1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); string name = ""; string edgeListPath = ""; @@ -641,7 +641,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // Get user response. - char user_res[FRONTEND_DATA_LENGTH]; + char user_res[FRONTEND_DATA_LENGTH + 1]; bzero(user_res, FRONTEND_DATA_LENGTH + 1); read(connFd, user_res, FRONTEND_DATA_LENGTH); string user_res_s(user_res); @@ -673,7 +673,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the file path here. - char file_path[FRONTEND_DATA_LENGTH]; + char file_path[FRONTEND_DATA_LENGTH + 1]; bzero(file_path, FRONTEND_DATA_LENGTH + 1); read(connFd, file_path, FRONTEND_DATA_LENGTH); string file_path_s(file_path); @@ -716,7 +716,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the topic name here. - char topic_name[FRONTEND_DATA_LENGTH]; + char topic_name[FRONTEND_DATA_LENGTH + 1]; bzero(topic_name, FRONTEND_DATA_LENGTH + 1); read(connFd, topic_name, FRONTEND_DATA_LENGTH); @@ -772,7 +772,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_id[FRONTEND_DATA_LENGTH]; + char graph_id[FRONTEND_DATA_LENGTH + 1]; bzero(graph_id, FRONTEND_DATA_LENGTH + 1); string name = ""; string path = ""; @@ -832,7 +832,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_data[FRONTEND_DATA_LENGTH]; + char graph_data[FRONTEND_DATA_LENGTH + 1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); @@ -877,7 +877,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_id_data[300]; + char graph_id_data[301]; bzero(graph_id_data, 301); string name = ""; @@ -913,7 +913,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char priority_data[300]; + char priority_data[301]; bzero(priority_data, 301); read(connFd, priority_data, FRONTEND_DATA_LENGTH); @@ -1015,7 +1015,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface frontend_logger.log("Error writing to socket", "error"); } - char graph_id_data[300]; + char graph_id_data[301]; bzero(graph_id_data, 301); string name = ""; @@ -1064,7 +1064,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface frontend_logger.log("Error writing to socket", "error"); } - char graph_id_data[300]; + char graph_id_data[301]; bzero(graph_id_data, 301); string name = ""; @@ -1117,7 +1117,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface message = "Send -- \n"; write(connFd, message.c_str(), message.size()); - char train_data[300]; + char train_data[301]; bzero(train_data, 301); read(connFd, train_data, 300); @@ -1175,7 +1175,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface message = "Send -- -- .. \n"; write(connFd, message.c_str(), message.size()); - char train_data[300]; + char train_data[301]; bzero(train_data, 301); read(connFd, train_data, 300); @@ -1251,7 +1251,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char graph_id[FRONTEND_DATA_LENGTH]; + char graph_id[FRONTEND_DATA_LENGTH + 1]; bzero(graph_id, FRONTEND_DATA_LENGTH + 1); read(connFd, graph_id, FRONTEND_DATA_LENGTH); @@ -1293,7 +1293,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char graph_id[FRONTEND_DATA_LENGTH]; + char graph_id[FRONTEND_DATA_LENGTH + 1]; bzero(graph_id, FRONTEND_DATA_LENGTH + 1); read(connFd, graph_id, FRONTEND_DATA_LENGTH); @@ -1335,7 +1335,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char page_rank_command[FRONTEND_DATA_LENGTH]; + char page_rank_command[FRONTEND_DATA_LENGTH + 1]; bzero(page_rank_command, FRONTEND_DATA_LENGTH + 1); string name = ""; string path = ""; @@ -1402,7 +1402,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char graph_id[FRONTEND_DATA_LENGTH]; + char graph_id[FRONTEND_DATA_LENGTH + 1]; bzero(graph_id, FRONTEND_DATA_LENGTH + 1); read(connFd, graph_id, FRONTEND_DATA_LENGTH); @@ -1444,7 +1444,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char graph_id[FRONTEND_DATA_LENGTH]; + char graph_id[FRONTEND_DATA_LENGTH + 1]; bzero(graph_id, FRONTEND_DATA_LENGTH + 1); read(connFd, graph_id, FRONTEND_DATA_LENGTH); @@ -1480,7 +1480,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface frontend_logger.log("Error writing to socket", "error"); } - char predict_data[300]; + char predict_data[301]; bzero(predict_data, 301); string graphID = ""; string path = ""; @@ -1525,7 +1525,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface frontend_logger.log("Error writing to socket", "error"); } - char worker_data[300]; + char worker_data[301]; bzero(worker_data, 301); read(connFd, worker_data, 300); @@ -1569,7 +1569,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface frontend_logger.log("Error writing to socket", "error"); } - char category[FRONTEND_DATA_LENGTH]; + char category[FRONTEND_DATA_LENGTH + 1]; bzero(category, FRONTEND_DATA_LENGTH + 1); read(connFd, category, FRONTEND_DATA_LENGTH); @@ -1654,6 +1654,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } frontend_logger.log("Closing thread " + to_string(pthread_self()) + " and connection", "info"); close(connFd); + return NULL; } JasmineGraphFrontEnd::JasmineGraphFrontEnd(SQLiteDBInterface db, PerformanceSQLiteDBInterface perfDb, std::string masterIP, @@ -1982,7 +1983,7 @@ void JasmineGraphServer::pageRank(std::string graphID, double alpha, int iterati } int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2172,7 +2173,7 @@ void JasmineGraphServer::egoNet(std::string graphID) { workerList.pop_back(); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; diff --git a/src/frontend/core/executor/impl/TriangleCountExecutor.cpp b/src/frontend/core/executor/impl/TriangleCountExecutor.cpp index 931b5d023..c3bc111ba 100644 --- a/src/frontend/core/executor/impl/TriangleCountExecutor.cpp +++ b/src/frontend/core/executor/impl/TriangleCountExecutor.cpp @@ -297,7 +297,7 @@ long TriangleCountExecutor::getTriangleCount(int graphId, std::string host, int std::string masterIP, int uniqueId, bool isCompositeAggregation, int threadPriority) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -601,7 +601,7 @@ bool TriangleCountExecutor::proceedOrNot(std::set partitionSet,int parti aggregateWeightMutex.unlock(); } -bool TriangleCountExecutor::updateMap(int partitionId) { +void TriangleCountExecutor::updateMap(int partitionId) { const std::lock_guard lock(aggregateWeightMutex); int currentWeight = aggregateWeightMap[partitionId]; @@ -792,7 +792,7 @@ string TriangleCountExecutor::isFileAccessibleToWorker(std::string graphId, std: std::string masterIP, std::string fileType, std::string fileName) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -936,7 +936,7 @@ std::string TriangleCountExecutor::copyCompositeCentralStoreToAggregator(std::st std::string aggregatorDataPort, std::string fileName, std::string masterIP) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1127,7 +1127,7 @@ TriangleCountExecutor::countCompositeCentralStoreTriangles(std::string aggregato std::string masterIP, std::string availableFileList, int threadPriority) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1240,8 +1240,8 @@ TriangleCountExecutor::countCompositeCentralStoreTriangles(std::string aggregato std::string chunk = chunksVector.at(loopCount); write(sockfd, chunk.c_str(), chunk.size()); } else { - bzero(data, INSTANCE_DATA_LENGTH); - read(sockfd, data, INSTANCE_DATA_LENGTH); + bzero(data, 301); + read(sockfd, data, 300); string chunkStatus = (data); std::string chunk = chunksVector.at(loopCount); write(sockfd, chunk.c_str(), chunk.size()); @@ -1328,7 +1328,7 @@ std::string TriangleCountExecutor::copyCentralStoreToAggregator(std::string aggr std::string aggregatorDataPort, int graphId, int partitionId, std::string masterIP) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1520,7 +1520,7 @@ string TriangleCountExecutor::countCentralStoreTriangles(std::string aggregatorH std::string graphId, std::string masterIP, int threadPriority) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; diff --git a/src/frontend/core/executor/impl/TriangleCountExecutor.h b/src/frontend/core/executor/impl/TriangleCountExecutor.h index 48fc2e1b5..5a4765709 100644 --- a/src/frontend/core/executor/impl/TriangleCountExecutor.h +++ b/src/frontend/core/executor/impl/TriangleCountExecutor.h @@ -67,7 +67,7 @@ class TriangleCountExecutor: public AbstractExecutor { static bool proceedOrNot(std::set partitionSet,int partitionId); - static bool updateMap(int partitionId); + static void updateMap(int partitionId); static int updateTriangleTreeAndGetTriangleCount(std::vector triangles); diff --git a/src/frontend/core/scheduler/JobScheduler.cpp b/src/frontend/core/scheduler/JobScheduler.cpp index de9a39bee..3979764cc 100644 --- a/src/frontend/core/scheduler/JobScheduler.cpp +++ b/src/frontend/core/scheduler/JobScheduler.cpp @@ -91,6 +91,7 @@ void *startScheduler(void *dummyPt) { std::this_thread::sleep_for(std::chrono::seconds(Conts::SCHEDULER_SLEEP_TIME)); } } + return NULL; } void JobScheduler::init() { diff --git a/src/localstore/incremental/JasmineGraphIncrementalLocalStore.cpp b/src/localstore/incremental/JasmineGraphIncrementalLocalStore.cpp index 8e423aa53..63194f80e 100644 --- a/src/localstore/incremental/JasmineGraphIncrementalLocalStore.cpp +++ b/src/localstore/incremental/JasmineGraphIncrementalLocalStore.cpp @@ -45,7 +45,7 @@ std::pair JasmineGraphIncrementalLocalStore::getIDs(s } } -std::string JasmineGraphIncrementalLocalStore::addEdgeFromString(std::string edgeString) { +void JasmineGraphIncrementalLocalStore::addEdgeFromString(std::string edgeString) { try { auto edgeJson = json::parse(edgeString); @@ -57,7 +57,7 @@ std::string JasmineGraphIncrementalLocalStore::addEdgeFromString(std::string edg RelationBlock* newRelation = this->nm->addEdge({sId, dId}); if (!newRelation) { - return ""; + return; } char value[PropertyLink::MAX_VALUE_SIZE] = {}; diff --git a/src/localstore/incremental/JasmineGraphIncrementalLocalStore.h b/src/localstore/incremental/JasmineGraphIncrementalLocalStore.h index b6f331681..822dd830d 100644 --- a/src/localstore/incremental/JasmineGraphIncrementalLocalStore.h +++ b/src/localstore/incremental/JasmineGraphIncrementalLocalStore.h @@ -25,7 +25,7 @@ class JasmineGraphIncrementalLocalStore public: GraphConfig gc; NodeManager *nm; - std::string addEdgeFromString(std::string edgeString); + void addEdgeFromString(std::string edgeString); static std::pair getIDs(std::string edgeString ); JasmineGraphIncrementalLocalStore(unsigned int graphID = 0, unsigned int partitionID = 0 ); }; diff --git a/src/metadb/SQLiteDBInterface.cpp b/src/metadb/SQLiteDBInterface.cpp index dec2c8702..2cbaad3ca 100644 --- a/src/metadb/SQLiteDBInterface.cpp +++ b/src/metadb/SQLiteDBInterface.cpp @@ -27,11 +27,12 @@ int SQLiteDBInterface::init() { return (-1); } else { db_logger.log("Database opened successfully", "info"); + return 0; } } int SQLiteDBInterface::finalize() { - sqlite3_close(database); + return sqlite3_close(database); } SQLiteDBInterface::SQLiteDBInterface() { @@ -70,12 +71,14 @@ vector >> SQLiteDBInterface::runSelect(std::string q } // This function inserts a new row to the DB and returns the last inserted row id +// returns -1 on error int SQLiteDBInterface::runInsert(std::string query) { char *zErrMsg = 0; int rc = sqlite3_exec(database, query.c_str(), NULL, NULL, &zErrMsg); if (rc != SQLITE_OK) { db_logger.log("SQL Error: " + string(zErrMsg) + " " + query, "error"); sqlite3_free(zErrMsg); + return -1; } else { db_logger.log("Insert operation done successfully", "info"); vector>> dbResults; @@ -86,6 +89,7 @@ int SQLiteDBInterface::runInsert(std::string query) { if (rc2 != SQLITE_OK) { db_logger.log("SQL Error: " + string(zErrMsg) + " " + query, "error"); sqlite3_free(zErrMsg); + return -1; } else { return std::stoi(dbResults[0][0].second); } diff --git a/src/ml/trainer/JasminGraphTrainingInitiator.cpp b/src/ml/trainer/JasminGraphTrainingInitiator.cpp index a3ada3109..8b63a8cd1 100644 --- a/src/ml/trainer/JasminGraphTrainingInitiator.cpp +++ b/src/ml/trainer/JasminGraphTrainingInitiator.cpp @@ -86,7 +86,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[DATA_LENGTH]; + char data[DATA_LENGTH+1]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -119,7 +119,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int //TODO::exit } - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH+1); int result_wr = write(sockfd, JasmineGraphInstanceProtocol::HANDSHAKE.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE.size()); if(result_wr < 0) { trainer_log.log("Error writing to socket", "error"); @@ -127,7 +127,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int } trainer_log.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE, "info"); - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH+1); read(sockfd, data, DATA_LENGTH); string response = (data); @@ -144,7 +144,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int trainer_log.log("Sent : " + server_host, "info"); - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH+1); read(sockfd, data, DATA_LENGTH); string response = (data); @@ -164,7 +164,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int } trainer_log.log("Sent : " + JasmineGraphInstanceProtocol::INITIATE_TRAIN, "info"); - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH+1); read(sockfd, data, DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -178,7 +178,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int } trainer_log.log("Sent : training args " + trainingArgs, "info"); - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH+1); read(sockfd, data, DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -192,7 +192,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int trainer_log.log("Sent : partition iteration " + to_string(iteration), "info"); - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH+1); read(sockfd, data, DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); diff --git a/src/partitioner/local/RDFParser.cpp b/src/partitioner/local/RDFParser.cpp index cd97b474e..f9bb4769a 100644 --- a/src/partitioner/local/RDFParser.cpp +++ b/src/partitioner/local/RDFParser.cpp @@ -404,7 +404,7 @@ long GetConfig::addToArticles(std::map *map, string URI) { return id; } -long GetConfig::addToEdges(std::map, int> *map, long node_1, long node_2, long article_id) { +void GetConfig::addToEdges(std::map, int> *map, long node_1, long node_2, long article_id) { map->insert({{node_1, node_2}, article_id}); diff --git a/src/partitioner/local/RDFParser.h b/src/partitioner/local/RDFParser.h index 6ebbe448b..5510299e6 100644 --- a/src/partitioner/local/RDFParser.h +++ b/src/partitioner/local/RDFParser.h @@ -72,7 +72,7 @@ class GetConfig { long addToAuthors(std::map *map, std::string URI); - long addToEdges(std::map, int> *map, long node_1, long node_2, long article_id); + void addToEdges(std::map, int> *map, long node_1, long node_2, long article_id); long addToArticles(std::map *map, std::string URI); diff --git a/src/performance/metrics/PerformanceUtil.cpp b/src/performance/metrics/PerformanceUtil.cpp index f6e3a2d93..c17de4bb0 100644 --- a/src/performance/metrics/PerformanceUtil.cpp +++ b/src/performance/metrics/PerformanceUtil.cpp @@ -21,7 +21,7 @@ Logger scheduler_logger; SQLiteDBInterface sqlLiteDB = *new SQLiteDBInterface(); PerformanceSQLiteDBInterface perfDb = *new PerformanceSQLiteDBInterface(); -int PerformanceUtil::init() { +void PerformanceUtil::init() { sqlLiteDB.init(); perfDb.init(); } @@ -198,10 +198,10 @@ std::vector PerformanceUtil::retrieveCurrentResourceUtiliza -int PerformanceUtil::collectRemotePerformanceData(std::string host, int port, std::string isVMStatManager, +void PerformanceUtil::collectRemotePerformanceData(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string hostId, std::string placeId) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -212,7 +212,7 @@ int PerformanceUtil::collectRemotePerformanceData(std::string host, int port, st if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return; } server = gethostbyname(host.c_str()); @@ -307,7 +307,7 @@ int PerformanceUtil::collectRemotePerformanceData(std::string host, int port, st } } -int PerformanceUtil::collectLocalPerformanceData(std::string isVMStatManager, std::string isResourceAllocationRequired, std::string hostId, std::string placeId) { +void PerformanceUtil::collectLocalPerformanceData(std::string isVMStatManager, std::string isResourceAllocationRequired, std::string hostId, std::string placeId) { StatisticCollector statisticCollector; Utils utils; statisticCollector.init(); @@ -352,7 +352,7 @@ int PerformanceUtil::collectRemoteSLAResourceUtilization(std::string host, int p std::string isResourceAllocationRequired, std::string placeId, int elapsedTime, std::string masterIP) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -466,7 +466,7 @@ int PerformanceUtil::collectRemoteSLAResourceUtilization(std::string host, int p } } -int PerformanceUtil::collectLocalSLAResourceUtilization(std::string placeId, int elapsedTime) { +void PerformanceUtil::collectLocalSLAResourceUtilization(std::string placeId, int elapsedTime) { StatisticCollector statisticCollector; Utils utils; statisticCollector.init(); @@ -514,7 +514,7 @@ ResourceConsumption PerformanceUtil::retrieveRemoteResourceConsumption(std::stri ResourceConsumption placeResourceConsumption; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1025,13 +1025,13 @@ std::string PerformanceUtil::getSLACategoryId(std::string command, std::string c } } -int PerformanceUtil::initiateCollectingRemoteSLAResourceUtilization(std::string host, int port, +void PerformanceUtil::initiateCollectingRemoteSLAResourceUtilization(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string placeId, int elapsedTime, std::string masterIP) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1043,7 +1043,7 @@ int PerformanceUtil::initiateCollectingRemoteSLAResourceUtilization(std::string if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return; } if (host.find('@') != std::string::npos) { @@ -1107,7 +1107,7 @@ std::string PerformanceUtil::requestRemoteLoadAverages(std::string host, int por std::string isResourceAllocationRequired, std::string placeId, int elapsedTime, std::string masterIP) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; diff --git a/src/performance/metrics/PerformanceUtil.h b/src/performance/metrics/PerformanceUtil.h index 03d1e2e1b..a06ff22e5 100644 --- a/src/performance/metrics/PerformanceUtil.h +++ b/src/performance/metrics/PerformanceUtil.h @@ -56,7 +56,7 @@ struct Place{ class PerformanceUtil { public: //PerformanceUtil(SQLiteDBInterface sqlLiteDB, PerformanceSQLiteDBInterface perfDb); - int init(); + void init(); static int collectPerformanceStatistics(); static int collectSLAResourceConsumption(std::vector placeList, std::string graphId, std::string masterIP, int elapsedTime); @@ -71,7 +71,7 @@ class PerformanceUtil { static void updateRemoteResourceConsumption(PerformanceSQLiteDBInterface performanceDb, std::string graphId, int partitionCount, std::vector placeList, std::string slaCategoryId, std::string masterIP); static std::string getSLACategoryId(std::string command, std::string category); - static int initiateCollectingRemoteSLAResourceUtilization(std::string host, int port, std::string isVMStatManager, + static void initiateCollectingRemoteSLAResourceUtilization(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string placeId, int elapsedTime, std::string masterIP); static std::string requestRemoteLoadAverages(std::string host, int port, @@ -83,12 +83,12 @@ class PerformanceUtil { private: //static SQLiteDBInterface sqlLiteDB; //static PerformanceSQLiteDBInterface perfDb; - static int collectRemotePerformanceData(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string hostId, std::string placeId); - static int collectLocalPerformanceData(std::string isVMStatManager, std::string isResourceAllocationRequired , std::string hostId, std::string placeId); + static void collectRemotePerformanceData(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string hostId, std::string placeId); + static void collectLocalPerformanceData(std::string isVMStatManager, std::string isResourceAllocationRequired , std::string hostId, std::string placeId); static int collectRemoteSLAResourceUtilization(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string placeId, int elapsedTime, std::string masterIP); - static int collectLocalSLAResourceUtilization(std::string placeId, int elapsedTime); + static void collectLocalSLAResourceUtilization(std::string placeId, int elapsedTime); static ResourceConsumption retrieveRemoteResourceConsumption(std::string host, int port, std::string hostId, std::string placeId); static ResourceConsumption retrieveLocalResourceConsumption(std::string hostId, std::string placeId); diff --git a/src/performance/metrics/StatisticCollector.cpp b/src/performance/metrics/StatisticCollector.cpp index a36a0d44b..7df86195c 100644 --- a/src/performance/metrics/StatisticCollector.cpp +++ b/src/performance/metrics/StatisticCollector.cpp @@ -31,6 +31,7 @@ int StatisticCollector::init() { if (strncmp(line, "processor", 9) == 0) numProcessors++; } fclose(file); + return 0; } @@ -126,6 +127,7 @@ long StatisticCollector::getTotalMemoryAllocated() { } file.ignore(std::numeric_limits::max(), '\n'); } + return 0; } int StatisticCollector::getTotalNumberofCores() { diff --git a/src/performancedb/PerformanceSQLiteDBInterface.cpp b/src/performancedb/PerformanceSQLiteDBInterface.cpp index c58beb82f..3d735d9c2 100644 --- a/src/performancedb/PerformanceSQLiteDBInterface.cpp +++ b/src/performancedb/PerformanceSQLiteDBInterface.cpp @@ -27,11 +27,12 @@ int PerformanceSQLiteDBInterface::init() { return (-1); } else { perfdb_logger.log("Database opened successfully", "info"); + return 0; } } int PerformanceSQLiteDBInterface::finalize() { - sqlite3_close(database); + return sqlite3_close(database); } PerformanceSQLiteDBInterface::PerformanceSQLiteDBInterface() { @@ -76,6 +77,7 @@ int PerformanceSQLiteDBInterface::runInsert(std::string query) { if (rc != SQLITE_OK) { perfdb_logger.log("SQL Error: " + string(zErrMsg), "error"); sqlite3_free(zErrMsg); + return -1; } else { perfdb_logger.log("Insert operation done successfully", "info"); vector>> dbResults; @@ -86,6 +88,7 @@ int PerformanceSQLiteDBInterface::runInsert(std::string query) { if (rc2 != SQLITE_OK) { fprintf(stderr, "SQL error: %s\n", zErrMsg); sqlite3_free(zErrMsg); + return -1; } else { return std::stoi(dbResults[0][0].second); } diff --git a/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp b/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp index 020d0fa0e..5f8b025e7 100644 --- a/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp +++ b/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp @@ -17,7 +17,7 @@ limitations under the License. Logger predictor_logger; -int JasminGraphLinkPredictor::initiateLinkPrediction(std::string graphID, std::string path, std::string masterIP) { +void JasminGraphLinkPredictor::initiateLinkPrediction(std::string graphID, std::string path, std::string masterIP) { JasmineGraphServer *jasmineServer = new JasmineGraphServer(); std::map graphPartitionedHosts = jasmineServer->getGraphPartitionedHosts( @@ -88,7 +88,7 @@ int JasminGraphLinkPredictor::sendQueryToWorker(std::string host, int port, int bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; diff --git a/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.h b/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.h index 66025d4eb..c56f8d4a6 100644 --- a/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.h +++ b/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.h @@ -23,7 +23,7 @@ limitations under the License. class JasminGraphLinkPredictor { public: - int initiateLinkPrediction(std::string graphID, std::string path, std::string masterIP); + void initiateLinkPrediction(std::string graphID, std::string path, std::string masterIP); int sendQueryToWorker(std::string host, int port, int dataPort, int selectedHostPartitionsNo, std::string graphID, std::string vertexCount, diff --git a/src/server/JasmineGraphInstance.cpp b/src/server/JasmineGraphInstance.cpp index fa1768f53..107df0532 100644 --- a/src/server/JasmineGraphInstance.cpp +++ b/src/server/JasmineGraphInstance.cpp @@ -22,12 +22,14 @@ void *runInstanceService(void *dummyPt) { refToInstance->instanceService = new JasmineGraphInstanceService(); refToInstance->instanceService->run(refToInstance->profile, refToInstance->masterHostName, refToInstance->hostName, refToInstance->serverPort, refToInstance->serverDataPort); + return NULL; } void *runFileTransferService(void *dummyPt) { JasmineGraphInstance *refToInstance = (JasmineGraphInstance *) dummyPt; refToInstance->ftpService = new JasmineGraphInstanceFileTransferService(); refToInstance->ftpService->run(refToInstance->serverDataPort); + return NULL; } int JasmineGraphInstance::start_running(string profile, string hostName, string masterHost,int serverPort, int serverDataPort, string enableNmon) { @@ -56,12 +58,12 @@ int JasmineGraphInstance::start_running(string profile, string hostName, string pthread_join(instanceCommunicatorThread,NULL); pthread_join(instanceFileTransferThread,NULL); - + return 0; } bool JasmineGraphInstance::acknowledgeMaster(string masterHost, string workerIP, string workerPort) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -205,7 +207,7 @@ bool JasmineGraphInstance::sendFileThroughService(std::string host, int dataPort std::string filePath) { Utils utils; int sockfd; - char data[300]; + char data[301]; socklen_t len; struct sockaddr_in serv_addr; struct hostent *server; @@ -214,7 +216,7 @@ bool JasmineGraphInstance::sendFileThroughService(std::string host, int dataPort if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return false; } server = gethostbyname(host.c_str()); @@ -231,6 +233,7 @@ bool JasmineGraphInstance::sendFileThroughService(std::string host, int dataPort serv_addr.sin_port = htons(dataPort); if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting to port " << dataPort << std::endl; + return false; } fileName = "jasminegraph-local_trained_model_store/"+fileName; @@ -247,7 +250,7 @@ bool JasmineGraphInstance::sendFileThroughService(std::string host, int dataPort if (fp == NULL) { printf("Error opening file\n"); close(sockfd); - return 0; + return false; } for (;;) { unsigned char buff[1024] = {0}; @@ -263,15 +266,19 @@ bool JasmineGraphInstance::sendFileThroughService(std::string host, int dataPort if (nread < 1024) { if (feof(fp)) //printf("End of file\n"); - if (ferror(fp)) + if (ferror(fp)){ printf("Error reading\n"); + return false; + } break; } } fclose(fp); close(sockfd); + return true; } + return false; } void JasmineGraphInstance::logLoadAverage(std::string name) { diff --git a/src/server/JasmineGraphInstanceFileTransferService.cpp b/src/server/JasmineGraphInstanceFileTransferService.cpp index 721e08dba..d69354380 100644 --- a/src/server/JasmineGraphInstanceFileTransferService.cpp +++ b/src/server/JasmineGraphInstanceFileTransferService.cpp @@ -23,7 +23,7 @@ void *filetransferservicesession(void *dummyPt) { filetransferservicesessionargs *sessionargs = (filetransferservicesessionargs *) dummyPt; int connFd = sessionargs->connFd; Utils utils; - char data[300]; + char data[301]; bzero(data, 301); read(connFd, data, 300); string fileName = (data); @@ -44,12 +44,13 @@ void *filetransferservicesession(void *dummyPt) { } } while (bytesReceived > 0); file.close(); + return NULL; } JasmineGraphInstanceFileTransferService::JasmineGraphInstanceFileTransferService() { } -int JasmineGraphInstanceFileTransferService::run(int dataPort) { +void JasmineGraphInstanceFileTransferService::run(int dataPort) { int listenFd; socklen_t len; @@ -60,7 +61,7 @@ int JasmineGraphInstanceFileTransferService::run(int dataPort) { listenFd = socket(AF_INET, SOCK_STREAM, 0); if (listenFd < 0) { std::cerr << "Cannot open socket" << std::endl; - return 0; + return; } bzero((char *) &svrAdd, sizeof(svrAdd)); @@ -79,7 +80,7 @@ int JasmineGraphInstanceFileTransferService::run(int dataPort) { //bind socket if (bind(listenFd, (struct sockaddr *) &svrAdd, sizeof(svrAdd)) < 0) { std::cerr << "Cannot bind on port " + dataPort << std::endl; - return 0; + return; } int connFd; listen(listenFd, 10); diff --git a/src/server/JasmineGraphInstanceFileTransferService.h b/src/server/JasmineGraphInstanceFileTransferService.h index 0f27b36c8..4b186a16c 100644 --- a/src/server/JasmineGraphInstanceFileTransferService.h +++ b/src/server/JasmineGraphInstanceFileTransferService.h @@ -37,7 +37,7 @@ class JasmineGraphInstanceFileTransferService { public: JasmineGraphInstanceFileTransferService(); - int run(int dataPort); + void run(int dataPort); }; diff --git a/src/server/JasmineGraphInstanceService.cpp b/src/server/JasmineGraphInstanceService.cpp index f6bf80b2e..c42b1b7e9 100644 --- a/src/server/JasmineGraphInstanceService.cpp +++ b/src/server/JasmineGraphInstanceService.cpp @@ -67,10 +67,10 @@ void *instanceservicesession(void *dummyPt) { utils.createDirectory(utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder")); - char data[INSTANCE_DATA_LENGTH]; + char data[INSTANCE_DATA_LENGTH+1]; bool loop = false; while (!loop) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string line = (data); @@ -87,7 +87,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::HANDSHAKE_OK.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE_OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE_OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); line = utils.trim_copy(line, " \f\n\r\t\v"); @@ -110,7 +110,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -118,14 +118,14 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); instance_logger.log("Received File name: " + fileName, "info"); write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); // int fileSize = atoi(size.c_str()); @@ -139,7 +139,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::FILE_RECV_CHK) == 0) { @@ -153,7 +153,7 @@ void *instanceservicesession(void *dummyPt) { continue; } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -178,7 +178,7 @@ void *instanceservicesession(void *dummyPt) { pthread_mutex_unlock(&file_lock); while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -189,7 +189,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -203,7 +203,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CENTRAL, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -211,7 +211,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -219,7 +219,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -233,7 +233,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -249,7 +249,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -269,7 +269,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -280,7 +280,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -293,7 +293,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_COMPOSITE_CENTRAL, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -301,7 +301,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -309,7 +309,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -323,7 +323,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -339,7 +339,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -359,7 +359,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -370,7 +370,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -383,7 +383,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::UPLOAD_RDF_ATTRIBUTES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -391,7 +391,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); // fileName = utils.trim_copy(fileName, " \f\n\r\t\v"); @@ -399,7 +399,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -412,7 +412,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::FILE_RECV_CHK) == 0) { @@ -427,7 +427,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -447,7 +447,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -458,7 +458,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -471,7 +471,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::UPLOAD_RDF_ATTRIBUTES_CENTRAL, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -479,7 +479,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); // fileName = utils.trim_copy(fileName, " \f\n\r\t\v"); @@ -487,7 +487,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -500,7 +500,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::FILE_RECV_CHK) == 0) { @@ -515,7 +515,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -535,7 +535,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -546,7 +546,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -559,7 +559,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::DELETE_GRAPH, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -567,7 +567,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_PARTITION_ID.c_str(), JasmineGraphInstanceProtocol::SEND_PARTITION_ID.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_PARTITION_ID, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); instance_logger.log("Received partition ID: " + partitionID, "info"); @@ -583,7 +583,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::DELETE_GRAPH_FRAGMENT, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); // Read the message read(connFd, data, INSTANCE_DATA_LENGTH); // Get graph ID from message @@ -603,7 +603,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : DP_CENTRALSTORE from server", "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -612,7 +612,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -621,7 +621,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -640,7 +640,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -649,7 +649,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -674,7 +674,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -683,7 +683,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -692,7 +692,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -715,7 +715,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -724,7 +724,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -748,7 +748,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -757,7 +757,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -766,7 +766,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -790,7 +790,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -799,7 +799,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -808,7 +808,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -824,7 +824,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphVertexCount = (data); graphVertexCount = utils.trim_copy(graphVertexCount, " \f\n\r\t\v"); @@ -833,7 +833,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string alphaValue = (data); alphaValue = utils.trim_copy(alphaValue, " \f\n\r\t\v"); @@ -844,7 +844,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string iterationsValue = (data); iterationsValue = utils.trim_copy(iterationsValue, " \f\n\r\t\v"); @@ -904,7 +904,7 @@ void *instanceservicesession(void *dummyPt) { string host = workerSocketPair[0]; int port = stoi(workerSocketPair[1]); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -983,7 +983,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -992,7 +992,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -1001,7 +1001,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -1017,7 +1017,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphVertexCount = (data); graphVertexCount = utils.trim_copy(graphVertexCount, " \f\n\r\t\v"); @@ -1026,7 +1026,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string alphaValue = (data); alphaValue = utils.trim_copy(alphaValue, " \f\n\r\t\v"); @@ -1037,7 +1037,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string iterationsValue = (data); iterationsValue = utils.trim_copy(iterationsValue, " \f\n\r\t\v"); @@ -1084,7 +1084,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -1093,7 +1093,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -1102,7 +1102,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = data; workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -1135,7 +1135,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -1144,7 +1144,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -1153,7 +1153,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -1211,21 +1211,21 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::TRIANGLES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphID, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionId = (data); partitionId = utils.trim_copy(partitionId, " \f\n\r\t\v"); instance_logger.log("Received Partition ID: " + partitionId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -1260,7 +1260,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -1268,7 +1268,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -1282,7 +1282,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1298,7 +1298,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1337,7 +1337,7 @@ void *instanceservicesession(void *dummyPt) { std::string movedFullFilePath = aggregatorFilePath + "/" + rawname; while (!utils.fileExists(movedFullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -1348,7 +1348,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -1363,7 +1363,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -1371,7 +1371,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -1385,7 +1385,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1401,7 +1401,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1440,7 +1440,7 @@ void *instanceservicesession(void *dummyPt) { std::string movedFullFilePath = aggregatorFilePath + "/" + rawname; while (!utils.fileExists(movedFullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -1451,7 +1451,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -1464,28 +1464,28 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::AGGREGATE_CENTRALSTORE_TRIANGLES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphId = (data); graphId = utils.trim_copy(graphId, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionId = (data); partitionId = utils.trim_copy(partitionId, " \f\n\r\t\v"); instance_logger.log("Received Partition ID: " + partitionId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionIdList = (data); partitionIdList = utils.trim_copy(partitionIdList, " \f\n\r\t\v"); instance_logger.log("Received Partition ID List : " + partitionIdList, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -1532,7 +1532,7 @@ void *instanceservicesession(void *dummyPt) { std::string chunk = chunksVector.at(loopCount); write(connFd, chunk.c_str(), chunk.size()); } else { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string chunkStatus = (data); std::string chunk = chunksVector.at(loopCount); @@ -1545,14 +1545,14 @@ void *instanceservicesession(void *dummyPt) { "Received : " + JasmineGraphInstanceProtocol::AGGREGATE_COMPOSITE_CENTRALSTORE_TRIANGLES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string availableFiles = (data); availableFiles = utils.trim_copy(availableFiles, " \f\n\r\t\v"); instance_logger.log("Received Available Files: " + availableFiles, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -1562,8 +1562,8 @@ void *instanceservicesession(void *dummyPt) { while (status == "/SEND") { write(connFd, status.c_str(), status.size()); - bzero(data, 301); - read(connFd, data, 300); + bzero(data, INSTANCE_DATA_LENGTH+1); + read(connFd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); status = response.substr(response.size() - 5); @@ -1575,7 +1575,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received Composite File List : " + compositeFileList, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -1620,7 +1620,7 @@ void *instanceservicesession(void *dummyPt) { std::string chunk = chunksVector.at(loopCount); write(connFd, chunk.c_str(), chunk.size()); } else { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string chunkStatus = (data); std::string chunk = chunksVector.at(loopCount); @@ -1632,14 +1632,14 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::PERFORMANCE_STATISTICS, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string isVMStatManager = (data); isVMStatManager = utils.trim_copy(isVMStatManager, " \f\n\r\t\v"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string isResourceAllocationRequired = (data); isResourceAllocationRequired = utils.trim_copy(isResourceAllocationRequired, " \f\n\r\t\v"); @@ -1836,7 +1836,7 @@ void *instanceservicesession(void *dummyPt) { std::string chunk = chunksVector.at(loopCount); write(connFd, chunk.c_str(), chunk.size()); } else { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string chunkStatus = (data); std::string chunk = chunksVector.at(loopCount); @@ -1847,7 +1847,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_TRAIN, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string trainData(data); @@ -1878,7 +1878,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_PARTITION_ITERATION.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_PARTITION_ITERATION, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partIteration(data); @@ -1886,7 +1886,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_PARTITION_ITERATION.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_PARTITION_COUNT, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partCount(data); @@ -1898,19 +1898,19 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_PREDICT, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphID, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string vertexCount = (data); vertexCount = utils.trim_copy(vertexCount, " \f\n\r\t\v"); instance_logger.log("Received vertexCount: " + vertexCount, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string ownPartitions = (data); ownPartitions = utils.trim_copy(ownPartitions, " \f\n\r\t\v"); @@ -1921,8 +1921,8 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_HOSTS.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_HOSTS, "info"); - char dataBuffer[INSTANCE_LONG_DATA_LENGTH]; - bzero(dataBuffer, INSTANCE_LONG_DATA_LENGTH); + char dataBuffer[INSTANCE_LONG_DATA_LENGTH+1]; + bzero(dataBuffer, INSTANCE_LONG_DATA_LENGTH+1); read(connFd, dataBuffer, INSTANCE_LONG_DATA_LENGTH); string hostList = (dataBuffer); instance_logger.log("Received Hosts List: " + hostList, "info"); @@ -1962,7 +1962,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); instance_logger.log("Received File name: " + fileName, "info"); @@ -1970,7 +1970,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -1982,7 +1982,7 @@ void *instanceservicesession(void *dummyPt) { utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + fileName; int fileSize = atoi(size.c_str()); while (utils.fileExists(fullFilePath) && utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1992,7 +1992,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -2031,31 +2031,31 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_MODEL_COLLECTION, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string serverHostName = (data); serverHostName = utils.trim_copy(serverHostName, " \f\n\r\t\v"); instance_logger.log("Received HostName: " + serverHostName, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string serverHostPort = (data); serverHostPort = utils.trim_copy(serverHostPort, " \f\n\r\t\v"); instance_logger.log("Received Port: " + serverHostPort, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string serverHostDataPort = (data); serverHostDataPort = utils.trim_copy(serverHostDataPort, " \f\n\r\t\v"); instance_logger.log("Received Data Port: " + serverHostDataPort, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphID, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -2073,14 +2073,14 @@ void *instanceservicesession(void *dummyPt) { int fileSize = utils.getFileSize(filePath); std::string fileLength = to_string(fileSize); // send file name - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::SEND_FILE_NAME) == 0) { write(connFd, fileName.c_str(), fileName.size()); instance_logger.log("Sent : File name " + fileName, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); // send file length @@ -2089,7 +2089,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, fileLength.c_str(), fileLength.size()); instance_logger.log("Sent : File length in bytes " + fileLength, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); // send content @@ -2107,7 +2107,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::FILE_RECV_CHK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::FILE_RECV_CHK, "info"); instance_logger.log("Checking if file is received", "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -2127,7 +2127,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK.c_str(), JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -2146,7 +2146,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_FRAGMENT_RESOLUTION, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string listOfPartitions = (data); listOfPartitions = utils.trim_copy(listOfPartitions, " \f\n\r\t\v"); @@ -2158,7 +2158,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::FRAGMENT_RESOLUTION_CHK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::FRAGMENT_RESOLUTION_CHK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string listOfPartitions = (data); @@ -2239,7 +2239,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_TYPE.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_TYPE.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_TYPE, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileType = (data); fileType = utils.trim_copy(fileType, " \f\n\r\t\v"); @@ -2247,14 +2247,14 @@ void *instanceservicesession(void *dummyPt) { if (fileType.compare(JasmineGraphInstanceProtocol::FILE_TYPE_CENTRALSTORE_AGGREGATE) == 0) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphId = (data); graphId = utils.trim_copy(graphId, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionId = (data); partitionId = utils.trim_copy(partitionId, " \f\n\r\t\v"); @@ -2277,7 +2277,7 @@ void *instanceservicesession(void *dummyPt) { } else if (fileType.compare(JasmineGraphInstanceProtocol::FILE_TYPE_CENTRALSTORE_COMPOSITE) == 0) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); fileName = utils.trim_copy(fileName, " \f\n\r\t\v"); @@ -2345,7 +2345,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::SEND_PRIORITY, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -2357,11 +2357,12 @@ void *instanceservicesession(void *dummyPt) { } instance_logger.log("Closing thread " + to_string(pthread_self()), "info"); close(connFd); + return NULL; } JasmineGraphInstanceService::JasmineGraphInstanceService() {} -int JasmineGraphInstanceService::run(string profile, string masterHost, string host, int serverPort, +void JasmineGraphInstanceService::run(string profile, string masterHost, string host, int serverPort, int serverDataPort) { int listenFd; socklen_t len; @@ -2372,7 +2373,7 @@ int JasmineGraphInstanceService::run(string profile, string masterHost, string h listenFd = socket(AF_INET, SOCK_STREAM, 0); if (listenFd < 0) { std::cerr << "Cannot open socket" << std::endl; - return 0; + return; } bzero((char *)&svrAdd, sizeof(svrAdd)); @@ -2391,7 +2392,7 @@ int JasmineGraphInstanceService::run(string profile, string masterHost, string h // bind socket if (bind(listenFd, (struct sockaddr *)&svrAdd, sizeof(svrAdd)) < 0) { std::cerr << "Cannot bind on port " + serverPort << std::endl; - return 0; + return; } listen(listenFd, 10); @@ -2899,7 +2900,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[INSTANCE_DATA_LENGTH]; + char data[INSTANCE_DATA_LENGTH+1]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2929,10 +2930,10 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi std::cerr << "ERROR connecting" << std::endl; // TODO::exit } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); write(sockfd, JasmineGraphInstanceProtocol::HANDSHAKE.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); @@ -2948,7 +2949,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi JasmineGraphInstanceProtocol::INITIATE_MODEL_COLLECTION.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::INITIATE_MODEL_COLLECTION, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -2978,14 +2979,14 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); string fileName = (data); instance_logger.log("Received File name: " + fileName, "info"); write(sockfd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -2997,7 +2998,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + fileName; int fileSize = atoi(size.c_str()); while (utils.fileExists(fullFilePath) && utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3007,7 +3008,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3027,7 +3028,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi utils.getJasmineGraphProperty("org.jasminegraph.server.instance.trainedmodelfolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -3038,7 +3039,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); if (response.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -3267,7 +3268,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[INSTANCE_DATA_LENGTH]; + char data[INSTANCE_DATA_LENGTH+1]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -3300,7 +3301,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int //TODO::exit } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); int result_wr = write(sockfd, JasmineGraphInstanceProtocol::HANDSHAKE.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE.size()); if(result_wr < 0) { @@ -3308,7 +3309,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); @@ -3324,7 +3325,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + masterIP, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3342,7 +3343,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CENTRAL, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -3360,7 +3361,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int int fileSize = utils.getFileSize(centralStoreFile); std::string fileLength = to_string(fileSize); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -3374,7 +3375,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : File name " + fileName, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3387,7 +3388,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : File length in bytes " + fileLength, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); if (response.compare(JasmineGraphInstanceProtocol::SEND_FILE_CONT) == 0) { @@ -3409,7 +3410,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::FILE_RECV_CHK, "info"); instance_logger.log("Checking if file is received", "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); if (response.compare(JasmineGraphInstanceProtocol::FILE_RECV_WAIT) == 0) { @@ -3434,7 +3435,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3463,7 +3464,7 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[INSTANCE_DATA_LENGTH]; + char data[INSTANCE_DATA_LENGTH+1]; socklen_t len; struct sockaddr_in serv_addr; struct hostent *server; @@ -3472,7 +3473,7 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return false; } server = gethostbyname(host.c_str()); @@ -3497,7 +3498,7 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d instance_logger.log("Error writing to socket", "error"); } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH+1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -3509,7 +3510,7 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d if (fp == NULL) { instance_logger.log("Error opening file", "error"); close(sockfd); - return 0; + return false; } for (;;) { @@ -3535,7 +3536,9 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d fclose(fp); close(sockfd); + return true; } + return false; } map calculateOutDegreeDist(string graphID, string partitionID, int serverPort, @@ -3575,7 +3578,7 @@ map calculateOutDegreeDist(string graphID, string partitionID, int s string host = workerSocketPair[0]; int port = stoi(workerSocketPair[1]); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -3790,7 +3793,7 @@ map calculateInDegreeDist(string graphID, string partitionID, int se string host = workerSocketPair[0]; int port = stoi(workerSocketPair[1]); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -4031,7 +4034,7 @@ void calculateEgoNet(string graphID, string partitionID, string host = workerSocketPair[0]; int port = stoi(workerSocketPair[1]); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; diff --git a/src/server/JasmineGraphInstanceService.h b/src/server/JasmineGraphInstanceService.h index 3c154df4c..fb73f875e 100644 --- a/src/server/JasmineGraphInstanceService.h +++ b/src/server/JasmineGraphInstanceService.h @@ -119,7 +119,7 @@ class JasmineGraphInstanceService { static const string END_OF_MESSAGE; JasmineGraphInstanceService(); - int run(string profile, string masterHost, string hostName, int serverPort, int serverDataPort); + void run(string profile, string masterHost, string hostName, int serverPort, int serverDataPort); static bool isGraphDBExists(std::string graphId, std::string partitionId); static bool isInstanceCentralStoreExists(std::string graphId, std::string partitionId); diff --git a/src/server/JasmineGraphServer.cpp b/src/server/JasmineGraphServer.cpp index 58f269b88..a5b0ae4c5 100644 --- a/src/server/JasmineGraphServer.cpp +++ b/src/server/JasmineGraphServer.cpp @@ -36,12 +36,14 @@ void *runfrontend(void *dummyPt) { refToServer->frontend = new JasmineGraphFrontEnd(refToServer->sqlite, refToServer->performanceSqlite, refToServer->masterHost, refToServer->jobScheduler); refToServer->frontend->run(); + return NULL; } void *runbackend(void *dummyPt) { JasmineGraphServer *refToServer = (JasmineGraphServer *) dummyPt; refToServer->backend = new JasmineGraphBackend(refToServer->sqlite, refToServer->numberOfWorkers); refToServer->backend->run(); + return NULL; } @@ -482,7 +484,7 @@ void JasmineGraphServer::resolveOperationalGraphs(){ workerPort = std::stoi(j->second); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -650,7 +652,7 @@ void JasmineGraphServer::deleteNonOperationalGraphFragment(int graphID) { } } -int JasmineGraphServer::shutdown_workers() { +void JasmineGraphServer::shutdown_workers() { std::cout << "Shutting the workers down" << std::endl; std::vector>::iterator mapIterator; for (mapIterator = hostWorkerMap.begin(); mapIterator < hostWorkerMap.end(); mapIterator++) { @@ -660,7 +662,7 @@ int JasmineGraphServer::shutdown_workers() { std::cout << pthread_self() << " host : " << worker.hostname << " port : " << worker.port << " DPort : " << worker.dataPort << std::endl; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -670,7 +672,7 @@ int JasmineGraphServer::shutdown_workers() { if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return; } std::string host = worker.hostname; @@ -823,7 +825,7 @@ bool JasmineGraphServer::batchUploadFile(std::string host, int port, int dataPor bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1020,7 +1022,7 @@ bool JasmineGraphServer::batchUploadCentralStore(std::string host, int port, int std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[300]; + char data[301]; struct sockaddr_in serv_addr; struct hostent *server; @@ -1258,7 +1260,7 @@ bool JasmineGraphServer::batchUploadAttributeFile(std::string host, int port, in std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[300]; + char data[301]; struct sockaddr_in serv_addr; struct hostent *server; @@ -1456,7 +1458,7 @@ bool JasmineGraphServer::batchUploadCentralAttributeFile(std::string host, int p std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[300]; + char data[301]; struct sockaddr_in serv_addr; struct hostent *server; @@ -1654,7 +1656,7 @@ bool JasmineGraphServer::batchUploadCompositeCentralstoreFile(std::string host, std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[300]; + char data[301]; struct sockaddr_in serv_addr; struct hostent *server; @@ -1849,7 +1851,7 @@ bool JasmineGraphServer::sendFileThroughService(std::string host, int dataPort, std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[300]; + char data[301]; socklen_t len; struct sockaddr_in serv_addr; struct hostent *server; @@ -1858,7 +1860,7 @@ bool JasmineGraphServer::sendFileThroughService(std::string host, int dataPort, if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return false; } server = gethostbyname(host.c_str()); @@ -1895,7 +1897,7 @@ bool JasmineGraphServer::sendFileThroughService(std::string host, int dataPort, if (fp == NULL) { //printf("Error opening file\n"); close(sockfd); - return 0; + return false; } for (;;) { @@ -1920,7 +1922,9 @@ bool JasmineGraphServer::sendFileThroughService(std::string host, int dataPort, fclose(fp); close(sockfd); + return true; } + return false; } void JasmineGraphServer::copyArtifactsToWorkers(std::string workerPath, std::string artifactLocation, @@ -2165,7 +2169,7 @@ int JasmineGraphServer::removeFragmentThroughService(string host, int port, stri Utils utils; std::cout << pthread_self() << " host : " << host << " port : " << port << std::endl; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2273,7 +2277,7 @@ int JasmineGraphServer::removePartitionThroughService(string host, int port, str Utils utils; std::cout << pthread_self() << " host : " << host << " port : " << port << std::endl; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2649,7 +2653,7 @@ void JasmineGraphServer::inDegreeDistribution(std::string graphID) { workerList.pop_back(); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2762,7 +2766,7 @@ void JasmineGraphServer::outDegreeDistribution(std::string graphID) { workerList.pop_back(); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2892,7 +2896,7 @@ void JasmineGraphServer::duplicateCentralStore(std::string graphID) { } int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; diff --git a/src/server/JasmineGraphServer.h b/src/server/JasmineGraphServer.h index d54e9576d..ba9fab24f 100644 --- a/src/server/JasmineGraphServer.h +++ b/src/server/JasmineGraphServer.h @@ -81,7 +81,7 @@ class JasmineGraphServer { void addInstanceDetailsToPerformanceDB(std::string host, std::vector portVector, std::string isMaster); - int shutdown_workers(); + void shutdown_workers(); int run(std::string profile, std::string masterIp, int numberofWorkers, std::string workerIps, std::string enableNmon); diff --git a/src/util/kafka/KafkaCC.cpp b/src/util/kafka/KafkaCC.cpp index 0b1692c58..d2deb7a56 100755 --- a/src/util/kafka/KafkaCC.cpp +++ b/src/util/kafka/KafkaCC.cpp @@ -66,4 +66,5 @@ void *KafkaConnector::startStream(string topicName, std::vector workerClients.at((int)partitionedEdge[1].second)->publish(edgeJson.dump()); } graphPartitioner.printStats(); + return NULL; } From 0ba389d9f1fee953395be0869658775d4730099c Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Tue, 25 Jul 2023 17:34:47 +0530 Subject: [PATCH 10/45] Fixed some compiler warnings: deprecations and non-returning functions --- .../core/executor/impl/TriangleCountExecutor.cpp | 9 +++++---- src/partitioner/local/RDFParser.cpp | 2 +- src/partitioner/local/RDFParser.h | 2 +- src/partitioner/local/RDFPartitioner.h | 3 +-- src/server/JasmineGraphInstance.cpp | 9 +++++---- src/server/JasmineGraphServer.cpp | 2 +- src/util/Utils.cpp | 13 ++++--------- 7 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/frontend/core/executor/impl/TriangleCountExecutor.cpp b/src/frontend/core/executor/impl/TriangleCountExecutor.cpp index c3bc111ba..8eb37a700 100644 --- a/src/frontend/core/executor/impl/TriangleCountExecutor.cpp +++ b/src/frontend/core/executor/impl/TriangleCountExecutor.cpp @@ -561,6 +561,7 @@ long TriangleCountExecutor::getTriangleCount(int graphId, std::string host, int triangleCount_logger.log("There was an error in the upload process and the response is :: " + response, "error"); } + return 0; } bool TriangleCountExecutor::proceedOrNot(std::set partitionSet,int partitionId) { @@ -586,19 +587,19 @@ bool TriangleCountExecutor::proceedOrNot(std::set partitionSet,int parti } } + bool result; if (entryWithMinValue.first == partitionId) { int currentWeight = aggregateWeightMap[entryWithMinValue.first]; currentWeight++; aggregateWeightMap[entryWithMinValue.first] = currentWeight; triangleCount_logger.log("###COMPOSITE### Aggregator Initiated : Partition ID: " + std::to_string(partitionId) + " Weight : " + std::to_string(currentWeight), "info"); - return true; + result = true; } else { - return false; + result = false; } - - aggregateWeightMutex.unlock(); + return result; } void TriangleCountExecutor::updateMap(int partitionId) { diff --git a/src/partitioner/local/RDFParser.cpp b/src/partitioner/local/RDFParser.cpp index f9bb4769a..128589923 100644 --- a/src/partitioner/local/RDFParser.cpp +++ b/src/partitioner/local/RDFParser.cpp @@ -136,7 +136,7 @@ GetConfig::~GetConfig() { */ void GetConfig::readConfigFile(string &configFile, int graphId) -throw(std::runtime_error) { +/* throw(std::runtime_error) */ { struct stat fileStatus; this->graphID = graphId; diff --git a/src/partitioner/local/RDFParser.h b/src/partitioner/local/RDFParser.h index 5510299e6..929ffcc8a 100644 --- a/src/partitioner/local/RDFParser.h +++ b/src/partitioner/local/RDFParser.h @@ -61,7 +61,7 @@ class GetConfig { ~GetConfig(); - void readConfigFile(std::string &, int id) throw(std::runtime_error); + void readConfigFile(std::string &, int id) /* throw(std::runtime_error) */; char *getOptionA() { return m_OptionA; }; diff --git a/src/partitioner/local/RDFPartitioner.h b/src/partitioner/local/RDFPartitioner.h index c7959065c..2ba7c332e 100644 --- a/src/partitioner/local/RDFPartitioner.h +++ b/src/partitioner/local/RDFPartitioner.h @@ -30,7 +30,6 @@ limitations under the License. #include #include #include -#include #include #include @@ -101,7 +100,7 @@ class RDFPartitioner { std::map predicatesTemp; std::map > graphStorage; std::map>> relationsMap; - std::map>> attributeMap; + std::map>> attributeMap; long edgeCount=0; long vertexCount=0; diff --git a/src/server/JasmineGraphInstance.cpp b/src/server/JasmineGraphInstance.cpp index 107df0532..9bb291f0c 100644 --- a/src/server/JasmineGraphInstance.cpp +++ b/src/server/JasmineGraphInstance.cpp @@ -74,7 +74,7 @@ bool JasmineGraphInstance::acknowledgeMaster(string masterHost, string workerIP, if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return false; } if (masterHost.find('@') != std::string::npos) { @@ -156,17 +156,18 @@ bool JasmineGraphInstance::acknowledgeMaster(string masterHost, string workerIP, response = (data); if (response.compare(JasmineGraphInstanceProtocol::UPDATE_DONE) == 0) { - return 1; + return true; } } if (response.compare(JasmineGraphInstanceProtocol::OK) == 0) { - return 1; + return true; } } - return 0; + return false; } + return false; } void JasmineGraphInstance::startNmonAnalyzer(string enableNmon, int serverPort) { diff --git a/src/server/JasmineGraphServer.cpp b/src/server/JasmineGraphServer.cpp index a5b0ae4c5..964f90d3b 100644 --- a/src/server/JasmineGraphServer.cpp +++ b/src/server/JasmineGraphServer.cpp @@ -3654,7 +3654,7 @@ bool JasmineGraphServer::receiveGlobalWeights(std::string host, int port, std::s std::string length = ""; for (int i=0; i< HEADER_LENGTH; i++) { - if (data[i] != NULL){ + if (data[i]){ length += data[i]; } } diff --git a/src/util/Utils.cpp b/src/util/Utils.cpp index ea7a0a01b..1b0277c01 100644 --- a/src/util/Utils.cpp +++ b/src/util/Utils.cpp @@ -68,19 +68,11 @@ std::vector Utils::getFileContent(std::string file) { ifstream in(file); std::string str; - //map* result = new map(); vector *vec = new vector(); while (std::getline(in, str)) { - // output the line - //std::cout << str << std::endl; - // now we loop back and get the next line in 'str' - //if (str.length() > 0 && !(str.rfind("#", 0) == 0)) { if (str.length() > 0) { - //std::vector vec = split(str, '='); - //std::cout << vec.size() << std::endl; - //result->insert(std::pair(vec.at(0), vec.at(1))); vec->insert(vec->begin(), str); } } @@ -220,9 +212,12 @@ std::vector Utils::getListOfFilesInDirectory(const std::string dirN } pclose(input); if (!result.empty()) { - std::vector vec = split(result, '\r\n'); + std::vector vec = split(result, '\n'); for(std::vector::iterator it = vec.begin(); it != vec.end(); ++it){ std::string line = it->c_str(); + if (line.back() == '\r') { + line.pop_back(); + } if (line.rfind("-", 0) == 0) { std::string file = line.substr(line.find_last_of(' ') + 1); results.push_back(file); From 742be022402a806c0917f458edf288c377b04d79 Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Tue, 25 Jul 2023 17:40:00 +0530 Subject: [PATCH 11/45] Fixed segfault when uploading graphs --- conf/jasminegraph-server.properties | 4 ++-- run-docker.sh | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/jasminegraph-server.properties b/conf/jasminegraph-server.properties index 1d6542d44..5a8fb4e09 100644 --- a/conf/jasminegraph-server.properties +++ b/conf/jasminegraph-server.properties @@ -22,7 +22,7 @@ org.jasminegraph.server.host=localhost #Number of workers JasmineGraph cluster should use if it was not specified as a console argument org.jasminegraph.server.nworkers=2 #org.jasminegraph.server.npartitions is the number of partitions into which the graph should be partitioned -org.jasminegraph.server.npartitions=1 +org.jasminegraph.server.npartitions=2 org.jasminegraph.server.streaming.kafka.host=127.0.0.1:9092 #org.jasminegraph.server.runtime.location is the location where temporary files of JasmineGraph master is kept org.jasminegraph.server.runtime.location=./tmp @@ -32,7 +32,7 @@ org.jasminegraph.worker.path=/var/tmp/jasminegraph/ #if it is empty please leave a space, else it will cause an issue org.jasminegraph.artifact.path= #org.jasminegraph.partitioner.metis.bin is the location where the METIS graph partitioner's gpmetis executable is installed -org.jasminegraph.partitioner.metis.bin=/home/ubuntu/software/metis/metis-5.1.0/bin +org.jasminegraph.partitioner.metis.bin=/usr/local/bin #The following folder is the location where workers keep their data. #This is the location where the actual data storage takes place in JasmineGraph. org.jasminegraph.server.instance.datafolder=/var/tmp/jasminegraph-localstore diff --git a/run-docker.sh b/run-docker.sh index a17605ddd..ea7fe8ae7 100755 --- a/run-docker.sh +++ b/run-docker.sh @@ -69,6 +69,7 @@ else fi fi +export LD_LIBRARY_PATH=/home/ubuntu/software/metis/metis-5.1.0/build/Linux-x86_64/libmetis if [ $MODE -eq 1 ] ; then ./JasmineGraph "docker" $MODE $MASTERIP $WORKERS $WORKERIP $ENABLE_NMON From 189979c8e5a884ad169e31acc58c6c41aefe9a8e Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Tue, 25 Jul 2023 20:06:55 +0530 Subject: [PATCH 12/45] Added tests for lst, adgr, rmgr, ecnt, vcnt, and trian --- .dockerignore | 14 + .gitignore | 5 +- src/frontend/JasmineGraphFrontEnd.cpp | 41 +- src/server/JasmineGraphServer.cpp | 11 +- test-docker.sh | 33 + tests/docker-compose.yml | 27 + tests/env_init/data/powergrid.dl | 6594 +++++++++++++++++ .../databases/metadb/jasminegraph_meta.db | Bin 0 -> 61440 bytes .../performancedb/jasminegraph_performance.db | Bin 0 -> 49152 bytes tests/test.py | 75 + 10 files changed, 6776 insertions(+), 24 deletions(-) create mode 100644 .dockerignore create mode 100644 test-docker.sh create mode 100644 tests/docker-compose.yml create mode 100755 tests/env_init/data/powergrid.dl create mode 100755 tests/env_init/databases/metadb/jasminegraph_meta.db create mode 100755 tests/env_init/databases/performancedb/jasminegraph_performance.db create mode 100644 tests/test.py diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..a104de03d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,14 @@ +tests +metadb +performancedb +docs +logs +.git +.github +.vscode +.idea +.dockerignore +.gitignore +test-docker.sh +README.md +LICENSE \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8a93f9c72..3a7fb3f62 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +tests/env/ + # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 @@ -69,4 +71,5 @@ fabric.properties build/ # Log files -logs/ \ No newline at end of file +logs/ +.trash/ \ No newline at end of file diff --git a/src/frontend/JasmineGraphFrontEnd.cpp b/src/frontend/JasmineGraphFrontEnd.cpp index 5dd3f46ae..6cca3f0ba 100755 --- a/src/frontend/JasmineGraphFrontEnd.cpp +++ b/src/frontend/JasmineGraphFrontEnd.cpp @@ -191,7 +191,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } counter++; } - ss << "\n"; + ss << "\r\n"; } string result = ss.str(); if (result.size() == 0) { @@ -390,7 +390,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -449,13 +449,13 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface frontend_logger.log("Upload done", "info"); write(connFd, DONE.c_str(), DONE.size()); - write(connFd, "\n", 2); + write(connFd, "\r\n", 2); } else { frontend_logger.log("Model file does not exist on the specified path", "error"); continue; } } else if (line.compare(ADGR_CUST) == 0) { - string message = "Select a custom graph upload option\n"; + string message = "Select a custom graph upload option\r\n"; int result_wr = write(connFd, message.c_str(), message.size()); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); @@ -469,7 +469,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -482,7 +482,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -495,7 +495,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); @@ -530,7 +530,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface // If data type is not specified, it will be inferred from values present in the first line of the attribute file // The provided data type should be the largest in the following order: float > int32 > int16 > int8 // Inferred data type will be the largest type based on the values present in the attribute file first line - message = "Send |||(optional)\n"; + message = "Send |||(optional)\r\n"; result_wr = write(connFd, message.c_str(), message.size()); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); @@ -614,7 +614,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -794,7 +794,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -809,7 +809,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -1108,13 +1108,12 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface Utils utils; std::string federatedEnabled = utils.getJasmineGraphProperty("org.jasminegraph.federated.enabled"); - string message = "Available main flags:\n"; + string message = "Available main flags:\r\n"; write(connFd, message.c_str(), message.size()); - string flags = - Conts::FLAGS::GRAPH_ID; + string flags = Conts::FLAGS::GRAPH_ID; write(connFd, flags.c_str(), flags.size()); - write(connFd, "\n", 2); - message = "Send -- \n"; + write(connFd, "\r\n", 2); + message = "Send -- \r\n"; write(connFd, message.c_str(), message.size()); char train_data[301]; @@ -1148,7 +1147,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface jasmineServer->initiateMerge(graphID, trainData, sqlite); } else if (line.compare(TRAIN) == 0) { - string message = "Available main flags:\n"; + string message = "Available main flags:\r\n"; int result_wr = write(connFd, message.c_str(), message.size()); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); @@ -1160,19 +1159,19 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } - message = "Send -- -- .. \n"; + message = "Send -- -- ..\r\n"; result_wr = write(connFd, message.c_str(), message.size()); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } write(connFd, flags.c_str(), flags.size()); - write(connFd, "\n", 2); - message = "Send -- -- .. \n"; + write(connFd, "\r\n", 2); + message = "Send -- -- ..\r\n"; write(connFd, message.c_str(), message.size()); char train_data[301]; diff --git a/src/server/JasmineGraphServer.cpp b/src/server/JasmineGraphServer.cpp index 964f90d3b..0c628f00b 100644 --- a/src/server/JasmineGraphServer.cpp +++ b/src/server/JasmineGraphServer.cpp @@ -325,6 +325,13 @@ void JasmineGraphServer::startRemoteWorkers(std::vector workerPortsVector, popen(serverStartScript.c_str(),"r"); } } else if (profile == "docker") { + std::string image_tag; + char *env_testing = getenv("TESTING"); + if (env_testing == NULL || strcasecmp(env_testing, "true")) { + image_tag = "latest"; + } else { + image_tag = "test"; + } for (int i =0 ; i < workerPortsVector.size() ; i++) { if (masterHost == host || host == "localhost") { serverStartScript = "docker run -v " + instanceDataFolder + ":" + instanceDataFolder + @@ -334,7 +341,7 @@ void JasmineGraphServer::startRemoteWorkers(std::vector workerPortsVector, std::to_string(workerPortsVector.at(i)) + ":" + std::to_string(workerPortsVector.at(i)) + " -p " + std::to_string(workerDataPortsVector.at(i)) + ":" + - std::to_string(workerDataPortsVector.at(i)) + " jasminegraph:latest --MODE 2 --HOST_NAME " + host + + std::to_string(workerDataPortsVector.at(i)) + " jasminegraph:" + image_tag + " --MODE 2 --HOST_NAME " + host + " --MASTERIP " + masterHost + " --SERVER_PORT " + std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; @@ -346,7 +353,7 @@ void JasmineGraphServer::startRemoteWorkers(std::vector workerPortsVector, std::to_string(workerPortsVector.at(i)) + ":" + std::to_string(workerPortsVector.at(i)) + " -p " + std::to_string(workerDataPortsVector.at(i)) + ":" + - std::to_string(workerDataPortsVector.at(i)) + " jasminegraph:latest --MODE 2 --HOST_NAME " + host + + std::to_string(workerDataPortsVector.at(i)) + " jasminegraph:" + image_tag + " --MODE 2 --HOST_NAME " + host + " --MASTERIP " + masterHost + " --SERVER_PORT " + std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; diff --git a/test-docker.sh b/test-docker.sh new file mode 100644 index 000000000..8c4175a8d --- /dev/null +++ b/test-docker.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +PROJECT_ROOT="$(pwd)" +mkdir -p logs/ + +run_id="$(date +%y%m%d_%H%M%S)" + +stop_and_remove_containers () { + docker ps -q | xargs docker kill &>/dev/null + docker container prune -f &>/dev/null +} + +build_and_run_docker () { + stop_and_remove_containers + cd "$PROJECT_ROOT" + docker build -t jasminegraph:test . |& tee "logs/${run_id}_build.txt" + docker compose -f tests/docker-compose.yml up |& tee "logs/${run_id}_run.txt" & +} + +rm -rf tests/env +cp -r tests/env_init tests/env +build_and_run_docker &>/dev/null + +# sleep until server starts listening +while ! nc -zvn 127.0.0.1 7777 &>/dev/null; do + sleep .2 +done + +timeout 1800 python3 -u tests/test.py |& tee "logs/${run_id}_test.txt" +exit_code="${PIPESTATUS[0]}" +rm -rf tests/env +stop_and_remove_containers +exit "$exit_code" \ No newline at end of file diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml new file mode 100644 index 000000000..c16e27626 --- /dev/null +++ b/tests/docker-compose.yml @@ -0,0 +1,27 @@ +version: '3.0' +services: + jasminegraph: + image: jasminegraph:test + ports: + - '7777:7777' + - '7778:7778' + volumes: + - '/var/run/docker.sock:/var/run/docker.sock:rw' + - './env/databases/metadb:/home/ubuntu/software/jasminegraph/metadb' + - './env/databases/performancedb:/home/ubuntu/software/jasminegraph/performancedb' + - './env/data:/var/tmp/data' + environment: + - TESTING=true + networks: + - jasminenet + command: --MODE 1 --MASTERIP 172.28.5.1 --WORKERS 2 --WORKERIP 172.28.5.1 --ENABLE_NMON false + +networks: + jasminenet: + name: jasminenet + driver: bridge + ipam: + config: + - subnet: 172.28.5.0/24 + ip_range: 172.28.5.0/24 + gateway: 172.28.5.1 diff --git a/tests/env_init/data/powergrid.dl b/tests/env_init/data/powergrid.dl new file mode 100755 index 000000000..7f337240c --- /dev/null +++ b/tests/env_init/data/powergrid.dl @@ -0,0 +1,6594 @@ +8 6 +8 7 +9 8 +10 9 +13 5 +13 12 +14 13 +15 13 +16 14 +17 14 +19 18 +20 19 +29 14 +34 33 +35 34 +36 35 +37 36 +38 36 +39 36 +42 41 +47 36 +47 44 +47 45 +47 46 +50 10 +51 21 +53 24 +58 25 +58 41 +59 58 +60 59 +61 9 +62 31 +68 63 +68 64 +68 65 +69 35 +69 66 +69 68 +70 67 +70 69 +73 72 +75 9 +75 48 +77 76 +79 78 +80 79 +82 81 +83 13 +86 71 +86 76 +88 4 +88 55 +88 87 +89 87 +90 88 +91 73 +94 11 +94 26 +94 43 +94 92 +94 93 +95 94 +97 34 +97 40 +98 28 +98 42 +98 57 +98 74 +98 82 +100 98 +100 99 +101 48 +104 31 +106 48 +107 55 +108 70 +109 54 +109 78 +110 76 +110 86 +111 52 +112 72 +113 112 +115 114 +116 108 +117 116 +118 116 +119 52 +119 56 +120 5 +120 51 +122 121 +123 30 +123 92 +123 101 +123 122 +125 11 +125 98 +129 95 +129 113 +129 126 +129 127 +129 128 +130 19 +130 29 +131 26 +131 94 +135 98 +136 25 +139 26 +139 50 +139 131 +139 138 +140 30 +140 102 +140 123 +140 138 +140 139 +141 35 +141 140 +142 35 +142 141 +143 138 +144 96 +145 103 +146 136 +147 14 +147 54 +148 96 +148 111 +148 119 +149 56 +150 138 +151 85 +151 143 +152 56 +153 103 +153 124 +153 146 +154 60 +154 62 +154 153 +155 32 +155 154 +156 153 +157 36 +157 153 +157 154 +158 153 +159 154 +160 29 +161 27 +163 43 +163 162 +164 163 +165 162 +166 27 +167 41 +167 58 +170 77 +170 168 +170 169 +171 47 +171 95 +171 170 +172 52 +172 88 +173 124 +173 154 +174 32 +174 92 +174 104 +175 56 +175 119 +176 21 +176 166 +178 88 +178 107 +178 177 +179 177 +180 177 +181 42 +181 150 +184 46 +184 80 +184 105 +184 182 +184 183 +185 76 +186 106 +186 140 +187 169 +187 185 +188 61 +189 156 +189 174 +190 18 +190 103 +191 77 +191 150 +191 163 +192 111 +192 144 +193 157 +193 192 +194 51 +194 124 +194 145 +195 88 +196 145 +196 161 +198 56 +198 88 +198 149 +198 152 +199 20 +199 80 +199 179 +200 184 +200 198 +201 197 +201 198 +201 199 +202 40 +202 143 +203 26 +204 111 +204 195 +205 9 +205 50 +205 98 +205 115 +205 138 +205 188 +206 179 +207 108 +207 116 +207 129 +207 205 +207 206 +208 9 +208 125 +209 61 +210 101 +211 210 +212 210 +213 210 +215 72 +215 112 +215 214 +218 41 +218 83 +218 217 +221 83 +221 220 +222 104 +222 134 +223 137 +224 71 +224 137 +224 219 +225 216 +225 221 +227 169 +227 223 +228 187 +228 216 +229 137 +229 168 +229 226 +230 187 +230 226 +231 53 +231 73 +232 41 +232 124 +234 143 +234 233 +235 129 +236 134 +236 135 +237 236 +240 239 +242 241 +247 245 +247 246 +250 248 +250 249 +252 238 +252 251 +253 252 +255 254 +257 246 +259 256 +259 257 +261 260 +262 261 +267 261 +267 266 +269 268 +274 270 +274 271 +274 272 +274 273 +275 274 +280 249 +280 279 +281 264 +282 279 +284 242 +284 254 +284 282 +284 283 +285 255 +285 284 +286 276 +287 260 +289 251 +289 252 +290 288 +292 291 +295 279 +295 282 +296 284 +296 295 +298 246 +298 278 +298 293 +299 255 +299 258 +299 298 +300 294 +300 297 +302 279 +302 282 +302 295 +302 301 +305 249 +305 280 +305 284 +305 304 +306 258 +306 285 +306 305 +307 303 +308 265 +308 297 +310 257 +311 258 +311 310 +312 249 +312 280 +313 249 +313 279 +313 280 +313 282 +313 295 +313 302 +313 305 +313 312 +314 277 +315 314 +316 240 +316 285 +316 299 +316 303 +316 306 +316 315 +318 238 +318 317 +319 251 +320 319 +321 263 +321 320 +322 252 +322 319 +323 308 +325 274 +325 292 +325 324 +326 314 +327 240 +328 327 +329 254 +330 247 +330 329 +333 239 +333 332 +334 261 +334 264 +334 281 +335 244 +335 278 +335 298 +336 290 +336 318 +337 240 +337 253 +337 316 +337 336 +338 336 +339 338 +340 297 +340 308 +340 331 +341 340 +342 243 +342 277 +343 298 +343 342 +344 262 +344 311 +345 262 +345 311 +346 269 +346 341 +350 260 +350 266 +350 349 +351 241 +351 276 +351 287 +352 334 +352 347 +352 348 +352 351 +353 309 +353 332 +354 239 +354 353 +355 243 +355 332 +355 342 +355 353 +356 315 +356 355 +357 330 +358 309 +360 249 +360 257 +360 280 +361 244 +361 359 +362 269 +362 274 +362 292 +362 299 +362 361 +363 242 +364 242 +365 242 +365 296 +366 242 +366 284 +367 251 +368 257 +368 310 +369 260 +369 350 +370 251 +370 319 +370 367 +371 246 +372 272 +373 335 +374 353 +376 252 +377 357 +378 246 +378 278 +378 371 +378 375 +379 327 +380 331 +381 257 +381 360 +382 260 +384 383 +386 0 +386 385 +387 386 +391 390 +392 391 +393 384 +394 391 +395 0 +395 393 +396 393 +397 396 +398 396 +399 396 +400 396 +402 392 +402 401 +403 402 +405 404 +406 392 +406 405 +408 407 +409 391 +411 402 +411 410 +414 413 +415 413 +417 416 +419 395 +420 396 +421 418 +421 419 +421 420 +423 391 +425 392 +425 414 +425 424 +426 384 +426 420 +426 425 +427 426 +429 383 +430 388 +430 416 +430 423 +431 405 +431 409 +432 431 +433 431 +435 402 +435 434 +436 392 +436 402 +436 432 +437 389 +437 408 +439 402 +439 422 +439 438 +441 430 +441 440 +442 394 +442 441 +443 424 +444 416 +444 424 +445 383 +445 386 +446 386 +446 429 +447 384 +447 393 +447 426 +449 448 +450 416 +451 0 +451 408 +452 413 +452 428 +453 451 +454 383 +455 383 +455 454 +456 408 +456 419 +457 394 +457 405 +459 413 +459 428 +459 455 +460 405 +460 457 +461 435 +461 458 +462 383 +462 413 +463 453 +464 413 +464 443 +465 449 +465 456 +466 442 +467 449 +467 463 +468 413 +468 443 +468 450 +469 416 +469 430 +469 464 +470 429 +470 454 +472 431 +472 438 +472 471 +473 412 +473 438 +477 476 +479 478 +480 477 +480 479 +481 474 +481 479 +484 477 +484 483 +485 482 +485 484 +486 485 +489 482 +489 485 +491 481 +491 487 +492 478 +493 480 +493 484 +493 492 +494 482 +494 486 +495 482 +496 91 +496 484 +496 495 +497 485 +497 492 +498 478 +498 485 +499 214 +499 496 +501 500 +504 502 +504 503 +512 511 +513 511 +519 515 +520 516 +520 517 +520 518 +520 519 +522 116 +522 521 +523 504 +524 523 +525 523 +527 526 +528 524 +529 528 +530 525 +530 528 +531 530 +532 523 +532 526 +533 532 +534 511 +536 535 +537 536 +538 511 +538 534 +539 506 +539 507 +540 539 +541 539 +542 539 +543 539 +544 539 +545 509 +545 543 +545 544 +546 506 +546 507 +548 505 +548 532 +548 547 +549 501 +549 548 +550 511 +550 534 +550 542 +551 505 +551 511 +551 538 +551 548 +551 550 +552 548 +553 546 +554 546 +555 547 +555 552 +555 553 +555 554 +556 504 +556 532 +557 536 +558 546 +558 557 +559 535 +559 546 +561 510 +561 543 +561 544 +561 560 +562 558 +563 556 +563 557 +563 562 +564 504 +564 532 +565 506 +565 508 +565 543 +566 507 +566 508 +566 544 +568 532 +568 548 +568 567 +569 540 +569 541 +570 501 +570 522 +570 533 +570 569 +571 509 +572 509 +573 501 +573 532 +574 535 +578 577 +582 576 +583 582 +584 582 +585 581 +585 584 +587 586 +590 589 +591 589 +593 592 +594 578 +594 589 +595 594 +596 594 +597 588 +597 592 +598 597 +599 597 +600 597 +601 597 +602 597 +604 603 +605 604 +606 604 +609 608 +610 578 +610 607 +610 609 +611 609 +612 582 +613 612 +614 585 +614 613 +616 615 +618 587 +618 617 +619 614 +620 597 +622 621 +624 587 +624 623 +625 576 +626 581 +626 619 +628 594 +628 627 +630 592 +630 629 +632 631 +634 632 +634 633 +636 614 +636 635 +639 616 +639 632 +639 638 +640 576 +640 612 +641 640 +644 643 +645 582 +646 645 +648 636 +648 644 +648 647 +650 649 +652 584 +653 622 +653 639 +653 651 +653 652 +655 624 +655 654 +657 575 +657 597 +657 604 +657 609 +658 605 +658 628 +658 642 +658 656 +658 657 +659 575 +660 575 +662 609 +662 661 +664 579 +664 663 +666 605 +666 665 +667 584 +668 618 +668 624 +668 632 +668 667 +669 587 +669 655 +671 637 +672 584 +672 671 +673 672 +674 672 +676 614 +676 675 +679 587 +679 678 +680 584 +680 652 +680 667 +681 639 +681 679 +681 680 +682 680 +683 680 +685 639 +685 653 +685 681 +685 684 +687 644 +687 681 +687 686 +689 632 +689 655 +689 688 +691 604 +691 662 +691 690 +692 589 +692 666 +693 680 +694 692 +695 694 +696 630 +696 657 +697 696 +699 698 +700 612 +702 579 +702 675 +702 681 +702 700 +702 701 +703 587 +704 645 +704 670 +705 594 +707 706 +708 624 +708 681 +709 637 +709 706 +710 709 +712 658 +712 711 +713 637 +713 671 +713 704 +714 713 +716 715 +718 632 +718 668 +718 717 +720 580 +720 677 +720 716 +720 719 +722 610 +722 712 +722 721 +723 722 +725 580 +725 616 +725 634 +725 639 +725 650 +725 653 +725 677 +725 720 +725 724 +726 652 +726 667 +726 680 +726 692 +726 694 +726 725 +727 720 +728 637 +728 698 +729 728 +730 575 +732 689 +732 731 +734 702 +734 733 +736 622 +736 734 +736 735 +738 658 +738 692 +738 737 +740 739 +743 742 +744 741 +744 743 +745 743 +746 744 +748 740 +749 739 +750 740 +750 748 +751 748 +752 749 +753 750 +757 740 +757 750 +757 755 +757 756 +758 757 +759 742 +760 743 +760 759 +762 742 +762 759 +762 761 +763 739 +764 754 +766 765 +771 767 +771 770 +772 768 +772 769 +772 771 +773 771 +774 764 +775 748 +776 750 +777 743 +777 763 +778 759 +778 762 +779 742 +780 747 +780 762 +781 774 +781 780 +783 754 +783 780 +784 780 +785 770 +786 771 +786 776 +786 785 +787 756 +789 762 +789 779 +789 780 +789 788 +791 757 +791 783 +791 787 +793 792 +794 793 +795 779 +796 795 +797 770 +799 780 +799 798 +800 783 +801 800 +802 744 +803 754 +803 766 +803 780 +803 782 +803 787 +803 791 +804 743 +804 794 +804 795 +805 748 +805 749 +807 803 +807 806 +808 795 +809 808 +811 793 +811 810 +812 758 +813 758 +814 760 +814 763 +814 778 +815 740 +815 744 +815 763 +816 815 +817 774 +818 817 +819 818 +820 764 +820 819 +821 803 +822 809 +822 811 +823 758 +823 772 +824 758 +824 772 +826 825 +828 521 +828 827 +829 826 +832 521 +832 831 +834 829 +834 833 +836 829 +836 835 +837 828 +839 838 +840 839 +842 841 +844 825 +845 827 +846 844 +847 846 +848 847 +853 837 +853 838 +853 852 +854 833 +854 850 +854 851 +855 831 +855 849 +855 854 +856 855 +858 827 +859 854 +860 846 +860 855 +860 859 +861 843 +861 854 +862 833 +862 843 +863 843 +863 854 +864 854 +864 859 +865 844 +865 852 +866 833 +867 831 +868 831 +869 831 +870 846 +871 837 +872 837 +873 852 +874 833 +876 875 +877 827 +877 845 +878 875 +879 848 +880 846 +881 859 +881 875 +882 857 +883 859 +883 864 +883 882 +884 846 +884 883 +885 858 +885 871 +885 874 +886 848 +887 848 +888 848 +889 848 +891 833 +891 854 +891 881 +892 835 +892 878 +893 857 +893 875 +894 846 +894 876 +894 893 +895 831 +895 869 +895 876 +896 835 +896 892 +896 895 +897 874 +897 895 +898 850 +899 869 +900 846 +900 852 +900 880 +901 874 +902 852 +902 857 +902 890 +903 831 +903 845 +904 831 +905 831 +906 831 +907 849 +908 849 +909 849 +910 831 +911 847 +912 846 +917 912 +917 913 +917 914 +918 912 +918 915 +918 916 +919 831 +920 831 +921 864 +926 921 +926 922 +926 923 +927 921 +927 924 +927 925 +928 871 +928 878 +928 885 +928 901 +928 902 +929 872 +929 878 +929 890 +929 902 +929 928 +930 873 +930 878 +930 899 +931 882 +931 902 +932 831 +935 934 +936 934 +938 937 +940 939 +941 936 +942 941 +944 943 +945 944 +946 942 +947 946 +949 948 +950 948 +951 949 +951 950 +953 952 +954 937 +956 939 +957 956 +959 942 +959 958 +961 939 +962 949 +964 948 +965 960 +966 965 +968 967 +969 934 +969 935 +970 950 +971 951 +971 970 +973 954 +973 965 +973 972 +975 952 +978 951 +979 68 +980 979 +982 981 +983 953 +983 955 +984 939 +985 984 +987 960 +988 987 +989 80 +989 987 +991 963 +992 977 +993 958 +993 962 +993 992 +994 941 +994 990 +995 944 +995 969 +996 970 +997 184 +997 966 +997 989 +998 992 +999 994 +1000 951 +1001 996 +1002 1001 +1003 943 +1005 943 +1005 978 +1005 1002 +1006 945 +1006 959 +1006 968 +1006 997 +1006 1005 +1007 1005 +1008 1005 +1009 1005 +1010 937 +1010 975 +1010 986 +1011 953 +1011 991 +1011 1010 +1012 986 +1013 963 +1013 1012 +1014 933 +1014 941 +1014 1005 +1015 956 +1015 981 +1016 940 +1016 1015 +1017 1016 +1019 1018 +1021 965 +1021 969 +1021 973 +1021 1004 +1021 1020 +1022 1018 +1023 952 +1023 974 +1024 952 +1024 974 +1025 964 +1026 967 +1026 971 +1026 1000 +1026 1005 +1026 1025 +1027 1026 +1028 943 +1028 944 +1028 995 +1028 1004 +1030 69 +1030 105 +1030 953 +1030 963 +1030 1029 +1031 974 +1031 1019 +1032 1031 +1033 1030 +1034 950 +1034 976 +1034 998 +1035 1034 +1036 940 +1036 979 +1037 971 +1037 1005 +1038 1030 +1039 1030 +1040 1030 +1042 1041 +1043 949 +1043 1026 +1044 986 +1044 1012 +1044 1041 +1045 1003 +1045 1026 +1046 1019 +1046 1022 +1046 1031 +1047 948 +1047 977 +1047 992 +1048 948 +1048 976 +1049 958 +1049 993 +1049 1005 +1049 1035 +1050 937 +1050 954 +1050 956 +1050 984 +1050 1019 +1050 1022 +1050 1023 +1050 1024 +1051 940 +1051 1050 +1052 69 +1052 953 +1052 1032 +1052 1050 +1053 933 +1054 975 +1054 991 +1055 105 +1055 961 +1055 981 +1056 952 +1056 1010 +1056 1041 +1057 968 +1057 997 +1057 1006 +1058 945 +1058 1052 +1059 1022 +1059 1023 +1059 1024 +1059 1046 +1061 1060 +1062 1060 +1065 1063 +1068 1067 +1070 1069 +1073 1072 +1076 1074 +1076 1075 +1079 1078 +1086 1085 +1087 1085 +1088 1086 +1088 1087 +1090 1087 +1091 1065 +1091 1086 +1091 1088 +1091 1090 +1092 1091 +1094 1093 +1095 1093 +1097 1086 +1097 1096 +1098 1084 +1099 1098 +1101 1100 +1103 1102 +1106 1105 +1107 1106 +1108 1090 +1111 1110 +1116 1113 +1119 317 +1119 1065 +1119 1118 +1122 1121 +1124 811 +1124 822 +1125 427 +1127 1126 +1128 1126 +1135 1132 +1136 1106 +1137 1107 +1137 1136 +1138 1136 +1139 1136 +1142 1141 +1143 1103 +1143 1106 +1145 1105 +1148 1146 +1148 1147 +1150 1149 +1154 1081 +1156 1155 +1159 1074 +1159 1158 +1160 1063 +1161 1156 +1163 1122 +1163 1162 +1165 1090 +1166 1091 +1166 1147 +1166 1159 +1166 1165 +1167 1148 +1167 1166 +1168 1166 +1170 1152 +1170 1159 +1170 1169 +1171 1170 +1175 1170 +1176 1064 +1176 1119 +1177 1094 +1178 285 +1178 1177 +1179 1105 +1180 1106 +1183 488 +1184 1174 +1187 1129 +1189 1117 +1189 1188 +1190 1182 +1191 1072 +1191 1190 +1192 1073 +1192 1191 +1193 1098 +1195 1194 +1196 1069 +1197 1069 +1197 1154 +1197 1196 +1200 1199 +1201 488 +1201 1170 +1201 1175 +1203 1202 +1204 1202 +1207 1147 +1207 1206 +1208 1072 +1210 1109 +1211 1210 +1213 1212 +1214 793 +1216 411 +1216 1215 +1217 1075 +1220 1087 +1221 1156 +1222 1144 +1223 1087 +1224 1077 +1224 1082 +1224 1084 +1225 1224 +1226 1102 +1226 1129 +1227 812 +1228 813 +1230 744 +1230 800 +1231 1227 +1231 1228 +1231 1230 +1234 1189 +1234 1233 +1236 1235 +1237 1236 +1239 1232 +1239 1238 +1240 1108 +1241 1162 +1242 1133 +1243 1123 +1243 1131 +1244 1078 +1244 1167 +1246 1191 +1246 1232 +1247 1218 +1248 412 +1249 1106 +1251 1220 +1253 1204 +1253 1252 +1254 1222 +1254 1229 +1256 1249 +1257 800 +1258 1257 +1260 1156 +1260 1161 +1260 1259 +1262 1224 +1263 1261 +1265 1177 +1267 1107 +1267 1243 +1267 1244 +1267 1266 +1269 1070 +1269 1268 +1271 1270 +1273 1272 +1274 1272 +1275 1122 +1275 1150 +1276 1100 +1277 1101 +1277 1276 +1278 1276 +1279 1278 +1280 1072 +1281 1280 +1283 1150 +1283 1282 +1285 1096 +1289 1250 +1289 1287 +1289 1288 +1290 1205 +1291 1242 +1292 1221 +1292 1257 +1294 1293 +1295 1083 +1297 435 +1297 1252 +1297 1296 +1299 1163 +1299 1298 +1300 1069 +1300 1286 +1301 1140 +1301 1300 +1302 1298 +1304 1253 +1304 1294 +1304 1303 +1306 1078 +1306 1244 +1306 1294 +1306 1305 +1307 1275 +1308 1131 +1308 1243 +1308 1307 +1309 1170 +1309 1201 +1309 1209 +1309 1279 +1310 1309 +1311 1089 +1312 1311 +1313 1073 +1313 1078 +1313 1123 +1313 1267 +1313 1281 +1314 1072 +1315 1314 +1316 1309 +1317 1106 +1319 1318 +1322 1159 +1323 1106 +1323 1133 +1324 1323 +1326 1157 +1326 1225 +1326 1256 +1326 1325 +1327 1326 +1328 1326 +1329 1239 +1329 1299 +1330 1131 +1330 1192 +1330 1329 +1331 1063 +1332 1140 +1332 1319 +1334 1080 +1334 1099 +1334 1237 +1334 1333 +1335 1151 +1337 1336 +1338 1102 +1338 1323 +1340 1148 +1340 1178 +1340 1339 +1341 1339 +1343 1097 +1343 1252 +1343 1342 +1345 1140 +1345 1332 +1345 1344 +1346 1213 +1346 1333 +1348 1199 +1349 1198 +1349 1252 +1349 1348 +1350 1296 +1351 1085 +1352 1276 +1353 1091 +1353 1128 +1353 1257 +1353 1289 +1354 1353 +1355 1241 +1356 1151 +1356 1335 +1357 1152 +1357 1356 +1359 1206 +1361 1140 +1361 1273 +1361 1360 +1362 1361 +1363 1360 +1364 1203 +1364 1342 +1364 1350 +1365 1107 +1365 1244 +1365 1324 +1367 1085 +1369 1334 +1369 1368 +1371 1070 +1371 1362 +1371 1370 +1373 1269 +1373 1313 +1373 1365 +1373 1372 +1374 1323 +1374 1372 +1376 1375 +1377 1283 +1379 1097 +1379 1353 +1379 1378 +1382 1377 +1382 1381 +1383 1243 +1383 1382 +1384 1247 +1385 1218 +1386 1095 +1387 1177 +1387 1386 +1388 1367 +1389 1251 +1391 1334 +1391 1390 +1396 1334 +1396 1395 +1397 1381 +1397 1393 +1398 1182 +1398 1302 +1399 1388 +1400 1367 +1400 1378 +1400 1399 +1401 1088 +1401 1128 +1401 1400 +1402 804 +1402 1230 +1402 1257 +1403 1169 +1403 1171 +1403 1371 +1404 1393 +1405 1153 +1406 1317 +1406 1377 +1406 1405 +1407 1191 +1407 1219 +1409 1290 +1410 1268 +1412 1321 +1412 1411 +1413 1166 +1413 1391 +1416 1134 +1416 1159 +1416 1195 +1416 1322 +1416 1414 +1416 1415 +1417 1219 +1418 1067 +1419 1068 +1419 1410 +1419 1418 +1420 1085 +1420 1251 +1422 1102 +1422 1376 +1422 1406 +1422 1421 +1423 1243 +1423 1422 +1424 422 +1424 1326 +1425 1217 +1425 1390 +1426 1296 +1426 1348 +1426 1392 +1427 1342 +1429 1091 +1429 1119 +1429 1428 +1431 1430 +1432 1224 +1432 1263 +1432 1430 +1433 1306 +1433 1327 +1433 1431 +1434 1143 +1435 1164 +1435 1278 +1435 1352 +1436 1117 +1436 1309 +1436 1435 +1438 1166 +1438 1334 +1439 1390 +1440 1320 +1440 1439 +1441 1208 +1442 1103 +1442 1185 +1442 1441 +1443 1313 +1443 1442 +1444 1061 +1444 1062 +1444 1361 +1445 1371 +1445 1444 +1446 1083 +1446 1089 +1446 1095 +1446 1311 +1447 1094 +1447 1312 +1447 1347 +1447 1446 +1448 1341 +1449 1205 +1449 1348 +1449 1427 +1450 1218 +1450 1274 +1450 1361 +1451 1135 +1451 1372 +1451 1374 +1452 1148 +1452 1195 +1453 1116 +1453 1419 +1454 1116 +1454 1419 +1455 1418 +1456 1453 +1456 1455 +1457 1454 +1457 1455 +1458 1140 +1458 1319 +1459 1078 +1459 1111 +1459 1123 +1459 1267 +1459 1327 +1460 1104 +1461 1117 +1461 1234 +1461 1347 +1461 1448 +1461 1460 +1462 1339 +1462 1436 +1463 1117 +1463 1279 +1463 1462 +1466 1276 +1466 1352 +1466 1464 +1466 1465 +1467 1175 +1467 1183 +1467 1209 +1467 1316 +1468 1173 +1469 1072 +1469 1187 +1470 1409 +1471 1109 +1471 1363 +1472 1268 +1472 1451 +1473 1151 +1474 1142 +1474 1284 +1475 1474 +1476 1125 +1476 1308 +1476 1383 +1478 1085 +1478 1229 +1478 1389 +1478 1477 +1480 1479 +1481 564 +1482 564 +1483 1239 +1483 1329 +1484 1152 +1484 1170 +1484 1173 +1484 1468 +1485 1403 +1485 1484 +1486 1140 +1486 1170 +1486 1173 +1487 1173 +1487 1361 +1488 1092 +1488 1204 +1488 1231 +1488 1258 +1489 1151 +1489 1276 +1489 1278 +1489 1356 +1490 1098 +1490 1366 +1491 1145 +1493 1132 +1493 1492 +1495 1109 +1495 1370 +1496 1090 +1496 1108 +1497 1069 +1497 1472 +1498 1069 +1498 1410 +1499 1116 +1500 1365 +1500 1499 +1501 1161 +1501 1250 +1502 1334 +1502 1380 +1503 1083 +1504 1091 +1504 1176 +1505 1158 +1505 1245 +1505 1321 +1505 1412 +1506 1074 +1506 1159 +1506 1334 +1506 1380 +1507 1244 +1507 1506 +1508 1342 +1510 1082 +1510 1509 +1512 1198 +1512 1216 +1512 1506 +1513 1512 +1514 1506 +1515 1334 +1515 1394 +1516 1366 +1516 1439 +1517 1162 +1518 1174 +1518 1517 +1521 1195 +1521 1519 +1521 1520 +1522 1321 +1522 1415 +1523 1280 +1523 1494 +1524 1223 +1524 1229 +1525 1091 +1525 1166 +1525 1524 +1526 1284 +1526 1439 +1527 1320 +1528 1193 +1529 1528 +1530 1100 +1530 1151 +1530 1356 +1530 1473 +1531 1134 +1531 1170 +1531 1173 +1531 1487 +1531 1530 +1532 1238 +1532 1298 +1533 1530 +1534 1135 +1535 1286 +1535 1419 +1535 1480 +1536 1210 +1536 1530 +1537 1442 +1537 1494 +1538 1371 +1539 1371 +1540 1310 +1540 1340 +1540 1403 +1541 1167 +1541 1403 +1541 1452 +1541 1507 +1542 1060 +1543 1115 +1547 1544 +1548 1442 +1548 1547 +1552 1116 +1552 1369 +1553 1071 +1553 1546 +1554 1072 +1556 1089 +1556 1104 +1558 1335 +1558 1356 +1559 1080 +1559 1529 +1560 1081 +1561 1555 +1562 1298 +1562 1355 +1565 1492 +1566 1069 +1567 1566 +1568 1566 +1569 1272 +1569 1564 +1570 1255 +1573 1102 +1574 1573 +1575 1545 +1576 1124 +1577 1235 +1579 1112 +1579 1326 +1580 1326 +1581 1112 +1582 1581 +1584 1117 +1586 1272 +1588 1520 +1588 1587 +1593 1378 +1593 1576 +1594 1224 +1594 1511 +1595 1547 +1598 1455 +1598 1597 +1599 1584 +1599 1589 +1601 1600 +1603 1115 +1605 1132 +1609 1133 +1610 1134 +1611 1543 +1613 1612 +1615 1071 +1618 1570 +1619 1140 +1620 1140 +1620 1617 +1621 1491 +1622 1143 +1622 1550 +1622 1591 +1623 1622 +1624 1087 +1624 1367 +1625 1063 +1626 1272 +1627 1612 +1629 1296 +1629 1348 +1630 1090 +1631 1333 +1631 1577 +1632 1389 +1632 1524 +1634 1271 +1634 1331 +1638 1547 +1641 1162 +1644 1542 +1645 1578 +1645 1606 +1646 1166 +1647 1224 +1648 1604 +1649 1173 +1653 1554 +1654 1614 +1657 1579 +1659 1615 +1662 1623 +1662 1661 +1663 1337 +1663 1628 +1664 1627 +1666 1105 +1667 1635 +1667 1666 +1670 1554 +1670 1669 +1674 1607 +1677 1098 +1677 1333 +1677 1676 +1678 1194 +1678 1245 +1679 1209 +1679 1589 +1684 1158 +1684 1284 +1685 1572 +1685 1575 +1685 1670 +1686 1598 +1686 1603 +1687 1218 +1687 1673 +1688 1687 +1689 1219 +1689 1563 +1689 1642 +1691 1583 +1691 1690 +1692 1622 +1694 1528 +1695 1528 +1696 1149 +1699 1605 +1699 1643 +1700 1617 +1700 1620 +1701 1282 +1701 1592 +1702 1586 +1703 1635 +1705 1206 +1706 1675 +1708 1547 +1709 1226 +1710 1492 +1712 1557 +1713 1098 +1714 1689 +1716 1590 +1717 1104 +1719 1359 +1720 1554 +1721 1585 +1722 1662 +1722 1721 +1723 1235 +1724 1704 +1725 1242 +1725 1609 +1726 1242 +1727 1224 +1728 1082 +1728 1571 +1729 1630 +1730 1153 +1731 1098 +1731 1694 +1733 1547 +1734 1680 +1735 1181 +1735 1358 +1736 1157 +1736 1513 +1738 1636 +1738 1637 +1738 1737 +1739 1714 +1740 1554 +1740 1572 +1742 1653 +1743 1741 +1743 1742 +1744 1547 +1745 1565 +1745 1585 +1746 1224 +1748 1468 +1748 1747 +1749 1157 +1750 1082 +1751 1644 +1752 1649 +1752 1654 +1753 1104 +1754 1669 +1755 1726 +1756 1755 +1758 1734 +1759 1652 +1760 1491 +1760 1611 +1761 1346 +1762 1255 +1762 1528 +1763 1256 +1764 1582 +1765 1358 +1766 1640 +1767 1219 +1767 1766 +1770 1158 +1770 1212 +1771 1658 +1773 1604 +1773 1607 +1774 1155 +1774 1214 +1775 1360 +1776 1268 +1776 1698 +1776 1699 +1777 1165 +1778 1683 +1778 1727 +1779 1551 +1780 1703 +1781 1560 +1781 1612 +1782 1549 +1782 1758 +1782 1759 +1783 1437 +1784 422 +1785 1739 +1786 1280 +1786 1658 +1786 1685 +1787 1563 +1788 1650 +1789 1671 +1790 1653 +1790 1754 +1793 1741 +1793 1791 +1793 1792 +1794 1208 +1794 1441 +1795 1651 +1795 1708 +1795 1724 +1796 1794 +1796 1795 +1797 1651 +1797 1709 +1798 1255 +1798 1408 +1799 1224 +1799 1264 +1800 1286 +1800 1674 +1801 1288 +1802 1734 +1803 1291 +1803 1680 +1804 1640 +1804 1642 +1805 1298 +1805 1299 +1807 1300 +1807 1648 +1807 1800 +1808 1668 +1809 1063 +1809 1628 +1810 1106 +1810 1237 +1811 1438 +1811 1440 +1812 1307 +1813 1633 +1814 1309 +1816 1315 +1816 1672 +1816 1789 +1817 1316 +1818 1506 +1818 1515 +1819 1317 +1819 1561 +1820 1605 +1820 1661 +1821 1326 +1822 1325 +1822 1749 +1823 1604 +1824 1636 +1825 1118 +1825 1120 +1826 1659 +1826 1696 +1827 1660 +1828 1418 +1829 1707 +1830 1130 +1830 1710 +1831 1338 +1832 1544 +1833 1754 +1833 1769 +1834 1616 +1834 1682 +1835 1284 +1837 1114 +1838 1601 +1838 1831 +1839 1554 +1839 1808 +1840 1768 +1840 1839 +1841 1555 +1841 1703 +1842 1347 +1843 1713 +1844 1415 +1844 1522 +1845 1190 +1846 1557 +1847 1613 +1847 1757 +1847 1806 +1848 1633 +1848 1779 +1849 1719 +1849 1777 +1850 1661 +1851 1812 +1852 1066 +1852 1400 +1853 1165 +1853 1705 +1854 1590 +1855 1584 +1856 1584 +1857 1563 +1857 1689 +1858 1693 +1859 1353 +1860 1342 +1861 1690 +1862 1665 +1863 1127 +1864 1361 +1864 1646 +1865 1164 +1865 1753 +1866 1206 +1867 1359 +1867 1587 +1869 1692 +1869 1776 +1870 1709 +1870 1744 +1872 1871 +1873 1871 +1874 1142 +1874 1415 +1875 1681 +1876 1508 +1877 1106 +1877 1499 +1878 1685 +1878 1772 +1879 1652 +1880 1763 +1881 1325 +1881 1571 +1882 1619 +1882 1757 +1883 1654 +1883 1846 +1884 1439 +1885 1749 +1886 1776 +1888 1546 +1889 1716 +1889 1854 +1890 1554 +1890 1668 +1891 1199 +1891 1511 +1892 1200 +1892 1660 +1893 1380 +1895 1384 +1895 1385 +1895 1894 +1896 1711 +1896 1787 +1897 1655 +1897 1656 +1897 1673 +1897 1687 +1898 1760 +1899 1771 +1900 1783 +1901 1066 +1901 1900 +1902 1235 +1902 1618 +1903 1368 +1904 1712 +1904 1747 +1905 1075 +1905 1158 +1906 1676 +1907 1693 +1907 1786 +1908 1466 +1909 1644 +1909 1757 +1910 1785 +1911 1639 +1912 1219 +1912 1314 +1913 1248 +1913 1730 +1914 1098 +1914 1824 +1915 1665 +1915 1685 +1916 1647 +1917 1868 +1917 1893 +1918 1583 +1918 1691 +1919 1363 +1919 1495 +1920 1416 +1920 1814 +1921 1417 +1921 1711 +1921 1716 +1922 1600 +1923 1419 +1923 1821 +1924 1424 +1924 1885 +1925 1516 +1926 1526 +1928 1272 +1928 1586 +1929 1360 +1929 1682 +1930 1434 +1930 1591 +1930 1638 +1930 1721 +1930 1832 +1931 1550 +1932 1114 +1933 1863 +1934 1289 +1934 1933 +1935 1437 +1935 1933 +1936 1894 +1937 1936 +1938 1542 +1938 1929 +1940 1926 +1940 1939 +1941 1906 +1942 1081 +1942 1130 +1944 1932 +1944 1933 +1945 1725 +1946 1575 +1947 1780 +1948 1105 +1948 1621 +1949 1186 +1949 1524 +1950 1360 +1950 1564 +1950 1775 +1950 1897 +1951 1584 +1951 1855 +1951 1856 +1952 1458 +1952 1836 +1953 1463 +1954 1468 +1954 1614 +1954 1649 +1954 1883 +1955 1145 +1955 1718 +1956 1120 +1956 1160 +1957 1554 +1958 1899 +1959 1090 +1959 1788 +1960 1596 +1960 1899 +1961 1715 +1962 1776 +1963 1419 +1963 1962 +1964 1633 +1964 1823 +1964 1962 +1966 1965 +1967 1695 +1969 1067 +1969 1115 +1970 1608 +1970 1969 +1971 1155 +1972 1601 +1974 1430 +1975 1368 +1975 1723 +1976 1704 +1976 1795 +1977 1726 +1977 1927 +1978 1910 +1979 1523 +1979 1978 +1980 1408 +1980 1510 +1981 1843 +1982 1698 +1983 1408 +1983 1968 +1984 1491 +1985 1578 +1986 1492 +1986 1982 +1987 1442 +1987 1580 +1988 1494 +1989 1206 +1990 1903 +1991 1971 +1992 1257 +1992 1859 +1993 1551 +1993 1879 +1994 1291 +1994 1499 +1994 1993 +1995 1242 +1995 1499 +1995 1993 +1996 1801 +1997 1337 +1997 1729 +1998 1608 +1999 1502 +1999 1761 +1999 1868 +1999 1917 +1999 1943 +2000 1584 +2000 1589 +2000 1855 +2001 1602 +2001 1802 +2002 1060 +2002 1616 +2003 1626 +2003 1702 +2003 1928 +2004 1625 +2006 1828 +2007 1356 +2007 1706 +2008 1747 +2009 1973 +2010 1496 +2010 1973 +2010 2005 +2011 1782 +2011 1813 +2012 1584 +2012 1599 +2012 1951 +2013 1671 +2014 1623 +2015 1165 +2015 1650 +2016 1333 +2016 1425 +2017 1090 +2017 1351 +2018 2017 +2019 1511 +2019 1707 +2019 1965 +2020 1512 +2020 1827 +2020 2019 +2021 1124 +2021 1378 +2022 1513 +2023 1815 +2023 1858 +2025 1741 +2025 1793 +2025 2024 +2026 1990 +2026 1999 +2027 1516 +2027 1940 +2028 1071 +2029 1961 +2029 1962 +2030 1893 +2030 1943 +2031 1523 +2031 1697 +2031 1815 +2032 1769 +2033 1946 +2033 2032 +2034 1829 +2034 1965 +2035 1060 +2035 1644 +2036 1311 +2037 1206 +2037 1681 +2038 1596 +2038 1653 +2038 1958 +2039 1653 +2039 1862 +2040 1545 +2040 2039 +2041 1786 +2041 2032 +2042 1474 +2042 1765 +2043 1605 +2043 1820 +2044 1359 +2045 2044 +2046 1827 +2046 2020 +2047 1885 +2047 2020 +2047 2046 +2048 1592 +2049 1837 +2049 1996 +2050 1186 +2050 1478 +2051 1734 +2051 1977 +2052 1733 +2052 1772 +2053 1573 +2056 1953 +2059 2057 +2060 1307 +2060 2028 +2060 2057 +2061 1104 +2062 1100 +2062 1908 +2063 1147 +2064 1147 +2065 1609 +2067 1643 +2067 1662 +2067 1871 +2068 1649 +2069 1066 +2069 1428 +2070 1842 +2071 1095 +2072 1460 +2073 2072 +2074 1460 +2075 1186 +2075 2004 +2076 1210 +2076 1530 +2077 1446 +2078 1985 +2078 2038 +2079 1842 +2080 1725 +2080 1755 +2080 1927 +2081 1460 +2081 2055 +2083 2082 +2084 2056 +2084 2083 +2085 2082 +2085 2084 +2086 1205 +2086 1478 +2087 1583 +2087 1756 +2088 1760 +2088 1898 +2089 1945 +2089 2054 +2091 1095 +2092 1160 +2092 1639 +2094 2083 +2095 1460 +2095 2079 +2096 1093 +2096 1386 +2097 1323 +2097 1600 +2097 1690 +2097 2065 +2098 1323 +2098 1600 +2098 1861 +2098 1945 +2099 1574 +2099 1623 +2099 1838 +2100 1709 +2101 2070 +2101 2073 +2101 2074 +2104 1378 +2105 1460 +2106 1869 +2106 2058 +2107 2055 +2107 2061 +2107 2094 +2107 2105 +2108 1460 +2108 2073 +2109 1096 +2109 2104 +2110 1549 +2111 1715 +2112 1470 +2113 1410 +2113 1732 +2113 2110 +2114 1945 +2114 2001 +2115 1574 +2115 1623 +2116 1933 +2117 1732 +2117 1961 +2118 1451 +2118 1850 +2119 1451 +2119 1850 +2119 1922 +2119 2054 +2120 1278 +2120 1356 +2120 1489 +2121 1104 +2122 1842 +2122 2101 +2123 1460 +2124 1461 +2124 2063 +2125 1461 +2125 2064 +2126 1528 +2126 1968 +2127 2014 +2127 2102 +2128 1472 +2128 1873 +2129 1472 +2129 1872 +2129 2089 +2130 1602 +2130 1732 +2131 1473 +2133 1972 +2134 2090 +2134 2123 +2135 1093 +2135 2096 +2136 1717 +2137 1953 +2137 2082 +2137 2121 +2138 1309 +2138 1467 +2138 1489 +2139 1101 +2139 1309 +2139 1357 +2139 1489 +2140 1953 +2140 2066 +2140 2137 +2141 1285 +2141 1876 +2142 1554 +2142 2093 +2143 1953 +2143 2085 +2144 1460 +2144 2090 +2145 1887 +2145 2103 +2145 2131 +2145 2132 +2146 2102 +2146 2133 +2147 2146 +2148 1609 +2148 1945 +2149 1817 +2150 1589 +2150 1817 +2150 2149 +2151 1602 +2151 1922 +2151 2054 +2151 2114 +2151 2118 +2153 2128 +2153 2130 +2154 2106 +2154 2133 +2155 1831 +2155 2102 +2156 1321 +2156 1844 +2156 2136 +2157 1484 +2157 1614 +2157 1752 +2157 1887 +2157 2103 +2158 1298 +2158 1532 +2158 1562 +2159 1095 +2159 1386 +2161 1985 +2161 2160 +2162 1742 +2162 2152 +2162 2160 +2163 1664 +2163 1807 +2163 2111 +2164 1181 +2164 2112 +2165 2071 +2166 2071 +2167 1687 +2167 1702 +2169 2159 +2170 2159 +2173 1471 +2173 1530 +2175 1978 +2175 2031 +2175 2174 +2176 1100 +2176 1536 +2177 1928 +2178 2177 +2179 1100 +2179 1489 +2180 1172 +2180 1345 +2181 2180 +2182 1268 +2183 1747 +2183 2178 +2184 1164 +2184 1435 +2185 1309 +2186 1953 +2186 2066 +2187 1953 +2187 2066 +2188 1468 +2188 1471 +2189 1164 +2189 1352 +2190 2091 +2190 2096 +2190 2168 +2191 1311 +2191 2077 +2192 1311 +2192 2171 +2192 2172 +2192 2191 +2193 1413 +2193 1527 +2194 1224 +2194 1713 +2195 1117 +2195 1447 +2196 1930 +2196 2053 +2197 2182 +2198 2185 +2200 2199 +2201 2200 +2202 1506 +2203 1277 +2203 2201 +2204 2199 +2204 2202 +2207 802 +2210 2205 +2211 2205 +2212 2210 +2212 2211 +2213 395 +2213 2207 +2213 2212 +2222 2221 +2223 393 +2223 2221 +2223 2222 +2224 2222 +2228 2226 +2229 2220 +2229 2222 +2229 2223 +2230 2227 +2231 396 +2232 2221 +2234 2228 +2235 2223 +2238 2236 +2238 2237 +2242 2241 +2244 2208 +2244 2219 +2249 2242 +2249 2248 +2250 2248 +2251 2249 +2252 2249 +2253 2249 +2256 2247 +2261 2221 +2262 2235 +2262 2258 +2262 2259 +2262 2260 +2263 2230 +2268 2267 +2269 2267 +2270 2267 +2271 2268 +2272 2266 +2275 2273 +2275 2274 +2277 2276 +2281 2254 +2282 389 +2282 2212 +2282 2257 +2282 2264 +2282 2281 +2283 396 +2283 420 +2283 2282 +2284 2280 +2284 2282 +2284 2283 +2285 2239 +2286 2264 +2286 2285 +2288 2217 +2290 2276 +2291 2238 +2292 2255 +2292 2290 +2295 2221 +2298 2235 +2298 2262 +2298 2296 +2298 2297 +2300 2299 +2302 2282 +2303 2256 +2304 790 +2304 2282 +2305 2233 +2306 2263 +2306 2265 +2307 386 +2308 2246 +2309 2235 +2310 2242 +2310 2305 +2311 2253 +2312 520 +2312 2235 +2313 2239 +2314 2225 +2315 2245 +2315 2291 +2316 2288 +2317 2231 +2317 2316 +2320 2278 +2321 2222 +2321 2224 +2321 2314 +2321 2319 +2321 2320 +2322 2321 +2323 2321 +2324 2321 +2325 2240 +2325 2243 +2327 2255 +2327 2318 +2328 2235 +2328 2327 +2329 2326 +2329 2327 +2329 2328 +2330 2307 +2331 2285 +2332 2219 +2332 2244 +2332 2294 +2332 2318 +2333 2267 +2334 2272 +2334 2287 +2335 2243 +2336 2281 +2338 2336 +2341 2289 +2343 2298 +2344 69 +2344 2343 +2345 2217 +2346 2218 +2346 2311 +2346 2345 +2347 2218 +2347 2231 +2348 2293 +2348 2303 +2349 2335 +2350 2224 +2350 2349 +2351 840 +2352 2327 +2354 2302 +2354 2304 +2355 2242 +2357 2215 +2357 2231 +2357 2263 +2357 2337 +2358 2325 +2359 2227 +2359 2314 +2360 2234 +2361 2233 +2361 2279 +2362 2360 +2363 2340 +2363 2342 +2363 2362 +2364 2262 +2364 2312 +2364 2351 +2364 2363 +2365 2363 +2366 2240 +2366 2319 +2367 2293 +2367 2336 +2368 2238 +2368 2290 +2369 2235 +2369 2298 +2369 2368 +2370 2216 +2370 2249 +2370 2317 +2371 2278 +2371 2335 +2371 2358 +2372 2274 +2372 2282 +2372 2301 +2372 2354 +2373 2219 +2373 2332 +2374 2336 +2375 2282 +2375 2374 +2376 2221 +2376 2356 +2377 2290 +2377 2368 +2378 2374 +2379 2254 +2379 2378 +2380 2327 +2381 2267 +2381 2333 +2382 2206 +2382 2268 +2382 2289 +2382 2294 +2382 2341 +2382 2353 +2382 2381 +2383 2223 +2383 2235 +2383 2309 +2383 2328 +2383 2382 +2384 2382 +2385 2382 +2386 2247 +2386 2378 +2387 2216 +2387 2287 +2387 2355 +2388 2246 +2388 2308 +2388 2309 +2388 2339 +2388 2352 +2388 2353 +2388 2380 +2389 2276 +2389 2332 +2389 2368 +2390 2208 +2392 2285 +2392 2331 +2393 395 +2393 2321 +2393 2392 +2394 2391 +2394 2392 +2394 2393 +2395 2382 +2395 2390 +2396 2214 +2396 2238 +2397 2219 +2397 2373 +2398 2382 +2398 2397 +2399 2397 +2400 2397 +2401 2340 +2402 2221 +2402 2356 +2403 2221 +2403 2376 +2404 2225 +2404 2337 +2405 2221 +2405 2232 +2405 2295 +2405 2330 +2405 2392 +2406 2325 +2406 2349 +2407 2257 +2407 2274 +2407 2299 +2407 2300 +2408 2303 +2408 2386 +2409 2233 +2410 2409 +2411 2215 +2411 2355 +2412 2209 +2412 2249 +2413 752 +2414 753 +2414 2266 +2414 2279 +2414 2413 +2415 2308 +2416 2268 +2416 2415 +2417 777 +2417 790 +2418 2222 +2418 2384 +2418 2385 +2419 2339 +2419 2382 +2420 2246 +2420 2327 +2421 2245 +2422 2421 +2425 2424 +2426 490 +2432 2431 +2436 2434 +2439 2437 +2439 2438 +2443 2441 +2443 2442 +2447 1184 +2449 2439 +2451 2450 +2454 2453 +2457 2447 +2458 2456 +2458 2457 +2459 2425 +2459 2458 +2461 2460 +2463 2462 +2471 2434 +2471 2470 +2475 2474 +2476 2473 +2476 2474 +2477 2473 +2477 2474 +2480 2479 +2481 2479 +2482 2480 +2483 2474 +2485 2426 +2486 2464 +2487 2458 +2489 2428 +2489 2488 +2490 2435 +2493 2472 +2493 2492 +2495 2490 +2496 2485 +2498 2490 +2502 2446 +2502 2501 +2503 2475 +2503 2502 +2505 2484 +2508 2507 +2510 2509 +2511 2509 +2513 2498 +2515 2514 +2517 2516 +2518 2516 +2519 2425 +2519 2475 +2519 2508 +2519 2516 +2521 2443 +2521 2489 +2522 2505 +2524 2434 +2525 2458 +2527 2468 +2528 2486 +2529 2439 +2530 2500 +2531 2530 +2533 2520 +2534 2533 +2536 2535 +2538 2499 +2539 2538 +2542 490 +2542 2533 +2543 490 +2543 2464 +2543 2486 +2543 2528 +2544 2499 +2544 2538 +2545 2429 +2545 2448 +2548 490 +2548 2485 +2548 2537 +2548 2546 +2548 2547 +2549 2528 +2549 2539 +2550 2538 +2551 2452 +2551 2538 +2551 2549 +2551 2550 +2552 2474 +2552 2502 +2554 2529 +2554 2538 +2554 2545 +2555 2479 +2557 1131 +2557 2532 +2558 2459 +2558 2475 +2558 2519 +2558 2557 +2559 2446 +2559 2474 +2559 2483 +2559 2521 +2560 2454 +2561 2452 +2561 2468 +2561 2485 +2561 2494 +2561 2527 +2561 2550 +2562 57 +2562 81 +2562 133 +2564 2534 +2567 2566 +2575 2554 +2575 2574 +2576 2450 +2576 2488 +2578 2433 +2579 2500 +2579 2530 +2580 2579 +2581 2575 +2583 2489 +2583 2541 +2583 2582 +2586 2428 +2586 2436 +2586 2454 +2586 2461 +2586 2489 +2586 2524 +2586 2578 +2586 2585 +2588 2434 +2588 2472 +2588 2493 +2588 2577 +2588 2587 +2590 2432 +2590 2461 +2591 2459 +2591 2475 +2591 2480 +2592 2545 +2592 2575 +2593 2458 +2593 2459 +2593 2567 +2593 2569 +2593 2572 +2594 1308 +2595 2430 +2595 2497 +2595 2514 +2595 2515 +2595 2520 +2595 2533 +2596 2439 +2596 2469 +2596 2554 +2596 2584 +2597 2448 +2597 2575 +2599 2459 +2599 2519 +2599 2598 +2600 2527 +2601 2522 +2601 2575 +2602 2519 +2604 2445 +2604 2504 +2604 2560 +2604 2586 +2605 2594 +2606 2528 +2606 2539 +2606 2605 +2607 2606 +2608 2554 +2608 2584 +2608 2603 +2608 2607 +2609 2504 +2609 2604 +2611 2503 +2611 2523 +2611 2607 +2612 2528 +2612 2532 +2612 2606 +2612 2611 +2613 2508 +2614 2522 +2616 2443 +2616 2509 +2616 2615 +2617 2429 +2617 2456 +2617 2458 +2617 2487 +2617 2522 +2617 2525 +2617 2614 +2618 2605 +2618 2606 +2619 2434 +2620 2563 +2621 2556 +2622 2506 +2623 2434 +2623 2608 +2624 2434 +2624 2608 +2627 2443 +2627 2493 +2627 2509 +2627 2559 +2627 2625 +2627 2626 +2629 2536 +2631 2439 +2632 2487 +2633 2439 +2634 2631 +2636 2531 +2637 2545 +2637 2617 +2638 2435 +2638 2622 +2638 2635 +2639 2439 +2639 2469 +2640 2610 +2641 2521 +2641 2577 +2642 2474 +2643 2492 +2643 2501 +2644 2643 +2645 2473 +2645 2501 +2646 2492 +2647 2645 +2648 2644 +2648 2645 +2648 2646 +2649 2647 +2649 2648 +2651 2608 +2654 2463 +2654 2607 +2655 2426 +2656 2428 +2658 2564 +2659 2534 +2661 2433 +2662 2434 +2666 2569 +2667 2658 +2668 2434 +2668 2662 +2668 2663 +2669 2656 +2670 2435 +2672 2436 +2673 2672 +2674 2585 +2674 2672 +2677 2458 +2677 2565 +2677 2676 +2680 490 +2680 2679 +2681 2444 +2682 2439 +2683 2439 +2684 2662 +2685 2444 +2685 2445 +2686 2685 +2687 2449 +2691 2690 +2692 2574 +2693 2657 +2694 2452 +2697 2454 +2698 2434 +2699 2698 +2701 2434 +2701 2536 +2702 2434 +2702 2622 +2703 2458 +2703 2696 +2704 2593 +2705 2662 +2707 2444 +2708 2445 +2709 2455 +2709 2456 +2709 2700 +2710 2585 +2710 2674 +2712 2464 +2713 2464 +2714 2678 +2716 2465 +2717 2450 +2717 2465 +2717 2466 +2717 2467 +2717 2585 +2718 2468 +2719 2450 +2719 2717 +2720 2585 +2720 2717 +2721 2553 +2722 2585 +2723 2469 +2723 2721 +2725 2531 +2726 2531 +2726 2725 +2728 2542 +2729 2427 +2729 2498 +2730 2427 +2730 2490 +2731 2729 +2732 2730 +2733 2575 +2733 2607 +2736 2484 +2737 2736 +2738 2734 +2738 2736 +2738 2737 +2740 2655 +2740 2739 +2741 2485 +2741 2739 +2742 2741 +2743 2485 +2743 2486 +2744 2743 +2745 2703 +2755 2724 +2756 2724 +2757 2722 +2758 2687 +2759 2491 +2759 2659 +2760 2494 +2760 2652 +2760 2740 +2761 2495 +2762 2495 +2763 2495 +2764 2485 +2765 2533 +2765 2542 +2765 2764 +2766 2496 +2766 2655 +2766 2740 +2767 2497 +2768 2767 +2769 2497 +2769 2498 +2770 2769 +2772 2771 +2775 2500 +2776 2500 +2777 2506 +2778 2686 +2779 2724 +2779 2737 +2780 2671 +2780 2771 +2781 2727 +2781 2771 +2781 2780 +2782 2504 +2783 2505 +2784 2783 +2785 2505 +2785 2783 +2785 2784 +2787 2696 +2787 2703 +2787 2786 +2788 2666 +2789 2527 +2789 2620 +2790 2563 +2790 2608 +2791 2544 +2792 2530 +2792 2791 +2793 2447 +2793 2457 +2794 2575 +2794 2607 +2795 2513 +2795 2652 +2795 2670 +2795 2760 +2796 2671 +2798 2797 +2799 490 +2799 2664 +2799 2665 +2800 2797 +2800 2798 +2800 2799 +2801 2553 +2802 2506 +2804 2527 +2804 2528 +2805 2804 +2806 2522 +2806 2736 +2807 2522 +2809 2553 +2810 2478 +2810 2515 +2810 2706 +2811 2715 +2812 2574 +2813 2524 +2813 2662 +2813 2684 +2814 2447 +2815 2527 +2816 2431 +2817 2565 +2818 2817 +2819 2662 +2820 2798 +2820 2800 +2821 2533 +2821 2534 +2822 2821 +2823 2533 +2823 2534 +2824 2823 +2825 2655 +2825 2820 +2826 2561 +2827 2735 +2828 2540 +2828 2541 +2828 2827 +2832 490 +2832 2543 +2833 2832 +2834 490 +2834 2542 +2834 2829 +2835 490 +2835 2542 +2835 2830 +2836 490 +2836 2542 +2836 2831 +2837 2662 +2837 2691 +2837 2819 +2838 2455 +2838 2724 +2838 2779 +2839 2724 +2839 2779 +2839 2796 +2839 2838 +2840 2706 +2840 2760 +2840 2810 +2841 2537 +2842 2778 +2842 2808 +2843 2544 +2843 2553 +2843 2809 +2844 2544 +2845 2553 +2846 2687 +2846 2723 +2847 2548 +2848 2548 +2849 2550 +2850 2550 +2851 2849 +2851 2850 +2852 2551 +2852 2851 +2853 2550 +2854 2550 +2855 2549 +2856 2549 +2857 2724 +2857 2756 +2857 2779 +2857 2838 +2858 2545 +2858 2846 +2859 2858 +2860 2545 +2860 2846 +2861 2860 +2862 2545 +2862 2846 +2863 2862 +2864 2478 +2864 2810 +2865 2820 +2865 2825 +2866 2819 +2870 2553 +2870 2554 +2871 2553 +2871 2554 +2872 2553 +2872 2554 +2873 2872 +2874 2529 +2874 2553 +2875 2874 +2876 2870 +2877 2871 +2878 2760 +2878 2815 +2878 2840 +2880 2585 +2880 2722 +2881 2697 +2881 2879 +2882 2560 +2882 2880 +2882 2881 +2883 2561 +2883 2740 +2883 2760 +2883 2840 +2883 2878 +2885 2439 +2885 2617 +2886 2617 +2887 2885 +2888 2886 +2889 2585 +2889 2722 +2889 2757 +2889 2880 +2890 2674 +2891 2691 +2892 2564 +2894 2565 +2894 2893 +2895 2568 +2895 2569 +2896 2570 +2896 2704 +2897 2896 +2898 2571 +2898 2572 +2899 2572 +2899 2573 +2900 2561 +2900 2883 +2901 2900 +2902 2578 +2903 2813 +2904 2575 +2905 2575 +2906 2574 +2907 2575 +2908 2553 +2908 2584 +2908 2657 +2908 2693 +2908 2843 +2909 2593 +2909 2594 +2910 2909 +2911 2585 +2911 2586 +2912 2590 +2914 2675 +2914 2851 +2916 2530 +2916 2657 +2916 2792 +2917 2529 +2917 2597 +2917 2874 +2918 2530 +2918 2596 +2918 2657 +2918 2908 +2918 2916 +2920 2538 +2920 2544 +2921 2694 +2922 2553 +2922 2801 +2923 2544 +2923 2791 +2923 2913 +2925 2924 +2926 2916 +2926 2918 +2927 2596 +2927 2918 +2928 2596 +2928 2918 +2929 2926 +2930 2457 +2932 2740 +2932 2841 +2932 2847 +2933 2600 +2934 2596 +2934 2636 +2935 2841 +2935 2932 +2936 2574 +2936 2601 +2936 2687 +2936 2692 +2936 2846 +2937 2851 +2937 2924 +2938 2924 +2938 2937 +2939 2465 +2940 2842 +2941 2565 +2941 2567 +2942 2678 +2942 2691 +2942 2714 +2942 2891 +2943 2603 +2944 2662 +2944 2819 +2944 2837 +2945 2944 +2946 2799 +2947 2799 +2948 2490 +2948 2629 +2949 490 +2950 2949 +2952 2542 +2952 2728 +2952 2820 +2952 2825 +2952 2865 +2953 2604 +2953 2605 +2954 2953 +2955 2604 +2956 2444 +2956 2604 +2956 2955 +2957 2711 +2957 2955 +2958 2485 +2958 2548 +2959 2607 +2959 2662 +2959 2819 +2959 2866 +2960 2606 +2960 2608 +2961 2960 +2963 2609 +2963 2962 +2964 2575 +2964 2601 +2965 2640 +2965 2915 +2966 2471 +2966 2619 +2966 2640 +2967 2447 +2967 2781 +2967 2814 +2968 2781 +2968 2967 +2969 2662 +2969 2837 +2970 2614 +2971 2553 +2971 2715 +2971 2811 +2971 2845 +2972 2574 +2972 2692 +2972 2936 +2973 2617 +2973 2722 +2974 2617 +2974 2618 +2975 2974 +2976 2619 +2976 2813 +2976 2867 +2976 2903 +2977 2787 +2977 2814 +2978 2620 +2978 2715 +2978 2971 +2979 2623 +2979 2695 +2980 2624 +2980 2943 +2981 2774 +2981 2842 +2982 2628 +2982 2803 +2983 2814 +2983 2977 +2984 2680 +2985 2984 +2986 2629 +2986 2810 +2986 2878 +2986 2883 +2987 2629 +2989 2488 +2989 2576 +2990 2628 +2990 2984 +2990 2988 +2991 2439 +2991 2463 +2993 2622 +2994 2938 +2995 2553 +2995 2801 +2996 2893 +2997 2542 +2997 2798 +2997 2800 +2997 2951 +2998 2880 +2999 2553 +3000 2893 +3001 2671 +3001 2781 +3002 2773 +3002 3001 +3003 2686 +3003 2774 +3003 2981 +3004 2457 +3004 2671 +3004 2780 +3005 2520 +3005 2533 +3005 2595 +3005 2670 +3007 3006 +3008 2670 +3008 3005 +3009 2727 +3009 2781 +3010 2736 +3010 2806 +3011 2457 +3011 2780 +3011 2967 +3012 2703 +3012 2745 +3012 2793 +3012 2814 +3014 2493 +3014 2577 +3014 3013 +3016 2493 +3016 2502 +3016 3015 +3017 2490 +3017 2494 +3017 2496 +3017 2513 +3017 2534 +3017 2764 +3017 2826 +3018 2846 +3019 2654 +3020 2932 +3021 2694 +3022 2694 +3023 2897 +3024 2660 +3025 2840 +3026 2671 +3026 2796 +3028 2864 +3029 2694 +3033 2936 +3034 2936 +3034 3033 +3035 2952 +3036 2515 +3036 2810 +3038 2851 +3038 2914 +3040 2653 +3041 2740 +3041 2760 +3041 2883 +3041 2932 +3041 3037 +3042 2740 +3042 2932 +3042 3041 +3043 2450 +3043 2576 +3045 2522 +3045 3044 +3047 2522 +3047 2931 +3047 3046 +3048 3027 +3049 2505 +3049 2601 +3049 3027 +3050 2687 +3051 2922 +3052 2973 +3054 2979 +3055 2537 +3055 2548 +3056 3005 +3057 2715 +3058 2884 +3060 2489 +3060 2608 +3061 2725 +3061 2726 +3062 2728 +3063 2959 +3064 2733 +3066 2964 +3067 2702 +3068 2542 +3070 3069 +3071 3024 +3073 3046 +3073 3070 +3073 3072 +3075 3044 +3075 3074 +3076 2783 +3077 2657 +3077 2693 +3078 2499 +3079 2813 +3080 2857 +3081 2746 +3081 3072 +3082 2747 +3083 2748 +3083 3074 +3084 2749 +3084 3069 +3085 2750 +3085 3074 +3086 2751 +3086 3071 +3087 2752 +3088 2753 +3088 3075 +3089 2754 +3089 3070 +3090 2484 +3090 2688 +3091 2484 +3091 2689 +3093 2697 +3094 2444 +3094 2956 +3095 2585 +3095 2880 +3096 2553 +3096 2843 +3096 2908 +3097 2574 +3098 2687 +3098 3050 +3099 2687 +3099 2758 +3100 2766 +3101 3031 +3101 3082 +3101 3090 +3102 3032 +3102 3087 +3102 3091 +3103 2704 +3104 2662 +3104 2837 +3104 2969 +3105 2455 +3105 2724 +3105 3039 +3106 2815 +3107 2986 +3108 2794 +3109 2959 +3109 3063 +3110 2796 +3111 2879 +3111 2881 +3112 2533 +3112 2542 +3112 2765 +3113 2500 +3113 2530 +3113 2579 +3114 2651 +3115 2489 +3115 2603 +3116 2813 +3116 3079 +3117 2879 +3117 2881 +3117 3111 +3118 2993 +3119 2993 +3119 3118 +3120 2864 +3121 2959 +3122 2864 +3122 2987 +3122 3028 +3123 2538 +3124 2538 +3125 3004 +3126 2851 +3126 2852 +3127 3092 +3128 2553 +3128 3030 +3128 3059 +3128 3092 +3128 3123 +3128 3124 +3128 3127 +3129 3030 +3129 3059 +3129 3127 +3129 3128 +3130 2851 +3130 2852 +3130 3126 +3131 2819 +3131 2837 +3131 2944 +3132 2970 +3133 2697 +3134 2697 +3134 3133 +3135 2868 +3135 3046 +3136 2869 +3137 3044 +3137 3071 +3137 3136 +3138 2915 +3140 2938 +3141 2553 +3142 2815 +3143 2671 +3143 3001 +3144 3117 +3145 2692 +3146 2563 +3146 2884 +3147 2563 +3147 2884 +3148 2959 +3148 3063 +3148 3109 +3149 2553 +3149 3128 +3150 2798 +3150 2800 +3151 2800 +3152 2796 +3152 2839 +3153 2878 +3153 2883 +3153 2986 +3154 2545 +3154 2575 +3155 2656 +3156 2851 +3156 2852 +3156 2914 +3156 2937 +3156 3139 +3157 2595 +3157 3005 +3158 2585 +3158 2717 +3159 3065 +3161 2959 +3161 3121 +3163 2927 +3164 2928 +3165 3009 +3166 3072 +3167 2919 +3167 3069 +3168 2807 +3169 2939 +3170 2941 +3171 2693 +3172 2497 +3173 2846 +3173 2936 +3173 3018 +3174 2542 +3174 2932 +3174 3020 +3174 3160 +3175 2797 +3176 2655 +3177 2825 +3178 2655 +3178 2825 +3179 2533 +3179 2595 +3180 2692 +3180 3145 +3181 2530 +3181 2918 +3186 2529 +3186 2874 +3186 2917 +3186 3065 +3186 3159 +3186 3185 +3187 2554 +3187 2633 +3187 3184 +3188 2607 +3188 2653 +3188 3183 +3189 2449 +3189 2886 +3189 3182 +3190 2697 +3190 2881 +3191 2978 +3192 2978 +3193 2737 +3194 3174 +3195 2842 +3196 2991 +3197 2880 +3197 2992 +3197 2998 +3197 3053 +3197 3162 +3198 2815 +3198 2878 +3199 2585 +3199 2710 +3200 2662 +3200 2819 +3200 2944 +3201 2660 +3201 3071 +3202 3065 +3202 3159 +3202 3186 +3203 2977 +3204 2632 +3205 2576 +3206 2446 +3207 2542 +3207 2728 +3208 2641 +3209 3008 +3210 2711 +3211 2798 +3211 2800 +3211 2997 +3212 2643 +3213 2846 +3213 3018 +3213 3173 +3214 2488 +3215 2585 +3215 2674 +3215 2710 +3216 2472 +3217 2476 +3218 2477 +3218 3217 +3219 2483 +3220 2711 +3221 2670 +3221 3005 +3221 3008 +3222 2798 +3222 2800 +3223 2939 +3224 2493 +3225 2493 +3226 2502 +3227 2502 +3228 2455 +3228 2838 +3229 2512 +3230 2880 +3230 2998 +3230 3197 +3231 2515 +3232 2983 +3233 2521 +3234 2526 +3235 2983 +3235 3232 +3236 2644 +3237 2644 +3238 2806 +3238 3010 +3239 2645 +3240 2645 +3241 2936 +3242 2559 +3243 2559 +3244 2465 +3244 2716 +3245 2893 +3245 2996 +3246 3117 +3246 3144 +3247 2577 +3247 3007 +3248 2577 +3249 3122 +3250 2839 +3250 3152 +3251 2589 +3251 3234 +3252 2488 +3252 3214 +3253 2798 +3253 2800 +3254 2646 +3255 2647 +3256 2647 +3257 2647 +3258 2647 +3259 2647 +3260 2647 +3261 2648 +3262 2692 +3263 2711 +3263 2957 +3264 3009 +3265 2728 +3265 2952 +3266 2616 +3266 3229 +3266 3234 +3266 3251 +3267 2787 +3267 2977 +3268 2700 +3269 3008 +3269 3209 +3270 2697 +3270 3133 +3270 3134 +3271 2500 +3272 2630 +3272 3219 +3273 2649 +3274 2649 +3275 2852 +3276 2851 +3276 2852 +3276 2914 +3276 3038 +3276 3275 +3277 2576 +3277 3205 +3278 2852 +3279 2465 +3279 2716 +3279 3244 +3280 2914 +3281 2574 +3281 3097 +3282 3281 +3283 2631 +3283 3188 +3284 2553 +3284 2801 +3284 3030 +3284 3128 +3284 3129 +3284 3141 +3286 2693 +3286 2792 +3286 3171 +3286 3285 +3287 2727 +3288 2611 +3288 2650 +3289 2611 +3289 2650 +3290 3288 +3291 3289 +3292 2552 +3295 3294 +3297 3296 +3299 3298 +3310 3297 +3310 3309 +3312 3311 +3314 3295 +3314 3299 +3314 3313 +3317 3316 +3321 3312 +3323 3322 +3325 3296 +3326 3297 +3328 3321 +3328 3327 +3329 3299 +3331 3323 +3331 3330 +3333 3297 +3333 3310 +3333 3312 +3333 3332 +3334 3294 +3336 3312 +3336 3317 +3336 3335 +3342 3324 +3342 3340 +3342 3341 +3344 3307 +3345 3323 +3348 3347 +3349 3337 +3349 3347 +3351 3312 +3351 3336 +3352 3317 +3355 3315 +3355 3354 +3357 3310 +3357 3356 +3359 3312 +3359 3358 +3360 3320 +3360 3346 +3361 3352 +3361 3360 +3362 3352 +3365 3329 +3365 3352 +3366 3316 +3368 3367 +3369 3368 +3370 3368 +3379 3378 +3380 3378 +3388 3294 +3392 3317 +3393 3317 +3395 3358 +3401 3400 +3402 3347 +3402 3401 +3403 3345 +3410 3406 +3410 3407 +3411 3293 +3411 3408 +3411 3409 +3411 3410 +3413 3342 +3417 3416 +3418 3319 +3420 3307 +3421 3317 +3423 3353 +3425 3423 +3426 3423 +3426 3424 +3429 3337 +3429 3428 +3430 3416 +3431 3373 +3431 3374 +3431 3375 +3431 3416 +3431 3417 +3432 3355 +3432 3376 +3433 3296 +3435 3314 +3435 3331 +3437 3355 +3440 3299 +3441 3299 +3444 3442 +3445 3386 +3446 3300 +3446 3301 +3447 3445 +3448 3445 +3450 3302 +3454 3322 +3454 3453 +3455 3311 +3456 3404 +3457 3456 +3458 3456 +3460 3310 +3462 3461 +3463 3462 +3464 3309 +3464 3463 +3465 3309 +3465 3459 +3465 3462 +3466 3329 +3466 3359 +3467 3306 +3468 3303 +3468 3304 +3468 3305 +3468 3412 +3468 3415 +3468 3467 +3469 3307 +3469 3468 +3470 3307 +3470 3468 +3471 3321 +3472 3329 +3472 3344 +3473 3318 +3474 3308 +3475 3363 +3477 3310 +3478 3310 +3479 3468 +3480 3377 +3481 3480 +3483 3316 +3484 3310 +3484 3312 +3485 3436 +3485 3484 +3486 3353 +3486 3485 +3487 3486 +3488 3293 +3491 3490 +3496 3493 +3497 3319 +3497 3452 +3498 3329 +3498 3488 +3499 3493 +3499 3494 +3499 3497 +3500 3493 +3500 3495 +3500 3497 +3501 3494 +3501 3495 +3501 3497 +3502 3414 +3502 3467 +3503 3467 +3506 3296 +3506 3505 +3510 3507 +3511 3509 +3512 3510 +3512 3511 +3513 3508 +3513 3511 +3515 3498 +3516 3371 +3517 3411 +3519 3411 +3520 3517 +3523 3370 +3525 3497 +3525 3524 +3526 3468 +3527 3438 +3527 3467 +3528 3422 +3529 3341 +3529 3434 +3531 3530 +3532 3420 +3534 3400 +3536 3316 +3536 3482 +3538 3298 +3538 3537 +3540 3307 +3542 3320 +3544 3473 +3545 3449 +3545 3489 +3546 3320 +3547 3320 +3550 3503 +3550 3514 +3551 3414 +3551 3514 +3552 3294 +3553 1 +3553 3422 +3554 3401 +3556 3544 +3557 3316 +3557 3521 +3558 3299 +3558 3329 +3560 3486 +3560 3512 +3561 3328 +3561 3351 +3562 3383 +3562 3542 +3563 3353 +3563 3511 +3564 3324 +3564 3434 +3564 3512 +3564 3563 +3565 3399 +3565 3418 +3567 3371 +3567 3436 +3567 3485 +3568 3296 +3569 3355 +3571 3522 +3572 3325 +3573 3319 +3573 3343 +3574 3319 +3574 3343 +3576 3326 +3577 3568 +3577 3576 +3578 3576 +3579 3364 +3579 3559 +3580 3308 +3580 3330 +3580 3389 +3581 3330 +3582 3329 +3583 2 +3583 3343 +3584 3517 +3585 3584 +3586 1 +3586 3329 +3587 1 +3587 3329 +3588 3438 +3588 3569 +3589 3572 +3589 3575 +3590 3356 +3590 3439 +3591 3384 +3591 3468 +3592 3468 +3593 3293 +3593 3312 +3596 3308 +3597 3596 +3598 3351 +3598 3471 +3600 3426 +3601 3355 +3601 3570 +3601 3571 +3604 3541 +3605 3555 +3605 3603 +3606 3605 +3607 3320 +3608 3371 +3608 3427 +3609 3400 +3609 3555 +3610 3315 +3610 3431 +3611 3604 +3612 3352 +3612 3548 +3612 3582 +3613 3468 +3614 3442 +3614 3468 +3615 3451 +3615 3591 +3616 3332 +3616 3506 +3617 3545 +3618 3545 +3619 3429 +3620 3316 +3620 3467 +3621 3371 +3621 3455 +3622 3301 +3622 3345 +3623 3427 +3623 3523 +3624 3590 +3625 3315 +3625 3398 +3625 3583 +3626 3412 +3626 3497 +3627 3307 +3627 3419 +3627 3498 +3628 3337 +3628 3599 +3629 3334 +3631 3302 +3631 3630 +3632 3312 +3632 3321 +3634 3338 +3635 3634 +3637 1 +3637 3525 +3637 3636 +3638 3343 +3638 3355 +3639 3343 +3641 3640 +3643 3339 +3645 3309 +3645 3644 +3646 3453 +3647 3343 +3647 3344 +3648 3343 +3648 3344 +3649 3618 +3650 3492 +3651 3554 +3651 3650 +3652 3307 +3652 3352 +3653 3541 +3654 3308 +3654 3539 +3654 3581 +3655 3353 +3655 3564 +3656 3315 +3656 3396 +3656 3397 +3656 3639 +3657 3433 +3657 3572 +3658 3405 +3659 3343 +3659 3415 +3660 3603 +3661 3347 +3661 3609 +3662 3592 +3662 3613 +3663 3349 +3663 3456 +3663 3651 +3665 3437 +3665 3526 +3666 3410 +3666 3518 +3667 3541 +3668 3322 +3669 3611 +3669 3649 +3670 3532 +3671 3351 +3671 3421 +3672 3302 +3672 3337 +3673 3350 +3673 3351 +3674 3350 +3674 3351 +3675 3399 +3675 3491 +3675 3553 +3675 3565 +3676 3411 +3676 3418 +3677 3319 +3677 3410 +3678 3347 +3678 3641 +3679 3487 +3680 3679 +3681 3679 +3682 3404 +3682 3661 +3683 3356 +3683 3633 +3684 3413 +3684 3484 +3685 3683 +3686 3401 +3686 3658 +3688 3350 +3689 3351 +3690 3390 +3691 3690 +3692 3308 +3692 3552 +3692 3691 +3693 3313 +3693 3597 +3694 3391 +3695 3431 +3695 3432 +3695 3694 +3696 3504 +3697 3312 +3697 3331 +3697 3696 +3698 3321 +3698 3689 +3699 3480 +3699 3675 +3700 3350 +3700 3514 +3701 3350 +3701 3514 +3702 3351 +3702 3670 +3703 3530 +3703 3536 +3705 3330 +3705 3619 +3705 3704 +3706 3533 +3706 3549 +3707 3706 +3708 3301 +3708 3556 +3708 3707 +3709 3346 +3709 3394 +3709 3607 +3710 3449 +3710 3476 +3712 3410 +3712 3711 +3713 3327 +3713 3711 +3714 3355 +3715 3355 +3716 3355 +3716 3365 +3717 3535 +3717 3542 +3718 3576 +3719 3566 +3719 3599 +3719 3602 +3721 3635 +3722 3332 +3722 3356 +3722 3631 +3722 3633 +3722 3645 +3722 3683 +3722 3721 +3723 3356 +3723 3685 +3724 3317 +3724 3540 +3725 3358 +3725 3359 +3726 3358 +3726 3585 +3726 3594 +3726 3664 +3727 3358 +3727 3491 +3727 3595 +3728 3687 +3729 3347 +3729 3728 +3730 3360 +3731 3568 +3731 3576 +3732 3504 +3732 3621 +3733 3426 +3733 3486 +3734 3494 +3735 3495 +3736 3607 +3737 3445 +3737 3446 +3737 3489 +3737 3720 +3738 3511 +3738 3600 +3739 3483 +3739 3522 +3740 3327 +3740 3382 +3740 3443 +3741 3538 +3741 3629 +3742 3328 +3742 3515 +3743 3661 +3744 3562 +3745 3667 +3745 3668 +3746 3537 +3747 3403 +3748 3403 +3748 3747 +3754 3753 +3755 3753 +3757 3756 +3759 3758 +3761 3760 +3762 3750 +3762 3751 +3764 3762 +3765 3763 +3766 3763 +3767 3750 +3769 483 +3769 692 +3770 113 +3770 3769 +3772 3771 +3773 3752 +3774 3753 +3776 3775 +3777 3775 +3778 3749 +3778 3755 +3781 726 +3781 3779 +3781 3780 +3782 3770 +3783 3771 +3784 3754 +3784 3761 +3784 3783 +3785 3781 +3785 3783 +3785 3784 +3787 3785 +3787 3786 +3788 3761 +3788 3762 +3789 3763 +3789 3787 +3790 3780 +3792 3757 +3792 3758 +3792 3775 +3792 3791 +3793 3750 +3793 3751 +3794 3793 +3795 3773 +3795 3794 +3797 3774 +3797 3776 +3797 3777 +3797 3784 +3797 3796 +3798 3781 +3798 3785 +3799 3796 +3800 3797 +3801 3766 +3801 3781 +3802 3795 +3803 3802 +3804 3752 +3804 3802 +3807 3806 +3809 3775 +3811 3810 +3813 3812 +3816 3779 +3817 3816 +3819 3815 +3821 3810 +3821 3815 +3822 3792 +3823 3822 +3825 3771 +3825 3824 +3828 3827 +3830 3829 +3831 3811 +3831 3814 +3832 3830 +3833 3832 +3835 3834 +3836 3783 +3837 3829 +3838 3766 +3838 3767 +3838 3768 +3838 3806 +3838 3813 +3839 3838 +3840 3838 +3841 3783 +3842 3783 +3842 3824 +3843 3812 +3843 3840 +3844 3807 +3844 3838 +3844 3843 +3847 3771 +3847 3846 +3849 3815 +3849 3831 +3850 3834 +3851 3779 +3851 3850 +3853 3852 +3854 3796 +3855 3779 +3855 3834 +3856 3827 +3856 3853 +3857 3786 +3857 3809 +3859 3847 +3859 3858 +3861 3853 +3862 3838 +3863 3774 +3863 3805 +3863 3826 +3863 3834 +3863 3851 +3864 3805 +3864 3811 +3864 3863 +3866 3865 +3868 3783 +3868 3859 +3870 3781 +3870 3782 +3870 3869 +3871 3779 +3872 3845 +3872 3867 +3873 3845 +3874 3873 +3875 3808 +3876 3796 +3877 3796 +3877 3876 +3878 3875 +3879 3783 +3879 3834 +3880 3818 +3881 3822 +3882 3881 +3883 3758 +3885 3884 +3886 3786 +3887 3796 +3888 3854 +3888 3887 +3889 3817 +3890 3817 +3890 3887 +3891 3786 +3892 3875 +3893 3779 +3893 3823 +3894 3808 +3895 3788 +3895 3789 +3895 3829 +3895 3830 +3895 3837 +3895 3848 +3895 3867 +3895 3872 +3895 3874 +3896 3786 +3896 3820 +3898 3812 +3898 3897 +3900 3829 +3900 3895 +3900 3899 +3901 3807 +3901 3862 +3902 3860 +3902 3891 +3903 3825 +3903 3860 +3903 3874 +3903 3902 +3904 3793 +3904 3865 +3904 3866 +3904 3878 +3904 3884 +3904 3885 +3904 3894 +3905 3785 +3905 3904 +3906 3838 +3906 3866 +3907 3836 +3907 3863 +3908 3814 +3908 3826 +3909 3888 +3909 3890 +3910 3883 +3911 3872 +3912 3823 +3912 3855 +3913 3823 +3914 3861 +3914 3885 +3915 3871 +3915 3893 +3916 3796 +3916 3871 +3916 3877 +3916 3881 +3917 3882 +3917 3910 +3917 3916 +3918 3801 +3918 3826 +3918 3836 +3918 3898 +3918 3911 +3919 3833 +3919 3895 +3920 3848 +3920 3895 +3921 3775 +3921 3809 +3922 3775 +3922 3792 +3922 3913 +3923 3839 +3923 3897 +3924 3923 +3925 3880 +3925 3901 +3925 3908 +3926 3762 +3927 3848 +3927 3895 +3927 3903 +3928 3802 +3928 3804 +3929 3873 +3930 3757 +3930 3809 +3931 3757 +3931 3930 +3932 3749 +3932 3762 +3933 3897 +3933 3918 +3934 3796 +3935 3762 +3935 3788 +3936 3752 +3936 3802 +3937 3790 +3937 3797 +3938 3766 +3938 3803 +3938 3892 +3939 3798 +3940 3798 +3941 3798 +3943 3768 +3943 3778 +3943 3942 +3944 3802 +3944 3827 +3945 3809 +3946 3763 +3950 3949 +3956 3948 +3957 3956 +3959 3958 +3962 3960 +3962 3961 +3963 3956 +3965 3957 +3965 3964 +3966 3954 +3969 3955 +3969 3967 +3969 3968 +3971 3969 +3971 3970 +3972 3970 +3973 3947 +3975 3950 +3975 3951 +3978 3948 +3979 3957 +3979 3959 +3979 3976 +3979 3977 +3979 3978 +3980 3951 +3980 3979 +3982 518 +3983 3953 +3983 3981 +3984 3973 +3985 3966 +3985 3984 +3986 3985 +3987 426 +3987 3985 +3989 3957 +3991 3990 +3992 3972 +3994 3975 +3995 3954 +3995 3973 +3997 3959 +3997 3996 +3998 3949 +3999 3958 +3999 3963 +4000 3953 +4000 3983 +4001 4000 +4002 3965 +4003 3991 +4004 3962 +4005 3972 +4006 3988 +4007 4006 +4008 3957 +4008 3959 +4011 3959 +4012 3948 +4012 3992 +4013 3992 +4016 3958 +4016 3996 +4017 4011 +4018 4009 +4020 3979 +4020 4000 +4020 4002 +4020 4019 +4021 3992 +4022 2717 +4023 2717 +4023 3960 +4024 2939 +4025 3990 +4025 4015 +4026 4024 +4027 3979 +4028 4005 +4028 4012 +4029 3971 +4029 4000 +4029 4014 +4029 4028 +4030 4001 +4031 3957 +4031 4029 +4031 4030 +4032 4029 +4033 3993 +4033 4015 +4033 4026 +4034 3960 +4034 4003 +4034 4022 +4034 4033 +4035 2342 +4035 3982 +4036 4004 +4036 4010 +4037 4009 +4037 4018 +4038 3981 +4038 4014 +4038 4036 +4038 4037 +4039 4030 +4039 4036 +4040 3952 +4041 3966 +4041 4030 +4041 4040 +4042 4041 +4043 4041 +4045 3961 +4045 4044 +4046 4009 +4046 4045 +4047 3962 +4047 4002 +4047 4010 +4048 3988 +4049 4007 +4049 4040 +4049 4048 +4050 3998 +4052 4051 +4053 4050 +4053 4051 +4055 3955 +4055 4054 +4056 3955 +4056 4007 +4057 4034 +4058 4015 +4058 4057 +4060 4059 +4061 4059 +4062 3954 +4062 4061 +4063 3966 +4063 4060 +4064 3954 +4064 3966 +4065 3995 +4065 4060 +4066 4041 +4066 4065 +4067 3982 +4068 3994 +4068 4067 +4069 4052 +4070 4052 +4071 4060 +4072 3971 +4073 4072 +4074 4073 +4075 4073 +4076 4073 +4078 3974 +4078 3986 +4078 4077 +4079 4009 +4080 4029 +4080 4036 +4080 4038 +4080 4047 +4080 4079 +4084 4082 +4084 4083 +4086 4081 +4086 4084 +4086 4085 +4089 4088 +4090 4084 +4090 4086 +4092 4091 +4099 2556 +4099 4084 +4101 4100 +4102 4093 +4104 4103 +4105 4069 +4105 4070 +4105 4095 +4106 4096 +4106 4105 +4107 4106 +4109 4106 +4109 4108 +4110 4099 +4111 481 +4112 129 +4112 4111 +4113 475 +4114 4113 +4116 4092 +4118 4117 +4120 108 +4120 522 +4120 4119 +4121 4090 +4121 4110 +4124 4118 +4124 4122 +4124 4123 +4128 4125 +4128 4126 +4128 4127 +4129 2440 +4129 2562 +4131 4130 +4133 4132 +4135 4134 +4136 4097 +4138 4110 +4138 4134 +4138 4137 +4143 4121 +4143 4140 +4143 4141 +4143 4142 +4144 4106 +4145 526 +4146 4144 +4146 4145 +4147 4098 +4147 4106 +4148 2440 +4148 4114 +4149 4114 +4150 4121 +4151 4102 +4151 4139 +4151 4147 +4152 4094 +4152 4103 +4152 4151 +4154 4118 +4154 4138 +4154 4153 +4156 4110 +4156 4132 +4156 4154 +4156 4155 +4157 4137 +4158 4134 +4159 4118 +4159 4154 +4160 4090 +4162 4086 +4162 4138 +4162 4158 +4162 4161 +4163 4119 +4163 4152 +4164 570 +4164 4120 +4164 4163 +4165 4152 +4166 4087 +4168 4167 +4169 4167 +4171 4147 +4171 4170 +4172 2621 +4172 4087 +4172 4099 +4172 4115 +4172 4162 +4173 474 +4173 4111 +4173 4149 +4174 4164 +4175 4139 +4176 4175 +4179 842 +4179 4120 +4179 4164 +4179 4177 +4179 4178 +4181 4166 +4182 4180 +4183 4182 +4184 4107 +4185 4184 +4186 4128 +4187 4089 +4187 4115 +4187 4180 +4188 4089 +4188 4166 +4188 4187 +4189 4092 +4193 4154 +4193 4162 +4193 4172 +4193 4190 +4193 4191 +4193 4192 +4194 4156 +4194 4172 +4196 4131 +4196 4167 +4196 4180 +4196 4187 +4196 4195 +4199 3763 +4199 3785 +4199 3803 +4199 3905 +4199 4197 +4199 4198 +4200 4097 +4201 4111 +4201 4128 +4202 4121 +4202 4150 +4202 4199 +4203 4187 +4204 4147 +4204 4171 +4206 4101 +4206 4160 +4206 4199 +4207 4164 +4207 4174 +4207 4206 +4208 4092 +4208 4166 +4209 4151 +4210 4181 +4211 564 +4211 4115 +4211 4133 +4211 4187 +4212 4151 +4213 4112 +4213 4207 +4214 4166 +4214 4189 +4215 4151 +4216 4163 +4216 4215 +4217 4090 +4217 4160 +4217 4206 +4218 4087 +4218 4172 +4218 4187 +4218 4194 +4218 4205 +4219 2543 +4219 4164 +4219 4218 +4221 4111 +4221 4128 +4221 4201 +4221 4220 +4222 4097 +4222 4136 +4222 4221 +4223 4157 +4224 4138 +4225 4103 +4226 4182 +4227 4101 +4227 4199 +4228 4157 +4229 4157 +4230 4158 +4231 4158 +4232 4158 +4233 4157 +4234 4193 +4235 4203 +4236 4203 +4238 4137 +4239 4117 +4240 4117 +4241 4100 +4242 4155 +4243 4110 +4243 4237 +4244 4100 +4245 4097 +4246 4097 +4247 4246 +4248 4246 +4249 4155 +4251 4161 +4252 4127 +4253 4153 +4254 4195 +4256 4203 +4257 4195 +4258 4155 +4259 4137 +4260 4100 +4261 4203 +4262 4203 +4264 4214 +4264 4255 +4264 4263 +4265 2621 +4265 4250 +4266 4195 +4267 4087 +4268 4111 +4269 4160 +4270 4224 +4271 4224 +4272 4224 +4273 4224 +4274 4224 +4275 4224 +4279 4094 +4279 4276 +4279 4277 +4279 4278 +4280 4175 +4281 4098 +4282 4098 +4283 4098 +4284 4188 +4285 4093 +4285 4119 +4286 4204 +4287 4204 +4288 4165 +4289 4165 +4290 4180 +4291 4279 +4292 4291 +4293 4291 +4294 4291 +4295 4181 +4296 4181 +4297 4181 +4298 4181 +4299 4088 +4300 4186 +4301 4218 +4302 4301 +4303 4301 +4304 4202 +4305 4102 +4305 4212 +4306 4102 +4307 4305 +4308 4209 +4309 4209 +4310 4209 +4311 4209 +4312 4209 +4313 4210 +4314 4210 +4315 4210 +4316 4210 +4317 2556 +4317 2621 +4317 4101 +4317 4128 +4317 4174 +4317 4186 +4317 4221 +4318 4299 +4319 4299 +4320 4114 +4321 4284 +4322 4284 +4323 4129 +4324 4129 +4325 4148 +4326 4149 +4331 4328 +4331 4329 +4335 4332 +4335 4334 +4336 4332 +4340 4332 +4340 4333 +4340 4339 +4341 321 +4342 4327 +4342 4336 +4342 4338 +4345 4336 +4345 4342 +4345 4343 +4346 4328 +4346 4336 +4346 4345 +4347 4332 +4347 4335 +4347 4336 +4347 4345 +4351 4350 +4352 4344 +4355 4333 +4357 4333 +4357 4340 +4357 4346 +4357 4356 +4359 4333 +4359 4351 +4359 4358 +4360 4346 +4361 4336 +4361 4343 +4361 4345 +4362 253 +4363 4352 +4363 4362 +4364 4358 +4364 4359 +4365 4342 +4365 4345 +4367 4366 +4368 4342 +4368 4345 +4368 4365 +4368 4367 +4369 4363 +4370 4363 +4371 4359 +4371 4364 +4372 4359 +4372 4361 +4372 4364 +4372 4365 +4372 4371 +4373 4336 +4373 4343 +4373 4345 +4373 4361 +4373 4364 +4373 4365 +4373 4372 +4374 4341 +4374 4352 +4374 4367 +4374 4369 +4374 4370 +4375 4327 +4375 4342 +4375 4368 +4376 4341 +4376 4352 +4376 4367 +4376 4374 +4377 4329 +4377 4346 +4377 4353 +4377 4357 +4380 4359 +4380 4371 +4380 4379 +4381 4332 +4381 4335 +4381 4336 +4381 4345 +4381 4346 +4381 4347 +4381 4352 +4381 4375 +4383 4333 +4383 4359 +4383 4364 +4384 4344 +4384 4352 +4384 4374 +4384 4376 +4385 4332 +4385 4344 +4385 4384 +4386 4337 +4386 4384 +4387 4327 +4388 4359 +4391 4332 +4391 4333 +4391 4355 +4391 4372 +4391 4383 +4391 4389 +4391 4390 +4392 4327 +4392 4352 +4392 4367 +4392 4369 +4392 4370 +4392 4374 +4392 4376 +4392 4384 +4395 4333 +4395 4336 +4395 4340 +4395 4345 +4395 4361 +4395 4372 +4395 4373 +4395 4383 +4395 4391 +4395 4393 +4396 4353 +4396 4373 +4396 4391 +4396 4394 +4396 4395 +4397 4371 +4397 4382 +4398 4332 +4398 4335 +4398 4347 +4398 4352 +4398 4381 +4399 4343 +4399 4365 +4399 4382 +4400 4332 +4400 4340 +4401 4330 +4401 4344 +4401 4352 +4401 4384 +4401 4392 +4402 4332 +4402 4335 +4402 4337 +4402 4347 +4402 4349 +4402 4381 +4402 4384 +4402 4386 +4402 4398 +4402 4401 +4403 4355 +4403 4383 +4404 4342 +4404 4354 +4404 4367 +4404 4368 +4405 4361 +4405 4373 +4406 4345 +4406 4361 +4407 4331 +4407 4346 +4407 4357 +4408 4344 +4408 4352 +4408 4381 +4408 4384 +4408 4401 +4409 4345 +4409 4360 +4410 4327 +4410 4354 +4410 4392 +4410 4404 +4411 4342 +4411 4368 +4412 4353 +4412 4373 +4413 4332 +4413 4344 +4413 4352 +4413 4384 +4413 4385 +4413 4401 +4413 4408 +4414 4404 +4415 263 +4415 4378 +4415 4386 +4416 4351 +4416 4358 +4416 4359 +4416 4371 +4416 4380 +4417 4346 +4417 4348 +4417 4357 +4418 4346 +4418 4361 +4419 4345 +4419 4361 +4421 4420 +4423 238 +4424 4422 +4425 353 +4426 354 +4428 326 +4429 4427 +4430 4426 +4431 309 +4432 4422 +4433 4431 +4435 290 +4435 4421 +4435 4432 +4435 4434 +4436 4421 +4436 4435 +4437 1119 +4439 4436 +4439 4437 +4439 4438 +4441 4437 +4441 4439 +4441 4440 +4442 4421 +4442 4436 +4442 4441 +4443 4427 +4443 4442 +4444 830 +4445 22 +4445 2562 +4446 23 +4446 84 +4446 91 +4446 475 +4446 493 +4448 49 +4448 85 +4448 521 +4448 2562 +4448 4445 +4448 4447 +4454 4451 +4454 4452 +4455 4453 +4456 4455 +4457 843 +4458 514 +4458 521 +4458 569 +4458 829 +4458 837 +4458 856 +4458 2440 +4458 4119 +4458 4444 +4458 4448 +4458 4454 +4458 4455 +4458 4457 +4459 99 +4459 4458 +4461 24 +4461 84 +4461 132 +4461 2562 +4461 4446 +4461 4460 +4462 826 +4462 4444 +4462 4449 +4462 4450 +4463 4458 +4464 4458 +4465 4458 +4466 4458 +4474 4473 +4475 4471 +4476 3362 +4476 4474 +4477 4476 +4478 3378 +4479 4478 +4481 4480 +4483 4482 +4485 4467 +4485 4468 +4485 4478 +4485 4480 +4487 4486 +4491 2423 +4492 4491 +4496 4485 +4499 4498 +4500 4490 +4500 4498 +4501 4483 +4501 4500 +4503 4502 +4506 4505 +4507 2241 +4507 4469 +4508 4473 +4509 3363 +4509 4489 +4510 4493 +4514 4513 +4517 4516 +4518 4512 +4520 4519 +4521 4520 +4522 4504 +4526 4469 +4528 4527 +4529 4488 +4530 4485 +4533 4486 +4535 2248 +4535 4507 +4535 4534 +4536 2248 +4540 4484 +4541 4534 +4542 4508 +4542 4531 +4543 4492 +4545 4523 +4545 4528 +4546 4506 +4547 4497 +4547 4533 +4549 4548 +4550 4486 +4552 2409 +4553 4467 +4553 4495 +4554 4516 +4554 4522 +4559 4475 +4561 4503 +4561 4557 +4562 4488 +4563 2423 +4565 4564 +4567 4537 +4567 4566 +4568 4553 +4570 3364 +4571 4570 +4573 2249 +4573 4572 +4574 4477 +4574 4573 +4575 4508 +4576 4549 +4579 4524 +4579 4544 +4579 4555 +4580 4491 +4581 4513 +4582 3352 +4582 4492 +4582 4581 +4584 4491 +4584 4551 +4585 4515 +4586 4551 +4587 4585 +4588 4487 +4588 4540 +4589 4504 +4589 4585 +4589 4586 +4590 4471 +4590 4482 +4592 4520 +4592 4555 +4594 4574 +4595 4574 +4596 4494 +4596 4532 +4597 4519 +4597 4538 +4598 4513 +4598 4579 +4600 4505 +4601 4485 +4602 4469 +4602 4564 +4602 4565 +4603 3331 +4605 4473 +4605 4604 +4606 4497 +4606 4547 +4607 4512 +4608 4607 +4610 4489 +4611 4531 +4611 4593 +4611 4602 +4612 4562 +4613 4468 +4613 4512 +4614 4516 +4614 4570 +4616 4493 +4617 4473 +4617 4503 +4618 4534 +4619 4605 +4620 4520 +4620 4522 +4621 4570 +4621 4577 +4622 4560 +4622 4562 +4622 4583 +4623 4583 +4624 4550 +4624 4600 +4625 4619 +4626 4469 +4626 4510 +4627 4552 +4628 3643 +4628 4476 +4628 4571 +4630 4607 +4631 2241 +4631 4536 +4632 2409 +4633 4621 +4634 2355 +4635 4592 +4636 4508 +4636 4610 +4637 4569 +4637 4619 +4638 4548 +4639 4470 +4640 4565 +4641 4602 +4641 4640 +4642 4637 +4643 4511 +4643 4557 +4643 4615 +4644 4608 +4644 4643 +4645 4641 +4646 4473 +4648 4490 +4648 4549 +4648 4556 +4649 2409 +4649 4627 +4650 4531 +4651 4532 +4651 4541 +4651 4569 +4652 2249 +4652 4474 +4652 4552 +4652 4573 +4652 4644 +4652 4651 +4653 4629 +4654 4523 +4654 4601 +4654 4615 +4654 4653 +4655 3336 +4655 4479 +4655 4481 +4655 4608 +4656 4574 +4656 4655 +4657 4590 +4659 4495 +4659 4524 +4659 4581 +4660 2387 +4660 4493 +4660 4506 +4660 4658 +4661 4517 +4661 4577 +4662 4476 +4662 4543 +4662 4628 +4662 4661 +4664 4509 +4664 4633 +4664 4663 +4665 4591 +4666 4554 +4667 4567 +4668 4645 +4669 4491 +4669 4515 +4670 4556 +4671 4472 +4672 4630 +4673 4534 +4674 4499 +4674 4647 +4674 4671 +4675 4542 +4675 4646 +4676 4470 +4676 4528 +4676 4672 +4677 3360 +4677 4560 +4678 3361 +4678 4476 +4678 4677 +4679 4562 +4679 4568 +4683 4616 +4683 4634 +4683 4682 +4684 4563 +4684 4677 +4686 4525 +4686 4537 +4686 4609 +4686 4667 +4686 4685 +4687 4530 +4687 4657 +4688 4484 +4688 4660 +4689 4639 +4689 4670 +4690 4608 +4690 4689 +4691 4518 +4691 4689 +4694 4588 +4694 4692 +4695 2414 +4695 4693 +4695 4694 +4696 4512 +4699 4520 +4699 4697 +4699 4698 +4700 4546 +4700 4558 +4700 4658 +4701 4554 +4702 4494 +4702 4511 +4703 4487 +4703 4606 +4711 4704 +4713 4707 +4714 4705 +4714 4710 +4716 4706 +4716 4707 +4719 4552 +4719 4706 +4720 4717 +4722 4534 +4722 4578 +4723 4591 +4723 4651 +4723 4722 +4724 4710 +4727 4712 +4727 4715 +4727 4725 +4728 4708 +4728 4709 +4728 4712 +4728 4717 +4729 4708 +4729 4709 +4731 4718 +4732 4713 +4732 4719 +4733 4627 +4733 4708 +4735 4711 +4735 4724 +4736 4720 +4736 4727 +4737 4718 +4738 4731 +4738 4734 +4739 4649 +4739 4721 +4739 4737 +4740 4733 +4742 4739 +4742 4741 +4743 2209 +4743 4632 +4744 4734 +4745 4705 +4745 4733 +4746 4704 +4746 4708 +4747 4740 +4747 4741 +4748 4728 +4748 4730 +4749 2409 +4749 4726 +4750 4649 +4751 4715 +4751 4721 +4751 4730 +4751 4744 +4751 4750 +4752 4708 +4753 2409 +4753 4649 +4754 4725 +4754 4749 +4754 4753 +4755 4721 +4756 4726 +4757 4733 +4758 4755 +4759 3334 +4759 4525 +4761 4570 +4761 4760 +4763 4539 +4763 4566 +4764 4500 +4765 4500 +4766 4470 +4767 4496 +4767 4529 +4768 4522 +4768 4762 +4769 4767 +4770 4769 +4771 4538 +4771 4681 +4771 4685 +4772 4482 +4773 4609 +4774 4727 +4775 4727 +4776 4620 +4777 4761 +4778 4518 +4779 4667 +4780 4779 +4781 4691 +4782 4518 +4784 4726 +4784 4749 +4784 4783 +4786 4626 +4786 4785 +4788 4588 +4789 4540 +4791 4616 +4791 4790 +4792 4788 +4793 4703 +4793 4792 +4794 4787 +4794 4793 +4795 4792 +4796 4469 +4797 4493 +4798 4497 +4799 4542 +4799 4675 +4800 4520 +4801 4520 +4802 4520 +4803 4526 +4804 4526 +4805 4538 +4806 4538 +4807 4538 +4808 4539 +4809 4539 +4811 4561 +4812 4755 +4813 4564 +4814 4564 +4815 4564 +4816 4541 +4817 4816 +4818 4697 +4820 4575 +4820 4599 +4820 4602 +4820 4819 +4821 4640 +4822 4798 +4823 4673 +4823 4810 +4824 4780 +4825 4681 +4826 4532 +4826 4651 +4826 4680 +4827 4670 +4827 4782 +4830 3322 +4831 3331 +4831 4830 +4832 4477 +4836 4835 +4837 2312 +4837 4832 +4837 4836 +4841 4832 +4841 4840 +4842 4840 +4843 4840 +4844 4841 +4845 3454 +4845 4830 +4847 4834 +4848 4846 +4848 4847 +4849 2396 +4849 4836 +4850 3381 +4850 3385 +4854 2265 +4854 4853 +4855 980 +4855 4851 +4859 2365 +4859 4856 +4859 4857 +4860 4852 +4860 4858 +4860 4859 +4861 3295 +4861 4537 +4862 3543 +4863 4862 +4864 3318 +4865 3337 +4866 4537 +4866 4828 +4866 4829 +4867 4474 +4867 4840 +4867 4861 +4867 4866 +4868 4867 +4869 4867 +4871 4856 +4873 4848 +4873 4872 +4874 4829 +4875 3341 +4875 3369 +4876 3333 +4876 3342 +4876 4483 +4876 4875 +4877 4863 +4878 3372 +4878 3387 +4878 4847 +4878 4862 +4879 4864 +4879 4878 +4880 4870 +4881 4838 +4881 4878 +4882 138 +4882 4852 +4883 3348 +4883 4848 +4883 4876 +4884 4828 +4884 4836 +4884 4874 +4885 3642 +4885 3649 +4885 4874 +4885 4877 +4886 4885 +4887 4841 +4887 4864 +4887 4886 +4888 3345 +4888 4886 +4889 4832 +4889 4887 +4889 4888 +4890 4838 +4890 4872 +4891 4873 +4892 4851 +4893 68 +4893 4871 +4893 4891 +4893 4892 +4894 1030 +4894 4893 +4896 4833 +4897 2214 +4897 4828 +4897 4836 +4897 4854 +4898 4833 +4899 4831 +4899 4898 +4900 4848 +4900 4880 +4900 4888 +4902 1033 +4902 4879 +4902 4901 +4903 4839 +4904 4838 +4904 4839 +4905 4872 +4905 4903 +4907 4901 +4907 4906 +4908 4850 +4908 4906 +4909 4850 +4909 4901 +4913 4870 +4914 4878 +4914 4910 +4915 4880 +4916 4834 +4917 4872 +4918 4913 +4919 4908 +4920 4878 +4921 4901 +4921 4911 +4922 4850 +4922 4917 +4923 4834 +4923 4865 +4923 4912 +4924 4878 +4924 4910 +4924 4918 +4925 4867 +4925 4895 +4925 4899 +4926 4896 +4926 4898 +4927 4695 +4928 776 +4928 4927 +4929 4928 +4930 3 +4931 4930 +4934 782 +4934 4932 +4934 4933 +4935 4932 +4937 4930 +4937 4935 +4938 4929 +4938 4936 +4939 4933 +4940 819 +4940 4939 diff --git a/tests/env_init/databases/metadb/jasminegraph_meta.db b/tests/env_init/databases/metadb/jasminegraph_meta.db new file mode 100755 index 0000000000000000000000000000000000000000..20c5eae836de10839301043975658e1b7123d1ec GIT binary patch literal 61440 zcmeI53wWGmmB+uC`R><38$v0Up|sL0X*)AXni4LhK&X|{mbM5LAx)EMI&GSSTqp$r zC*b4EfVi#|*9*#e!^^VX?;@_NpzEWux+~xfRD1+iS5(wRMfd#w@8mLR-Nk41QSnX4 z0Z07JG*V|*&DjEyp&y5>Q~14joZ4{ zb#KXT+_Wvb@uCeIvYWT8zhLc_?b-9Yx3^}8diNEx&t1FaoM*4yl3iBlXqonF%}$IA z4)^x=jP#E0o^ff*BWp{xmx` z^VaN@#nJKNRei$~L*v=A*RK>bLU z+kM{Ji#BY_?&=*JE6&_Meqdyl-uYZhi+gqIwrAEpeFjxCxo*N~UbrxIV~Iy@|M2ME z;;4EI8xGxKb#ZZaneXk`Jv=rpn;D;Wc!%s_aTqI(%2w_f86Fjf>5Y~xwNKg!vMh<^@tY>6m=U}OChj;d-O&hw`ZlrU+D(H9Q z&+~e?aI@gDY)5G-NQ>Wc{yw|;_lS(;%BR+=fi2FC)UtlS6Y>Xr1$Appl`|l&nLvXEtD` z2M>eLDgUQ4)U&@dzPqP?Vq|QJ=q-_%zUpbOpLWy={DBnM9NEpMoRZqkgEn@>p#1pK zGgiD}qBzu7obxnjICOIcmjSY^a%W3CXx#b-O78z3X4A9n=A})kvC?_lXvlXnvtT;~ zKJT!oCHRE2vq9KWb}~-$(xs{Lg;Z?zH*2$Pvq7ubBh%l8PJLH3g{j#jochkRHQQet z>l-bN;M=%HwzeeiH4grs0!<#Vj@-XdeY-rjeD%%pVq8{VwP(IymoMJ#G@o`_YO;IQ zMj0EQ=r0ZTj2HKf^r*|_-1D90j*ir1hR@X(%%0u7@&$G3o6*Bv^BdGUoJV%qbO8Ax zIc-l#(wd#V)YAz0`nM9T*?QEeFTm5_6$vl+gMAf_upsl~2mO~NwF4;I@fkcJ0V$wk?;yV?u#`=9)&zBzw`x$y32jTC7AL(|GNkrzc#-|%Q} zLkwJ)6Jm8&TV92bI|pzl=6*VNc6N2N)hG84nhRbh_n&;kMe6=Sd&9gd_VkYJD-Ee% zKCc|#H?mS33hlE~DRgzLo~foD(E3W#IVxa2m(MkXJa>5i5Ps1-wh}{gBDHlD8d3|s zZgf#r5#|4qwa``Q=<3MTD?9aQ-=HWFzi<8H?;rC!&8MzelggwrO=E+-W4jxQ=9LxW zSB-DmJ&|2IF_6u7WD9Lw`9fEFz1}$kvPZ-N8zh}tku#(FeqAW6$jSdzyY{#anI$c= z?CR|+%CDdIHcV6;7(UE2`L2AYiZ*AO{PZSDC-<7EOWvMu=Pb>O&ZyTiF2BwhFOD`$ zQonZSM6$07^?ltqQBHR2bUkOh+FbJZ@ttj$DRbxiHrA7F8W?D6m_?rB;4}!9>*#7b z^>CHQKu3M%G*47sh2JRQc`%Hp6}~VnyE>PWVEFq*$j$6v=3yA=e`N&O!Sx*E(%%>- zmNRvQ4P#(vV!Svw*xObI$G*~miP4Gvl^c3@uH;XA%kdlGmFwzm%f)Y`FtU8=d0QSU zae@304Z`GQL&>(1V+p|vIe*T8>?|lK18L)ltIhP<_o+2c-FiY#eI*QIWO#pZbYQg9 zuU6!DBsA?M>ojMUTvvYeVW-b^2?9C2IsXE4;V1Ll)~UA`3lGTb^44S+W2Jo~gT?8o z4MQ$AUpp;VacFdSXnOQ;N_E3yd2wHFX>cVUm-7lYY#qe;_H2HYY|5_ox*Ag?st>G^ z!#O3>OShTUYgZJwql{Y9#cS4hD$$+2V>4+UE)h7a=o`DTF?f5YIt{W0hYYmipvpjC z9;u`;j2esgKo-N8DqaC?_>a%E=^1=j`1$|W$mKr5gX&n_gXnCA$ zZkERv9CegDUfCqS3ou3&ERe@N^XJQB|B*+^a#X z5Mb2DkMixFCyy&!S00x+_{;sp@?jW9S@;Y7c_#jTf1Z_*M?amGM-#tCHIq*p$)}Tl zOTLx-F!_*N&~I7+t$55;J5FbelQwPc-m-Sv`b`_xZtycQM#t`Rk1#Vv%f?L`XAR@$|5Wm@A^+(& zt$e+BUG0`RX3@aF*d_XT$Hf#lBQ z&B<-a!Q`f7GPyb#O-k|_02e2ll6A?NWL2^}S&|%^EJ(t{jDHpXBz`RZR{UUmU;LT) z6Y&S*e~RB6-xj|jzB#@jz9t@v_r$&NCGqC?+3}iqRlGc28Xp%gh=VvC{WAJV^jP$8 zbbs{4=-%k==mXK6(VL>zMhBytqRHq$bVXE(dZX>p=4f4XX0$3=5iO05jpj!|lnH+s z{v`Z<_^t4P@QdNS;oac}!aKt^g|7_{hBt+i;nm@2SPFN97l)g|b>W#|N7x!J36Blu zhklp}o(z5*JQ_R{d?oloa8K~D;61@xgVzVQ1~&(j!BxRc88+!@tcx=-=d*{r&zvzu&*qztCUjpW(Orr}!uO zNBfCydB5_0>^DIq#pn4|(tO-t4``dzn}9uJh^vw>mdFlg4|k z9d9*Rp_MlO+x#!{yXM!;FPWb)KW@I?{73T*=HHvQm@hJ4V2+x*&CAV;%njz*=4x|= zxzs$?JkoSCzsdY8^MlN{GY@3Gkok1xW1074-kNz`<`tQnGn1LCGDDeS=J}bene~}9 znT||r=A_KROp>wEzfS)&{g~`!_2x_tnn{w%txDUId&TndtL(`=Vz{|g&SVK=g;l0A zxf@p7s*E!^04opwU1E7T@h^(u7R0|_d5M1?tU`zQ@8q=(@$VJO%Xiq5JH&8vV)Ves zcRG`o!ztG(H(mxS-zhgfA68qZ+<2*2UZK;Te4ZF?PW-oHtN{N@l$ZEl3@Z=+=ZfX! z#Q!2OnAkRYp^&ZgLLpmVvG5DUV&R*`VBwoE#=s_O~B>yvEvEDPp zV!fw}!F*1m7wYYz7wSC~7VBLt7VGU4gY~Y$80+nT#d_OevEDYZSZ_fL#?LD+iJybT zdROuq>Rllg>s>Ae>utptt2~8XSf#gn`}Ub3poFvcoRR$h|zvtY5xrDCzlC1Nm( zljwyi7t;$>o(PLoX2oKaCy2o+kH;9RJPsDCJQfzKTqG8&JVp%0U#Pq!{?V{lWizj# z%A>?$l}%!>$^{%lZSygP+K%Ly)OG~MSlc}1CAlWBSX(R>Ym3C-+#$VCTR<<==EGub zo>;8S6@#@o7-MZVEY@bhVr`~atSuu35Rgn20+g{3kPO?dOpsw~l>su9KS-t)0w`ntAQ|HmWQ-4xsr*4Q zl|N9%{6RA2PmnQxfK25NlBxWGGUgAGF}?yB^a03J{veskA1Gt~AQ|%~$hds~GL8X1+Xo<1S%YNE8YE+Uf{gJAG8~99K&G+= z$(S`r#;gf4?ht|uTb&@oRwu|9iy&jJ1R1wFL58hPkYTG6WXzQyW3B`lw>m+Ftxk|3 zK0(I#1Q~NB$ar`OG8|rl42KsWqnh9tt5q1o8UbT!4}fDzO@NGQf@4$@98-spAY+CE z88ZaPs3thZ_~4j2BLo>UB*>T{Kt?seF&;*845g7{ER7tabmSPNBgY^eIR@#-F-k{{ zF)?xsi4kL>94RKz0WoF;h;d^QV#o;$LrNeR)))MuEBHly$S-68d_f(+3*rD>)CTC{ z@gTa80LTSlz%A$kYB4IP#RL?!BmqDR2>@A00KnqB02Y@8z{0%X73L+aPS%E2n` zZ?FpU0#%ropn|I86jlS6;?@SHFfS;DdC4f02}EH!01DHAPb{;}r;I~9p-j*T(}7Kx z4rpST3QaPdB9oK}Fkw1i2`djOVHQ9Mvk*xribO(D01}G=kT45)gjwn|G9AJQMS(>u z3M|4bKoMpEh!C9^LUd4wO9cusIw*wbU=X5%K&$}-;!-IBNeuuHq60sW4Dg{cfDfZ~ zz<@Gf52AuRhzjm7D!9X_iaQb&*g;f42T_3>1_N>!49Gz+00+Uq8wMk9AOLZL?F`x= z7+8Z~Kn-I6HHZPwAO-WEP0;Db9w1>C!N8|i)G%OO1bi$ab#GYzCn4{Z)I1Lg%UEtZ zJ#W)7%!WZ0e~Yz<5PkBg$mKr5gX_!BB{O3HVenj&fBXBeHGs|)hcHq*#&#$rpqQ;Y`Z zoH)wUuepm(SDM(Kt{iOZ4{XP2|_LuF?+MlpLXy0kS(SDWv zxAu$eYwa<+Wbd#qwl~`6+Ff?eKG{CrUSRvSVg17TFY6KOtJZziz1GLA_gQbZZns`( z-D2HnU2Tn61J>o%HtRXoSyrdD!dhY-W6iT1^Ec)b=J(Bq&HK$Sn4dB~V!q3~!+f22 z(5#s+H22F^({F#Z3fMLF>uu|_YpP*yr&D9c-n=yRuCZlrPP(ht*t54F-PLQVX|MRR zYj2zQtG2!HN8es)qAmXD+$-(C#UH(U(Y?Kf-o0pgUSsdxHu$4?ukuIx-c%0$Xy8kK zH1Ks1pACG`WW0tBzRDjxe3ifI;w$ml#uxsok1zb$$d~!ElP~jOD_`WpUcPzpXEWa% z{MpTy`Kxxm$cO!W;jbF{ia$E~vT1vbJ$=zWyvC-!XvtkeS6?)|uA!?h8qe0y)|c&M zYi#U`zS1>z_C>4X8e03J3vmstebFemhTgvH>04uWUo;}FvAr+4`qt3j7p-t>=Zll4 z-|7`=O#DY+(SH~g*0(w&7X9~$!T5t1gPzsBu;{-B7X3?NF`wOH(0>49^xvhtB%dNI z=F=}0$}Frz^{oPCILKA733mH2g+1@uuQEl zVTOZT1VmJC{wEnmZ?<*%%~z*Miq%NssfZLRlqW(B49>Uz%r^rl;PA?fimR} zmZ?<&%;*o6F+NeoRRYSCKUk*x0W;c zru+dj`U7UnpDbg1vW%+=mdTx>B4EZ<1Q$s6)@wf0%lxQvJ8#f zt7I8YZ51rzsjUKLTvfn~@yRmAC(C$h!7_FWuL5RVRltm^N|y12f@RbWD5G{jnJ6Z6 zlVv?GHL;oiB95AmeHRqy=ns@JK2WAk1X)IZvW)&<8S??k=ns@B zf3l2(Q7nVjU>V~BWn4?3Oyy6OA%2A{L;e-84E`0M4Ea}pGRCivWmwA!S%$T&fMrY2$Cs(pp5wdW%MV>=&wiyg+Vfv4^YPVKp9rBLXu$z zRuswL50WW=pp5=N8S_^pgTEpf{6R9F#tKlz6$HwtFiD2fQUS@x*a}d_(^vt^xPm|# zSCAybX{>-`WNZZ}<7upbWn4j^jPXe_#s|sB*a}d_(^vt^xPm|#R}dtlPyiXXZUrPG ohAKoEw=Ph|!a*_?4v_KaRX{T3Uq_j26`+j%AQ|HWWZ3He1LBdEV*mgE literal 0 HcmV?d00001 diff --git a/tests/env_init/databases/performancedb/jasminegraph_performance.db b/tests/env_init/databases/performancedb/jasminegraph_performance.db new file mode 100755 index 0000000000000000000000000000000000000000..04fba59319897cce12f73d8ed66bd02f3a4b1f9d GIT binary patch literal 49152 zcmeI)O>g5w7zgl~q^*;-sh30K1JcH=x}uR*Q4++a<+5a}h^^?RkfuOEi{o|N*4iYt z9A}q3a7cUQz=3N&12+zEM&c77A-Kbd11FBmjN`=4x&aQX`to<{#`Qe*%=7ciq@!+k z|ASr2Gu0#8?dqQTCb>l@CGV&zA>@ed%WPj{dy)`3WUq5<4>lSc%y>N_h5J8eq#sFY z;XJvrpLw|acZnCCsET&sl zyOrLlH*4?K8fty7sn!p6ckiar_FZDLov-`IInZ5*oa)ebj!bMuRNxk!JzERPNC_}>JE zpL`)Hxg0%9h6V)dlHSpcZChxC~?s}GI z**(p$2R$zm&4C#`NLg$-bm)ZPC-Gq2xkiTx;vzDAVb)Qe4{8 zL9-2f!k*5DT97HL&>W4v;M8;5eQLTfnVX-R#z3g}!*w#i<5D&5`>C>w*u>^f9MkQM zKf4f3H9lx|s#aTE6?t$M&Q69ih?%oqmWj*qs;#|=5=u-&S&=M)nXhN%R zy6hc8b8MHj@xy9k`(d@AZm8vAQO)x~YB{l|2kg4o0;{ie^}feTAMEYz)~a=Jm%b)i z;+njoXyKHCpA35|8h*4XDcLMNdu{yG`8^U*2!1MX;K#AhEq^%v`}9~A&frPMG9p=c z?4fit-jNO4HT&bLc!qwN-#5kse=0T6K9-q3t&d**VU8cJe(2tWV=5P$##AOHaf zKmY;|fB*y_009U<00Izz00bZa0SG|g<_O^T|2OAZBU1=K00Izz00bZa0SG_<0uZ?I z0tqIt#CH6j2sgef0006IfB*y_009U<00Izz00bZa0SG_<0uX=z1Rwwb2tWV=5P$## yuA%_{_y1J>ldw;05P$##AOHafKmY;|fB*y_009VG8-Zmik+e(`w3MLVC;tYdHp)o= literal 0 HcmV?d00001 diff --git a/tests/test.py b/tests/test.py new file mode 100644 index 000000000..3a100e026 --- /dev/null +++ b/tests/test.py @@ -0,0 +1,75 @@ +import sys +import socket + +HOST = '127.0.0.1' +PORT = 7777 # The port used by the server + +def recv_all(sock, n): + b = bytearray() + read = 0 + while read < n: + tmp = sock.recv(n-read) + if tmp: + read += len(tmp) + b.extend(tmp) + return bytes(b) + +def expect_response(sock, expected): + global passedAll + data = recv_all(s, len(expected)) + print(data.decode('utf-8'), end='') + if data != expected: + print(f'Output mismatch\nexpected : {expected}\nreceived : {data}', file=sys.stderr) + passedAll = False + return False + return True + +def send_and_expect_response(sock, send, expected, exitOnFail=False): + s.sendall(send + b'\r\n') + print(send.decode('utf-8')) + if not expect_response(sock, expected + b'\r\n'): + if exitOnFail: + sys.exit(1) + +passedAll = True + +with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + s.connect((HOST, PORT)) + + print("\nTesting lst") + send_and_expect_response(s, b'lst', b'empty') + + print("\nTesting adgr") + send_and_expect_response(s, b'adgr', b'send', exitOnFail=True) + send_and_expect_response(s, b'powergrid|/var/tmp/data/powergrid.dl', b'done', exitOnFail=True) + + print("\nTesting lst after adgr") + send_and_expect_response(s, b'lst', b'|1|powergrid|/var/tmp/data/powergrid.dl|op|') + + print("\nTesting ecnt") + send_and_expect_response(s, b'ecnt', b'graphid-send') + send_and_expect_response(s, b'1', b'6594') + + print("\nTesting vcnt") + send_and_expect_response(s, b'vcnt', b'graphid-send') + send_and_expect_response(s, b'1', b'4941') + + print("\nTesting trian") + send_and_expect_response(s, b'trian', b'grap', exitOnFail=True) + send_and_expect_response(s, b'1', b'priority(>=1)', exitOnFail=True) + send_and_expect_response(s, b'1', b'651') + + print("\nTesting rmgr") + send_and_expect_response(s, b'rmgr', b'send') + send_and_expect_response(s, b'1', b'done') + + print("\nTesting lst after rmgr") + send_and_expect_response(s, b'lst', b'empty') + + print("\nShutting down") + s.sendall(b'shdn\r\n') + + if passedAll: + print('\nPassed all tests') + else: + print('\nFailed some tests', file=sys.stderr) \ No newline at end of file From ae97daa243ceab357d9deca99e96bb6ea236b082 Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Tue, 25 Jul 2023 20:30:38 +0530 Subject: [PATCH 13/45] Modified Dockerfile to reduce image size with apt install --no-install-recomends --- Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b08ba801..f2fdeb86f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,21 +4,21 @@ RUN mkdir software WORKDIR /home/ubuntu/software RUN apt-get update -RUN apt-get install -y apt-transport-https +RUN apt-get install --no-install-recommends -y apt-transport-https RUN apt-get update -RUN apt-get install -y curl gnupg2 ca-certificates software-properties-common nlohmann-json3-dev -RUN apt-get install -y git cmake build-essential sqlite3 libsqlite3-dev libssl-dev librdkafka-dev libboost-all-dev libtool libxerces-c-dev libflatbuffers-dev python3-pip +RUN apt-get install --no-install-recommends -y curl gnupg2 ca-certificates software-properties-common nlohmann-json3-dev +RUN apt-get install --no-install-recommends -y git cmake build-essential sqlite3 libsqlite3-dev libssl-dev librdkafka-dev libboost-all-dev libtool libxerces-c-dev libflatbuffers-dev python3-pip RUN add-apt-repository ppa:deadsnakes/ppa -RUN apt-get install -y python3.5-dev -RUN apt-get install -y libjsoncpp-dev libspdlog-dev pigz +RUN apt-get install --no-install-recommends -y python3.5-dev +RUN apt-get install --no-install-recommends -y libjsoncpp-dev libspdlog-dev pigz RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" RUN apt-get update -RUN apt-get install -y docker-ce-cli +RUN apt-get install --no-install-recommends -y docker-ce-cli -RUN git clone https://github.com/chinthakarukshan/metis.git -RUN git clone https://github.com/mfontanini/cppkafka.git +RUN git clone --single-branch --depth 1 https://github.com/chinthakarukshan/metis.git +RUN git clone --single-branch --depth 1 https://github.com/mfontanini/cppkafka.git WORKDIR /home/ubuntu/software/metis RUN tar -xzf metis-5.1.0.tar.gz From f65ea48e40efcf01b6d9a0508e1aadda7f0901a9 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 26 Jul 2023 10:59:35 +0530 Subject: [PATCH 14/45] Add integration tests to the workflow --- .github/workflows/build.yml | 4 +++- test-docker.sh | 0 2 files changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 test-docker.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38152626a..4d515541e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,4 +22,6 @@ jobs: repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} - name: Build # Build JasmineGraph docker image - run: docker build -t jasminegraph . \ No newline at end of file + run: docker build -t jasminegraph . + - name: Run Integration Tests + run: ./test-docker.sh \ No newline at end of file diff --git a/test-docker.sh b/test-docker.sh old mode 100644 new mode 100755 From 56d608f80385eea9586f5d4474108722781a8ab1 Mon Sep 17 00:00:00 2001 From: Kandeeban Date: Thu, 27 Jul 2023 12:15:31 +0530 Subject: [PATCH 15/45] Fixed issues in merge command --- src/server/JasmineGraphServer.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/server/JasmineGraphServer.cpp b/src/server/JasmineGraphServer.cpp index 58f269b88..b81174e12 100644 --- a/src/server/JasmineGraphServer.cpp +++ b/src/server/JasmineGraphServer.cpp @@ -3270,14 +3270,27 @@ bool JasmineGraphServer::initiateTrain(std::string host, int port, int dataPort, string server_host = utils.getJasmineGraphProperty("org.jasminegraph.server.host"); write(sockfd, server_host.c_str(), server_host.size()); server_logger.log("Sent : " + server_host, "info"); + bzero(data, 301); + read(sockfd, data, 300); + response = (data); + response = utils.trim_copy(response, " \f\n\r\t\v"); + + if (response.compare(JasmineGraphInstanceProtocol::HOST_OK) == 0) { + server_logger.log("Received : " + JasmineGraphInstanceProtocol::HOST_OK, "info"); + } write(sockfd, JasmineGraphInstanceProtocol::INITIATE_FILES.c_str(), - JasmineGraphInstanceProtocol::INITIATE_FILES.size()); + JasmineGraphInstanceProtocol::INITIATE_FILES.size()); server_logger.log("Sent : " + JasmineGraphInstanceProtocol::INITIATE_FILES, "info"); bzero(data, FED_DATA_LENGTH); + server_logger.log("AAAAAAAAAA : ", "info"); + read(sockfd, data, FED_DATA_LENGTH); + server_logger.log("AAAAAAAAAA : 2", "info"); + response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); + server_logger.log("Sent : " + response, "info"); if (response.compare(JasmineGraphInstanceProtocol::OK) == 0) { server_logger.log("Received : " + JasmineGraphInstanceProtocol::OK, "info"); write(sockfd, (trainingArgs).c_str(), (trainingArgs).size()); @@ -3290,7 +3303,10 @@ bool JasmineGraphServer::initiateTrain(std::string host, int port, int dataPort, "error"); } + server_logger.log("AAAAAAAAAA : 3", "info"); close(sockfd); + server_logger.log("AAAAAAAAAA : 4", "info"); + return 0; } @@ -3754,6 +3770,15 @@ bool JasmineGraphServer::mergeFiles(std::string host, int port, int dataPort,std write(sockfd, server_host.c_str(), server_host.size()); server_logger.log("Sent merge : " + server_host, "info"); + bzero(data, 301); + read(sockfd, data, 300); + response = (data); + response = utils.trim_copy(response, " \f\n\r\t\v"); + + if (response.compare(JasmineGraphInstanceProtocol::HOST_OK) == 0) { + server_logger.log("Received : " + JasmineGraphInstanceProtocol::HOST_OK, "info"); + } + write(sockfd, JasmineGraphInstanceProtocol::MERGE_FILES.c_str(), JasmineGraphInstanceProtocol::MERGE_FILES.size()); server_logger.log("Sent merge : " + JasmineGraphInstanceProtocol::MERGE_FILES, "info"); From a358f6eb6b74f4fa0d491d1f18e0ccbc00c54396 Mon Sep 17 00:00:00 2001 From: Ishad-M-I-M Date: Thu, 27 Jul 2023 08:46:43 +0530 Subject: [PATCH 16/45] Clone metis from original source --- Dockerfile | 13 ++++++------- run-docker.sh | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index f2fdeb86f..9aec71981 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,15 +17,14 @@ RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubunt RUN apt-get update RUN apt-get install --no-install-recommends -y docker-ce-cli -RUN git clone --single-branch --depth 1 https://github.com/chinthakarukshan/metis.git RUN git clone --single-branch --depth 1 https://github.com/mfontanini/cppkafka.git -WORKDIR /home/ubuntu/software/metis -RUN tar -xzf metis-5.1.0.tar.gz -WORKDIR /home/ubuntu/software/metis/metis-5.1.0 -RUN sed -i '/#define IDXTYPEWIDTH 32/c\#define IDXTYPEWIDTH 64' include/metis.h -RUN make config shared=1 cc=gcc -RUN make -j4 install +WORKDIR /home/ubuntu/software +RUN git clone --single-branch --depth 1 --branch v5.1.1-DistDGL-v0.5 https://github.com/KarypisLab/METIS.git +WORKDIR /home/ubuntu/software/METIS +RUN git submodule update --init +RUN make config shared=1 cc=gcc prefix=/usr/local +RUN make install RUN mkdir /home/ubuntu/software/cppkafka/build WORKDIR /home/ubuntu/software/cppkafka/build diff --git a/run-docker.sh b/run-docker.sh index ea7fe8ae7..4e4cf178f 100755 --- a/run-docker.sh +++ b/run-docker.sh @@ -69,7 +69,7 @@ else fi fi -export LD_LIBRARY_PATH=/home/ubuntu/software/metis/metis-5.1.0/build/Linux-x86_64/libmetis +export LD_LIBRARY_PATH=/home/ubuntu/software/METIS/build/libmetis if [ $MODE -eq 1 ] ; then ./JasmineGraph "docker" $MODE $MASTERIP $WORKERS $WORKERIP $ENABLE_NMON From a507c6b276a77b4ee8742d0ad25d47f6e28b2610 Mon Sep 17 00:00:00 2001 From: Ishad-M-I-M Date: Thu, 27 Jul 2023 16:52:39 +0530 Subject: [PATCH 17/45] Apply style changes --- CMakeLists.txt | 2 - src/frontend/JasmineGraphFrontEnd.cpp | 177 +++++----- .../trainer/JasminGraphTrainingInitiator.cpp | 14 +- src/server/JasmineGraphInstanceService.cpp | 302 +++++++++--------- tests/test.py | 13 + 5 files changed, 265 insertions(+), 243 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4baca2a40..bd7c8780a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,8 +53,6 @@ target_link_libraries(JasmineGraph sqlite3) target_link_libraries(JasmineGraph pthread) target_link_libraries(JasmineGraph rdkafka) target_link_libraries(JasmineGraph Threads::Threads) -#include_directories("$ENV{HOME}/software/cppkafka/include") - target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libxerces-c.so) target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libflatbuffers.a) target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libjsoncpp.a) diff --git a/src/frontend/JasmineGraphFrontEnd.cpp b/src/frontend/JasmineGraphFrontEnd.cpp index 6cca3f0ba..953e2c057 100755 --- a/src/frontend/JasmineGraphFrontEnd.cpp +++ b/src/frontend/JasmineGraphFrontEnd.cpp @@ -60,9 +60,10 @@ std::set processData; std::mutex aggregateWeightMutex; std::mutex triangleTreeMutex; std::string stream_topic_name; + // Thread function -void listen_to_kafka_topic(KafkaConnector *kstream, Partitioner &graphPartitioner, vector &workerClients) -{ +void +listen_to_kafka_topic(KafkaConnector *kstream, Partitioner &graphPartitioner, vector &workerClients) { while (true) { cppkafka::Message msg = kstream->consumer.poll(); if (!msg || msg.get_error()) { @@ -70,7 +71,7 @@ void listen_to_kafka_topic(KafkaConnector *kstream, Partitioner &graphPartitione } string data(msg.get_payload()); if (data == "-1") { // Marks the end of stream - frontend_logger.log("Received the end of `" +stream_topic_name+"` input kafka stream", "info"); + frontend_logger.log("Received the end of `" + stream_topic_name + "` input kafka stream", "info"); break; } auto edgeJson = json::parse(data); @@ -83,7 +84,7 @@ void listen_to_kafka_topic(KafkaConnector *kstream, Partitioner &graphPartitione destinationJson["pid"] = partitionedEdge[1].second; string source = sourceJson.dump(); string destination = destinationJson.dump(); - json obj ; + json obj; obj["source"] = sourceJson; obj["destination"] = destinationJson; long temp_s = partitionedEdge[0].second; @@ -91,7 +92,7 @@ void listen_to_kafka_topic(KafkaConnector *kstream, Partitioner &graphPartitione workerClients.at((int) partitionedEdge[0].second)->publish(sourceJson.dump()); workerClients.at((int) partitionedEdge[1].second)->publish(destinationJson.dump()); // storing Node block - if (temp_s ==temp_d){ + if (temp_s == temp_d) { //+miyurud: Temorarily commeting the following line to make the code build //workerClients.at((int) partitionedEdge[0].second)->publish_relation(obj.dump()); } @@ -103,20 +104,20 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface PerformanceSQLiteDBInterface perfSqlite, JobScheduler jobScheduler) { frontend_logger.log("Thread No: " + to_string(pthread_self()), "info"); frontend_logger.log("Master IP: " + masterIP, "info"); - char data[FRONTEND_DATA_LENGTH+1]; + char data[FRONTEND_DATA_LENGTH + 1]; bzero(data, FRONTEND_DATA_LENGTH + 1); Utils utils; vector workerList = utils.getWorkerList(sqlite); - vector workerClients; + vector workerClients; // Initiate Thread thread input_stream_handler; // Initiate kafka consumer parameters std::string partitionCount = utils.getJasmineGraphProperty("org.jasminegraph.server.npartitions"); int numberOfPartitions = std::stoi(partitionCount); - std::string kafka_server_IP ; + std::string kafka_server_IP; cppkafka::Configuration configs; - KafkaConnector* kstream; + KafkaConnector *kstream; Partitioner graphPartitioner(numberOfPartitions, 1, spt::Algorithms::HASH); for (int i = 0; i < workerList.size(); i++) { @@ -125,16 +126,16 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface string workerHost = currentWorker.hostname; string workerID = currentWorker.workerID; int workerPort = atoi(string(currentWorker.port).c_str()); - DataPublisher* workerClient = new DataPublisher(workerPort, workerHost); + DataPublisher *workerClient = new DataPublisher(workerPort, workerHost); workerClients.push_back(workerClient); } bool loop = false; while (!loop) { - if(currentFESession == Conts::MAX_FE_SESSIONS + 1) { + if (currentFESession == Conts::MAX_FE_SESSIONS + 1) { currentFESession--; std::string errorResponse = "Jasminegraph Server is Busy. Please try again later."; int result_wr = write(connFd, errorResponse.c_str(), errorResponse.length()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } break; @@ -170,12 +171,12 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface break; } else if (line.compare(LIST) == 0) { std::stringstream ss; - std::vector < vector < pair < string, string>>> v = sqlite.runSelect( + std::vector>> v = sqlite.runSelect( "SELECT idgraph, name, upload_path, graph_status_idgraph_status FROM graph;"); - for (std::vector < vector < pair < string, string>>>::iterator i = v.begin(); i != v.end(); ++i) { + for (std::vector>>::iterator i = v.begin(); i != v.end(); ++i) { ss << "|"; int counter = 0; - for (std::vector < pair < string, string >> ::iterator j = (i->begin()); j != i->end(); ++j) { + for (std::vector>::iterator j = (i->begin()); j != i->end(); ++j) { if (counter == 3) { if (std::stoi(j->second) == Conts::GRAPH_STATUS::LOADING) { ss << "loading|"; @@ -240,7 +241,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_data[FRONTEND_DATA_LENGTH+1]; + char graph_data[FRONTEND_DATA_LENGTH + 1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); string name = ""; string path = ""; @@ -255,7 +256,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface gData = utils.trim_copy(gData, " \f\n\r\t\v"); frontend_logger.log("Data received: " + gData, "info"); - std::vector strArr = Utils::split(gData, '|'); + std::vector strArr = Utils::split(gData, '|'); if (strArr.size() != 2) { frontend_logger.log("Message format not recognized", "error"); @@ -284,7 +285,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface appConfig.readConfigFile(path, newGraphID); MetisPartitioner *metisPartitioner = new MetisPartitioner(&sqlite); - vector > fullFileList; + vector> fullFileList; string input_file_path = utils.getHomeDir() + "/.jasminegraph/tmp/" + to_string(newGraphID) + "/" + to_string(newGraphID); metisPartitioner->loadDataSet(input_file_path, newGraphID); @@ -316,7 +317,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_data[FRONTEND_DATA_LENGTH+1]; + char graph_data[FRONTEND_DATA_LENGTH + 1]; char partition_count[FRONTEND_DATA_LENGTH + 1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); string name = ""; @@ -333,7 +334,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface gData = utils.trim_copy(gData, " \f\n\r\t\v"); frontend_logger.log("Data received: " + gData, "info"); - std::vector strArr = Utils::split(gData, '|'); + std::vector strArr = Utils::split(gData, '|'); if (strArr.size() < 2) { frontend_logger.log("Message format not recognized", "error"); @@ -363,7 +364,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface int newGraphID = sqlite.runInsert(sqlStatement); JasmineGraphServer *jasmineServer = new JasmineGraphServer(); MetisPartitioner *partitioner = new MetisPartitioner(&sqlite); - vector > fullFileList; + vector> fullFileList; partitioner->loadDataSet(path, newGraphID); int result = partitioner->constructMetisFormat(Conts::GRAPH_TYPE_NORMAL); @@ -380,7 +381,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface jasmineServer->uploadGraphLocally(newGraphID, Conts::GRAPH_TYPE_NORMAL, fullFileList, masterIP); utils.deleteDirectory(utils.getHomeDir() + "/.jasminegraph/tmp/" + to_string(newGraphID)); string workerCountQuery = "select count(*) from worker"; - std::vector < vector < pair < string, string>>> results = sqlite.runSelect(workerCountQuery); + std::vector>> results = sqlite.runSelect(workerCountQuery); string workerCount = results[0][0].second; int nWorkers = atoi(workerCount.c_str()); JasmineGraphFrontEnd::getAndUpdateUploadTime(to_string(newGraphID), sqlite); @@ -509,7 +510,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface string graphType(type); graphType = utils.trim_copy(graphType, " \f\n\r\t\v"); - std::unordered_set s = {"1", "2", "3"}; + std::unordered_set s = {"1", "2", "3"}; if (s.find(graphType) == s.end()) { frontend_logger.log("Graph type not recognized", "error"); continue; @@ -537,7 +538,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - char graph_data[FRONTEND_DATA_LENGTH+1]; + char graph_data[FRONTEND_DATA_LENGTH + 1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); string name = ""; string edgeListPath = ""; @@ -554,7 +555,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface gData = utils.trim_copy(gData, " \f\n\r\t\v"); frontend_logger.log("Data received: " + gData, "info"); - std::vector strArr = Utils::split(gData, '|'); + std::vector strArr = Utils::split(gData, '|'); if (strArr.size() != 3 && strArr.size() != 4) { frontend_logger.log("Message format not recognized", "error"); @@ -590,7 +591,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface int newGraphID = sqlite.runInsert(sqlStatement); JasmineGraphServer *jasmineServer = new JasmineGraphServer(); MetisPartitioner *partitioner = new MetisPartitioner(&sqlite); - vector > fullFileList; + vector> fullFileList; partitioner->loadContentData(attributeListPath, graphAttributeType, newGraphID, attrDataType); partitioner->loadDataSet(edgeListPath, newGraphID); int result = partitioner->constructMetisFormat(Conts::GRAPH_TYPE_NORMAL); @@ -646,18 +647,18 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface read(connFd, user_res, FRONTEND_DATA_LENGTH); string user_res_s(user_res); user_res_s = utils.trim_copy(user_res_s, " \f\n\r\t\v"); - for (char& c : user_res_s) { + for (char &c: user_res_s) { c = tolower(c); } // use default kafka consumer details - if (user_res_s =="y"){ + if (user_res_s == "y") { kafka_server_IP = utils.getJasmineGraphProperty("org.jasminegraph.server.streaming.kafka.host"); configs = {{"metadata.broker.list", kafka_server_IP}, {"group.id", "knnect"}}; } // user need to start relevant kafka cluster using relevant IP address // read relevant IP address from given file path - else{ + else { string message = "Send file path to the kafka configuration file."; int result_wr = write(connFd, message.c_str(), message.length()); if (result_wr < 0) { @@ -688,9 +689,9 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface std::vector vec2 = utils.split(item, '='); if (vec2.at(0).compare("kafka.host") == 0) { if (item.substr(item.length() - 1, item.length()).compare("=") != 0) { - std::string kafka_server_IP= vec2.at(1); + std::string kafka_server_IP = vec2.at(1); } else { - std::string kafka_server_IP= " "; + std::string kafka_server_IP = " "; } } } @@ -734,10 +735,11 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface string topic_name_s(topic_name); topic_name_s = utils.trim_copy(topic_name_s, " \f\n\r\t\v"); - stream_topic_name=topic_name_s; + stream_topic_name = topic_name_s; kstream->Subscribe(topic_name_s); frontend_logger.log("Start listening to " + topic_name_s, "info"); - input_stream_handler = thread(listen_to_kafka_topic, kstream,std::ref(graphPartitioner),std::ref(workerClients)); + input_stream_handler = thread(listen_to_kafka_topic, kstream, std::ref(graphPartitioner), + std::ref(workerClients)); } else if (line.compare(STOP_STREAM_KAFKA) == 0) { frontend_logger.log("Start serving `" + STOP_STREAM_KAFKA + "` command", "info"); @@ -924,7 +926,8 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface priority = utils.trim_copy(priority, " \f\n\r\t\v"); if (!(std::find_if(priority.begin(), - priority.end(), [](unsigned char c) { return !std::isdigit(c); }) == priority.end())) { + priority.end(), [](unsigned char c) { return !std::isdigit(c); }) == + priority.end())) { string error_message = "Priority should be numeric and > 1 or empty"; result_wr = write(connFd, error_message.c_str(), error_message.length()); @@ -951,7 +954,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface if (threadPriority > Conts::DEFAULT_THREAD_PRIORITY) { threadPriority = Conts::HIGH_PRIORITY_DEFAULT_VALUE; long graphSLA = JasmineGraphFrontEnd::getSLAForGraphId(sqlite, perfSqlite, graph_id, - TRIANGLES, Conts::SLA_CATEGORY::LATENCY); + TRIANGLES, Conts::SLA_CATEGORY::LATENCY); jobDetails.addParameter(Conts::PARAM_KEYS::GRAPH_SLA, std::to_string(graphSLA)); } @@ -1041,7 +1044,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } else { string sqlStatement = "SELECT vertexcount from graph where idgraph=" + graph_id; - std::vector < vector < pair < string, string>>> output = sqlite.runSelect(sqlStatement); + std::vector>> output = sqlite.runSelect(sqlStatement); int vertexCount = std::stoi(output[0][0].second); frontend_logger.log("Vertex Count: " + to_string(vertexCount), "info"); @@ -1090,7 +1093,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } else { string sqlStatement = "SELECT edgecount from graph where idgraph=" + graph_id; - std::vector < vector < pair < string, string>>> output = sqlite.runSelect(sqlStatement); + std::vector>> output = sqlite.runSelect(sqlStatement); int edgeCount = std::stoi(output[0][0].second); frontend_logger.log("Edge Count: " + to_string(edgeCount), "info"); @@ -1201,23 +1204,23 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } if (!JasmineGraphFrontEnd::isGraphActive(graphID, sqlite)) { - string error_message = "Graph is not in the active status"; - frontend_logger.log(error_message, "error"); - result_wr = write(connFd, error_message.c_str(), error_message.length()); - if (result_wr < 0) { - frontend_logger.log("Error writing to socket", "error"); - } - result_wr = write(connFd, "\r\n", 2); - if (result_wr < 0) { - frontend_logger.log("Error writing to socket", "error"); - } - continue; + string error_message = "Graph is not in the active status"; + frontend_logger.log(error_message, "error"); + result_wr = write(connFd, error_message.c_str(), error_message.length()); + if (result_wr < 0) { + frontend_logger.log("Error writing to socket", "error"); + } + result_wr = write(connFd, "\r\n", 2); + if (result_wr < 0) { + frontend_logger.log("Error writing to socket", "error"); + } + continue; } Utils utils; std::string federatedEnabled = utils.getJasmineGraphProperty("org.jasminegraph.federated.enabled"); - if (federatedEnabled=="true"){ + if (federatedEnabled == "true") { JasmineGraphServer *jasmineServer = new JasmineGraphServer(); if (utils.getJasmineGraphProperty("org.jasminegraph.fl.org.training") == "true") { jasmineServer->initiateOrgCommunication(graphID, trainData, sqlite); @@ -1227,10 +1230,10 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } - }else{ + } else { JasminGraphTrainingInitiator *jasminGraphTrainingInitiator = new JasminGraphTrainingInitiator(); - jasminGraphTrainingInitiator->initiateTrainingLocally(graphID,trainData); + jasminGraphTrainingInitiator->initiateTrainingLocally(graphID, trainData); } @@ -1346,7 +1349,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface graphID = strArr[0]; double alpha = PAGE_RANK_ALPHA; if (strArr.size() > 1) { - alpha = std::stod(strArr[1]); + alpha = std::stod(strArr[1]); if (alpha < 0 || alpha >= 1) { frontend_logger.log("Invalid value for alpha", "error"); loop = true; @@ -1356,7 +1359,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface int iterations = PAGE_RANK_ITERATIONS; if (strArr.size() > 2) { - iterations = std::stod(strArr[2]); + iterations = std::stod(strArr[2]); if (iterations <= 0 || iterations >= 100) { frontend_logger.log("Invalid value for iterations", "error"); loop = true; @@ -1471,11 +1474,11 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } } else if (line.compare(PREDICT) == 0) { int result_wr = write(connFd, SEND.c_str(), FRONTEND_COMMAND_LENGTH); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } result_wr = write(connFd, "\r\n", 2); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } @@ -1501,7 +1504,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface graphID = strArr[0]; path = strArr[1]; - if(JasmineGraphFrontEnd::isGraphActiveAndTrained(graphID, sqlite)) { + if (JasmineGraphFrontEnd::isGraphActiveAndTrained(graphID, sqlite)) { if (utils.fileExists(path)) { std::cout << "Path exists" << endl; JasminGraphLinkPredictor *jasminGraphLinkPredictor = new JasminGraphLinkPredictor(); @@ -1516,11 +1519,11 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } } else if (line.compare(START_REMOTE_WORKER) == 0) { int result_wr = write(connFd, REMOTE_WORKER_ARGS.c_str(), REMOTE_WORKER_ARGS.size()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } result_wr = write(connFd, "\r\n", 2); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } @@ -1556,15 +1559,15 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface enableNmon = strArr[5]; JasmineGraphServer *jasmineServer = new JasmineGraphServer(); - bool isSpawned = jasmineServer->spawnNewWorker(host,port,dataPort,profile,masterHost,enableNmon); + bool isSpawned = jasmineServer->spawnNewWorker(host, port, dataPort, profile, masterHost, enableNmon); } else if (line.compare(SLA) == 0) { int result_wr = write(connFd, COMMAND.c_str(), COMMAND.size()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } result_wr = write(connFd, "\r\n", 2); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } @@ -1584,7 +1587,8 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface string slaCategoryIds; - for (std::vector>>::iterator i = categoryResults.begin(); i != categoryResults.end(); ++i) { + for (std::vector>>::iterator i = categoryResults.begin(); + i != categoryResults.end(); ++i) { for (std::vector>::iterator j = (i->begin()); j != i->end(); ++j) { slaCategoryIds = slaCategoryIds + "'" + j->second + "',"; } @@ -1594,7 +1598,8 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface std::stringstream ss; std::vector>> v = perfSqlite.runSelect( - "SELECT graph_id, partition_count, sla_value FROM graph_sla where id_sla_category in (" + adjustedIdList + ");"); + "SELECT graph_id, partition_count, sla_value FROM graph_sla where id_sla_category in (" + + adjustedIdList + ");"); for (std::vector>>::iterator i = v.begin(); i != v.end(); ++i) { std::stringstream slass; slass << "|"; @@ -1623,14 +1628,14 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface string result = ss.str(); if (result.size() == 0) { int result_wr = write(connFd, EMPTY.c_str(), EMPTY.length()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; continue; } result_wr = write(connFd, "\r\n", 2); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; continue; @@ -1638,7 +1643,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } else { int result_wr = write(connFd, result.c_str(), result.length()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; continue; @@ -1648,7 +1653,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface frontend_logger.log("Message format not recognized " + line, "error"); } } - if (input_stream_handler.joinable()){ + if (input_stream_handler.joinable()) { input_stream_handler.join(); } frontend_logger.log("Closing thread " + to_string(pthread_self()) + " and connection", "info"); @@ -1656,7 +1661,8 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface return NULL; } -JasmineGraphFrontEnd::JasmineGraphFrontEnd(SQLiteDBInterface db, PerformanceSQLiteDBInterface perfDb, std::string masterIP, +JasmineGraphFrontEnd::JasmineGraphFrontEnd(SQLiteDBInterface db, PerformanceSQLiteDBInterface perfDb, + std::string masterIP, JobScheduler jobScheduler) { this->sqlite = db; this->masterIP = masterIP; @@ -1703,7 +1709,7 @@ int JasmineGraphFrontEnd::run() { listen(listenFd, 10); - std::thread* myThreads = new std::thread[20]; + std::thread *myThreads = new std::thread[20]; std::vector threadVector; len = sizeof(clntAdd); @@ -1724,14 +1730,15 @@ int JasmineGraphFrontEnd::run() { frontend_logger.log("Master IP" + masterIP, "info"); - struct frontendservicesessionargs *frontendservicesessionargs1 =(struct frontendservicesessionargs*) malloc( - sizeof(struct frontendservicesessionargs)*1 );; + struct frontendservicesessionargs *frontendservicesessionargs1 = (struct frontendservicesessionargs *) malloc( + sizeof(struct frontendservicesessionargs) * 1);; frontendservicesessionargs1->sqlite = this->sqlite; frontendservicesessionargs1->connFd = connFd; //TODO(miyurud):Temporarily commenting this line to enable building the project. Asked tmkasun to provide a // permanent fix later when he is available. - threadVector.push_back(std::thread(frontendservicesesion, masterIP, connFd, this->sqlite, this->perfSqlite, this->jobScheduler)); + threadVector.push_back(std::thread(frontendservicesesion, masterIP, connFd, this->sqlite, this->perfSqlite, + this->jobScheduler)); std::thread(); @@ -1787,7 +1794,8 @@ void JasmineGraphFrontEnd::removeGraph(std::string graphID, SQLiteDBInterface sq vector>> hostPartitionResults = sqlite.runSelect( "SELECT name, partition_idpartition FROM worker_has_partition INNER JOIN worker ON " "worker_has_partition.worker_idworker = worker.idworker WHERE partition_graph_idgraph = " + graphID + ";"); - for (vector>>::iterator i = hostPartitionResults.begin(); i != hostPartitionResults.end(); ++i) { + for (vector>>::iterator i = hostPartitionResults.begin(); + i != hostPartitionResults.end(); ++i) { int count = 0; string hostname; string partitionID; @@ -1825,7 +1833,8 @@ bool JasmineGraphFrontEnd::isGraphActiveAndTrained(std::string graphID, SQLiteDB bool result = true; string stmt = "SELECT COUNT( * ) FROM graph WHERE idgraph LIKE '" + graphID + "' AND graph_status_idgraph_status = '" + - to_string(Conts::GRAPH_STATUS::OPERATIONAL) + "' AND train_status = '"+(Conts::TRAIN_STATUS::TRAINED) +"';"; + to_string(Conts::GRAPH_STATUS::OPERATIONAL) + "' AND train_status = '" + (Conts::TRAIN_STATUS::TRAINED) + + "';"; std::vector>> v = sqlite.runSelect(stmt); int count = std::stoi(v[0][0].second); if (count == 0) { @@ -1872,10 +1881,10 @@ void JasmineGraphFrontEnd::getAndUpdateUploadTime(std::string graphID, SQLiteDBI } JasmineGraphHashMapCentralStore JasmineGraphFrontEnd::loadCentralStore(std::string centralStoreFileName) { - frontend_logger.log("Loading Central Store File : Started " + centralStoreFileName,"info"); + frontend_logger.log("Loading Central Store File : Started " + centralStoreFileName, "info"); JasmineGraphHashMapCentralStore *jasmineGraphHashMapCentralStore = new JasmineGraphHashMapCentralStore(); jasmineGraphHashMapCentralStore->loadGraph(centralStoreFileName); - frontend_logger.log("Loading Central Store File : Completed","info"); + frontend_logger.log("Loading Central Store File : Completed", "info"); return *jasmineGraphHashMapCentralStore; } @@ -1890,7 +1899,7 @@ map JasmineGraphFrontEnd::getOutDegreeDistributionHashMap(map uid { 0 }; + static std::atomic uid{0}; return ++uid; } @@ -1909,9 +1918,11 @@ long JasmineGraphFrontEnd::getSLAForGraphId(SQLiteDBInterface sqlite, Performanc int partitionCount = results.size(); - string graphSlaQuery = "select graph_sla.sla_value from graph_sla,sla_category where graph_sla.id_sla_category=sla_category.id " - "and sla_category.command='" + command + "' and sla_category.category='" + category + "' and " - "graph_sla.graph_id='" + graphId + "' and graph_sla.partition_count='" + std::to_string(partitionCount) + "';"; + string graphSlaQuery = + "select graph_sla.sla_value from graph_sla,sla_category where graph_sla.id_sla_category=sla_category.id " + "and sla_category.command='" + command + "' and sla_category.category='" + category + "' and " + "graph_sla.graph_id='" + + graphId + "' and graph_sla.partition_count='" + std::to_string(partitionCount) + "';"; std::vector>> slaResults = perfSqlite.runSelect(graphSlaQuery); @@ -1929,7 +1940,8 @@ int JasmineGraphFrontEnd::getRunningHighPriorityTaskCount() { int taskCount = 0; std::set::iterator processQueryIterator; - for (processQueryIterator = processData.begin(); processQueryIterator != processData.end(); ++processQueryIterator) { + for (processQueryIterator = processData.begin(); + processQueryIterator != processData.end(); ++processQueryIterator) { ProcessInfo processInformation = *processQueryIterator; if (processInformation.priority == Conts::HIGH_PRIORITY_DEFAULT_VALUE) { @@ -2202,7 +2214,7 @@ void JasmineGraphServer::egoNet(std::string graphID) { bzero(data, 301); int result_wr = write(sockfd, JasmineGraphInstanceProtocol::EGONET.c_str(), JasmineGraphInstanceProtocol::EGONET.size()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } @@ -2273,7 +2285,6 @@ void JasmineGraphServer::egoNet(std::string graphID) { } - bool JasmineGraphFrontEnd::modelExists(string path, SQLiteDBInterface sqlite) { bool result = true; string stmt = diff --git a/src/ml/trainer/JasminGraphTrainingInitiator.cpp b/src/ml/trainer/JasminGraphTrainingInitiator.cpp index 8b63a8cd1..4baa0e249 100644 --- a/src/ml/trainer/JasminGraphTrainingInitiator.cpp +++ b/src/ml/trainer/JasminGraphTrainingInitiator.cpp @@ -86,7 +86,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[DATA_LENGTH+1]; + char data[DATA_LENGTH + 1]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -119,7 +119,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int //TODO::exit } - bzero(data, DATA_LENGTH+1); + bzero(data, DATA_LENGTH + 1); int result_wr = write(sockfd, JasmineGraphInstanceProtocol::HANDSHAKE.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE.size()); if(result_wr < 0) { trainer_log.log("Error writing to socket", "error"); @@ -127,7 +127,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int } trainer_log.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE, "info"); - bzero(data, DATA_LENGTH+1); + bzero(data, DATA_LENGTH + 1); read(sockfd, data, DATA_LENGTH); string response = (data); @@ -144,7 +144,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int trainer_log.log("Sent : " + server_host, "info"); - bzero(data, DATA_LENGTH+1); + bzero(data, DATA_LENGTH + 1); read(sockfd, data, DATA_LENGTH); string response = (data); @@ -164,7 +164,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int } trainer_log.log("Sent : " + JasmineGraphInstanceProtocol::INITIATE_TRAIN, "info"); - bzero(data, DATA_LENGTH+1); + bzero(data, DATA_LENGTH + 1); read(sockfd, data, DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -178,7 +178,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int } trainer_log.log("Sent : training args " + trainingArgs, "info"); - bzero(data, DATA_LENGTH+1); + bzero(data, DATA_LENGTH + 1); read(sockfd, data, DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -192,7 +192,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int trainer_log.log("Sent : partition iteration " + to_string(iteration), "info"); - bzero(data, DATA_LENGTH+1); + bzero(data, DATA_LENGTH + 1); read(sockfd, data, DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); diff --git a/src/server/JasmineGraphInstanceService.cpp b/src/server/JasmineGraphInstanceService.cpp index c42b1b7e9..0947c8f99 100644 --- a/src/server/JasmineGraphInstanceService.cpp +++ b/src/server/JasmineGraphInstanceService.cpp @@ -67,10 +67,10 @@ void *instanceservicesession(void *dummyPt) { utils.createDirectory(utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder")); - char data[INSTANCE_DATA_LENGTH+1]; + char data[INSTANCE_DATA_LENGTH + 1]; bool loop = false; while (!loop) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string line = (data); @@ -87,7 +87,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::HANDSHAKE_OK.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE_OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE_OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); line = utils.trim_copy(line, " \f\n\r\t\v"); @@ -110,7 +110,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -118,14 +118,14 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); instance_logger.log("Received File name: " + fileName, "info"); write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); // int fileSize = atoi(size.c_str()); @@ -139,7 +139,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::FILE_RECV_CHK) == 0) { @@ -153,7 +153,7 @@ void *instanceservicesession(void *dummyPt) { continue; } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -178,7 +178,7 @@ void *instanceservicesession(void *dummyPt) { pthread_mutex_unlock(&file_lock); while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -189,7 +189,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -203,7 +203,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CENTRAL, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -211,7 +211,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -219,7 +219,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -233,7 +233,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -249,7 +249,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -269,7 +269,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -280,7 +280,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -293,7 +293,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_COMPOSITE_CENTRAL, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -301,7 +301,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -309,7 +309,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -323,7 +323,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -339,7 +339,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -359,7 +359,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -370,7 +370,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -383,7 +383,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::UPLOAD_RDF_ATTRIBUTES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -391,7 +391,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); // fileName = utils.trim_copy(fileName, " \f\n\r\t\v"); @@ -399,7 +399,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -412,7 +412,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::FILE_RECV_CHK) == 0) { @@ -427,7 +427,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -447,7 +447,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -458,7 +458,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -471,7 +471,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::UPLOAD_RDF_ATTRIBUTES_CENTRAL, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -479,7 +479,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); // fileName = utils.trim_copy(fileName, " \f\n\r\t\v"); @@ -487,7 +487,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -500,7 +500,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::FILE_RECV_CHK) == 0) { @@ -515,7 +515,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -535,7 +535,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -546,7 +546,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -559,7 +559,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::DELETE_GRAPH, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -567,7 +567,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_PARTITION_ID.c_str(), JasmineGraphInstanceProtocol::SEND_PARTITION_ID.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_PARTITION_ID, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); instance_logger.log("Received partition ID: " + partitionID, "info"); @@ -583,7 +583,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::DELETE_GRAPH_FRAGMENT, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); // Read the message read(connFd, data, INSTANCE_DATA_LENGTH); // Get graph ID from message @@ -603,7 +603,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : DP_CENTRALSTORE from server", "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -612,7 +612,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -621,7 +621,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -640,7 +640,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -649,7 +649,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -674,7 +674,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -683,7 +683,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -692,7 +692,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -715,7 +715,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -724,7 +724,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -748,7 +748,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -757,7 +757,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -766,7 +766,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -790,7 +790,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -799,7 +799,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -808,7 +808,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -824,7 +824,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphVertexCount = (data); graphVertexCount = utils.trim_copy(graphVertexCount, " \f\n\r\t\v"); @@ -833,7 +833,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string alphaValue = (data); alphaValue = utils.trim_copy(alphaValue, " \f\n\r\t\v"); @@ -844,7 +844,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string iterationsValue = (data); iterationsValue = utils.trim_copy(iterationsValue, " \f\n\r\t\v"); @@ -983,7 +983,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -992,7 +992,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -1001,7 +1001,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -1017,7 +1017,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphVertexCount = (data); graphVertexCount = utils.trim_copy(graphVertexCount, " \f\n\r\t\v"); @@ -1026,7 +1026,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string alphaValue = (data); alphaValue = utils.trim_copy(alphaValue, " \f\n\r\t\v"); @@ -1037,7 +1037,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string iterationsValue = (data); iterationsValue = utils.trim_copy(iterationsValue, " \f\n\r\t\v"); @@ -1084,7 +1084,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -1093,7 +1093,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -1102,7 +1102,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = data; workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -1135,7 +1135,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -1144,7 +1144,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -1153,7 +1153,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -1211,21 +1211,21 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::TRIANGLES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphID, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionId = (data); partitionId = utils.trim_copy(partitionId, " \f\n\r\t\v"); instance_logger.log("Received Partition ID: " + partitionId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -1260,7 +1260,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -1268,7 +1268,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -1282,7 +1282,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1298,7 +1298,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1337,7 +1337,7 @@ void *instanceservicesession(void *dummyPt) { std::string movedFullFilePath = aggregatorFilePath + "/" + rawname; while (!utils.fileExists(movedFullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -1348,7 +1348,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -1363,7 +1363,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -1371,7 +1371,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -1385,7 +1385,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1401,7 +1401,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1440,7 +1440,7 @@ void *instanceservicesession(void *dummyPt) { std::string movedFullFilePath = aggregatorFilePath + "/" + rawname; while (!utils.fileExists(movedFullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -1451,7 +1451,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -1464,28 +1464,28 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::AGGREGATE_CENTRALSTORE_TRIANGLES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphId = (data); graphId = utils.trim_copy(graphId, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionId = (data); partitionId = utils.trim_copy(partitionId, " \f\n\r\t\v"); instance_logger.log("Received Partition ID: " + partitionId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionIdList = (data); partitionIdList = utils.trim_copy(partitionIdList, " \f\n\r\t\v"); instance_logger.log("Received Partition ID List : " + partitionIdList, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -1532,7 +1532,7 @@ void *instanceservicesession(void *dummyPt) { std::string chunk = chunksVector.at(loopCount); write(connFd, chunk.c_str(), chunk.size()); } else { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string chunkStatus = (data); std::string chunk = chunksVector.at(loopCount); @@ -1545,14 +1545,14 @@ void *instanceservicesession(void *dummyPt) { "Received : " + JasmineGraphInstanceProtocol::AGGREGATE_COMPOSITE_CENTRALSTORE_TRIANGLES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string availableFiles = (data); availableFiles = utils.trim_copy(availableFiles, " \f\n\r\t\v"); instance_logger.log("Received Available Files: " + availableFiles, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -1562,7 +1562,7 @@ void *instanceservicesession(void *dummyPt) { while (status == "/SEND") { write(connFd, status.c_str(), status.size()); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -1575,7 +1575,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received Composite File List : " + compositeFileList, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -1620,7 +1620,7 @@ void *instanceservicesession(void *dummyPt) { std::string chunk = chunksVector.at(loopCount); write(connFd, chunk.c_str(), chunk.size()); } else { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string chunkStatus = (data); std::string chunk = chunksVector.at(loopCount); @@ -1632,14 +1632,14 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::PERFORMANCE_STATISTICS, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string isVMStatManager = (data); isVMStatManager = utils.trim_copy(isVMStatManager, " \f\n\r\t\v"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string isResourceAllocationRequired = (data); isResourceAllocationRequired = utils.trim_copy(isResourceAllocationRequired, " \f\n\r\t\v"); @@ -1836,7 +1836,7 @@ void *instanceservicesession(void *dummyPt) { std::string chunk = chunksVector.at(loopCount); write(connFd, chunk.c_str(), chunk.size()); } else { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string chunkStatus = (data); std::string chunk = chunksVector.at(loopCount); @@ -1847,7 +1847,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_TRAIN, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string trainData(data); @@ -1878,7 +1878,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_PARTITION_ITERATION.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_PARTITION_ITERATION, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partIteration(data); @@ -1886,7 +1886,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_PARTITION_ITERATION.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_PARTITION_COUNT, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partCount(data); @@ -1898,19 +1898,19 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_PREDICT, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphID, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string vertexCount = (data); vertexCount = utils.trim_copy(vertexCount, " \f\n\r\t\v"); instance_logger.log("Received vertexCount: " + vertexCount, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string ownPartitions = (data); ownPartitions = utils.trim_copy(ownPartitions, " \f\n\r\t\v"); @@ -1921,8 +1921,8 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_HOSTS.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_HOSTS, "info"); - char dataBuffer[INSTANCE_LONG_DATA_LENGTH+1]; - bzero(dataBuffer, INSTANCE_LONG_DATA_LENGTH+1); + char dataBuffer[INSTANCE_LONG_DATA_LENGTH + 1]; + bzero(dataBuffer, INSTANCE_LONG_DATA_LENGTH + 1); read(connFd, dataBuffer, INSTANCE_LONG_DATA_LENGTH); string hostList = (dataBuffer); instance_logger.log("Received Hosts List: " + hostList, "info"); @@ -1962,7 +1962,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); instance_logger.log("Received File name: " + fileName, "info"); @@ -1970,7 +1970,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -1982,7 +1982,7 @@ void *instanceservicesession(void *dummyPt) { utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + fileName; int fileSize = atoi(size.c_str()); while (utils.fileExists(fullFilePath) && utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1992,7 +1992,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -2031,31 +2031,31 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_MODEL_COLLECTION, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string serverHostName = (data); serverHostName = utils.trim_copy(serverHostName, " \f\n\r\t\v"); instance_logger.log("Received HostName: " + serverHostName, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string serverHostPort = (data); serverHostPort = utils.trim_copy(serverHostPort, " \f\n\r\t\v"); instance_logger.log("Received Port: " + serverHostPort, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string serverHostDataPort = (data); serverHostDataPort = utils.trim_copy(serverHostDataPort, " \f\n\r\t\v"); instance_logger.log("Received Data Port: " + serverHostDataPort, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphID, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -2073,14 +2073,14 @@ void *instanceservicesession(void *dummyPt) { int fileSize = utils.getFileSize(filePath); std::string fileLength = to_string(fileSize); // send file name - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::SEND_FILE_NAME) == 0) { write(connFd, fileName.c_str(), fileName.size()); instance_logger.log("Sent : File name " + fileName, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); // send file length @@ -2089,7 +2089,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, fileLength.c_str(), fileLength.size()); instance_logger.log("Sent : File length in bytes " + fileLength, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); // send content @@ -2107,7 +2107,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::FILE_RECV_CHK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::FILE_RECV_CHK, "info"); instance_logger.log("Checking if file is received", "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -2127,7 +2127,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK.c_str(), JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -2146,7 +2146,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_FRAGMENT_RESOLUTION, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string listOfPartitions = (data); listOfPartitions = utils.trim_copy(listOfPartitions, " \f\n\r\t\v"); @@ -2158,7 +2158,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::FRAGMENT_RESOLUTION_CHK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::FRAGMENT_RESOLUTION_CHK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string listOfPartitions = (data); @@ -2239,7 +2239,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_TYPE.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_TYPE.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_TYPE, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileType = (data); fileType = utils.trim_copy(fileType, " \f\n\r\t\v"); @@ -2247,14 +2247,14 @@ void *instanceservicesession(void *dummyPt) { if (fileType.compare(JasmineGraphInstanceProtocol::FILE_TYPE_CENTRALSTORE_AGGREGATE) == 0) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphId = (data); graphId = utils.trim_copy(graphId, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionId = (data); partitionId = utils.trim_copy(partitionId, " \f\n\r\t\v"); @@ -2277,7 +2277,7 @@ void *instanceservicesession(void *dummyPt) { } else if (fileType.compare(JasmineGraphInstanceProtocol::FILE_TYPE_CENTRALSTORE_COMPOSITE) == 0) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); fileName = utils.trim_copy(fileName, " \f\n\r\t\v"); @@ -2345,7 +2345,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::SEND_PRIORITY, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -2900,7 +2900,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[INSTANCE_DATA_LENGTH+1]; + char data[INSTANCE_DATA_LENGTH + 1]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2930,10 +2930,10 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi std::cerr << "ERROR connecting" << std::endl; // TODO::exit } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); write(sockfd, JasmineGraphInstanceProtocol::HANDSHAKE.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); @@ -2949,7 +2949,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi JasmineGraphInstanceProtocol::INITIATE_MODEL_COLLECTION.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::INITIATE_MODEL_COLLECTION, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -2979,14 +2979,14 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string fileName = (data); instance_logger.log("Received File name: " + fileName, "info"); write(sockfd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -2998,7 +2998,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + fileName; int fileSize = atoi(size.c_str()); while (utils.fileExists(fullFilePath) && utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3008,7 +3008,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3028,7 +3028,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi utils.getJasmineGraphProperty("org.jasminegraph.server.instance.trainedmodelfolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -3039,7 +3039,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); if (response.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -3268,7 +3268,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[INSTANCE_DATA_LENGTH+1]; + char data[INSTANCE_DATA_LENGTH + 1]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -3301,7 +3301,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int //TODO::exit } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); int result_wr = write(sockfd, JasmineGraphInstanceProtocol::HANDSHAKE.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE.size()); if(result_wr < 0) { @@ -3309,7 +3309,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); @@ -3325,7 +3325,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + masterIP, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3343,7 +3343,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CENTRAL, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -3361,7 +3361,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int int fileSize = utils.getFileSize(centralStoreFile); std::string fileLength = to_string(fileSize); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -3375,7 +3375,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : File name " + fileName, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3388,7 +3388,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : File length in bytes " + fileLength, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); if (response.compare(JasmineGraphInstanceProtocol::SEND_FILE_CONT) == 0) { @@ -3410,7 +3410,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::FILE_RECV_CHK, "info"); instance_logger.log("Checking if file is received", "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); if (response.compare(JasmineGraphInstanceProtocol::FILE_RECV_WAIT) == 0) { @@ -3435,7 +3435,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK, "info"); - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3464,7 +3464,7 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[INSTANCE_DATA_LENGTH+1]; + char data[INSTANCE_DATA_LENGTH + 1]; socklen_t len; struct sockaddr_in serv_addr; struct hostent *server; @@ -3498,7 +3498,7 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d instance_logger.log("Error writing to socket", "error"); } - bzero(data, INSTANCE_DATA_LENGTH+1); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); diff --git a/tests/test.py b/tests/test.py index 3a100e026..4139a7f71 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,3 +1,16 @@ +""" +Copyright 2023 JasmineGraph Team +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + import sys import socket From 90f798bea67fa70ab26819a1ac298ca15a3f601e Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Thu, 27 Jul 2023 18:47:41 +0530 Subject: [PATCH 18/45] Moved tests to tests/integration Renamed single letter variables --- .github/workflows/build.yml | 4 +- .../executor/impl/TriangleCountExecutor.cpp | 4 +- src/server/JasmineGraphServer.cpp | 2 +- test-docker.sh | 12 +- tests/{ => integration}/docker-compose.yml | 0 .../env_init/data/powergrid.dl | 0 .../databases/metadb/jasminegraph_meta.db | Bin .../performancedb/jasminegraph_performance.db | Bin tests/integration/test.py | 106 ++++++++++++++++++ tests/test.py | 88 --------------- 10 files changed, 118 insertions(+), 98 deletions(-) rename tests/{ => integration}/docker-compose.yml (100%) rename tests/{ => integration}/env_init/data/powergrid.dl (100%) rename tests/{ => integration}/env_init/databases/metadb/jasminegraph_meta.db (100%) rename tests/{ => integration}/env_init/databases/performancedb/jasminegraph_performance.db (100%) create mode 100644 tests/integration/test.py delete mode 100644 tests/test.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d515541e..69f08276d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,4 +24,6 @@ jobs: # Build JasmineGraph docker image run: docker build -t jasminegraph . - name: Run Integration Tests - run: ./test-docker.sh \ No newline at end of file + run: | + chmod +x test-docker.sh + ./test-docker.sh \ No newline at end of file diff --git a/src/frontend/core/executor/impl/TriangleCountExecutor.cpp b/src/frontend/core/executor/impl/TriangleCountExecutor.cpp index 8eb37a700..89a1253f4 100644 --- a/src/frontend/core/executor/impl/TriangleCountExecutor.cpp +++ b/src/frontend/core/executor/impl/TriangleCountExecutor.cpp @@ -587,15 +587,13 @@ bool TriangleCountExecutor::proceedOrNot(std::set partitionSet,int parti } } - bool result; + bool result = false; if (entryWithMinValue.first == partitionId) { int currentWeight = aggregateWeightMap[entryWithMinValue.first]; currentWeight++; aggregateWeightMap[entryWithMinValue.first] = currentWeight; triangleCount_logger.log("###COMPOSITE### Aggregator Initiated : Partition ID: " + std::to_string(partitionId) + " Weight : " + std::to_string(currentWeight), "info"); result = true; - } else { - result = false; } aggregateWeightMutex.unlock(); diff --git a/src/server/JasmineGraphServer.cpp b/src/server/JasmineGraphServer.cpp index 0c628f00b..509f11aeb 100644 --- a/src/server/JasmineGraphServer.cpp +++ b/src/server/JasmineGraphServer.cpp @@ -327,7 +327,7 @@ void JasmineGraphServer::startRemoteWorkers(std::vector workerPortsVector, } else if (profile == "docker") { std::string image_tag; char *env_testing = getenv("TESTING"); - if (env_testing == NULL || strcasecmp(env_testing, "true")) { + if (env_testing == NULL || strcasecmp(env_testing, "true") != 0) { image_tag = "latest"; } else { image_tag = "test"; diff --git a/test-docker.sh b/test-docker.sh index 8c4175a8d..edd0c0597 100755 --- a/test-docker.sh +++ b/test-docker.sh @@ -14,11 +14,13 @@ build_and_run_docker () { stop_and_remove_containers cd "$PROJECT_ROOT" docker build -t jasminegraph:test . |& tee "logs/${run_id}_build.txt" - docker compose -f tests/docker-compose.yml up |& tee "logs/${run_id}_run.txt" & + docker compose -f tests/integration/docker-compose.yml up |& tee "logs/${run_id}_run.txt" & } -rm -rf tests/env -cp -r tests/env_init tests/env +cd tests/integration +rm -rf env +cp -r env_init env +cd "$PROJECT_ROOT" build_and_run_docker &>/dev/null # sleep until server starts listening @@ -26,8 +28,8 @@ while ! nc -zvn 127.0.0.1 7777 &>/dev/null; do sleep .2 done -timeout 1800 python3 -u tests/test.py |& tee "logs/${run_id}_test.txt" +timeout 1800 python3 -u tests/integration/test.py |& tee "logs/${run_id}_test.txt" exit_code="${PIPESTATUS[0]}" -rm -rf tests/env +rm -rf tests/integration/env stop_and_remove_containers exit "$exit_code" \ No newline at end of file diff --git a/tests/docker-compose.yml b/tests/integration/docker-compose.yml similarity index 100% rename from tests/docker-compose.yml rename to tests/integration/docker-compose.yml diff --git a/tests/env_init/data/powergrid.dl b/tests/integration/env_init/data/powergrid.dl similarity index 100% rename from tests/env_init/data/powergrid.dl rename to tests/integration/env_init/data/powergrid.dl diff --git a/tests/env_init/databases/metadb/jasminegraph_meta.db b/tests/integration/env_init/databases/metadb/jasminegraph_meta.db similarity index 100% rename from tests/env_init/databases/metadb/jasminegraph_meta.db rename to tests/integration/env_init/databases/metadb/jasminegraph_meta.db diff --git a/tests/env_init/databases/performancedb/jasminegraph_performance.db b/tests/integration/env_init/databases/performancedb/jasminegraph_performance.db similarity index 100% rename from tests/env_init/databases/performancedb/jasminegraph_performance.db rename to tests/integration/env_init/databases/performancedb/jasminegraph_performance.db diff --git a/tests/integration/test.py b/tests/integration/test.py new file mode 100644 index 000000000..8b14f1376 --- /dev/null +++ b/tests/integration/test.py @@ -0,0 +1,106 @@ +""" +Copyright 2023 JasmineGraph Team +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import sys +import socket + +HOST = '127.0.0.1' +PORT = 7777 # The port used by the server + +LIST=b'lst' +ADGR=b'adgr' +EMPTY=b'empty' +RMGR=b'rmgr' +VCNT=b'vcnt' +ECNT=b'ecnt' +TRIAN=b'trian' +SHDN=b'shdn' +SEND=b'send' +DONE=b'done' +LINE_END=b'\r\n' + +def recv_all(sock, n_bytes): + buffer = bytearray() + read = 0 + while read < n_bytes: + received = sock.recv(n_bytes - read) + if received: + read += len(received) + buffer.extend(received) + return bytes(buffer) + +def expect_response(sock, expected): + global passedAll + data = recv_all(sock, len(expected)) + print(data.decode('utf-8'), end='') + if data != expected: + print(f'Output mismatch\nexpected : {expected}\nreceived : {data}', file=sys.stderr) + passedAll = False + return False + return True + +def send_and_expect_response(sock, testName, send, expected, exitOnFail=False): + global failedTests + sock.sendall(send + LINE_END) + print(send.decode('utf-8')) + if not expect_response(sock, expected + LINE_END): + failedTests.append(testName) + if exitOnFail: + print('\nFailed some tests,', file=sys.stderr) + print(*failedTests, sep='\n', file=sys.stderr) + sys.exit(1) + +passedAll = True +failedTests = [] + +with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + sock.connect((HOST, PORT)) + + print("\nTesting lst") + send_and_expect_response(sock, 'Initial lst', LIST, EMPTY) + + print("\nTesting adgr") + send_and_expect_response(sock, 'adgr', ADGR, SEND, exitOnFail=True) + send_and_expect_response(sock, 'adgr', b'powergrid|/var/tmp/data/powergrid.dl', DONE, exitOnFail=True) + + print("\nTesting lst after adgr") + send_and_expect_response(sock, "lst after adgr", LIST, b'|1|powergrid|/var/tmp/data/powergrid.dl|op|') + + print("\nTesting ecnt") + send_and_expect_response(sock, "ecnt", ECNT, b'graphid-send') + send_and_expect_response(sock, "ecnt", b'1', b'6594') + + print("\nTesting vcnt") + send_and_expect_response(sock, "vcnt", VCNT, b'graphid-send') + send_and_expect_response(sock, "vcnt", b'1', b'4941') + + print("\nTesting trian") + send_and_expect_response(sock, "trian", TRIAN, b'grap', exitOnFail=True) + send_and_expect_response(sock, "trian", b'1', b'priority(>=1)', exitOnFail=True) + send_and_expect_response(sock, "trian", b'1', b'651') + + print("\nTesting rmgr") + send_and_expect_response(sock, 'rmgr', RMGR, SEND) + send_and_expect_response(sock, 'rmgr', b'1', DONE) + + print("\nTesting lst after rmgr") + send_and_expect_response(sock, 'lst after rmgr', LIST, EMPTY) + + print("\nShutting down") + sock.sendall(SHDN + LINE_END) + + if passedAll: + print('\nPassed all tests') + else: + print('\nFailed some tests', file=sys.stderr) + print(*failedTests, sep='\n', file=sys.stderr) \ No newline at end of file diff --git a/tests/test.py b/tests/test.py deleted file mode 100644 index 4139a7f71..000000000 --- a/tests/test.py +++ /dev/null @@ -1,88 +0,0 @@ -""" -Copyright 2023 JasmineGraph Team -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import sys -import socket - -HOST = '127.0.0.1' -PORT = 7777 # The port used by the server - -def recv_all(sock, n): - b = bytearray() - read = 0 - while read < n: - tmp = sock.recv(n-read) - if tmp: - read += len(tmp) - b.extend(tmp) - return bytes(b) - -def expect_response(sock, expected): - global passedAll - data = recv_all(s, len(expected)) - print(data.decode('utf-8'), end='') - if data != expected: - print(f'Output mismatch\nexpected : {expected}\nreceived : {data}', file=sys.stderr) - passedAll = False - return False - return True - -def send_and_expect_response(sock, send, expected, exitOnFail=False): - s.sendall(send + b'\r\n') - print(send.decode('utf-8')) - if not expect_response(sock, expected + b'\r\n'): - if exitOnFail: - sys.exit(1) - -passedAll = True - -with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: - s.connect((HOST, PORT)) - - print("\nTesting lst") - send_and_expect_response(s, b'lst', b'empty') - - print("\nTesting adgr") - send_and_expect_response(s, b'adgr', b'send', exitOnFail=True) - send_and_expect_response(s, b'powergrid|/var/tmp/data/powergrid.dl', b'done', exitOnFail=True) - - print("\nTesting lst after adgr") - send_and_expect_response(s, b'lst', b'|1|powergrid|/var/tmp/data/powergrid.dl|op|') - - print("\nTesting ecnt") - send_and_expect_response(s, b'ecnt', b'graphid-send') - send_and_expect_response(s, b'1', b'6594') - - print("\nTesting vcnt") - send_and_expect_response(s, b'vcnt', b'graphid-send') - send_and_expect_response(s, b'1', b'4941') - - print("\nTesting trian") - send_and_expect_response(s, b'trian', b'grap', exitOnFail=True) - send_and_expect_response(s, b'1', b'priority(>=1)', exitOnFail=True) - send_and_expect_response(s, b'1', b'651') - - print("\nTesting rmgr") - send_and_expect_response(s, b'rmgr', b'send') - send_and_expect_response(s, b'1', b'done') - - print("\nTesting lst after rmgr") - send_and_expect_response(s, b'lst', b'empty') - - print("\nShutting down") - s.sendall(b'shdn\r\n') - - if passedAll: - print('\nPassed all tests') - else: - print('\nFailed some tests', file=sys.stderr) \ No newline at end of file From d14be5bee51e27270d330e32758830df04488904 Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Fri, 28 Jul 2023 22:00:41 +0530 Subject: [PATCH 19/45] Added logging to testing Python script --- tests/integration/test.py | 41 ++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/tests/integration/test.py b/tests/integration/test.py index 8b14f1376..8fd77ea62 100644 --- a/tests/integration/test.py +++ b/tests/integration/test.py @@ -13,6 +13,9 @@ import sys import socket +import logging + +logging.getLogger().setLevel(logging.INFO) HOST = '127.0.0.1' PORT = 7777 # The port used by the server @@ -44,7 +47,7 @@ def expect_response(sock, expected): data = recv_all(sock, len(expected)) print(data.decode('utf-8'), end='') if data != expected: - print(f'Output mismatch\nexpected : {expected}\nreceived : {data}', file=sys.stderr) + logging.warning(f'Output mismatch\nexpected : {expected}\nreceived : {data}') passedAll = False return False return True @@ -56,7 +59,8 @@ def send_and_expect_response(sock, testName, send, expected, exitOnFail=False): if not expect_response(sock, expected + LINE_END): failedTests.append(testName) if exitOnFail: - print('\nFailed some tests,', file=sys.stderr) + print() + logging.fatal('Failed some tests,', file=sys.stderr) print(*failedTests, sep='\n', file=sys.stderr) sys.exit(1) @@ -66,41 +70,52 @@ def send_and_expect_response(sock, testName, send, expected, exitOnFail=False): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: sock.connect((HOST, PORT)) - print("\nTesting lst") + print() + logging.info("Testing lst") send_and_expect_response(sock, 'Initial lst', LIST, EMPTY) - print("\nTesting adgr") + print() + logging.info("Testing adgr") send_and_expect_response(sock, 'adgr', ADGR, SEND, exitOnFail=True) send_and_expect_response(sock, 'adgr', b'powergrid|/var/tmp/data/powergrid.dl', DONE, exitOnFail=True) - print("\nTesting lst after adgr") + print() + logging.info("Testing lst after adgr") send_and_expect_response(sock, "lst after adgr", LIST, b'|1|powergrid|/var/tmp/data/powergrid.dl|op|') - print("\nTesting ecnt") + print() + logging.info("Testing ecnt") send_and_expect_response(sock, "ecnt", ECNT, b'graphid-send') send_and_expect_response(sock, "ecnt", b'1', b'6594') - print("\nTesting vcnt") + print() + logging.info("Testing vcnt") send_and_expect_response(sock, "vcnt", VCNT, b'graphid-send') send_and_expect_response(sock, "vcnt", b'1', b'4941') - print("\nTesting trian") + print() + logging.info("Testing trian") send_and_expect_response(sock, "trian", TRIAN, b'grap', exitOnFail=True) send_and_expect_response(sock, "trian", b'1', b'priority(>=1)', exitOnFail=True) send_and_expect_response(sock, "trian", b'1', b'651') - print("\nTesting rmgr") + print() + logging.info("Testing rmgr") send_and_expect_response(sock, 'rmgr', RMGR, SEND) send_and_expect_response(sock, 'rmgr', b'1', DONE) - print("\nTesting lst after rmgr") + print() + logging.info("Testing lst after rmgr") send_and_expect_response(sock, 'lst after rmgr', LIST, EMPTY) - print("\nShutting down") + print() + logging.info("Shutting down") sock.sendall(SHDN + LINE_END) if passedAll: - print('\nPassed all tests') + print() + logging.info('Passed all tests') else: - print('\nFailed some tests', file=sys.stderr) + print() + logging.critical('Failed some tests') print(*failedTests, sep='\n', file=sys.stderr) \ No newline at end of file From 389fdff2e5136ce9088e6d64a67cb4ca58dafe3d Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Fri, 28 Jul 2023 23:17:03 +0530 Subject: [PATCH 20/45] Defined frontend graph type length as a constant --- src/frontend/JasmineGraphFrontEnd.cpp | 6 +++--- src/frontend/JasmineGraphFrontEndProtocol.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/JasmineGraphFrontEnd.cpp b/src/frontend/JasmineGraphFrontEnd.cpp index 953e2c057..67ee9a583 100755 --- a/src/frontend/JasmineGraphFrontEnd.cpp +++ b/src/frontend/JasmineGraphFrontEnd.cpp @@ -504,9 +504,9 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char type[21]; - bzero(type, 21); - read(connFd, type, 20); + char type[FRONTEND_GRAPH_TYPE_LENGTH + 1]; + bzero(type, FRONTEND_GRAPH_TYPE_LENGTH + 1); + read(connFd, type, FRONTEND_GRAPH_TYPE_LENGTH); string graphType(type); graphType = utils.trim_copy(graphType, " \f\n\r\t\v"); diff --git a/src/frontend/JasmineGraphFrontEndProtocol.h b/src/frontend/JasmineGraphFrontEndProtocol.h index 318d631e4..7d022b3cf 100755 --- a/src/frontend/JasmineGraphFrontEndProtocol.h +++ b/src/frontend/JasmineGraphFrontEndProtocol.h @@ -93,6 +93,7 @@ class JasminGraphFrontEndProtocol { const int FRONTEND_COMMAND_LENGTH = 4; const int FRONTEND_DATA_LENGTH = 300; +const int FRONTEND_GRAPH_TYPE_LENGTH = 20; const double PAGE_RANK_ALPHA = 0.85; const int PAGE_RANK_ITERATIONS = 10; From b8d7145ada6467fd2584bc88f011c141ebd0007c Mon Sep 17 00:00:00 2001 From: Kandeeban Date: Mon, 31 Jul 2023 22:26:53 +0530 Subject: [PATCH 21/45] Refactored and fixed bugs in merge.py --- src_python/merge.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src_python/merge.py b/src_python/merge.py index 9b2ebbdf2..8b52a5730 100644 --- a/src_python/merge.py +++ b/src_python/merge.py @@ -26,8 +26,8 @@ ) arg_names = [ - 'path_localstore', - 'path_centralstore', + 'path_datafolder', + 'path_modelstore', 'path_data', 'graph_id', 'partition_id', @@ -43,30 +43,30 @@ args = dict(zip(arg_names, sys.argv[1:])) -path_nodes_localstore = args['path_localstore'] + args['graph_id'] + '_attributes_' + args['partition_id'] -nodes_localstore = pd.read_csv(path_nodes_localstore , sep='\s+', lineterminator='\n',header=None) -nodes_localstore.set_index(0,inplace=True) +path_attributes_localstore = args['path_datafolder'] + args['graph_id'] + '_attributes_' + args['partition_id'] +node_attributes_localstore = pd.read_csv(path_attributes_localstore , sep='\s+', lineterminator='\n',header=None) +node_attributes_localstore.set_index(0,inplace=True) -path_edges_localstore = args['path_localstore'] + args['graph_id'] + '_' + args['partition_id'] +path_edges_localstore = args['path_modelstore'] + args['graph_id'] + '_' + args['partition_id'] edges_localstore = pd.read_csv(path_edges_localstore, sep='\s+', lineterminator='\n', header=None) edges_localstore.columns = ["source","target"] -path_nodes_centralstore = args['path_centralstore'] + args['graph_id'] + '_centralstore_attributes_' + args['partition_id'] -nodes_centralstore = pd.read_csv(path_nodes_centralstore , sep='\s+', lineterminator='\n',header=None) -nodes_centralstore.set_index(0,inplace=True) +path_attributes_centralstore = args['path_datafolder'] + args['graph_id'] + '_centralstore_attributes_' + args['partition_id'] +node_attributes_centralstore = pd.read_csv(path_attributes_centralstore , sep='\s+', lineterminator='\n',header=None) +node_attributes_centralstore.set_index(0,inplace=True) -path_edges_centralstore = args['path_centralstore'] + args['graph_id'] + '_centralstore_' + args['partition_id'] +path_edges_centralstore = args['path_modelstore'] + args['graph_id'] + '_centralstore_' + args['partition_id'] edges_centralstore = pd.read_csv(path_edges_centralstore, sep='\s+', lineterminator='\n', header=None) edges_centralstore.columns = ["source","target"] # Reducing memory consumption edges_centralstore = edges_centralstore.astype({"source":"uint32","target":"uint32"}) edges_localstore = edges_localstore.astype({"source":"uint32","target":"uint32"}) -nodes_localstore = nodes_localstore.astype("float32") -nodes_centralstore = nodes_centralstore.astype("float32") +node_attributes_localstore = node_attributes_localstore.astype("float32") +node_attributes_centralstore = node_attributes_centralstore.astype("float32") -nodes = pd.concat([nodes_localstore,nodes_centralstore]) +nodes = pd.concat([node_attributes_localstore,node_attributes_centralstore]) nodes = nodes.loc[~nodes.index.duplicated(keep='first')] edges = pd.concat([edges_localstore,edges_centralstore],ignore_index=True) @@ -76,3 +76,4 @@ nodes.to_csv(path_nodes) edges.to_csv(path_edges,index=False) + From 127bfcfbd96370940c38ef4cd428050f55a785bb Mon Sep 17 00:00:00 2001 From: Kandeeban Date: Mon, 31 Jul 2023 22:38:55 +0530 Subject: [PATCH 22/45] Fixed issues in GraphSAGE to support python 3.11 --- GraphSAGE/graphsage/aggregators.py | 4 +- GraphSAGE/graphsage/inits.py | 4 +- GraphSAGE/graphsage/layers.py | 3 +- GraphSAGE/graphsage/metrics.py | 3 +- GraphSAGE/graphsage/minibatch.py | 42 +++++++-------- GraphSAGE/graphsage/models.py | 3 +- GraphSAGE/graphsage/neigh_samplers.py | 3 +- GraphSAGE/graphsage/prediction.py | 3 +- GraphSAGE/graphsage/supervised_models.py | 3 +- GraphSAGE/graphsage/supervised_train.py | 5 +- GraphSAGE/graphsage/unsupervised_train.py | 16 +++--- GraphSAGE/graphsage/utils.py | 64 ++++++++++++++--------- 12 files changed, 90 insertions(+), 63 deletions(-) diff --git a/GraphSAGE/graphsage/aggregators.py b/GraphSAGE/graphsage/aggregators.py index 60fabcccc..8d1b5c471 100644 --- a/GraphSAGE/graphsage/aggregators.py +++ b/GraphSAGE/graphsage/aggregators.py @@ -1,8 +1,10 @@ -import tensorflow as tf +import tensorflow.compat.v1 as tf from layers import Layer, Dense from inits import glorot, zeros +tf.disable_v2_behavior() + class MeanAggregator(Layer): """ Aggregates via mean followed by matmul and non-linearity. diff --git a/GraphSAGE/graphsage/inits.py b/GraphSAGE/graphsage/inits.py index c3351494e..019fd86e8 100644 --- a/GraphSAGE/graphsage/inits.py +++ b/GraphSAGE/graphsage/inits.py @@ -1,6 +1,8 @@ -import tensorflow as tf +import tensorflow.compat.v1 as tf import numpy as np +tf.disable_v2_behavior() + # DISCLAIMER: # Parts of this code file are derived from # https://github.com/tkipf/gcn diff --git a/GraphSAGE/graphsage/layers.py b/GraphSAGE/graphsage/layers.py index 28df3f42f..f4102ebdb 100644 --- a/GraphSAGE/graphsage/layers.py +++ b/GraphSAGE/graphsage/layers.py @@ -1,10 +1,11 @@ from __future__ import division from __future__ import print_function -import tensorflow as tf +import tensorflow.compat.v1 as tf from inits import zeros +tf.disable_v2_behavior() flags = tf.app.flags FLAGS = flags.FLAGS diff --git a/GraphSAGE/graphsage/metrics.py b/GraphSAGE/graphsage/metrics.py index c69630695..fadfab7e1 100644 --- a/GraphSAGE/graphsage/metrics.py +++ b/GraphSAGE/graphsage/metrics.py @@ -1,4 +1,5 @@ -import tensorflow as tf +import tensorflow.compat.v1 as tf +tf.disable_v2_behavior() # DISCLAIMER: # Parts of this code file were originally forked from diff --git a/GraphSAGE/graphsage/minibatch.py b/GraphSAGE/graphsage/minibatch.py index 15f1fcca2..9ac5216f8 100644 --- a/GraphSAGE/graphsage/minibatch.py +++ b/GraphSAGE/graphsage/minibatch.py @@ -25,16 +25,16 @@ def __init__(self, G, G_local,id2idx, **kwargs): self.G = G - self.nodes = G.nodes() + self.nodes = list(G.nodes()) self.local_nodes = G_local.nodes() - self.central_nodes = list(set(G.nodes())-set(G_local.nodes())) + self.central_nodes = list(set(list(G.nodes()))-set(G_local.nodes())) self.id2idx = id2idx self.placeholders = placeholders self.batch_size = batch_size self.max_degree = max_degree self.batch_num = 0 - self.nodes = np.random.permutation(G.nodes()) + self.nodes = np.random.permutation(list(G.nodes())) self.adj, self.deg = self.construct_adj() self.test_adj = self.construct_test_adj() if context_pairs is None: @@ -52,12 +52,12 @@ def __init__(self, G, G_local,id2idx, else: self.train_edges = self.val_edges = self.edges - print(len([n for n in G.nodes() if not G.node[n]['test'] and not G.node[n]['val']]), 'train nodes') - print(len([n for n in G.nodes() if G.node[n]['test'] or G.node[n]['val']]), 'test nodes') + print(len([n for n in list(G.nodes()) if not G.nodes[n]['test'] and not G.nodes[n]['val']]), 'train nodes') + print(len([n for n in list(G.nodes()) if G.nodes[n]['test'] or G.nodes[n]['val']]), 'test nodes') self.val_set_size = len(self.val_edges) def _n2v_prune(self, edges): - is_val = lambda n : self.G.node[n]["val"] or self.G.node[n]["test"] + is_val = lambda n : self.G.nodes[n]["val"] or self.G.nodes[n]["test"] return [e for e in edges if not is_val(e[1])] def _remove_isolated(self, edge_list): @@ -67,11 +67,11 @@ def _remove_isolated(self, edge_list): count = 0 for n1, n2 in edge_list: count +=1 - if not n1 in self.G.node or not n2 in self.G.node: + if not n1 in list(self.G.nodes()) or not n2 in list(self.G.nodes()): missing += 1 continue - if (self.G.node[n1]['test'] and self.G.node[n2]['test']) \ - or (self.G.node[n1]['val'] and self.G.node[n2]['val']): + if (self.G.nodes[n1]['test'] and self.G.nodes[n2]['test']) \ + or (self.G.nodes[n1]['val'] and self.G.nodes[n2]['val']): continue else: new_edge_list.append((n1,n2)) @@ -82,8 +82,8 @@ def construct_adj(self): adj = len(self.id2idx)*np.ones((len(self.id2idx)+1, self.max_degree)) deg = np.zeros((len(self.id2idx),)) - for nodeid in self.G.nodes(): - if self.G.node[nodeid]['test'] or self.G.node[nodeid]['val']: + for nodeid in list(self.G.nodes()): + if self.G.nodes[nodeid]['test'] or self.G.nodes[nodeid]['val']: continue neighbors = np.array([self.id2idx[neighbor] for neighbor in self.G.neighbors(nodeid) @@ -100,7 +100,7 @@ def construct_adj(self): def construct_test_adj(self): adj = len(self.id2idx)*np.ones((len(self.id2idx)+1, self.max_degree)) - for nodeid in self.G.nodes(): + for nodeid in list(self.G.nodes()): neighbors = np.array([self.id2idx[neighbor] for neighbor in self.G.neighbors(nodeid)]) if len(neighbors) == 0: @@ -183,8 +183,8 @@ def label_val(self): train_edges = [] val_edges = [] for n1, n2 in self.G.edges(): - if (self.G.node[n1]['val'] or self.G.node[n1]['test'] - or self.G.node[n2]['val'] or self.G.node[n2]['test']): + if (self.G.nodes[n1]['val'] or self.G.nodes[n1]['test'] + or self.G.nodes[n2]['val'] or self.G.nodes[n2]['test']): val_edges.append((n1,n2)) else: train_edges.append((n1,n2)) @@ -217,7 +217,7 @@ def __init__(self, G, id2idx, **kwargs): self.G = G - self.nodes = G.nodes() + self.nodes = list(G.nodes()) self.id2idx = id2idx self.placeholders = placeholders self.batch_size = batch_size @@ -229,11 +229,11 @@ def __init__(self, G, id2idx, self.adj, self.deg = self.construct_adj() self.test_adj = self.construct_test_adj() - self.val_nodes = [n for n in self.G.nodes() if self.G.node[n]['val']] - self.test_nodes = [n for n in self.G.nodes() if self.G.node[n]['test']] + self.val_nodes = [n for n in list(self.G.nodes()) if self.G.nodes[n]['val']] + self.test_nodes = [n for n in list(self.G.nodes()) if self.G.nodes[n]['test']] self.no_train_nodes_set = set(self.val_nodes + self.test_nodes) - self.train_nodes = set(G.nodes()).difference(self.no_train_nodes_set) + self.train_nodes = set(list(G.nodes())).difference(self.no_train_nodes_set) # don't train on nodes that only have edges to test set self.train_nodes = [n for n in self.train_nodes if self.deg[id2idx[n]] > 0] @@ -251,8 +251,8 @@ def construct_adj(self): adj = len(self.id2idx)*np.ones((len(self.id2idx)+1, self.max_degree)) deg = np.zeros((len(self.id2idx),)) - for nodeid in self.G.nodes(): - if self.G.node[nodeid]['test'] or self.G.node[nodeid]['val']: + for nodeid in list(self.G.nodes()): + if self.G.nodes[nodeid]['test'] or self.G.nodes[nodeid]['val']: continue neighbors = np.array([self.id2idx[neighbor] for neighbor in self.G.neighbors(nodeid) @@ -269,7 +269,7 @@ def construct_adj(self): def construct_test_adj(self): adj = len(self.id2idx)*np.ones((len(self.id2idx)+1, self.max_degree)) - for nodeid in self.G.nodes(): + for nodeid in list(self.G.nodes()): neighbors = np.array([self.id2idx[neighbor] for neighbor in self.G.neighbors(nodeid)]) if len(neighbors) == 0: diff --git a/GraphSAGE/graphsage/models.py b/GraphSAGE/graphsage/models.py index 32fc22add..0bc5d38ff 100644 --- a/GraphSAGE/graphsage/models.py +++ b/GraphSAGE/graphsage/models.py @@ -1,6 +1,6 @@ from collections import namedtuple -import tensorflow as tf +import tensorflow.compat.v1 as tf import math import layers as layers @@ -9,6 +9,7 @@ from prediction import BipartiteEdgePredLayer from aggregators import MeanAggregator, MaxPoolingAggregator, MeanPoolingAggregator, SeqAggregator, GCNAggregator +tf.disable_v2_behavior() flags = tf.app.flags FLAGS = flags.FLAGS diff --git a/GraphSAGE/graphsage/neigh_samplers.py b/GraphSAGE/graphsage/neigh_samplers.py index fef6ceb27..11ffcf827 100644 --- a/GraphSAGE/graphsage/neigh_samplers.py +++ b/GraphSAGE/graphsage/neigh_samplers.py @@ -3,7 +3,8 @@ from layers import Layer -import tensorflow as tf +import tensorflow.compat.v1 as tf +tf.disable_v2_behavior() flags = tf.app.flags FLAGS = flags.FLAGS diff --git a/GraphSAGE/graphsage/prediction.py b/GraphSAGE/graphsage/prediction.py index 1f037af7b..419d63de4 100644 --- a/GraphSAGE/graphsage/prediction.py +++ b/GraphSAGE/graphsage/prediction.py @@ -3,8 +3,9 @@ from inits import zeros from layers import Layer -import tensorflow as tf +import tensorflow.compat.v1 as tf +tf.disable_v2_behavior() flags = tf.app.flags FLAGS = flags.FLAGS diff --git a/GraphSAGE/graphsage/supervised_models.py b/GraphSAGE/graphsage/supervised_models.py index 6a0108c74..1941bc909 100644 --- a/GraphSAGE/graphsage/supervised_models.py +++ b/GraphSAGE/graphsage/supervised_models.py @@ -1,9 +1,10 @@ -import tensorflow as tf +import tensorflow.compat.v1 as tf import models as models import layers as layers from aggregators import MeanAggregator, MaxPoolingAggregator, MeanPoolingAggregator, SeqAggregator, GCNAggregator +tf.disable_v2_behavior() flags = tf.app.flags FLAGS = flags.FLAGS diff --git a/GraphSAGE/graphsage/supervised_train.py b/GraphSAGE/graphsage/supervised_train.py index 5579f8e9b..c8228777b 100644 --- a/GraphSAGE/graphsage/supervised_train.py +++ b/GraphSAGE/graphsage/supervised_train.py @@ -3,7 +3,7 @@ import os import time -import tensorflow as tf +import tensorflow.compat.v1 as tf import numpy as np import sklearn from sklearn import metrics @@ -16,6 +16,7 @@ os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" +tf.disable_v2_behavior() # Set random seed seed = 123 np.random.seed(seed) @@ -25,7 +26,7 @@ flags = tf.app.flags FLAGS = flags.FLAGS -tf.app.flags.DEFINE_boolean('log_device_placement', False, +flags.DEFINE_boolean('log_device_placement', False, """Whether to log device placement.""") #core params.. flags.DEFINE_string('model', 'graphsage_mean', 'model names. See README for possible values.') diff --git a/GraphSAGE/graphsage/unsupervised_train.py b/GraphSAGE/graphsage/unsupervised_train.py index 6ae0f02d3..b2360a25e 100644 --- a/GraphSAGE/graphsage/unsupervised_train.py +++ b/GraphSAGE/graphsage/unsupervised_train.py @@ -3,7 +3,7 @@ import os import time -import tensorflow as tf +import tensorflow.compat.v1 as tf import numpy as np import datetime @@ -14,16 +14,18 @@ os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" +tf.disable_v2_behavior() + # Set random seed seed = 123 np.random.seed(seed) -tf.set_random_seed(seed) +tf.random.set_random_seed(seed) # Settings flags = tf.app.flags FLAGS = flags.FLAGS -tf.app.flags.DEFINE_boolean('log_device_placement', False, +flags.DEFINE_boolean('log_device_placement', False, """Whether to log device placement.""") #core params.. flags.DEFINE_string('model', 'graphsage_mean', 'model names. See README for possible values.') @@ -66,7 +68,7 @@ def log_dir(): - log_dir = FLAGS.base_log_dir + "/jasminegraph-local_trained_model_store/" + log_dir = FLAGS.base_log_dir + "jasminegraph-local_trained_model_store/" log_dir += "{graph_id:s}_model_{train_worker:s}".format( graph_id = FLAGS.train_prefix.split("/")[-1], train_worker = FLAGS.train_worker @@ -414,9 +416,9 @@ def train(train_data, G_local,test_data=None): if FLAGS.model == "n2v": # stopping the gradient for the already trained nodes - train_ids = tf.constant([[id_map[n]] for n in G.nodes_iter() if not G.node[n]['val'] and not G.node[n]['test']], + train_ids = tf.constant([[id_map[n]] for n in G.nodes_iter() if not G._node[n]['val'] and not G._node[n]['test']], dtype=tf.int32) - test_ids = tf.constant([[id_map[n]] for n in G.nodes_iter() if G.node[n]['val'] or G.node[n]['test']], + test_ids = tf.constant([[id_map[n]] for n in G.nodes_iter() if G._node[n]['val'] or G._node[n]['test']], dtype=tf.int32) update_nodes = tf.nn.embedding_lookup(model.context_embeds, tf.squeeze(test_ids)) no_update_nodes = tf.nn.embedding_lookup(model.context_embeds,tf.squeeze(train_ids)) @@ -427,7 +429,7 @@ def train(train_data, G_local,test_data=None): # run random walks from graphsage.utils import run_random_walks - nodes = [n for n in G.nodes_iter() if G.node[n]["val"] or G.node[n]["test"]] + nodes = [n for n in G.nodes_iter() if G._node[n]["val"] or G._node[n]["test"]] start_time = time.time() pairs = run_random_walks(G, nodes, num_walks=50) walk_time = time.time() - start_time diff --git a/GraphSAGE/graphsage/utils.py b/GraphSAGE/graphsage/utils.py index b8800afc8..a9665884b 100644 --- a/GraphSAGE/graphsage/utils.py +++ b/GraphSAGE/graphsage/utils.py @@ -6,14 +6,16 @@ import sys import os -import tensorflow as tf +import tensorflow.compat.v1 as tf import networkx as nx from networkx.readwrite import json_graph +tf.disable_v2_behavior() + version_info = list(map(int, nx.__version__.split('.'))) major = version_info[0] minor = version_info[1] -assert (major <= 1) and (minor <= 11), "networkx major version > 1.11" +assert (major <= 3) and (minor <= 1), "networkx major version > 1.11" WALK_LEN = 5 N_WALKS = 50 @@ -21,6 +23,16 @@ flags = tf.app.flags FLAGS = flags.FLAGS +def log_dir(): + + log_dir = FLAGS.base_log_dir + "jasminegraph-local_trained_model_store/" + log_dir += "{graph_id:s}_model_{train_worker:s}".format( + graph_id = FLAGS.train_prefix.split("/")[-1], + train_worker = FLAGS.train_worker + ) + if not os.path.exists(log_dir): + os.makedirs(log_dir) + return log_dir def preprocess_data(prefix,attr_prefix,worker,isLabel=False,isFeatures=False,normalize=True,load_walks=False): @@ -30,7 +42,7 @@ def preprocess_data(prefix,attr_prefix,worker,isLabel=False,isFeatures=False,nor G_central = nx.read_edgelist(prefix + '_centralstore_' + worker, nodetype=int) G = nx.compose(G_local, G_central) nodes_key_list = list(G.nodes()) - save_dir = FLAGS.base_log_dir + "/jasminegraph-local_trained_model_store/" + save_dir = FLAGS.base_log_dir + "jasminegraph-local_trained_model_store/" if not os.path.exists(save_dir): os.makedirs(save_dir) @@ -39,15 +51,17 @@ def preprocess_data(prefix,attr_prefix,worker,isLabel=False,isFeatures=False,nor test_val_frac = 0.2 for i, n in enumerate(nodes_key_list): if i < len(nodes_key_list) * test_val_frac: - G.node[n]["test"] = True - G.node[n]["val"] = False + G.nodes[n]["test"] = True + G.nodes[n]["val"] = False if len(nodes_key_list) * test_val_frac <= i < 2 * len(nodes_key_list) * test_val_frac: - G.node[n]["test"] = False - G.node[n]["val"] = True + G.nodes[n]["test"] = False + G.nodes[n]["val"] = True if i >= 2 * len(nodes_key_list) * test_val_frac: - G.node[n]["test"] = False - G.node[n]["val"] = False - if isinstance(G.nodes()[0], int): + G.nodes[n]["test"] = False + G.nodes[n]["val"] = False + + list_of_nodes = list(G.nodes()) + if isinstance(list_of_nodes[0], int): conversion = lambda n: int(n) else: conversion = lambda n: n @@ -115,7 +129,7 @@ def preprocess_data(prefix,attr_prefix,worker,isLabel=False,isFeatures=False,nor broken_count = 0 for node in G.nodes(): - if not 'val' in G.node[node] or not 'test' in G.node[node]: + if not 'val' in G.nodes[node] or not 'test' in G.nodes[node]: G.remove_node(node) broken_count += 1 print("Removed {:d} nodes that lacked proper annotations due to networkx versioning issues".format(broken_count)) @@ -124,16 +138,16 @@ def preprocess_data(prefix,attr_prefix,worker,isLabel=False,isFeatures=False,nor ## (some datasets might already have this..) print("Loaded data.. now preprocessing..") for edge in G.edges(): - if (G.node[edge[0]]['val'] or G.node[edge[1]]['val'] or - G.node[edge[0]]['test'] or G.node[edge[1]]['test']): + if (G.nodes[edge[0]]['val'] or G.nodes[edge[1]]['val'] or + G.nodes[edge[0]]['test'] or G.nodes[edge[1]]['test']): G[edge[0]][edge[1]]['train_removed'] = True else: G[edge[0]][edge[1]]['train_removed'] = False - if(G.node[edge[0]]['val'] and G.node[edge[1]]['val']): + if(G.nodes[edge[0]]['val'] and G.nodes[edge[1]]['val']): G[edge[0]][edge[1]]['validation'] = True else: G[edge[0]][edge[1]]['validation'] = False - if(G.node[edge[0]]['test'] and G.node[edge[1]]['test']): + if(G.nodes[edge[0]]['test'] and G.nodes[edge[1]]['test']): G[edge[0]][edge[1]]['testing'] = True else: G[edge[0]][edge[1]]['testing'] = False @@ -141,7 +155,7 @@ def preprocess_data(prefix,attr_prefix,worker,isLabel=False,isFeatures=False,nor if normalize and not feat_data is None: # comes here only if normalize == true and the data set has feat from sklearn.preprocessing import StandardScaler - train_ids = np.array([node_map[n] for n in G.nodes() if not G.node[n]['val'] and not G.node[n]['test']]) + train_ids = np.array([node_map[n] for n in list(G.nodes()) if not G.nodes[n]['val'] and not G.nodes[n]['test']]) train_feats = feat_data[train_ids] scaler = StandardScaler() scaler.fit(train_feats) @@ -153,11 +167,11 @@ def preprocess_data(prefix,attr_prefix,worker,isLabel=False,isFeatures=False,nor return G, feat_data, node_map, walks, G_local def load_data(prefix, worker,isLabel, normalize=True, load_walks=False): - save_dir = FLAGS.base_log_dir + "/jasminegraph-local_trained_model_store/" + save_dir = FLAGS.base_log_dir + "jasminegraph-local_trained_model_store/" G_data = json.load(open(save_dir + str(FLAGS.graph_id) + "_" + worker + "-G.json")) G = json_graph.node_link_graph(G_data) - if isinstance(G.nodes()[0], int): + if isinstance(G.nodes[0], int): conversion = lambda n: int(n) else: conversion = lambda n: n @@ -184,7 +198,7 @@ def load_data(prefix, worker,isLabel, normalize=True, load_walks=False): ## (necessary because of networkx weirdness with the Reddit data) broken_count = 0 for node in G.nodes(): - if not 'val' in G.node[node] or not 'test' in G.node[node]: + if not 'val' in G.nodes[node] or not 'test' in G.nodes[node]: G.remove_node(node) broken_count += 1 print("Removed {:d} nodes that lacked proper annotations due to networkx versioning issues".format(broken_count)) @@ -193,16 +207,16 @@ def load_data(prefix, worker,isLabel, normalize=True, load_walks=False): ## (some datasets might already have this..) print("Loaded data.. now preprocessing..") for edge in G.edges(): - if (G.node[edge[0]]['val'] or G.node[edge[1]]['val'] or - G.node[edge[0]]['test'] or G.node[edge[1]]['test']): + if (G.nodes[edge[0]]['val'] or G.nodes[edge[1]]['val'] or + G.nodes[edge[0]]['test'] or G.nodes[edge[1]]['test']): G[edge[0]][edge[1]]['train_removed'] = True else: G[edge[0]][edge[1]]['train_removed'] = False - if(G.node[edge[0]]['val'] and G.node[edge[1]]['val']): + if(G.nodes[edge[0]]['val'] and G.nodes[edge[1]]['val']): G[edge[0]][edge[1]]['validation'] = True else: G[edge[0]][edge[1]]['validation'] = False - if(G.node[edge[0]]['test'] and G.node[edge[1]]['test']): + if(G.nodes[edge[0]]['test'] and G.nodes[edge[1]]['test']): G[edge[0]][edge[1]]['testing'] = True else: G[edge[0]][edge[1]]['testing'] = False @@ -210,7 +224,7 @@ def load_data(prefix, worker,isLabel, normalize=True, load_walks=False): if normalize and not feats is None: # comes here only if normalize == true and the data set has feat from sklearn.preprocessing import StandardScaler - train_ids = np.array([id_map[n] for n in G.nodes() if not G.node[n]['val'] and not G.node[n]['test']]) + train_ids = np.array([id_map[n] for n in G.nodes() if not G.nodes[n]['val'] and not G.nodes[n]['test']]) train_feats = feats[train_ids] scaler = StandardScaler() scaler.fit(train_feats) @@ -252,7 +266,7 @@ def run_random_walks(G, nodes, num_walks=N_WALKS): out_file = sys.argv[2] G_data = json.load(open(graph_file)) G = json_graph.node_link_graph(G_data) - nodes = [n for n in G.nodes() if not G.node[n]["val"] and not G.node[n]["test"]] + nodes = [n for n in G.nodes() if not G.nodes[n]["val"] and not G.nodes[n]["test"]] G = G.subgraph(nodes) pairs = run_random_walks(G, nodes) with open(out_file, "w") as fp: From 4770f40d14780d83de7f763b062ad621ee71cb6e Mon Sep 17 00:00:00 2001 From: Kandeeban Date: Mon, 31 Jul 2023 22:49:06 +0530 Subject: [PATCH 23/45] Updated JasminGraphTrainingInitiator.cpp --- .../trainer/JasminGraphTrainingInitiator.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ml/trainer/JasminGraphTrainingInitiator.cpp b/src/ml/trainer/JasminGraphTrainingInitiator.cpp index a3ada3109..f42591db5 100644 --- a/src/ml/trainer/JasminGraphTrainingInitiator.cpp +++ b/src/ml/trainer/JasminGraphTrainingInitiator.cpp @@ -47,8 +47,8 @@ void JasminGraphTrainingInitiator::initiateTrainingLocally(std::string graphID, string attr_prefix = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder"); string trainarg_prefix = "Graphsage Unsupervised_train "; trainingArgs = - trainarg_prefix + trainingArgs + " --train_prefix " + prefix + "/" + graphID + " --train_attr_prefix " + - attr_prefix + "/" + graphID; + trainarg_prefix + trainingArgs + " --train_prefix " + prefix + graphID + " --train_attr_prefix " + + attr_prefix + graphID; std::map::iterator j; @@ -86,7 +86,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[DATA_LENGTH]; + char data[DATA_LENGTH + 1]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -119,7 +119,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int //TODO::exit } - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH + 1); int result_wr = write(sockfd, JasmineGraphInstanceProtocol::HANDSHAKE.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE.size()); if(result_wr < 0) { trainer_log.log("Error writing to socket", "error"); @@ -127,7 +127,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int } trainer_log.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE, "info"); - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH + 1); read(sockfd, data, DATA_LENGTH); string response = (data); @@ -144,7 +144,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int trainer_log.log("Sent : " + server_host, "info"); - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH + 1); read(sockfd, data, DATA_LENGTH); string response = (data); @@ -157,14 +157,14 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int } result_wr = write(sockfd, JasmineGraphInstanceProtocol::INITIATE_TRAIN.c_str(), - JasmineGraphInstanceProtocol::INITIATE_TRAIN.size()); + JasmineGraphInstanceProtocol::INITIATE_TRAIN.size()); if(result_wr < 0) { trainer_log.log("Error writing to socket", "error"); return false; } trainer_log.log("Sent : " + JasmineGraphInstanceProtocol::INITIATE_TRAIN, "info"); - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH + 1); read(sockfd, data, DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -178,7 +178,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int } trainer_log.log("Sent : training args " + trainingArgs, "info"); - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH + 1); read(sockfd, data, DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -192,7 +192,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int trainer_log.log("Sent : partition iteration " + to_string(iteration), "info"); - bzero(data, DATA_LENGTH); + bzero(data, DATA_LENGTH + 1); read(sockfd, data, DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); From 10dfd1641abe6d36e15196e54e752c10f3f52e9a Mon Sep 17 00:00:00 2001 From: Kandeeban Date: Mon, 7 Aug 2023 22:55:03 +0530 Subject: [PATCH 24/45] Fixed issues related to Docker Setup --- CMakeLists.txt | 24 +- Dockerfile | 61 +++- GraphSAGE/graphsage/utils.py | 10 - conf/jasminegraph-server.properties | 12 +- .../trainer/JasminGraphTrainingInitiator.cpp | 6 +- .../trainer/JasmineGraphTrainingSchedular.cpp | 2 + src/partitioner/local/JSONParser.cpp | 2 +- src/partitioner/local/RDFParser.cpp | 2 +- src/server/JasmineGraphInstanceService.cpp | 339 +++++++++--------- src/server/JasmineGraphServer.cpp | 82 +++-- src/server/JasmineGraphServer.h | 5 +- src_python/merge_new.py | 79 ++++ 12 files changed, 360 insertions(+), 264 deletions(-) mode change 100755 => 100644 CMakeLists.txt create mode 100644 src_python/merge_new.py diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 index 3002dbfd1..65d3e2951 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,31 +48,19 @@ if(CMAKE_ENABLE_DEBUG) target_compile_options(JasmineGraph PRIVATE -g) endif() -target_link_libraries(JasmineGraph /usr/local/lib/libmetis.so) -target_link_libraries(JasmineGraph /usr/local/lib/libxerces-c-3.2.so) #TODO: Need to install the library separately target_link_libraries(JasmineGraph sqlite3) target_link_libraries(JasmineGraph pthread) target_link_libraries(JasmineGraph rdkafka) -#target_link_libraries(JasmineGraph cppkafka) target_link_libraries(JasmineGraph Threads::Threads) -include_directories("$ENV{HOME}/software/flatbuffers/include") -include_directories("$ENV{HOME}/software/xerces/include") -include_directories("$ENV{HOME}/software/spdlog/include") -include_directories("$ENV{HOME}/software/jsoncpp/include") -include_directories("$ENV{HOME}/software/cppkafka/include") -include_directories("$ENV{HOME}/software/nlohmann_json/include") - -#target_link_libraries(JasmineGraph /usr/local/lib/libmetis.a) -#target_link_libraries(JasmineGraph $ENV{HOME}/software/xerces-c-3.2.3/lib/libxerces-c.so) -target_link_libraries(JasmineGraph $ENV{HOME}/software/flatbuffers/libflatbuffers.a) -include_directories("$ENV{HOME}/software/xerces-c-3.2.3/include") -target_link_libraries(JasmineGraph $ENV{HOME}/software/jsoncpp/build/debug/src/lib_json/libjsoncpp.a) +target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libxerces-c.so) +target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libflatbuffers.a) +target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libjsoncpp.a) target_link_libraries(JasmineGraph /usr/local/lib/libcppkafka.so) -set(PYTHON_EXECUTABLE "/usr/local/bin/python3.11") -set(PYTHON_INCLUDE_DIRS "/usr/local/include/python3.11") -set(PYTHON_LIBRARIES "/usr/local/lib/libpython3.11.so") +set(PYTHON_EXECUTABLE "/usr/bin/python3.11") +set(PYTHON_INCLUDE_DIR "/usr/include/python3.11m") +set(PYTHON_LIBRARIES "/usr/lib/x86_64-linux-gnu/libpython3.11.so") include_directories(${PYTHON_INCLUDE_DIRS}) include_directories(${PYTHON_DIRECTORIES}) diff --git a/Dockerfile b/Dockerfile index cea04965e..8d0ea76c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,50 @@ -FROM miyurud/jasminegraph +FROM ubuntu:focal +WORKDIR /home/ubuntu +RUN mkdir software WORKDIR /home/ubuntu/software + RUN apt-get update -COPY . jasminegraph/ +RUN apt-get install --no-install-recommends -y apt-transport-https +RUN apt-get update +RUN apt-get install --no-install-recommends -y curl gnupg2 ca-certificates software-properties-common nlohmann-json3-dev +RUN apt-get install --no-install-recommends -y git cmake build-essential sqlite3 libsqlite3-dev libssl-dev librdkafka-dev libboost-all-dev libtool libxerces-c-dev libflatbuffers-dev +RUN add-apt-repository ppa:deadsnakes/ppa +RUN apt-get install --no-install-recommends -y python3.11-dev +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py +RUN apt-get install --no-install-recommends -y libjsoncpp-dev libspdlog-dev pigz +RUN python3.11 get-pip.py + +RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - +RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" +RUN apt-get update +RUN apt-get install --no-install-recommends -y docker-ce-cli + +RUN git clone --single-branch --depth 1 https://github.com/mfontanini/cppkafka.git + +WORKDIR /home/ubuntu/software +RUN git clone --single-branch --depth 1 --branch v5.1.1-DistDGL-v0.5 https://github.com/KarypisLab/METIS.git +WORKDIR /home/ubuntu/software/METIS +RUN git submodule update --init +RUN make config shared=1 cc=gcc prefix=/usr/local +RUN make install + +RUN mkdir /home/ubuntu/software/cppkafka/build +WORKDIR /home/ubuntu/software/cppkafka/build +RUN cmake .. +RUN make -j4 +RUN make install + ENV HOME="/home/ubuntu" -RUN mkdir -p /var/tmp/nmon -WORKDIR /home/ubuntu/software/jasminegraph -RUN apt-get update && \ - sed -i '/target_link_libraries(JasmineGraph \/usr\/local\/lib\/libmetis.so)/c\target_link_libraries(JasmineGraph \/usr\/local\/lib\/libmetis.so)' CMakeLists.txt && \ - sed -i '/target_link_libraries(JasmineGraph \/usr\/local\/lib\/libxerces-c-3.2.so)/c\target_link_libraries(JasmineGraph \/usr\/local\/lib\/libxerces-c-3.2.so)' CMakeLists.txt && \ - sed -i '/target_link_libraries(JasmineGraph \/usr\/local\/lib\/libmetis.a)/c\#target_link_libraries(JasmineGraph \/usr\/local\/lib\/libmetis.a)' CMakeLists.txt && \ - sed -i '/target_link_libraries(JasmineGraph $ENV{HOME}\/software\/xerces-c-3.2.2\/lib\/libxerces-c.so)/c\#target_link_libraries(JasmineGraph $ENV{HOME}\/software\/xerces-c-3.2.2\/lib\/libxerces-c.so)' CMakeLists.txt && \ - sed -i '/target_link_libraries(JasmineGraph \/opt\/lib\/libxerces-c.a)/c\#target_link_libraries(JasmineGraph \/opt\/lib\/libxerces-c.a)' CMakeLists.txt && \ - sed -i '/target_link_libraries(JasmineGraph $ENV{HOME}\/software\/cppkafka\/build\/usr\/local\/lib\/libcppkafka.so)/c\target_link_libraries(JasmineGraph \/usr\/local\/lib\/libcppkafka.so)' CMakeLists.txt && \ - sed -i '/namespace JasminGraph.Edgestore;/c\namespace JasmineGraph.Edgestore;' src/util/dbutil/edgestore.fbs && \ - sed -i '/org.jasminegraph.partitioner.metis.bin=home\/ubuntu\/software\/metis-5.1.0\/bin/c\org.jasminegraph.partitioner.metis.bin=\/home\/ubuntu\/software\/metis\/metis-5.1.0\/bin' conf/jasminegraph-server.properties -WORKDIR /home/ubuntu/software/flatbuffers -RUN ./flatc --cpp -o /home/ubuntu/software/jasminegraph/src/util/dbutil /home/ubuntu/software/jasminegraph/src/util/dbutil/edgestore.fbs && \ - ./flatc --cpp -o /home/ubuntu/software/jasminegraph/src/util/dbutil /home/ubuntu/software/jasminegraph/src/util/dbutil/attributestore.fbs && \ - ./flatc --cpp -o /home/ubuntu/software/jasminegraph/src/util/dbutil /home/ubuntu/software/jasminegraph/src/util/dbutil/partedgemapstore.fbs -WORKDIR /home/ubuntu/software/jasminegraph ENV JASMINEGRAPH_HOME="/home/ubuntu/software/jasminegraph" +RUN mkdir /home/ubuntu/software/jasminegraph +WORKDIR /home/ubuntu/software/jasminegraph +COPY ./GraphSAGE/requirements ./GraphSAGE/requirements +RUN pip install -r ./GraphSAGE/requirements +RUN apt-get install net-tools -y +RUN apt-get install netcat -y +RUN apt-get install telnet -y +COPY . . + RUN sh build.sh ENTRYPOINT ["/home/ubuntu/software/jasminegraph/run-docker.sh"] CMD ["bash"] diff --git a/GraphSAGE/graphsage/utils.py b/GraphSAGE/graphsage/utils.py index a9665884b..5fc69dda1 100644 --- a/GraphSAGE/graphsage/utils.py +++ b/GraphSAGE/graphsage/utils.py @@ -23,16 +23,6 @@ flags = tf.app.flags FLAGS = flags.FLAGS -def log_dir(): - - log_dir = FLAGS.base_log_dir + "jasminegraph-local_trained_model_store/" - log_dir += "{graph_id:s}_model_{train_worker:s}".format( - graph_id = FLAGS.train_prefix.split("/")[-1], - train_worker = FLAGS.train_worker - ) - if not os.path.exists(log_dir): - os.makedirs(log_dir) - return log_dir def preprocess_data(prefix,attr_prefix,worker,isLabel=False,isFeatures=False,normalize=True,load_walks=False): diff --git a/conf/jasminegraph-server.properties b/conf/jasminegraph-server.properties index 1d6542d44..9d19e01a2 100644 --- a/conf/jasminegraph-server.properties +++ b/conf/jasminegraph-server.properties @@ -22,7 +22,7 @@ org.jasminegraph.server.host=localhost #Number of workers JasmineGraph cluster should use if it was not specified as a console argument org.jasminegraph.server.nworkers=2 #org.jasminegraph.server.npartitions is the number of partitions into which the graph should be partitioned -org.jasminegraph.server.npartitions=1 +org.jasminegraph.server.npartitions=2 org.jasminegraph.server.streaming.kafka.host=127.0.0.1:9092 #org.jasminegraph.server.runtime.location is the location where temporary files of JasmineGraph master is kept org.jasminegraph.server.runtime.location=./tmp @@ -32,14 +32,14 @@ org.jasminegraph.worker.path=/var/tmp/jasminegraph/ #if it is empty please leave a space, else it will cause an issue org.jasminegraph.artifact.path= #org.jasminegraph.partitioner.metis.bin is the location where the METIS graph partitioner's gpmetis executable is installed -org.jasminegraph.partitioner.metis.bin=/home/ubuntu/software/metis/metis-5.1.0/bin +org.jasminegraph.partitioner.metis.bin=/usr/local/bin #The following folder is the location where workers keep their data. #This is the location where the actual data storage takes place in JasmineGraph. org.jasminegraph.server.instance.datafolder=/var/tmp/jasminegraph-localstore #The folder path for keeping central stores for triangle count aggregation org.jasminegraph.server.instance.aggregatefolder=/var/tmp/jasminegraph-aggregate org.jasminegraph.server.instance.trainedmodelfolder=/var/tmp/jasminegraph-localstore/jasminegraph-local_trained_model_store -org.jasminegraph.graphsage=/var/tmp/jasminegraph/GraphSAGE/graphsage/ +org.jasminegraph.graphsage=/var/tmp/jasminegraph/GraphSAGE/graphsage #This parameter controls the nmon stat collection enable and disable org.jasminegraph.server.enable.nmon=false; #This parameter holds the path to nmon stat file @@ -67,8 +67,8 @@ org.jasminegraph.fl.num.orgs=1 org.jasminegraph.fl.weights.file=/var/tmp/jasminegraph-localstore/weights.txt org.jasminegraph.fl.flag.file=/var/tmp/jasminegraph-localstore/flag.txt org.jasminegraph.fl.aggregator=true -org.jasminegraph.fl.org.training=true -org.jasminegraph.fl.organization.file=/home/ubuntu/software/jasminegraph/conf/orgs_details.txt +org.jasminegraph.fl.org.training=false +org.jasminegraph.fl.organization.file=/home/ubuntu/software/jasminegraph/conf/hosts.txt #-------------------------------------------------------------------------------- @@ -89,4 +89,4 @@ org.jasminegraph.performance.db.location=./performancedb/jasminegraph_performanc #-------------------------------------------------------------------------------- #Java 1.6 Jetty -org.acacia.ui.jetty.home=/home/ubuntu/software/jetty-distribution-8.1.9.v20130131 \ No newline at end of file +org.acacia.ui.jetty.home=/home/ubuntu/software/jetty-distribution-8.1.9.v20130131 diff --git a/src/ml/trainer/JasminGraphTrainingInitiator.cpp b/src/ml/trainer/JasminGraphTrainingInitiator.cpp index f42591db5..4baa0e249 100644 --- a/src/ml/trainer/JasminGraphTrainingInitiator.cpp +++ b/src/ml/trainer/JasminGraphTrainingInitiator.cpp @@ -47,8 +47,8 @@ void JasminGraphTrainingInitiator::initiateTrainingLocally(std::string graphID, string attr_prefix = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder"); string trainarg_prefix = "Graphsage Unsupervised_train "; trainingArgs = - trainarg_prefix + trainingArgs + " --train_prefix " + prefix + graphID + " --train_attr_prefix " + - attr_prefix + graphID; + trainarg_prefix + trainingArgs + " --train_prefix " + prefix + "/" + graphID + " --train_attr_prefix " + + attr_prefix + "/" + graphID; std::map::iterator j; @@ -157,7 +157,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int } result_wr = write(sockfd, JasmineGraphInstanceProtocol::INITIATE_TRAIN.c_str(), - JasmineGraphInstanceProtocol::INITIATE_TRAIN.size()); + JasmineGraphInstanceProtocol::INITIATE_TRAIN.size()); if(result_wr < 0) { trainer_log.log("Error writing to socket", "error"); return false; diff --git a/src/ml/trainer/JasmineGraphTrainingSchedular.cpp b/src/ml/trainer/JasmineGraphTrainingSchedular.cpp index 1fd59c804..bd59f649f 100644 --- a/src/ml/trainer/JasmineGraphTrainingSchedular.cpp +++ b/src/ml/trainer/JasmineGraphTrainingSchedular.cpp @@ -31,6 +31,8 @@ map> JasmineGraphTrainingSchedular::schedulePartition string sqlStatement = "SELECT host_idhost, name FROM worker_has_partition INNER JOIN worker ON worker_idworker = " "idworker WHERE partition_graph_idgraph = " + graphID + " group by host_idhost"; + + std::vector>> result = refToSqlite.runSelect(sqlStatement); for (vector>>::iterator i = result.begin(); i != result.end(); ++i) { int count = 0; diff --git a/src/partitioner/local/JSONParser.cpp b/src/partitioner/local/JSONParser.cpp index b854dc141..13ea0541b 100644 --- a/src/partitioner/local/JSONParser.cpp +++ b/src/partitioner/local/JSONParser.cpp @@ -20,7 +20,7 @@ limitations under the License. #include #include -#include "json/json.h" +#include #include #include #include diff --git a/src/partitioner/local/RDFParser.cpp b/src/partitioner/local/RDFParser.cpp index cd97b474e..7f8fadaac 100644 --- a/src/partitioner/local/RDFParser.cpp +++ b/src/partitioner/local/RDFParser.cpp @@ -136,7 +136,7 @@ GetConfig::~GetConfig() { */ void GetConfig::readConfigFile(string &configFile, int graphId) -throw(std::runtime_error) { +/* throw(std::runtime_error) */ { struct stat fileStatus; this->graphID = graphId; diff --git a/src/server/JasmineGraphInstanceService.cpp b/src/server/JasmineGraphInstanceService.cpp index f6bf80b2e..d565e0a43 100644 --- a/src/server/JasmineGraphInstanceService.cpp +++ b/src/server/JasmineGraphInstanceService.cpp @@ -67,10 +67,10 @@ void *instanceservicesession(void *dummyPt) { utils.createDirectory(utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder")); - char data[INSTANCE_DATA_LENGTH]; + char data[INSTANCE_DATA_LENGTH + 1]; bool loop = false; while (!loop) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string line = (data); @@ -87,7 +87,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::HANDSHAKE_OK.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE_OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE_OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); line = utils.trim_copy(line, " \f\n\r\t\v"); @@ -110,7 +110,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -118,14 +118,14 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); instance_logger.log("Received File name: " + fileName, "info"); write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); // int fileSize = atoi(size.c_str()); @@ -139,7 +139,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::FILE_RECV_CHK) == 0) { @@ -153,7 +153,7 @@ void *instanceservicesession(void *dummyPt) { continue; } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -178,7 +178,7 @@ void *instanceservicesession(void *dummyPt) { pthread_mutex_unlock(&file_lock); while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -189,7 +189,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -203,7 +203,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CENTRAL, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -211,7 +211,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -219,7 +219,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -233,7 +233,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -249,7 +249,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -269,7 +269,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -280,7 +280,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -293,7 +293,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_COMPOSITE_CENTRAL, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -301,7 +301,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -309,7 +309,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -323,7 +323,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -339,7 +339,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -359,7 +359,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -370,7 +370,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -383,7 +383,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::UPLOAD_RDF_ATTRIBUTES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -391,7 +391,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); // fileName = utils.trim_copy(fileName, " \f\n\r\t\v"); @@ -399,7 +399,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -412,7 +412,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::FILE_RECV_CHK) == 0) { @@ -427,7 +427,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -447,7 +447,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -458,7 +458,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -471,7 +471,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::UPLOAD_RDF_ATTRIBUTES_CENTRAL, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -479,7 +479,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); // fileName = utils.trim_copy(fileName, " \f\n\r\t\v"); @@ -487,7 +487,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -500,7 +500,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::FILE_RECV_CHK) == 0) { @@ -515,7 +515,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -535,7 +535,7 @@ void *instanceservicesession(void *dummyPt) { fullFilePath = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -546,7 +546,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -559,7 +559,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::DELETE_GRAPH, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -567,7 +567,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_PARTITION_ID.c_str(), JasmineGraphInstanceProtocol::SEND_PARTITION_ID.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_PARTITION_ID, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); instance_logger.log("Received partition ID: " + partitionID, "info"); @@ -583,7 +583,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::DELETE_GRAPH_FRAGMENT, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); // Read the message read(connFd, data, INSTANCE_DATA_LENGTH); // Get graph ID from message @@ -603,7 +603,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : DP_CENTRALSTORE from server", "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -612,7 +612,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -621,7 +621,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -640,7 +640,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -649,7 +649,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -674,7 +674,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -683,7 +683,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -692,7 +692,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -715,7 +715,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -724,7 +724,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -748,7 +748,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -757,7 +757,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -766,7 +766,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -790,7 +790,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -799,7 +799,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -808,7 +808,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -824,7 +824,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphVertexCount = (data); graphVertexCount = utils.trim_copy(graphVertexCount, " \f\n\r\t\v"); @@ -833,7 +833,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string alphaValue = (data); alphaValue = utils.trim_copy(alphaValue, " \f\n\r\t\v"); @@ -844,7 +844,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string iterationsValue = (data); iterationsValue = utils.trim_copy(iterationsValue, " \f\n\r\t\v"); @@ -904,7 +904,7 @@ void *instanceservicesession(void *dummyPt) { string host = workerSocketPair[0]; int port = stoi(workerSocketPair[1]); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -983,7 +983,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -992,7 +992,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -1001,7 +1001,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -1017,7 +1017,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphVertexCount = (data); graphVertexCount = utils.trim_copy(graphVertexCount, " \f\n\r\t\v"); @@ -1026,7 +1026,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string alphaValue = (data); alphaValue = utils.trim_copy(alphaValue, " \f\n\r\t\v"); @@ -1037,7 +1037,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string iterationsValue = (data); iterationsValue = utils.trim_copy(iterationsValue, " \f\n\r\t\v"); @@ -1084,7 +1084,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -1093,7 +1093,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -1102,7 +1102,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = data; workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -1135,7 +1135,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); @@ -1144,7 +1144,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -1153,7 +1153,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string workerList = (data); workerList = utils.trim_copy(workerList, " \f\n\r\t\v"); @@ -1211,21 +1211,21 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::TRIANGLES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphID, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionId = (data); partitionId = utils.trim_copy(partitionId, " \f\n\r\t\v"); instance_logger.log("Received Partition ID: " + partitionId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -1260,7 +1260,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -1268,7 +1268,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -1282,7 +1282,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1298,7 +1298,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1337,7 +1337,7 @@ void *instanceservicesession(void *dummyPt) { std::string movedFullFilePath = aggregatorFilePath + "/" + rawname; while (!utils.fileExists(movedFullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -1348,7 +1348,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -1363,7 +1363,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_NAME.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); @@ -1371,7 +1371,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -1385,7 +1385,7 @@ void *instanceservicesession(void *dummyPt) { while (true) { if (utils.fileExists(fullFilePath)) { while (utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1401,7 +1401,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1440,7 +1440,7 @@ void *instanceservicesession(void *dummyPt) { std::string movedFullFilePath = aggregatorFilePath + "/" + rawname; while (!utils.fileExists(movedFullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -1451,7 +1451,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -1464,28 +1464,28 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::AGGREGATE_CENTRALSTORE_TRIANGLES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphId = (data); graphId = utils.trim_copy(graphId, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionId = (data); partitionId = utils.trim_copy(partitionId, " \f\n\r\t\v"); instance_logger.log("Received Partition ID: " + partitionId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionIdList = (data); partitionIdList = utils.trim_copy(partitionIdList, " \f\n\r\t\v"); instance_logger.log("Received Partition ID List : " + partitionIdList, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -1532,7 +1532,7 @@ void *instanceservicesession(void *dummyPt) { std::string chunk = chunksVector.at(loopCount); write(connFd, chunk.c_str(), chunk.size()); } else { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string chunkStatus = (data); std::string chunk = chunksVector.at(loopCount); @@ -1545,14 +1545,14 @@ void *instanceservicesession(void *dummyPt) { "Received : " + JasmineGraphInstanceProtocol::AGGREGATE_COMPOSITE_CENTRALSTORE_TRIANGLES, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string availableFiles = (data); availableFiles = utils.trim_copy(availableFiles, " \f\n\r\t\v"); instance_logger.log("Received Available Files: " + availableFiles, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -1562,8 +1562,8 @@ void *instanceservicesession(void *dummyPt) { while (status == "/SEND") { write(connFd, status.c_str(), status.size()); - bzero(data, 301); - read(connFd, data, 300); + bzero(data, INSTANCE_DATA_LENGTH + 1); + read(connFd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); status = response.substr(response.size() - 5); @@ -1575,7 +1575,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received Composite File List : " + compositeFileList, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -1620,7 +1620,7 @@ void *instanceservicesession(void *dummyPt) { std::string chunk = chunksVector.at(loopCount); write(connFd, chunk.c_str(), chunk.size()); } else { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string chunkStatus = (data); std::string chunk = chunksVector.at(loopCount); @@ -1632,14 +1632,14 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::PERFORMANCE_STATISTICS, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string isVMStatManager = (data); isVMStatManager = utils.trim_copy(isVMStatManager, " \f\n\r\t\v"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string isResourceAllocationRequired = (data); isResourceAllocationRequired = utils.trim_copy(isResourceAllocationRequired, " \f\n\r\t\v"); @@ -1836,7 +1836,7 @@ void *instanceservicesession(void *dummyPt) { std::string chunk = chunksVector.at(loopCount); write(connFd, chunk.c_str(), chunk.size()); } else { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string chunkStatus = (data); std::string chunk = chunksVector.at(loopCount); @@ -1847,7 +1847,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_TRAIN, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string trainData(data); @@ -1878,7 +1878,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_PARTITION_ITERATION.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_PARTITION_ITERATION, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partIteration(data); @@ -1886,7 +1886,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_PARTITION_ITERATION.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_PARTITION_COUNT, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partCount(data); @@ -1898,19 +1898,19 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_PREDICT, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphID, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string vertexCount = (data); vertexCount = utils.trim_copy(vertexCount, " \f\n\r\t\v"); instance_logger.log("Received vertexCount: " + vertexCount, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string ownPartitions = (data); ownPartitions = utils.trim_copy(ownPartitions, " \f\n\r\t\v"); @@ -1921,8 +1921,8 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_HOSTS.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_HOSTS, "info"); - char dataBuffer[INSTANCE_LONG_DATA_LENGTH]; - bzero(dataBuffer, INSTANCE_LONG_DATA_LENGTH); + char dataBuffer[INSTANCE_LONG_DATA_LENGTH + 1]; + bzero(dataBuffer, INSTANCE_LONG_DATA_LENGTH + 1); read(connFd, dataBuffer, INSTANCE_LONG_DATA_LENGTH); string hostList = (dataBuffer); instance_logger.log("Received Hosts List: " + hostList, "info"); @@ -1962,7 +1962,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); instance_logger.log("Received File name: " + fileName, "info"); @@ -1970,7 +1970,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -1982,7 +1982,7 @@ void *instanceservicesession(void *dummyPt) { utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + fileName; int fileSize = atoi(size.c_str()); while (utils.fileExists(fullFilePath) && utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -1992,7 +1992,7 @@ void *instanceservicesession(void *dummyPt) { } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -2016,7 +2016,7 @@ void *instanceservicesession(void *dummyPt) { std::transform(predictargs.begin(), predictargs.end(), std::back_inserter(predict_agrs_vector), converter); std::string path = "cd " + utils.getJasmineGraphProperty("org.jasminegraph.graphsage") + " && "; - std::string command = path + "python3.5 predict.py "; + std::string command = path + "python3.11 predict.py "; int argc = predictargs.size(); for (int i = 0; i < argc; ++i) { @@ -2031,31 +2031,31 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_MODEL_COLLECTION, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string serverHostName = (data); serverHostName = utils.trim_copy(serverHostName, " \f\n\r\t\v"); instance_logger.log("Received HostName: " + serverHostName, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string serverHostPort = (data); serverHostPort = utils.trim_copy(serverHostPort, " \f\n\r\t\v"); instance_logger.log("Received Port: " + serverHostPort, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string serverHostDataPort = (data); serverHostDataPort = utils.trim_copy(serverHostDataPort, " \f\n\r\t\v"); instance_logger.log("Received Data Port: " + serverHostDataPort, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphID = (data); graphID = utils.trim_copy(graphID, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphID, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionID = (data); partitionID = utils.trim_copy(partitionID, " \f\n\r\t\v"); @@ -2073,14 +2073,14 @@ void *instanceservicesession(void *dummyPt) { int fileSize = utils.getFileSize(filePath); std::string fileLength = to_string(fileSize); // send file name - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); if (line.compare(JasmineGraphInstanceProtocol::SEND_FILE_NAME) == 0) { write(connFd, fileName.c_str(), fileName.size()); instance_logger.log("Sent : File name " + fileName, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); // send file length @@ -2089,7 +2089,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, fileLength.c_str(), fileLength.size()); instance_logger.log("Sent : File length in bytes " + fileLength, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); // send content @@ -2107,7 +2107,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::FILE_RECV_CHK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::FILE_RECV_CHK, "info"); instance_logger.log("Checking if file is received", "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -2127,7 +2127,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK.c_str(), JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); line = (data); @@ -2146,7 +2146,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::INITIATE_FRAGMENT_RESOLUTION, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string listOfPartitions = (data); listOfPartitions = utils.trim_copy(listOfPartitions, " \f\n\r\t\v"); @@ -2158,7 +2158,7 @@ void *instanceservicesession(void *dummyPt) { JasmineGraphInstanceProtocol::FRAGMENT_RESOLUTION_CHK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::FRAGMENT_RESOLUTION_CHK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string listOfPartitions = (data); @@ -2239,7 +2239,7 @@ void *instanceservicesession(void *dummyPt) { write(connFd, JasmineGraphInstanceProtocol::SEND_FILE_TYPE.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_TYPE.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_TYPE, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileType = (data); fileType = utils.trim_copy(fileType, " \f\n\r\t\v"); @@ -2247,14 +2247,14 @@ void *instanceservicesession(void *dummyPt) { if (fileType.compare(JasmineGraphInstanceProtocol::FILE_TYPE_CENTRALSTORE_AGGREGATE) == 0) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string graphId = (data); graphId = utils.trim_copy(graphId, " \f\n\r\t\v"); instance_logger.log("Received Graph ID: " + graphId, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string partitionId = (data); partitionId = utils.trim_copy(partitionId, " \f\n\r\t\v"); @@ -2277,7 +2277,7 @@ void *instanceservicesession(void *dummyPt) { } else if (fileType.compare(JasmineGraphInstanceProtocol::FILE_TYPE_CENTRALSTORE_COMPOSITE) == 0) { write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string fileName = (data); fileName = utils.trim_copy(fileName, " \f\n\r\t\v"); @@ -2345,7 +2345,7 @@ void *instanceservicesession(void *dummyPt) { instance_logger.log("Received : " + JasmineGraphInstanceProtocol::SEND_PRIORITY, "info"); write(connFd, JasmineGraphInstanceProtocol::OK.c_str(), JasmineGraphInstanceProtocol::OK.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::OK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(connFd, data, INSTANCE_DATA_LENGTH); string priority = (data); priority = utils.trim_copy(priority, " \f\n\r\t\v"); @@ -2357,11 +2357,12 @@ void *instanceservicesession(void *dummyPt) { } instance_logger.log("Closing thread " + to_string(pthread_self()), "info"); close(connFd); + return NULL; } JasmineGraphInstanceService::JasmineGraphInstanceService() {} -int JasmineGraphInstanceService::run(string profile, string masterHost, string host, int serverPort, +void JasmineGraphInstanceService::run(string profile, string masterHost, string host, int serverPort, int serverDataPort) { int listenFd; socklen_t len; @@ -2372,7 +2373,7 @@ int JasmineGraphInstanceService::run(string profile, string masterHost, string h listenFd = socket(AF_INET, SOCK_STREAM, 0); if (listenFd < 0) { std::cerr << "Cannot open socket" << std::endl; - return 0; + return; } bzero((char *)&svrAdd, sizeof(svrAdd)); @@ -2391,7 +2392,7 @@ int JasmineGraphInstanceService::run(string profile, string masterHost, string h // bind socket if (bind(listenFd, (struct sockaddr *)&svrAdd, sizeof(svrAdd)) < 0) { std::cerr << "Cannot bind on port " + serverPort << std::endl; - return 0; + return; } listen(listenFd, 10); @@ -2899,7 +2900,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[INSTANCE_DATA_LENGTH]; + char data[INSTANCE_DATA_LENGTH + 1]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2929,10 +2930,10 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi std::cerr << "ERROR connecting" << std::endl; // TODO::exit } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); write(sockfd, JasmineGraphInstanceProtocol::HANDSHAKE.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); @@ -2948,7 +2949,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi JasmineGraphInstanceProtocol::INITIATE_MODEL_COLLECTION.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::INITIATE_MODEL_COLLECTION, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -2978,14 +2979,14 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi JasmineGraphInstanceProtocol::SEND_FILE_NAME.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_NAME, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string fileName = (data); instance_logger.log("Received File name: " + fileName, "info"); write(sockfd, JasmineGraphInstanceProtocol::SEND_FILE_LEN.c_str(), JasmineGraphInstanceProtocol::SEND_FILE_LEN.size()); instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::SEND_FILE_LEN, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string size = (data); instance_logger.log("Received file size in bytes: " + size, "info"); @@ -2997,7 +2998,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder") + "/" + fileName; int fileSize = atoi(size.c_str()); while (utils.fileExists(fullFilePath) && utils.getFileSize(fullFilePath) < fileSize) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3007,7 +3008,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3027,7 +3028,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi utils.getJasmineGraphProperty("org.jasminegraph.server.instance.trainedmodelfolder") + "/" + rawname; while (!utils.fileExists(fullFilePath)) { - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -3038,7 +3039,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_WAIT, "info"); } } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); if (response.compare(JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK) == 0) { @@ -3166,7 +3167,7 @@ void JasmineGraphInstanceService::trainPartition(string trainData) { std::transform(trainargs.begin(), trainargs.end(), std::back_inserter(vc), converter); std::string path = "cd " + utils.getJasmineGraphProperty("org.jasminegraph.graphsage") + " && "; - std::string command = path + "python3 -m unsupervised_train "; + std::string command = path + "python3.11 -m unsupervised_train "; int argc = trainargs.size(); for (int i = 0; i < argc - 2; ++i) { @@ -3267,7 +3268,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[INSTANCE_DATA_LENGTH]; + char data[INSTANCE_DATA_LENGTH + 1]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -3300,7 +3301,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int //TODO::exit } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); int result_wr = write(sockfd, JasmineGraphInstanceProtocol::HANDSHAKE.c_str(), JasmineGraphInstanceProtocol::HANDSHAKE.size()); if(result_wr < 0) { @@ -3308,7 +3309,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::HANDSHAKE, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); @@ -3324,7 +3325,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + masterIP, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3342,7 +3343,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CENTRAL, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -3360,7 +3361,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int int fileSize = utils.getFileSize(centralStoreFile); std::string fileLength = to_string(fileSize); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -3374,7 +3375,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : File name " + fileName, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3387,7 +3388,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : File length in bytes " + fileLength, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); if (response.compare(JasmineGraphInstanceProtocol::SEND_FILE_CONT) == 0) { @@ -3409,7 +3410,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::FILE_RECV_CHK, "info"); instance_logger.log("Checking if file is received", "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); if (response.compare(JasmineGraphInstanceProtocol::FILE_RECV_WAIT) == 0) { @@ -3434,7 +3435,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int } instance_logger.log("Sent : " + JasmineGraphInstanceProtocol::BATCH_UPLOAD_CHK, "info"); - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); response = (data); @@ -3463,7 +3464,7 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[INSTANCE_DATA_LENGTH]; + char data[INSTANCE_DATA_LENGTH + 1]; socklen_t len; struct sockaddr_in serv_addr; struct hostent *server; @@ -3472,7 +3473,7 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return false; } server = gethostbyname(host.c_str()); @@ -3497,7 +3498,7 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d instance_logger.log("Error writing to socket", "error"); } - bzero(data, INSTANCE_DATA_LENGTH); + bzero(data, INSTANCE_DATA_LENGTH + 1); read(sockfd, data, INSTANCE_DATA_LENGTH); string response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); @@ -3509,7 +3510,7 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d if (fp == NULL) { instance_logger.log("Error opening file", "error"); close(sockfd); - return 0; + return false; } for (;;) { @@ -3535,7 +3536,9 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d fclose(fp); close(sockfd); + return true; } + return false; } map calculateOutDegreeDist(string graphID, string partitionID, int serverPort, @@ -3575,7 +3578,7 @@ map calculateOutDegreeDist(string graphID, string partitionID, int s string host = workerSocketPair[0]; int port = stoi(workerSocketPair[1]); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -3790,7 +3793,7 @@ map calculateInDegreeDist(string graphID, string partitionID, int se string host = workerSocketPair[0]; int port = stoi(workerSocketPair[1]); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -4031,7 +4034,7 @@ void calculateEgoNet(string graphID, string partitionID, string host = workerSocketPair[0]; int port = stoi(workerSocketPair[1]); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -4477,7 +4480,7 @@ void JasmineGraphInstanceService::initServer(string trainData){ std::transform(trainargs.begin(), trainargs.end(), std::back_inserter(vc), converter); std::string path = "cd " + utils.getJasmineGraphProperty("org.jasminegraph.fl.location") + " && "; - std::string command = path + "python3 fl_server.py "+ utils.getJasmineGraphProperty("org.jasminegraph.fl.weights") + " " + std::string command = path + "python3.11 fl_server.py "+ utils.getJasmineGraphProperty("org.jasminegraph.fl.weights") + " " + utils.getJasmineGraphProperty("org.jasminegraph.fl.dataDir") + " " + utils.getJasmineGraphProperty("org.jasminegraph.fl.dataDir")+ " "+ graphID + " 0 " + utils.getJasmineGraphProperty("org.jasminegraph.fl_clients") @@ -4502,7 +4505,7 @@ void JasmineGraphInstanceService::initOrgServer(string trainData){ std::transform(trainargs.begin(), trainargs.end(), std::back_inserter(vc), converter); std::string path = "cd " + utils.getJasmineGraphProperty("org.jasminegraph.fl.location") + " && "; - std::string command = path + "python3 org_server.py " + graphID+ " " + utils.getJasmineGraphProperty("org.jasminegraph.fl_clients") + std::string command = path + "python3.11 org_server.py " + graphID+ " " + utils.getJasmineGraphProperty("org.jasminegraph.fl_clients") + " " + utils.getJasmineGraphProperty("org.jasminegraph.fl.epochs") +" localhost 5050 > org_server_logs.txt"; popen(command.c_str(), "r"); @@ -4525,7 +4528,7 @@ void JasmineGraphInstanceService::initAgg(string trainData){ std::transform(trainargs.begin(), trainargs.end(), std::back_inserter(vc), converter); std::string path = "cd " + utils.getJasmineGraphProperty("org.jasminegraph.fl.location") + " && "; - std::string command = path + "python3 org_agg.py "+ " " + std::string command = path + "python3.11 org_agg.py "+ " " + utils.getJasmineGraphProperty("org.jasminegraph.fl.dataDir") + " " + utils.getJasmineGraphProperty("org.jasminegraph.fl.dataDir")+ " " + "4" + " 0 " + utils.getJasmineGraphProperty("org.jasminegraph.fl.num.orgs") @@ -4551,7 +4554,7 @@ void JasmineGraphInstanceService::initClient(string trainData){ std::transform(trainargs.begin(), trainargs.end(), std::back_inserter(vc), converter); std::string path = "cd " + utils.getJasmineGraphProperty("org.jasminegraph.fl.location") + " && "; - std::string command = path + "python3 fl_client.py "+ utils.getJasmineGraphProperty("org.jasminegraph.fl.weights") + " " + std::string command = path + "python3.11 fl_client.py "+ utils.getJasmineGraphProperty("org.jasminegraph.fl.weights") + " " + utils.getJasmineGraphProperty("org.jasminegraph.fl.dataDir") + " " + utils.getJasmineGraphProperty("org.jasminegraph.fl.dataDir")+ " "+ graphID + " " + partitionID + " " + utils.getJasmineGraphProperty("org.jasminegraph.fl.epochs") @@ -4569,7 +4572,7 @@ void JasmineGraphInstanceService::mergeFiles(string trainData){ string partitionID = trainargs[2]; std::string path = "cd " + utils.getJasmineGraphProperty("org.jasminegraph.fl.location") + " && "; - std::string command = path + "python3 merge.py "+ utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder")+ " " + std::string command = path + "python3.11 merge.py "+ utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder")+ " " + utils.getJasmineGraphProperty("org.jasminegraph.server.instance.trainedmodelfolder") + " " + utils.getJasmineGraphProperty("org.jasminegraph.fl.dataDir") + " " + graphID + " " + partitionID + " > merge_logs" + partitionID +".txt"; diff --git a/src/server/JasmineGraphServer.cpp b/src/server/JasmineGraphServer.cpp index b81174e12..f0d019528 100644 --- a/src/server/JasmineGraphServer.cpp +++ b/src/server/JasmineGraphServer.cpp @@ -36,12 +36,14 @@ void *runfrontend(void *dummyPt) { refToServer->frontend = new JasmineGraphFrontEnd(refToServer->sqlite, refToServer->performanceSqlite, refToServer->masterHost, refToServer->jobScheduler); refToServer->frontend->run(); + return NULL; } void *runbackend(void *dummyPt) { JasmineGraphServer *refToServer = (JasmineGraphServer *) dummyPt; refToServer->backend = new JasmineGraphBackend(refToServer->sqlite, refToServer->numberOfWorkers); refToServer->backend->run(); + return NULL; } @@ -293,6 +295,7 @@ void JasmineGraphServer::startRemoteWorkers(std::vector workerPortsVector, std::string instanceDataFolder = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.datafolder"); std::string aggregateDataFolder = utils.getJasmineGraphProperty("org.jasminegraph.server.instance.aggregatefolder"); std::string nmonFileLocation = utils.getJasmineGraphProperty("org.jasminegraph.server.nmon.file.location"); + std::string graphsagelocation = utils.getJasmineGraphProperty("org.jasminegraph.graphsage"); std::string jasmineGraphExecutableName = Conts::JASMINEGRAPH_EXECUTABLE; server_logger.log("###MASTER#### Starting remote workers for profile " + profile, "info"); if (hasEnding(workerPath,"/")) { @@ -323,16 +326,24 @@ void JasmineGraphServer::startRemoteWorkers(std::vector workerPortsVector, popen(serverStartScript.c_str(),"r"); } } else if (profile == "docker") { + std::string image_tag; + char *env_testing = getenv("TESTING"); + if (env_testing == NULL || strcasecmp(env_testing, "true") != 0) { + image_tag = "latest"; + } else { + image_tag = "test"; + } for (int i =0 ; i < workerPortsVector.size() ; i++) { if (masterHost == host || host == "localhost") { serverStartScript = "docker run -v " + instanceDataFolder + ":" + instanceDataFolder + " -v " + aggregateDataFolder + ":" + aggregateDataFolder + " -v " + nmonFileLocation + ":" + nmonFileLocation + + " -v " + graphsagelocation + ":" + graphsagelocation + " -v " + instanceDataFolder + "/" + to_string(i) + "/logs" + ":" + "/home/ubuntu/software/jasminegraph/logs" + " -p " + std::to_string(workerPortsVector.at(i)) + ":" + std::to_string(workerPortsVector.at(i)) + " -p " + std::to_string(workerDataPortsVector.at(i)) + ":" + - std::to_string(workerDataPortsVector.at(i)) + " jasminegraph:latest --MODE 2 --HOST_NAME " + host + + std::to_string(workerDataPortsVector.at(i)) + " jasminegraph:" + image_tag + " --MODE 2 --HOST_NAME " + host + " --MASTERIP " + masterHost + " --SERVER_PORT " + std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; @@ -340,11 +351,12 @@ void JasmineGraphServer::startRemoteWorkers(std::vector workerPortsVector, serverStartScript = "docker -H ssh://" + host + " run -v " + instanceDataFolder + ":" + instanceDataFolder + " -v " + aggregateDataFolder + ":" + aggregateDataFolder + " -v " + nmonFileLocation + ":" + nmonFileLocation + + " -v " + graphsagelocation + ":" + graphsagelocation + " -v " + instanceDataFolder + "/" + to_string(i) + "/logs" + ":" + "/home/ubuntu/software/jasminegraph/logs" + " -p " + std::to_string(workerPortsVector.at(i)) + ":" + std::to_string(workerPortsVector.at(i)) + " -p " + std::to_string(workerDataPortsVector.at(i)) + ":" + - std::to_string(workerDataPortsVector.at(i)) + " jasminegraph:latest --MODE 2 --HOST_NAME " + host + + std::to_string(workerDataPortsVector.at(i)) + " jasminegraph:" + image_tag + " --MODE 2 --HOST_NAME " + host + " --MASTERIP " + masterHost + " --SERVER_PORT " + std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; @@ -482,7 +494,7 @@ void JasmineGraphServer::resolveOperationalGraphs(){ workerPort = std::stoi(j->second); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -650,7 +662,7 @@ void JasmineGraphServer::deleteNonOperationalGraphFragment(int graphID) { } } -int JasmineGraphServer::shutdown_workers() { +void JasmineGraphServer::shutdown_workers() { std::cout << "Shutting the workers down" << std::endl; std::vector>::iterator mapIterator; for (mapIterator = hostWorkerMap.begin(); mapIterator < hostWorkerMap.end(); mapIterator++) { @@ -660,7 +672,7 @@ int JasmineGraphServer::shutdown_workers() { std::cout << pthread_self() << " host : " << worker.hostname << " port : " << worker.port << " DPort : " << worker.dataPort << std::endl; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -670,7 +682,7 @@ int JasmineGraphServer::shutdown_workers() { if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return; } std::string host = worker.hostname; @@ -823,7 +835,7 @@ bool JasmineGraphServer::batchUploadFile(std::string host, int port, int dataPor bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1020,7 +1032,7 @@ bool JasmineGraphServer::batchUploadCentralStore(std::string host, int port, int std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[300]; + char data[301]; struct sockaddr_in serv_addr; struct hostent *server; @@ -1258,7 +1270,7 @@ bool JasmineGraphServer::batchUploadAttributeFile(std::string host, int port, in std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[300]; + char data[301]; struct sockaddr_in serv_addr; struct hostent *server; @@ -1456,7 +1468,7 @@ bool JasmineGraphServer::batchUploadCentralAttributeFile(std::string host, int p std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[300]; + char data[301]; struct sockaddr_in serv_addr; struct hostent *server; @@ -1654,7 +1666,7 @@ bool JasmineGraphServer::batchUploadCompositeCentralstoreFile(std::string host, std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[300]; + char data[301]; struct sockaddr_in serv_addr; struct hostent *server; @@ -1849,7 +1861,7 @@ bool JasmineGraphServer::sendFileThroughService(std::string host, int dataPort, std::string filePath, std::string masterIP) { Utils utils; int sockfd; - char data[300]; + char data[301]; socklen_t len; struct sockaddr_in serv_addr; struct hostent *server; @@ -1858,7 +1870,7 @@ bool JasmineGraphServer::sendFileThroughService(std::string host, int dataPort, if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return false; } server = gethostbyname(host.c_str()); @@ -1895,7 +1907,7 @@ bool JasmineGraphServer::sendFileThroughService(std::string host, int dataPort, if (fp == NULL) { //printf("Error opening file\n"); close(sockfd); - return 0; + return false; } for (;;) { @@ -1920,7 +1932,9 @@ bool JasmineGraphServer::sendFileThroughService(std::string host, int dataPort, fclose(fp); close(sockfd); + return true; } + return false; } void JasmineGraphServer::copyArtifactsToWorkers(std::string workerPath, std::string artifactLocation, @@ -2165,7 +2179,7 @@ int JasmineGraphServer::removeFragmentThroughService(string host, int port, stri Utils utils; std::cout << pthread_self() << " host : " << host << " port : " << port << std::endl; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2273,7 +2287,7 @@ int JasmineGraphServer::removePartitionThroughService(string host, int port, str Utils utils; std::cout << pthread_self() << " host : " << host << " port : " << port << std::endl; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2649,7 +2663,7 @@ void JasmineGraphServer::inDegreeDistribution(std::string graphID) { workerList.pop_back(); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2762,7 +2776,7 @@ void JasmineGraphServer::outDegreeDistribution(std::string graphID) { workerList.pop_back(); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2892,7 +2906,7 @@ void JasmineGraphServer::duplicateCentralStore(std::string graphID) { } int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -3175,13 +3189,14 @@ void JasmineGraphServer::initiateMerge(std::string graphID, std::string training int count = 0; JasmineGraphTrainingSchedular *schedular = new JasmineGraphTrainingSchedular(); map> scheduleForAllHosts = schedular->schedulePartitionTraining(graphID); - std::map graphPartitionedHosts = this->getGraphPartitionedHosts( + std::map graphPartitionedHosts = this->getWorkerPartitions( graphID); int partition_count = 0; - std::map::iterator mapIterator; + std::map::iterator mapIterator; for (mapIterator = graphPartitionedHosts.begin(); mapIterator != graphPartitionedHosts.end(); mapIterator++) { - JasmineGraphServer::workerPartitions workerPartition = mapIterator->second; - std::vector partitions = workerPartition.partitionID; + JasmineGraphServer::workerPartition workerPartition = mapIterator->second; + std::vector partitions; + partitions.push_back(workerPartition.partitionID); std::vector::iterator it; for (it = partitions.begin(); it < partitions.end(); it++) { partition_count++; @@ -3194,17 +3209,18 @@ void JasmineGraphServer::initiateMerge(std::string graphID, std::string training trainingArgs = trainingArgs; int fl_clients = stoi(utils.getJasmineGraphProperty("org.jasminegraph.fl_clients")); - std::map::iterator j; + std::map::iterator j; for (j = graphPartitionedHosts.begin(); j != graphPartitionedHosts.end(); j++) { - JasmineGraphServer::workerPartitions workerPartition = j->second; - std::vector partitions = workerPartition.partitionID; + JasmineGraphServer::workerPartition workerPartition = j->second; + std::vector partitions; + partitions.push_back(workerPartition.partitionID); string partitionCount = std::to_string(partitions.size()); std::vector::iterator k; map scheduleOfHost = scheduleForAllHosts[j->first]; for (k = partitions.begin(); k != partitions.end(); k++) { int iterationOfPart = scheduleOfHost[stoi(*k)]; - workerThreads[count] = std::thread(mergeFiles,"localhost", workerPartition.port, + workerThreads[count] = std::thread(mergeFiles, workerPartition.hostname, workerPartition.port, workerPartition.dataPort,trainingArgs + " " + *k, fl_clients, *k); count++; } @@ -3280,17 +3296,12 @@ bool JasmineGraphServer::initiateTrain(std::string host, int port, int dataPort, } write(sockfd, JasmineGraphInstanceProtocol::INITIATE_FILES.c_str(), - JasmineGraphInstanceProtocol::INITIATE_FILES.size()); + JasmineGraphInstanceProtocol::INITIATE_FILES.size()); server_logger.log("Sent : " + JasmineGraphInstanceProtocol::INITIATE_FILES, "info"); bzero(data, FED_DATA_LENGTH); - server_logger.log("AAAAAAAAAA : ", "info"); - read(sockfd, data, FED_DATA_LENGTH); - server_logger.log("AAAAAAAAAA : 2", "info"); - response = (data); response = utils.trim_copy(response, " \f\n\r\t\v"); - server_logger.log("Sent : " + response, "info"); if (response.compare(JasmineGraphInstanceProtocol::OK) == 0) { server_logger.log("Received : " + JasmineGraphInstanceProtocol::OK, "info"); write(sockfd, (trainingArgs).c_str(), (trainingArgs).size()); @@ -3303,10 +3314,7 @@ bool JasmineGraphServer::initiateTrain(std::string host, int port, int dataPort, "error"); } - server_logger.log("AAAAAAAAAA : 3", "info"); close(sockfd); - server_logger.log("AAAAAAAAAA : 4", "info"); - return 0; } @@ -3666,7 +3674,7 @@ bool JasmineGraphServer::receiveGlobalWeights(std::string host, int port, std::s std::string length = ""; for (int i=0; i< HEADER_LENGTH; i++) { - if (data[i] != NULL){ + if (data[i]){ length += data[i]; } } diff --git a/src/server/JasmineGraphServer.h b/src/server/JasmineGraphServer.h index d54e9576d..948f94c75 100644 --- a/src/server/JasmineGraphServer.h +++ b/src/server/JasmineGraphServer.h @@ -81,7 +81,7 @@ class JasmineGraphServer { void addInstanceDetailsToPerformanceDB(std::string host, std::vector portVector, std::string isMaster); - int shutdown_workers(); + void shutdown_workers(); int run(std::string profile, std::string masterIp, int numberofWorkers, std::string workerIps, std::string enableNmon); @@ -130,6 +130,7 @@ class JasmineGraphServer { int dataPort; }; +//Deprecated (07-08-2023): workerPartitions should not be used in future. Instead use workerPartition. struct workerPartitions { int port; int dataPort; @@ -140,7 +141,7 @@ class JasmineGraphServer { string hostname; int port; int dataPort; - string partitionID; + string partitionID; //Deprecated (07-08-2023) : This should be a vector of partition IDs instead of a single partiton ID. }; static void updateMetaDB(std::vector hostWorkerMap, std::map partitionFileList, int graphID, diff --git a/src_python/merge_new.py b/src_python/merge_new.py new file mode 100644 index 000000000..8b52a5730 --- /dev/null +++ b/src_python/merge_new.py @@ -0,0 +1,79 @@ +""" + Copyright 2020 JasmineGraph Team + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + """ + +import sys +import pandas as pd +import os +import logging + +logging.basicConfig( + level=logging.INFO, + format='%(asctime)s : [%(levelname)s] %(message)s', + handlers=[ + logging.FileHandler('merge.log'), + logging.StreamHandler(sys.stdout) + ] +) + +arg_names = [ + 'path_datafolder', + 'path_modelstore', + 'path_data', + 'graph_id', + 'partition_id', + ] + +folder_path = "data" +if os.path.exists(folder_path): + logging.info("Folder path \"" + folder_path + "\" exists") + pass +else: + logging.info("Data folder created") + os.makedirs(folder_path) + +args = dict(zip(arg_names, sys.argv[1:])) + +path_attributes_localstore = args['path_datafolder'] + args['graph_id'] + '_attributes_' + args['partition_id'] +node_attributes_localstore = pd.read_csv(path_attributes_localstore , sep='\s+', lineterminator='\n',header=None) +node_attributes_localstore.set_index(0,inplace=True) + +path_edges_localstore = args['path_modelstore'] + args['graph_id'] + '_' + args['partition_id'] +edges_localstore = pd.read_csv(path_edges_localstore, sep='\s+', lineterminator='\n', header=None) +edges_localstore.columns = ["source","target"] + + +path_attributes_centralstore = args['path_datafolder'] + args['graph_id'] + '_centralstore_attributes_' + args['partition_id'] +node_attributes_centralstore = pd.read_csv(path_attributes_centralstore , sep='\s+', lineterminator='\n',header=None) +node_attributes_centralstore.set_index(0,inplace=True) + +path_edges_centralstore = args['path_modelstore'] + args['graph_id'] + '_centralstore_' + args['partition_id'] +edges_centralstore = pd.read_csv(path_edges_centralstore, sep='\s+', lineterminator='\n', header=None) +edges_centralstore.columns = ["source","target"] + +# Reducing memory consumption +edges_centralstore = edges_centralstore.astype({"source":"uint32","target":"uint32"}) +edges_localstore = edges_localstore.astype({"source":"uint32","target":"uint32"}) +node_attributes_localstore = node_attributes_localstore.astype("float32") +node_attributes_centralstore = node_attributes_centralstore.astype("float32") + +nodes = pd.concat([node_attributes_localstore,node_attributes_centralstore]) +nodes = nodes.loc[~nodes.index.duplicated(keep='first')] +edges = pd.concat([edges_localstore,edges_centralstore],ignore_index=True) + + +path_nodes = args['path_data'] + args['graph_id'] + '_nodes_' + args['partition_id'] + ".csv" +path_edges = args['path_data'] + args['graph_id'] + '_edges_' + args['partition_id'] + ".csv" + +nodes.to_csv(path_nodes) +edges.to_csv(path_edges,index=False) + From 08f1e9e0671010782dff931d21d721015815d4ea Mon Sep 17 00:00:00 2001 From: kandeeban15 <88717578+kandeeban15@users.noreply.github.com> Date: Mon, 7 Aug 2023 23:12:43 +0530 Subject: [PATCH 25/45] Delete merge_new.py --- src_python/merge_new.py | 79 ----------------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 src_python/merge_new.py diff --git a/src_python/merge_new.py b/src_python/merge_new.py deleted file mode 100644 index 8b52a5730..000000000 --- a/src_python/merge_new.py +++ /dev/null @@ -1,79 +0,0 @@ -""" - Copyright 2020 JasmineGraph Team - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - """ - -import sys -import pandas as pd -import os -import logging - -logging.basicConfig( - level=logging.INFO, - format='%(asctime)s : [%(levelname)s] %(message)s', - handlers=[ - logging.FileHandler('merge.log'), - logging.StreamHandler(sys.stdout) - ] -) - -arg_names = [ - 'path_datafolder', - 'path_modelstore', - 'path_data', - 'graph_id', - 'partition_id', - ] - -folder_path = "data" -if os.path.exists(folder_path): - logging.info("Folder path \"" + folder_path + "\" exists") - pass -else: - logging.info("Data folder created") - os.makedirs(folder_path) - -args = dict(zip(arg_names, sys.argv[1:])) - -path_attributes_localstore = args['path_datafolder'] + args['graph_id'] + '_attributes_' + args['partition_id'] -node_attributes_localstore = pd.read_csv(path_attributes_localstore , sep='\s+', lineterminator='\n',header=None) -node_attributes_localstore.set_index(0,inplace=True) - -path_edges_localstore = args['path_modelstore'] + args['graph_id'] + '_' + args['partition_id'] -edges_localstore = pd.read_csv(path_edges_localstore, sep='\s+', lineterminator='\n', header=None) -edges_localstore.columns = ["source","target"] - - -path_attributes_centralstore = args['path_datafolder'] + args['graph_id'] + '_centralstore_attributes_' + args['partition_id'] -node_attributes_centralstore = pd.read_csv(path_attributes_centralstore , sep='\s+', lineterminator='\n',header=None) -node_attributes_centralstore.set_index(0,inplace=True) - -path_edges_centralstore = args['path_modelstore'] + args['graph_id'] + '_centralstore_' + args['partition_id'] -edges_centralstore = pd.read_csv(path_edges_centralstore, sep='\s+', lineterminator='\n', header=None) -edges_centralstore.columns = ["source","target"] - -# Reducing memory consumption -edges_centralstore = edges_centralstore.astype({"source":"uint32","target":"uint32"}) -edges_localstore = edges_localstore.astype({"source":"uint32","target":"uint32"}) -node_attributes_localstore = node_attributes_localstore.astype("float32") -node_attributes_centralstore = node_attributes_centralstore.astype("float32") - -nodes = pd.concat([node_attributes_localstore,node_attributes_centralstore]) -nodes = nodes.loc[~nodes.index.duplicated(keep='first')] -edges = pd.concat([edges_localstore,edges_centralstore],ignore_index=True) - - -path_nodes = args['path_data'] + args['graph_id'] + '_nodes_' + args['partition_id'] + ".csv" -path_edges = args['path_data'] + args['graph_id'] + '_edges_' + args['partition_id'] + ".csv" - -nodes.to_csv(path_nodes) -edges.to_csv(path_edges,index=False) - From a5e75bdde1b4ac6f4199b45678d9856dfac52e56 Mon Sep 17 00:00:00 2001 From: kandeeban15 <88717578+kandeeban15@users.noreply.github.com> Date: Mon, 7 Aug 2023 23:35:23 +0530 Subject: [PATCH 26/45] Update GraphSage dependencies to support python 3.11.3 --- GraphSAGE/requirements | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/GraphSAGE/requirements b/GraphSAGE/requirements index 55793c4a2..9f286d51f 100644 --- a/GraphSAGE/requirements +++ b/GraphSAGE/requirements @@ -1,23 +1,23 @@ -absl-py-1.4.0 -astor-0.8.1 -backports.weakref-1.0.post1 -bleach-6.0.0 -decorator-5.1.1 -enum34-1.1.10 -funcsigs-1.0.2 -gast-0.4.0 -grpcio-1.56.0 -html5lib-1.1 -Markdown-3.4.3 -mock-5.1.0 -networkx-3.1 -numpy-1.24.3 -pbr-5.11.1 -protobuf-4.23.4 -scikit-learn-1.3.0 -scipy-1.11.1 -six-1.16.0 -tensorboard-2.13.0 -tensorflow-2.13.0 -termcolor-2.3.0 -Werkzeug-2.3.6 +absl-py==1.4.0 +astor==0.8.1 +backports.weakref==1.0.post1 +bleach==6.0.0 +decorator==5.1.1 +enum34==1.1.10 +funcsigs==1.0.2 +gast==0.4.0 +grpcio==1.56.0 +html5lib==1.1 +Markdown==3.4.3 +mock==5.1.0 +networkx==3.1 +numpy==1.24.3 +pbr==5.11.1 +protobuf==4.23.4 +scikit-learn==1.3.0 +scipy==1.11.1 +six==1.16.0 +tensorboard==2.13.0 +tensorflow==2.13.0 +termcolor==2.3.0 +Werkzeug==2.3.6 From 64e1c3cfcb9287a8367db9f796507ec5cfb3470d Mon Sep 17 00:00:00 2001 From: kandeeban15 <88717578+kandeeban15@users.noreply.github.com> Date: Mon, 7 Aug 2023 23:50:59 +0530 Subject: [PATCH 27/45] Removed testing tools --- Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8d0ea76c4..3c31d7de9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,9 +40,6 @@ RUN mkdir /home/ubuntu/software/jasminegraph WORKDIR /home/ubuntu/software/jasminegraph COPY ./GraphSAGE/requirements ./GraphSAGE/requirements RUN pip install -r ./GraphSAGE/requirements -RUN apt-get install net-tools -y -RUN apt-get install netcat -y -RUN apt-get install telnet -y COPY . . RUN sh build.sh From 6e726ad40b3e5b1e07c1b474a65c23a30262edac Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Tue, 8 Aug 2023 11:31:39 +0530 Subject: [PATCH 28/45] Modify tests to fail and exit on different response without timeout --- Dockerfile | 13 ++++++++++++- test-docker.sh | 2 +- tests/integration/test.py | 30 ++++++++++++++++-------------- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9aec71981..2255a068f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,13 +34,24 @@ RUN make install ENV HOME="/home/ubuntu" ENV JASMINEGRAPH_HOME="/home/ubuntu/software/jasminegraph" + RUN mkdir /home/ubuntu/software/jasminegraph WORKDIR /home/ubuntu/software/jasminegraph + RUN pip install tensorflow==2.5.3 RUN pip install -U scikit-learn -COPY . . +COPY ./GraphSAGE ./GraphSAGE RUN pip install -r ./GraphSAGE/requirements +COPY ./conf ./conf +COPY ./src ./src +COPY ./src_python ./src_python +COPY ./build.sh ./build.sh +COPY ./CMakeLists.txt ./CMakeLists.txt +COPY ./main.cpp ./main.cpp +COPY ./main.h ./main.h +COPY ./run-docker.sh ./run-docker.sh + RUN sh build.sh ENTRYPOINT ["/home/ubuntu/software/jasminegraph/run-docker.sh"] CMD ["bash"] \ No newline at end of file diff --git a/test-docker.sh b/test-docker.sh index edd0c0597..7f36a8b33 100755 --- a/test-docker.sh +++ b/test-docker.sh @@ -28,7 +28,7 @@ while ! nc -zvn 127.0.0.1 7777 &>/dev/null; do sleep .2 done -timeout 1800 python3 -u tests/integration/test.py |& tee "logs/${run_id}_test.txt" +timeout 600 python3 -u tests/integration/test.py |& tee "logs/${run_id}_test.txt" exit_code="${PIPESTATUS[0]}" rm -rf tests/integration/env stop_and_remove_containers diff --git a/tests/integration/test.py b/tests/integration/test.py index 8fd77ea62..1a79803ef 100644 --- a/tests/integration/test.py +++ b/tests/integration/test.py @@ -32,24 +32,26 @@ DONE=b'done' LINE_END=b'\r\n' -def recv_all(sock, n_bytes): +def expect_response(sock, expected): + global passedAll buffer = bytearray() read = 0 - while read < n_bytes: - received = sock.recv(n_bytes - read) + expected_len = len(expected) + while read < expected_len: + received = sock.recv(expected_len - read) + received_len = len(received) if received: - read += len(received) + if received != expected[read:read + received_len]: + buffer.extend(received) + data = bytes(buffer) + logging.warning(f'Output mismatch\nexpected : {expected}\nreceived : {data}') + passedAll = False + return False + read += received_len buffer.extend(received) - return bytes(buffer) - -def expect_response(sock, expected): - global passedAll - data = recv_all(sock, len(expected)) + data = bytes(buffer) print(data.decode('utf-8'), end='') - if data != expected: - logging.warning(f'Output mismatch\nexpected : {expected}\nreceived : {data}') - passedAll = False - return False + assert data == expected return True def send_and_expect_response(sock, testName, send, expected, exitOnFail=False): @@ -60,7 +62,7 @@ def send_and_expect_response(sock, testName, send, expected, exitOnFail=False): failedTests.append(testName) if exitOnFail: print() - logging.fatal('Failed some tests,', file=sys.stderr) + logging.fatal('Failed some tests,') print(*failedTests, sep='\n', file=sys.stderr) sys.exit(1) From 710018a059c3aa2b21235b29850e0334975d4fdc Mon Sep 17 00:00:00 2001 From: Kandeeban Date: Tue, 8 Aug 2023 11:46:13 +0530 Subject: [PATCH 29/45] Fix issues in testing phase --- Dockerfile | 1 + Testing/Temporary/LastTest.log | 3 + src/backend/JasmineGraphBackend.cpp | 8 +- src/frontend/JasmineGraphFrontEnd.cpp | 271 +- src/frontend/JasmineGraphFrontEndProtocol.h | 1 + .../executor/impl/TriangleCountExecutor.cpp | 27 +- .../executor/impl/TriangleCountExecutor.h | 2 +- src/frontend/core/scheduler/JobScheduler.cpp | 3 +- .../JasmineGraphIncrementalLocalStore.cpp | 4 +- .../JasmineGraphIncrementalLocalStore.h | 2 +- src/metadb/SQLiteDBInterface.cpp | 6 +- .../trainer/JasmineGraphTrainingSchedular.cpp | 2 - src/partitioner/local/RDFParser.cpp | 2 +- src/partitioner/local/RDFParser.h | 4 +- src/partitioner/local/RDFPartitioner.h | 3 +- src/performance/metrics/PerformanceUtil.cpp | 24 +- src/performance/metrics/PerformanceUtil.h | 10 +- .../metrics/StatisticCollector.cpp | 2 + .../PerformanceSQLiteDBInterface.cpp | 5 +- .../JasminGraphLinkPredictor.cpp | 4 +- .../linkprediction/JasminGraphLinkPredictor.h | 2 +- src/server/JasmineGraphInstance.cpp | 28 +- ...asmineGraphInstanceFileTransferService.cpp | 9 +- .../JasmineGraphInstanceFileTransferService.h | 2 +- src/server/JasmineGraphInstanceService.h | 2 +- src/util/Utils.cpp | 13 +- src/util/kafka/KafkaCC.cpp | 1 + tests/integration/docker-compose.yml | 27 + tests/integration/env_init/data/powergrid.dl | 6594 +++++++++++++++++ .../databases/metadb/jasminegraph_meta.db | Bin 0 -> 61440 bytes .../performancedb/jasminegraph_performance.db | Bin 0 -> 49152 bytes tests/integration/test.py | 121 + 32 files changed, 6977 insertions(+), 206 deletions(-) create mode 100644 Testing/Temporary/LastTest.log create mode 100644 tests/integration/docker-compose.yml create mode 100755 tests/integration/env_init/data/powergrid.dl create mode 100755 tests/integration/env_init/databases/metadb/jasminegraph_meta.db create mode 100755 tests/integration/env_init/databases/performancedb/jasminegraph_performance.db create mode 100644 tests/integration/test.py diff --git a/Dockerfile b/Dockerfile index 8d0ea76c4..c7a60dfb6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,6 +44,7 @@ RUN apt-get install net-tools -y RUN apt-get install netcat -y RUN apt-get install telnet -y COPY . . +RUN mkdir /home/ubuntu/datasets RUN sh build.sh ENTRYPOINT ["/home/ubuntu/software/jasminegraph/run-docker.sh"] diff --git a/Testing/Temporary/LastTest.log b/Testing/Temporary/LastTest.log new file mode 100644 index 000000000..6b1a421b4 --- /dev/null +++ b/Testing/Temporary/LastTest.log @@ -0,0 +1,3 @@ +Start testing: Aug 07 22:46 +0530 +---------------------------------------------------------- +End testing: Aug 07 22:46 +0530 diff --git a/src/backend/JasmineGraphBackend.cpp b/src/backend/JasmineGraphBackend.cpp index dfefb7db0..39e08531f 100644 --- a/src/backend/JasmineGraphBackend.cpp +++ b/src/backend/JasmineGraphBackend.cpp @@ -27,7 +27,7 @@ void *backendservicesesion(void *dummyPt) { int connFd = sessionargs->connFd; SQLiteDBInterface sqLiteDbInterface = sessionargs->sqlite; backend_logger.log("Thread No: " + to_string(pthread_self()), "info"); - char data[300]; + char data[301]; bzero(data, 301); bool loop = false; while (!loop) { @@ -46,7 +46,7 @@ void *backendservicesesion(void *dummyPt) { write(connFd, HANDSHAKE_OK.c_str(), HANDSHAKE_OK.size()); write(connFd, "\r\n", 2); - char host[300]; + char host[301]; bzero(host, 301); read(connFd, host, 300); string hostname(host); @@ -66,7 +66,7 @@ void *backendservicesesion(void *dummyPt) { } // We get the name and the path to graph as a pair separated by |. - char worker_info_data[300]; + char worker_info_data[301]; bzero(worker_info_data, 301); string name = ""; @@ -92,6 +92,7 @@ void *backendservicesesion(void *dummyPt) { } backend_logger.log("Closing thread " + to_string(pthread_self()) + " and connection", "info"); close(connFd); + return NULL; } JasmineGraphBackend::JasmineGraphBackend(SQLiteDBInterface db, int numberOfWorkers) { @@ -170,4 +171,5 @@ int JasmineGraphBackend::run() { for (int i = 0; i < noThread; i++) { pthread_join(threadA[i], NULL); } + return 1; } diff --git a/src/frontend/JasmineGraphFrontEnd.cpp b/src/frontend/JasmineGraphFrontEnd.cpp index 383bfccdb..67ee9a583 100755 --- a/src/frontend/JasmineGraphFrontEnd.cpp +++ b/src/frontend/JasmineGraphFrontEnd.cpp @@ -60,9 +60,10 @@ std::set processData; std::mutex aggregateWeightMutex; std::mutex triangleTreeMutex; std::string stream_topic_name; + // Thread function -void listen_to_kafka_topic(KafkaConnector *kstream, Partitioner &graphPartitioner, vector &workerClients) -{ +void +listen_to_kafka_topic(KafkaConnector *kstream, Partitioner &graphPartitioner, vector &workerClients) { while (true) { cppkafka::Message msg = kstream->consumer.poll(); if (!msg || msg.get_error()) { @@ -70,7 +71,7 @@ void listen_to_kafka_topic(KafkaConnector *kstream, Partitioner &graphPartitione } string data(msg.get_payload()); if (data == "-1") { // Marks the end of stream - frontend_logger.log("Received the end of `" +stream_topic_name+"` input kafka stream", "info"); + frontend_logger.log("Received the end of `" + stream_topic_name + "` input kafka stream", "info"); break; } auto edgeJson = json::parse(data); @@ -83,7 +84,7 @@ void listen_to_kafka_topic(KafkaConnector *kstream, Partitioner &graphPartitione destinationJson["pid"] = partitionedEdge[1].second; string source = sourceJson.dump(); string destination = destinationJson.dump(); - json obj ; + json obj; obj["source"] = sourceJson; obj["destination"] = destinationJson; long temp_s = partitionedEdge[0].second; @@ -91,7 +92,7 @@ void listen_to_kafka_topic(KafkaConnector *kstream, Partitioner &graphPartitione workerClients.at((int) partitionedEdge[0].second)->publish(sourceJson.dump()); workerClients.at((int) partitionedEdge[1].second)->publish(destinationJson.dump()); // storing Node block - if (temp_s ==temp_d){ + if (temp_s == temp_d) { //+miyurud: Temorarily commeting the following line to make the code build //workerClients.at((int) partitionedEdge[0].second)->publish_relation(obj.dump()); } @@ -103,20 +104,20 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface PerformanceSQLiteDBInterface perfSqlite, JobScheduler jobScheduler) { frontend_logger.log("Thread No: " + to_string(pthread_self()), "info"); frontend_logger.log("Master IP: " + masterIP, "info"); - char data[FRONTEND_DATA_LENGTH]; + char data[FRONTEND_DATA_LENGTH + 1]; bzero(data, FRONTEND_DATA_LENGTH + 1); Utils utils; vector workerList = utils.getWorkerList(sqlite); - vector workerClients; + vector workerClients; // Initiate Thread thread input_stream_handler; // Initiate kafka consumer parameters std::string partitionCount = utils.getJasmineGraphProperty("org.jasminegraph.server.npartitions"); int numberOfPartitions = std::stoi(partitionCount); - std::string kafka_server_IP ; + std::string kafka_server_IP; cppkafka::Configuration configs; - KafkaConnector* kstream; + KafkaConnector *kstream; Partitioner graphPartitioner(numberOfPartitions, 1, spt::Algorithms::HASH); for (int i = 0; i < workerList.size(); i++) { @@ -125,16 +126,16 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface string workerHost = currentWorker.hostname; string workerID = currentWorker.workerID; int workerPort = atoi(string(currentWorker.port).c_str()); - DataPublisher* workerClient = new DataPublisher(workerPort, workerHost); + DataPublisher *workerClient = new DataPublisher(workerPort, workerHost); workerClients.push_back(workerClient); } bool loop = false; while (!loop) { - if(currentFESession == Conts::MAX_FE_SESSIONS + 1) { + if (currentFESession == Conts::MAX_FE_SESSIONS + 1) { currentFESession--; std::string errorResponse = "Jasminegraph Server is Busy. Please try again later."; int result_wr = write(connFd, errorResponse.c_str(), errorResponse.length()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } break; @@ -170,12 +171,12 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface break; } else if (line.compare(LIST) == 0) { std::stringstream ss; - std::vector < vector < pair < string, string>>> v = sqlite.runSelect( + std::vector>> v = sqlite.runSelect( "SELECT idgraph, name, upload_path, graph_status_idgraph_status FROM graph;"); - for (std::vector < vector < pair < string, string>>>::iterator i = v.begin(); i != v.end(); ++i) { + for (std::vector>>::iterator i = v.begin(); i != v.end(); ++i) { ss << "|"; int counter = 0; - for (std::vector < pair < string, string >> ::iterator j = (i->begin()); j != i->end(); ++j) { + for (std::vector>::iterator j = (i->begin()); j != i->end(); ++j) { if (counter == 3) { if (std::stoi(j->second) == Conts::GRAPH_STATUS::LOADING) { ss << "loading|"; @@ -191,7 +192,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } counter++; } - ss << "\n"; + ss << "\r\n"; } string result = ss.str(); if (result.size() == 0) { @@ -240,7 +241,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_data[FRONTEND_DATA_LENGTH]; + char graph_data[FRONTEND_DATA_LENGTH + 1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); string name = ""; string path = ""; @@ -255,7 +256,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface gData = utils.trim_copy(gData, " \f\n\r\t\v"); frontend_logger.log("Data received: " + gData, "info"); - std::vector strArr = Utils::split(gData, '|'); + std::vector strArr = Utils::split(gData, '|'); if (strArr.size() != 2) { frontend_logger.log("Message format not recognized", "error"); @@ -284,7 +285,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface appConfig.readConfigFile(path, newGraphID); MetisPartitioner *metisPartitioner = new MetisPartitioner(&sqlite); - vector > fullFileList; + vector> fullFileList; string input_file_path = utils.getHomeDir() + "/.jasminegraph/tmp/" + to_string(newGraphID) + "/" + to_string(newGraphID); metisPartitioner->loadDataSet(input_file_path, newGraphID); @@ -316,8 +317,8 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_data[FRONTEND_DATA_LENGTH]; - char partition_count[FRONTEND_DATA_LENGTH]; + char graph_data[FRONTEND_DATA_LENGTH + 1]; + char partition_count[FRONTEND_DATA_LENGTH + 1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); string name = ""; string path = ""; @@ -333,7 +334,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface gData = utils.trim_copy(gData, " \f\n\r\t\v"); frontend_logger.log("Data received: " + gData, "info"); - std::vector strArr = Utils::split(gData, '|'); + std::vector strArr = Utils::split(gData, '|'); if (strArr.size() < 2) { frontend_logger.log("Message format not recognized", "error"); @@ -363,7 +364,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface int newGraphID = sqlite.runInsert(sqlStatement); JasmineGraphServer *jasmineServer = new JasmineGraphServer(); MetisPartitioner *partitioner = new MetisPartitioner(&sqlite); - vector > fullFileList; + vector> fullFileList; partitioner->loadDataSet(path, newGraphID); int result = partitioner->constructMetisFormat(Conts::GRAPH_TYPE_NORMAL); @@ -380,7 +381,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface jasmineServer->uploadGraphLocally(newGraphID, Conts::GRAPH_TYPE_NORMAL, fullFileList, masterIP); utils.deleteDirectory(utils.getHomeDir() + "/.jasminegraph/tmp/" + to_string(newGraphID)); string workerCountQuery = "select count(*) from worker"; - std::vector < vector < pair < string, string>>> results = sqlite.runSelect(workerCountQuery); + std::vector>> results = sqlite.runSelect(workerCountQuery); string workerCount = results[0][0].second; int nWorkers = atoi(workerCount.c_str()); JasmineGraphFrontEnd::getAndUpdateUploadTime(to_string(newGraphID), sqlite); @@ -390,7 +391,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -405,7 +406,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface write(connFd, SEND.c_str(), FRONTEND_COMMAND_LENGTH); write(connFd, "\r\n", 2); - char graph_data[FRONTEND_DATA_LENGTH]; + char graph_data[FRONTEND_DATA_LENGTH + 1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); string name = ""; string path = ""; @@ -449,13 +450,13 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface frontend_logger.log("Upload done", "info"); write(connFd, DONE.c_str(), DONE.size()); - write(connFd, "\n", 2); + write(connFd, "\r\n", 2); } else { frontend_logger.log("Model file does not exist on the specified path", "error"); continue; } } else if (line.compare(ADGR_CUST) == 0) { - string message = "Select a custom graph upload option\n"; + string message = "Select a custom graph upload option\r\n"; int result_wr = write(connFd, message.c_str(), message.size()); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); @@ -469,7 +470,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -482,7 +483,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -495,7 +496,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); @@ -503,13 +504,13 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char type[20]; - bzero(type, 21); - read(connFd, type, 20); + char type[FRONTEND_GRAPH_TYPE_LENGTH + 1]; + bzero(type, FRONTEND_GRAPH_TYPE_LENGTH + 1); + read(connFd, type, FRONTEND_GRAPH_TYPE_LENGTH); string graphType(type); graphType = utils.trim_copy(graphType, " \f\n\r\t\v"); - std::unordered_set s = {"1", "2", "3"}; + std::unordered_set s = {"1", "2", "3"}; if (s.find(graphType) == s.end()) { frontend_logger.log("Graph type not recognized", "error"); continue; @@ -530,14 +531,14 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface // If data type is not specified, it will be inferred from values present in the first line of the attribute file // The provided data type should be the largest in the following order: float > int32 > int16 > int8 // Inferred data type will be the largest type based on the values present in the attribute file first line - message = "Send |||(optional)\n"; + message = "Send |||(optional)\r\n"; result_wr = write(connFd, message.c_str(), message.size()); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; continue; } - char graph_data[FRONTEND_DATA_LENGTH]; + char graph_data[FRONTEND_DATA_LENGTH + 1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); string name = ""; string edgeListPath = ""; @@ -554,7 +555,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface gData = utils.trim_copy(gData, " \f\n\r\t\v"); frontend_logger.log("Data received: " + gData, "info"); - std::vector strArr = Utils::split(gData, '|'); + std::vector strArr = Utils::split(gData, '|'); if (strArr.size() != 3 && strArr.size() != 4) { frontend_logger.log("Message format not recognized", "error"); @@ -590,7 +591,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface int newGraphID = sqlite.runInsert(sqlStatement); JasmineGraphServer *jasmineServer = new JasmineGraphServer(); MetisPartitioner *partitioner = new MetisPartitioner(&sqlite); - vector > fullFileList; + vector> fullFileList; partitioner->loadContentData(attributeListPath, graphAttributeType, newGraphID, attrDataType); partitioner->loadDataSet(edgeListPath, newGraphID); int result = partitioner->constructMetisFormat(Conts::GRAPH_TYPE_NORMAL); @@ -614,7 +615,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -641,23 +642,23 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // Get user response. - char user_res[FRONTEND_DATA_LENGTH]; + char user_res[FRONTEND_DATA_LENGTH + 1]; bzero(user_res, FRONTEND_DATA_LENGTH + 1); read(connFd, user_res, FRONTEND_DATA_LENGTH); string user_res_s(user_res); user_res_s = utils.trim_copy(user_res_s, " \f\n\r\t\v"); - for (char& c : user_res_s) { + for (char &c: user_res_s) { c = tolower(c); } // use default kafka consumer details - if (user_res_s =="y"){ + if (user_res_s == "y") { kafka_server_IP = utils.getJasmineGraphProperty("org.jasminegraph.server.streaming.kafka.host"); configs = {{"metadata.broker.list", kafka_server_IP}, {"group.id", "knnect"}}; } // user need to start relevant kafka cluster using relevant IP address // read relevant IP address from given file path - else{ + else { string message = "Send file path to the kafka configuration file."; int result_wr = write(connFd, message.c_str(), message.length()); if (result_wr < 0) { @@ -673,7 +674,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the file path here. - char file_path[FRONTEND_DATA_LENGTH]; + char file_path[FRONTEND_DATA_LENGTH + 1]; bzero(file_path, FRONTEND_DATA_LENGTH + 1); read(connFd, file_path, FRONTEND_DATA_LENGTH); string file_path_s(file_path); @@ -688,9 +689,9 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface std::vector vec2 = utils.split(item, '='); if (vec2.at(0).compare("kafka.host") == 0) { if (item.substr(item.length() - 1, item.length()).compare("=") != 0) { - std::string kafka_server_IP= vec2.at(1); + std::string kafka_server_IP = vec2.at(1); } else { - std::string kafka_server_IP= " "; + std::string kafka_server_IP = " "; } } } @@ -716,7 +717,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the topic name here. - char topic_name[FRONTEND_DATA_LENGTH]; + char topic_name[FRONTEND_DATA_LENGTH + 1]; bzero(topic_name, FRONTEND_DATA_LENGTH + 1); read(connFd, topic_name, FRONTEND_DATA_LENGTH); @@ -734,10 +735,11 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface string topic_name_s(topic_name); topic_name_s = utils.trim_copy(topic_name_s, " \f\n\r\t\v"); - stream_topic_name=topic_name_s; + stream_topic_name = topic_name_s; kstream->Subscribe(topic_name_s); frontend_logger.log("Start listening to " + topic_name_s, "info"); - input_stream_handler = thread(listen_to_kafka_topic, kstream,std::ref(graphPartitioner),std::ref(workerClients)); + input_stream_handler = thread(listen_to_kafka_topic, kstream, std::ref(graphPartitioner), + std::ref(workerClients)); } else if (line.compare(STOP_STREAM_KAFKA) == 0) { frontend_logger.log("Start serving `" + STOP_STREAM_KAFKA + "` command", "info"); @@ -772,7 +774,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_id[FRONTEND_DATA_LENGTH]; + char graph_id[FRONTEND_DATA_LENGTH + 1]; bzero(graph_id, FRONTEND_DATA_LENGTH + 1); string name = ""; string path = ""; @@ -794,7 +796,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -809,7 +811,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface loop = true; continue; } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; @@ -832,7 +834,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_data[FRONTEND_DATA_LENGTH]; + char graph_data[FRONTEND_DATA_LENGTH + 1]; bzero(graph_data, FRONTEND_DATA_LENGTH + 1); @@ -877,7 +879,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char graph_id_data[300]; + char graph_id_data[301]; bzero(graph_id_data, 301); string name = ""; @@ -913,7 +915,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } // We get the name and the path to graph as a pair separated by |. - char priority_data[300]; + char priority_data[301]; bzero(priority_data, 301); read(connFd, priority_data, FRONTEND_DATA_LENGTH); @@ -924,7 +926,8 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface priority = utils.trim_copy(priority, " \f\n\r\t\v"); if (!(std::find_if(priority.begin(), - priority.end(), [](unsigned char c) { return !std::isdigit(c); }) == priority.end())) { + priority.end(), [](unsigned char c) { return !std::isdigit(c); }) == + priority.end())) { string error_message = "Priority should be numeric and > 1 or empty"; result_wr = write(connFd, error_message.c_str(), error_message.length()); @@ -951,7 +954,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface if (threadPriority > Conts::DEFAULT_THREAD_PRIORITY) { threadPriority = Conts::HIGH_PRIORITY_DEFAULT_VALUE; long graphSLA = JasmineGraphFrontEnd::getSLAForGraphId(sqlite, perfSqlite, graph_id, - TRIANGLES, Conts::SLA_CATEGORY::LATENCY); + TRIANGLES, Conts::SLA_CATEGORY::LATENCY); jobDetails.addParameter(Conts::PARAM_KEYS::GRAPH_SLA, std::to_string(graphSLA)); } @@ -1015,7 +1018,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface frontend_logger.log("Error writing to socket", "error"); } - char graph_id_data[300]; + char graph_id_data[301]; bzero(graph_id_data, 301); string name = ""; @@ -1041,7 +1044,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } else { string sqlStatement = "SELECT vertexcount from graph where idgraph=" + graph_id; - std::vector < vector < pair < string, string>>> output = sqlite.runSelect(sqlStatement); + std::vector>> output = sqlite.runSelect(sqlStatement); int vertexCount = std::stoi(output[0][0].second); frontend_logger.log("Vertex Count: " + to_string(vertexCount), "info"); @@ -1064,7 +1067,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface frontend_logger.log("Error writing to socket", "error"); } - char graph_id_data[300]; + char graph_id_data[301]; bzero(graph_id_data, 301); string name = ""; @@ -1090,7 +1093,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } else { string sqlStatement = "SELECT edgecount from graph where idgraph=" + graph_id; - std::vector < vector < pair < string, string>>> output = sqlite.runSelect(sqlStatement); + std::vector>> output = sqlite.runSelect(sqlStatement); int edgeCount = std::stoi(output[0][0].second); frontend_logger.log("Edge Count: " + to_string(edgeCount), "info"); @@ -1108,16 +1111,15 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface Utils utils; std::string federatedEnabled = utils.getJasmineGraphProperty("org.jasminegraph.federated.enabled"); - string message = "Available main flags:\n"; + string message = "Available main flags:\r\n"; write(connFd, message.c_str(), message.size()); - string flags = - Conts::FLAGS::GRAPH_ID; + string flags = Conts::FLAGS::GRAPH_ID; write(connFd, flags.c_str(), flags.size()); - write(connFd, "\n", 2); - message = "Send -- \n"; + write(connFd, "\r\n", 2); + message = "Send -- \r\n"; write(connFd, message.c_str(), message.size()); - char train_data[300]; + char train_data[301]; bzero(train_data, 301); read(connFd, train_data, 300); @@ -1148,7 +1150,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface jasmineServer->initiateMerge(graphID, trainData, sqlite); } else if (line.compare(TRAIN) == 0) { - string message = "Available main flags:\n"; + string message = "Available main flags:\r\n"; int result_wr = write(connFd, message.c_str(), message.size()); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); @@ -1160,22 +1162,22 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } - result_wr = write(connFd, "\n", 2); + result_wr = write(connFd, "\r\n", 2); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } - message = "Send -- -- .. \n"; + message = "Send -- -- ..\r\n"; result_wr = write(connFd, message.c_str(), message.size()); if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } write(connFd, flags.c_str(), flags.size()); - write(connFd, "\n", 2); - message = "Send -- -- .. \n"; + write(connFd, "\r\n", 2); + message = "Send -- -- ..\r\n"; write(connFd, message.c_str(), message.size()); - char train_data[300]; + char train_data[301]; bzero(train_data, 301); read(connFd, train_data, 300); @@ -1202,23 +1204,23 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } if (!JasmineGraphFrontEnd::isGraphActive(graphID, sqlite)) { - string error_message = "Graph is not in the active status"; - frontend_logger.log(error_message, "error"); - result_wr = write(connFd, error_message.c_str(), error_message.length()); - if (result_wr < 0) { - frontend_logger.log("Error writing to socket", "error"); - } - result_wr = write(connFd, "\r\n", 2); - if (result_wr < 0) { - frontend_logger.log("Error writing to socket", "error"); - } - continue; + string error_message = "Graph is not in the active status"; + frontend_logger.log(error_message, "error"); + result_wr = write(connFd, error_message.c_str(), error_message.length()); + if (result_wr < 0) { + frontend_logger.log("Error writing to socket", "error"); + } + result_wr = write(connFd, "\r\n", 2); + if (result_wr < 0) { + frontend_logger.log("Error writing to socket", "error"); + } + continue; } Utils utils; std::string federatedEnabled = utils.getJasmineGraphProperty("org.jasminegraph.federated.enabled"); - if (federatedEnabled=="true"){ + if (federatedEnabled == "true") { JasmineGraphServer *jasmineServer = new JasmineGraphServer(); if (utils.getJasmineGraphProperty("org.jasminegraph.fl.org.training") == "true") { jasmineServer->initiateOrgCommunication(graphID, trainData, sqlite); @@ -1228,10 +1230,10 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } - }else{ + } else { JasminGraphTrainingInitiator *jasminGraphTrainingInitiator = new JasminGraphTrainingInitiator(); - jasminGraphTrainingInitiator->initiateTrainingLocally(graphID,trainData); + jasminGraphTrainingInitiator->initiateTrainingLocally(graphID, trainData); } @@ -1251,7 +1253,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char graph_id[FRONTEND_DATA_LENGTH]; + char graph_id[FRONTEND_DATA_LENGTH + 1]; bzero(graph_id, FRONTEND_DATA_LENGTH + 1); read(connFd, graph_id, FRONTEND_DATA_LENGTH); @@ -1293,7 +1295,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char graph_id[FRONTEND_DATA_LENGTH]; + char graph_id[FRONTEND_DATA_LENGTH + 1]; bzero(graph_id, FRONTEND_DATA_LENGTH + 1); read(connFd, graph_id, FRONTEND_DATA_LENGTH); @@ -1335,7 +1337,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char page_rank_command[FRONTEND_DATA_LENGTH]; + char page_rank_command[FRONTEND_DATA_LENGTH + 1]; bzero(page_rank_command, FRONTEND_DATA_LENGTH + 1); string name = ""; string path = ""; @@ -1347,7 +1349,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface graphID = strArr[0]; double alpha = PAGE_RANK_ALPHA; if (strArr.size() > 1) { - alpha = std::stod(strArr[1]); + alpha = std::stod(strArr[1]); if (alpha < 0 || alpha >= 1) { frontend_logger.log("Invalid value for alpha", "error"); loop = true; @@ -1357,7 +1359,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface int iterations = PAGE_RANK_ITERATIONS; if (strArr.size() > 2) { - iterations = std::stod(strArr[2]); + iterations = std::stod(strArr[2]); if (iterations <= 0 || iterations >= 100) { frontend_logger.log("Invalid value for iterations", "error"); loop = true; @@ -1402,7 +1404,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char graph_id[FRONTEND_DATA_LENGTH]; + char graph_id[FRONTEND_DATA_LENGTH + 1]; bzero(graph_id, FRONTEND_DATA_LENGTH + 1); read(connFd, graph_id, FRONTEND_DATA_LENGTH); @@ -1444,7 +1446,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface continue; } - char graph_id[FRONTEND_DATA_LENGTH]; + char graph_id[FRONTEND_DATA_LENGTH + 1]; bzero(graph_id, FRONTEND_DATA_LENGTH + 1); read(connFd, graph_id, FRONTEND_DATA_LENGTH); @@ -1472,15 +1474,15 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } } else if (line.compare(PREDICT) == 0) { int result_wr = write(connFd, SEND.c_str(), FRONTEND_COMMAND_LENGTH); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } result_wr = write(connFd, "\r\n", 2); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } - char predict_data[300]; + char predict_data[301]; bzero(predict_data, 301); string graphID = ""; string path = ""; @@ -1502,7 +1504,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface graphID = strArr[0]; path = strArr[1]; - if(JasmineGraphFrontEnd::isGraphActiveAndTrained(graphID, sqlite)) { + if (JasmineGraphFrontEnd::isGraphActiveAndTrained(graphID, sqlite)) { if (utils.fileExists(path)) { std::cout << "Path exists" << endl; JasminGraphLinkPredictor *jasminGraphLinkPredictor = new JasminGraphLinkPredictor(); @@ -1517,15 +1519,15 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } } else if (line.compare(START_REMOTE_WORKER) == 0) { int result_wr = write(connFd, REMOTE_WORKER_ARGS.c_str(), REMOTE_WORKER_ARGS.size()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } result_wr = write(connFd, "\r\n", 2); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } - char worker_data[300]; + char worker_data[301]; bzero(worker_data, 301); read(connFd, worker_data, 300); @@ -1557,19 +1559,19 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface enableNmon = strArr[5]; JasmineGraphServer *jasmineServer = new JasmineGraphServer(); - bool isSpawned = jasmineServer->spawnNewWorker(host,port,dataPort,profile,masterHost,enableNmon); + bool isSpawned = jasmineServer->spawnNewWorker(host, port, dataPort, profile, masterHost, enableNmon); } else if (line.compare(SLA) == 0) { int result_wr = write(connFd, COMMAND.c_str(), COMMAND.size()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } result_wr = write(connFd, "\r\n", 2); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } - char category[FRONTEND_DATA_LENGTH]; + char category[FRONTEND_DATA_LENGTH + 1]; bzero(category, FRONTEND_DATA_LENGTH + 1); read(connFd, category, FRONTEND_DATA_LENGTH); @@ -1585,7 +1587,8 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface string slaCategoryIds; - for (std::vector>>::iterator i = categoryResults.begin(); i != categoryResults.end(); ++i) { + for (std::vector>>::iterator i = categoryResults.begin(); + i != categoryResults.end(); ++i) { for (std::vector>::iterator j = (i->begin()); j != i->end(); ++j) { slaCategoryIds = slaCategoryIds + "'" + j->second + "',"; } @@ -1595,7 +1598,8 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface std::stringstream ss; std::vector>> v = perfSqlite.runSelect( - "SELECT graph_id, partition_count, sla_value FROM graph_sla where id_sla_category in (" + adjustedIdList + ");"); + "SELECT graph_id, partition_count, sla_value FROM graph_sla where id_sla_category in (" + + adjustedIdList + ");"); for (std::vector>>::iterator i = v.begin(); i != v.end(); ++i) { std::stringstream slass; slass << "|"; @@ -1624,14 +1628,14 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface string result = ss.str(); if (result.size() == 0) { int result_wr = write(connFd, EMPTY.c_str(), EMPTY.length()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; continue; } result_wr = write(connFd, "\r\n", 2); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; continue; @@ -1639,7 +1643,7 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface } else { int result_wr = write(connFd, result.c_str(), result.length()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); loop = true; continue; @@ -1649,14 +1653,16 @@ void *frontendservicesesion(std::string masterIP, int connFd, SQLiteDBInterface frontend_logger.log("Message format not recognized " + line, "error"); } } - if (input_stream_handler.joinable()){ + if (input_stream_handler.joinable()) { input_stream_handler.join(); } frontend_logger.log("Closing thread " + to_string(pthread_self()) + " and connection", "info"); close(connFd); + return NULL; } -JasmineGraphFrontEnd::JasmineGraphFrontEnd(SQLiteDBInterface db, PerformanceSQLiteDBInterface perfDb, std::string masterIP, +JasmineGraphFrontEnd::JasmineGraphFrontEnd(SQLiteDBInterface db, PerformanceSQLiteDBInterface perfDb, + std::string masterIP, JobScheduler jobScheduler) { this->sqlite = db; this->masterIP = masterIP; @@ -1703,7 +1709,7 @@ int JasmineGraphFrontEnd::run() { listen(listenFd, 10); - std::thread* myThreads = new std::thread[20]; + std::thread *myThreads = new std::thread[20]; std::vector threadVector; len = sizeof(clntAdd); @@ -1724,14 +1730,15 @@ int JasmineGraphFrontEnd::run() { frontend_logger.log("Master IP" + masterIP, "info"); - struct frontendservicesessionargs *frontendservicesessionargs1 =(struct frontendservicesessionargs*) malloc( - sizeof(struct frontendservicesessionargs)*1 );; + struct frontendservicesessionargs *frontendservicesessionargs1 = (struct frontendservicesessionargs *) malloc( + sizeof(struct frontendservicesessionargs) * 1);; frontendservicesessionargs1->sqlite = this->sqlite; frontendservicesessionargs1->connFd = connFd; //TODO(miyurud):Temporarily commenting this line to enable building the project. Asked tmkasun to provide a // permanent fix later when he is available. - threadVector.push_back(std::thread(frontendservicesesion, masterIP, connFd, this->sqlite, this->perfSqlite, this->jobScheduler)); + threadVector.push_back(std::thread(frontendservicesesion, masterIP, connFd, this->sqlite, this->perfSqlite, + this->jobScheduler)); std::thread(); @@ -1787,7 +1794,8 @@ void JasmineGraphFrontEnd::removeGraph(std::string graphID, SQLiteDBInterface sq vector>> hostPartitionResults = sqlite.runSelect( "SELECT name, partition_idpartition FROM worker_has_partition INNER JOIN worker ON " "worker_has_partition.worker_idworker = worker.idworker WHERE partition_graph_idgraph = " + graphID + ";"); - for (vector>>::iterator i = hostPartitionResults.begin(); i != hostPartitionResults.end(); ++i) { + for (vector>>::iterator i = hostPartitionResults.begin(); + i != hostPartitionResults.end(); ++i) { int count = 0; string hostname; string partitionID; @@ -1825,7 +1833,8 @@ bool JasmineGraphFrontEnd::isGraphActiveAndTrained(std::string graphID, SQLiteDB bool result = true; string stmt = "SELECT COUNT( * ) FROM graph WHERE idgraph LIKE '" + graphID + "' AND graph_status_idgraph_status = '" + - to_string(Conts::GRAPH_STATUS::OPERATIONAL) + "' AND train_status = '"+(Conts::TRAIN_STATUS::TRAINED) +"';"; + to_string(Conts::GRAPH_STATUS::OPERATIONAL) + "' AND train_status = '" + (Conts::TRAIN_STATUS::TRAINED) + + "';"; std::vector>> v = sqlite.runSelect(stmt); int count = std::stoi(v[0][0].second); if (count == 0) { @@ -1872,10 +1881,10 @@ void JasmineGraphFrontEnd::getAndUpdateUploadTime(std::string graphID, SQLiteDBI } JasmineGraphHashMapCentralStore JasmineGraphFrontEnd::loadCentralStore(std::string centralStoreFileName) { - frontend_logger.log("Loading Central Store File : Started " + centralStoreFileName,"info"); + frontend_logger.log("Loading Central Store File : Started " + centralStoreFileName, "info"); JasmineGraphHashMapCentralStore *jasmineGraphHashMapCentralStore = new JasmineGraphHashMapCentralStore(); jasmineGraphHashMapCentralStore->loadGraph(centralStoreFileName); - frontend_logger.log("Loading Central Store File : Completed","info"); + frontend_logger.log("Loading Central Store File : Completed", "info"); return *jasmineGraphHashMapCentralStore; } @@ -1890,7 +1899,7 @@ map JasmineGraphFrontEnd::getOutDegreeDistributionHashMap(map uid { 0 }; + static std::atomic uid{0}; return ++uid; } @@ -1909,9 +1918,11 @@ long JasmineGraphFrontEnd::getSLAForGraphId(SQLiteDBInterface sqlite, Performanc int partitionCount = results.size(); - string graphSlaQuery = "select graph_sla.sla_value from graph_sla,sla_category where graph_sla.id_sla_category=sla_category.id " - "and sla_category.command='" + command + "' and sla_category.category='" + category + "' and " - "graph_sla.graph_id='" + graphId + "' and graph_sla.partition_count='" + std::to_string(partitionCount) + "';"; + string graphSlaQuery = + "select graph_sla.sla_value from graph_sla,sla_category where graph_sla.id_sla_category=sla_category.id " + "and sla_category.command='" + command + "' and sla_category.category='" + category + "' and " + "graph_sla.graph_id='" + + graphId + "' and graph_sla.partition_count='" + std::to_string(partitionCount) + "';"; std::vector>> slaResults = perfSqlite.runSelect(graphSlaQuery); @@ -1929,7 +1940,8 @@ int JasmineGraphFrontEnd::getRunningHighPriorityTaskCount() { int taskCount = 0; std::set::iterator processQueryIterator; - for (processQueryIterator = processData.begin(); processQueryIterator != processData.end(); ++processQueryIterator) { + for (processQueryIterator = processData.begin(); + processQueryIterator != processData.end(); ++processQueryIterator) { ProcessInfo processInformation = *processQueryIterator; if (processInformation.priority == Conts::HIGH_PRIORITY_DEFAULT_VALUE) { @@ -1982,7 +1994,7 @@ void JasmineGraphServer::pageRank(std::string graphID, double alpha, int iterati } int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2172,7 +2184,7 @@ void JasmineGraphServer::egoNet(std::string graphID) { workerList.pop_back(); int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -2202,7 +2214,7 @@ void JasmineGraphServer::egoNet(std::string graphID) { bzero(data, 301); int result_wr = write(sockfd, JasmineGraphInstanceProtocol::EGONET.c_str(), JasmineGraphInstanceProtocol::EGONET.size()); - if(result_wr < 0) { + if (result_wr < 0) { frontend_logger.log("Error writing to socket", "error"); } @@ -2273,7 +2285,6 @@ void JasmineGraphServer::egoNet(std::string graphID) { } - bool JasmineGraphFrontEnd::modelExists(string path, SQLiteDBInterface sqlite) { bool result = true; string stmt = diff --git a/src/frontend/JasmineGraphFrontEndProtocol.h b/src/frontend/JasmineGraphFrontEndProtocol.h index 318d631e4..7d022b3cf 100755 --- a/src/frontend/JasmineGraphFrontEndProtocol.h +++ b/src/frontend/JasmineGraphFrontEndProtocol.h @@ -93,6 +93,7 @@ class JasminGraphFrontEndProtocol { const int FRONTEND_COMMAND_LENGTH = 4; const int FRONTEND_DATA_LENGTH = 300; +const int FRONTEND_GRAPH_TYPE_LENGTH = 20; const double PAGE_RANK_ALPHA = 0.85; const int PAGE_RANK_ITERATIONS = 10; diff --git a/src/frontend/core/executor/impl/TriangleCountExecutor.cpp b/src/frontend/core/executor/impl/TriangleCountExecutor.cpp index 931b5d023..89a1253f4 100644 --- a/src/frontend/core/executor/impl/TriangleCountExecutor.cpp +++ b/src/frontend/core/executor/impl/TriangleCountExecutor.cpp @@ -297,7 +297,7 @@ long TriangleCountExecutor::getTriangleCount(int graphId, std::string host, int std::string masterIP, int uniqueId, bool isCompositeAggregation, int threadPriority) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -561,6 +561,7 @@ long TriangleCountExecutor::getTriangleCount(int graphId, std::string host, int triangleCount_logger.log("There was an error in the upload process and the response is :: " + response, "error"); } + return 0; } bool TriangleCountExecutor::proceedOrNot(std::set partitionSet,int partitionId) { @@ -586,22 +587,20 @@ bool TriangleCountExecutor::proceedOrNot(std::set partitionSet,int parti } } + bool result = false; if (entryWithMinValue.first == partitionId) { int currentWeight = aggregateWeightMap[entryWithMinValue.first]; currentWeight++; aggregateWeightMap[entryWithMinValue.first] = currentWeight; triangleCount_logger.log("###COMPOSITE### Aggregator Initiated : Partition ID: " + std::to_string(partitionId) + " Weight : " + std::to_string(currentWeight), "info"); - return true; - } else { - return false; + result = true; } - - aggregateWeightMutex.unlock(); + return result; } -bool TriangleCountExecutor::updateMap(int partitionId) { +void TriangleCountExecutor::updateMap(int partitionId) { const std::lock_guard lock(aggregateWeightMutex); int currentWeight = aggregateWeightMap[partitionId]; @@ -792,7 +791,7 @@ string TriangleCountExecutor::isFileAccessibleToWorker(std::string graphId, std: std::string masterIP, std::string fileType, std::string fileName) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -936,7 +935,7 @@ std::string TriangleCountExecutor::copyCompositeCentralStoreToAggregator(std::st std::string aggregatorDataPort, std::string fileName, std::string masterIP) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1127,7 +1126,7 @@ TriangleCountExecutor::countCompositeCentralStoreTriangles(std::string aggregato std::string masterIP, std::string availableFileList, int threadPriority) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1240,8 +1239,8 @@ TriangleCountExecutor::countCompositeCentralStoreTriangles(std::string aggregato std::string chunk = chunksVector.at(loopCount); write(sockfd, chunk.c_str(), chunk.size()); } else { - bzero(data, INSTANCE_DATA_LENGTH); - read(sockfd, data, INSTANCE_DATA_LENGTH); + bzero(data, 301); + read(sockfd, data, 300); string chunkStatus = (data); std::string chunk = chunksVector.at(loopCount); write(sockfd, chunk.c_str(), chunk.size()); @@ -1328,7 +1327,7 @@ std::string TriangleCountExecutor::copyCentralStoreToAggregator(std::string aggr std::string aggregatorDataPort, int graphId, int partitionId, std::string masterIP) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1520,7 +1519,7 @@ string TriangleCountExecutor::countCentralStoreTriangles(std::string aggregatorH std::string graphId, std::string masterIP, int threadPriority) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; diff --git a/src/frontend/core/executor/impl/TriangleCountExecutor.h b/src/frontend/core/executor/impl/TriangleCountExecutor.h index 48fc2e1b5..5a4765709 100644 --- a/src/frontend/core/executor/impl/TriangleCountExecutor.h +++ b/src/frontend/core/executor/impl/TriangleCountExecutor.h @@ -67,7 +67,7 @@ class TriangleCountExecutor: public AbstractExecutor { static bool proceedOrNot(std::set partitionSet,int partitionId); - static bool updateMap(int partitionId); + static void updateMap(int partitionId); static int updateTriangleTreeAndGetTriangleCount(std::vector triangles); diff --git a/src/frontend/core/scheduler/JobScheduler.cpp b/src/frontend/core/scheduler/JobScheduler.cpp index de9a39bee..bbf57bb57 100644 --- a/src/frontend/core/scheduler/JobScheduler.cpp +++ b/src/frontend/core/scheduler/JobScheduler.cpp @@ -91,6 +91,7 @@ void *startScheduler(void *dummyPt) { std::this_thread::sleep_for(std::chrono::seconds(Conts::SCHEDULER_SLEEP_TIME)); } } + return NULL; } void JobScheduler::init() { @@ -127,4 +128,4 @@ JobResponse JobScheduler::getResult(JobRequest jobRequest) { } return jobResponse; -} \ No newline at end of file +} diff --git a/src/localstore/incremental/JasmineGraphIncrementalLocalStore.cpp b/src/localstore/incremental/JasmineGraphIncrementalLocalStore.cpp index 8e423aa53..63194f80e 100644 --- a/src/localstore/incremental/JasmineGraphIncrementalLocalStore.cpp +++ b/src/localstore/incremental/JasmineGraphIncrementalLocalStore.cpp @@ -45,7 +45,7 @@ std::pair JasmineGraphIncrementalLocalStore::getIDs(s } } -std::string JasmineGraphIncrementalLocalStore::addEdgeFromString(std::string edgeString) { +void JasmineGraphIncrementalLocalStore::addEdgeFromString(std::string edgeString) { try { auto edgeJson = json::parse(edgeString); @@ -57,7 +57,7 @@ std::string JasmineGraphIncrementalLocalStore::addEdgeFromString(std::string edg RelationBlock* newRelation = this->nm->addEdge({sId, dId}); if (!newRelation) { - return ""; + return; } char value[PropertyLink::MAX_VALUE_SIZE] = {}; diff --git a/src/localstore/incremental/JasmineGraphIncrementalLocalStore.h b/src/localstore/incremental/JasmineGraphIncrementalLocalStore.h index b6f331681..822dd830d 100644 --- a/src/localstore/incremental/JasmineGraphIncrementalLocalStore.h +++ b/src/localstore/incremental/JasmineGraphIncrementalLocalStore.h @@ -25,7 +25,7 @@ class JasmineGraphIncrementalLocalStore public: GraphConfig gc; NodeManager *nm; - std::string addEdgeFromString(std::string edgeString); + void addEdgeFromString(std::string edgeString); static std::pair getIDs(std::string edgeString ); JasmineGraphIncrementalLocalStore(unsigned int graphID = 0, unsigned int partitionID = 0 ); }; diff --git a/src/metadb/SQLiteDBInterface.cpp b/src/metadb/SQLiteDBInterface.cpp index dec2c8702..2cbaad3ca 100644 --- a/src/metadb/SQLiteDBInterface.cpp +++ b/src/metadb/SQLiteDBInterface.cpp @@ -27,11 +27,12 @@ int SQLiteDBInterface::init() { return (-1); } else { db_logger.log("Database opened successfully", "info"); + return 0; } } int SQLiteDBInterface::finalize() { - sqlite3_close(database); + return sqlite3_close(database); } SQLiteDBInterface::SQLiteDBInterface() { @@ -70,12 +71,14 @@ vector >> SQLiteDBInterface::runSelect(std::string q } // This function inserts a new row to the DB and returns the last inserted row id +// returns -1 on error int SQLiteDBInterface::runInsert(std::string query) { char *zErrMsg = 0; int rc = sqlite3_exec(database, query.c_str(), NULL, NULL, &zErrMsg); if (rc != SQLITE_OK) { db_logger.log("SQL Error: " + string(zErrMsg) + " " + query, "error"); sqlite3_free(zErrMsg); + return -1; } else { db_logger.log("Insert operation done successfully", "info"); vector>> dbResults; @@ -86,6 +89,7 @@ int SQLiteDBInterface::runInsert(std::string query) { if (rc2 != SQLITE_OK) { db_logger.log("SQL Error: " + string(zErrMsg) + " " + query, "error"); sqlite3_free(zErrMsg); + return -1; } else { return std::stoi(dbResults[0][0].second); } diff --git a/src/ml/trainer/JasmineGraphTrainingSchedular.cpp b/src/ml/trainer/JasmineGraphTrainingSchedular.cpp index bd59f649f..1fd59c804 100644 --- a/src/ml/trainer/JasmineGraphTrainingSchedular.cpp +++ b/src/ml/trainer/JasmineGraphTrainingSchedular.cpp @@ -31,8 +31,6 @@ map> JasmineGraphTrainingSchedular::schedulePartition string sqlStatement = "SELECT host_idhost, name FROM worker_has_partition INNER JOIN worker ON worker_idworker = " "idworker WHERE partition_graph_idgraph = " + graphID + " group by host_idhost"; - - std::vector>> result = refToSqlite.runSelect(sqlStatement); for (vector>>::iterator i = result.begin(); i != result.end(); ++i) { int count = 0; diff --git a/src/partitioner/local/RDFParser.cpp b/src/partitioner/local/RDFParser.cpp index 7f8fadaac..128589923 100644 --- a/src/partitioner/local/RDFParser.cpp +++ b/src/partitioner/local/RDFParser.cpp @@ -404,7 +404,7 @@ long GetConfig::addToArticles(std::map *map, string URI) { return id; } -long GetConfig::addToEdges(std::map, int> *map, long node_1, long node_2, long article_id) { +void GetConfig::addToEdges(std::map, int> *map, long node_1, long node_2, long article_id) { map->insert({{node_1, node_2}, article_id}); diff --git a/src/partitioner/local/RDFParser.h b/src/partitioner/local/RDFParser.h index 6ebbe448b..929ffcc8a 100644 --- a/src/partitioner/local/RDFParser.h +++ b/src/partitioner/local/RDFParser.h @@ -61,7 +61,7 @@ class GetConfig { ~GetConfig(); - void readConfigFile(std::string &, int id) throw(std::runtime_error); + void readConfigFile(std::string &, int id) /* throw(std::runtime_error) */; char *getOptionA() { return m_OptionA; }; @@ -72,7 +72,7 @@ class GetConfig { long addToAuthors(std::map *map, std::string URI); - long addToEdges(std::map, int> *map, long node_1, long node_2, long article_id); + void addToEdges(std::map, int> *map, long node_1, long node_2, long article_id); long addToArticles(std::map *map, std::string URI); diff --git a/src/partitioner/local/RDFPartitioner.h b/src/partitioner/local/RDFPartitioner.h index c7959065c..2ba7c332e 100644 --- a/src/partitioner/local/RDFPartitioner.h +++ b/src/partitioner/local/RDFPartitioner.h @@ -30,7 +30,6 @@ limitations under the License. #include #include #include -#include #include #include @@ -101,7 +100,7 @@ class RDFPartitioner { std::map predicatesTemp; std::map > graphStorage; std::map>> relationsMap; - std::map>> attributeMap; + std::map>> attributeMap; long edgeCount=0; long vertexCount=0; diff --git a/src/performance/metrics/PerformanceUtil.cpp b/src/performance/metrics/PerformanceUtil.cpp index f6e3a2d93..c17de4bb0 100644 --- a/src/performance/metrics/PerformanceUtil.cpp +++ b/src/performance/metrics/PerformanceUtil.cpp @@ -21,7 +21,7 @@ Logger scheduler_logger; SQLiteDBInterface sqlLiteDB = *new SQLiteDBInterface(); PerformanceSQLiteDBInterface perfDb = *new PerformanceSQLiteDBInterface(); -int PerformanceUtil::init() { +void PerformanceUtil::init() { sqlLiteDB.init(); perfDb.init(); } @@ -198,10 +198,10 @@ std::vector PerformanceUtil::retrieveCurrentResourceUtiliza -int PerformanceUtil::collectRemotePerformanceData(std::string host, int port, std::string isVMStatManager, +void PerformanceUtil::collectRemotePerformanceData(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string hostId, std::string placeId) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -212,7 +212,7 @@ int PerformanceUtil::collectRemotePerformanceData(std::string host, int port, st if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return; } server = gethostbyname(host.c_str()); @@ -307,7 +307,7 @@ int PerformanceUtil::collectRemotePerformanceData(std::string host, int port, st } } -int PerformanceUtil::collectLocalPerformanceData(std::string isVMStatManager, std::string isResourceAllocationRequired, std::string hostId, std::string placeId) { +void PerformanceUtil::collectLocalPerformanceData(std::string isVMStatManager, std::string isResourceAllocationRequired, std::string hostId, std::string placeId) { StatisticCollector statisticCollector; Utils utils; statisticCollector.init(); @@ -352,7 +352,7 @@ int PerformanceUtil::collectRemoteSLAResourceUtilization(std::string host, int p std::string isResourceAllocationRequired, std::string placeId, int elapsedTime, std::string masterIP) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -466,7 +466,7 @@ int PerformanceUtil::collectRemoteSLAResourceUtilization(std::string host, int p } } -int PerformanceUtil::collectLocalSLAResourceUtilization(std::string placeId, int elapsedTime) { +void PerformanceUtil::collectLocalSLAResourceUtilization(std::string placeId, int elapsedTime) { StatisticCollector statisticCollector; Utils utils; statisticCollector.init(); @@ -514,7 +514,7 @@ ResourceConsumption PerformanceUtil::retrieveRemoteResourceConsumption(std::stri ResourceConsumption placeResourceConsumption; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1025,13 +1025,13 @@ std::string PerformanceUtil::getSLACategoryId(std::string command, std::string c } } -int PerformanceUtil::initiateCollectingRemoteSLAResourceUtilization(std::string host, int port, +void PerformanceUtil::initiateCollectingRemoteSLAResourceUtilization(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string placeId, int elapsedTime, std::string masterIP) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -1043,7 +1043,7 @@ int PerformanceUtil::initiateCollectingRemoteSLAResourceUtilization(std::string if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return; } if (host.find('@') != std::string::npos) { @@ -1107,7 +1107,7 @@ std::string PerformanceUtil::requestRemoteLoadAverages(std::string host, int por std::string isResourceAllocationRequired, std::string placeId, int elapsedTime, std::string masterIP) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; diff --git a/src/performance/metrics/PerformanceUtil.h b/src/performance/metrics/PerformanceUtil.h index 03d1e2e1b..a06ff22e5 100644 --- a/src/performance/metrics/PerformanceUtil.h +++ b/src/performance/metrics/PerformanceUtil.h @@ -56,7 +56,7 @@ struct Place{ class PerformanceUtil { public: //PerformanceUtil(SQLiteDBInterface sqlLiteDB, PerformanceSQLiteDBInterface perfDb); - int init(); + void init(); static int collectPerformanceStatistics(); static int collectSLAResourceConsumption(std::vector placeList, std::string graphId, std::string masterIP, int elapsedTime); @@ -71,7 +71,7 @@ class PerformanceUtil { static void updateRemoteResourceConsumption(PerformanceSQLiteDBInterface performanceDb, std::string graphId, int partitionCount, std::vector placeList, std::string slaCategoryId, std::string masterIP); static std::string getSLACategoryId(std::string command, std::string category); - static int initiateCollectingRemoteSLAResourceUtilization(std::string host, int port, std::string isVMStatManager, + static void initiateCollectingRemoteSLAResourceUtilization(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string placeId, int elapsedTime, std::string masterIP); static std::string requestRemoteLoadAverages(std::string host, int port, @@ -83,12 +83,12 @@ class PerformanceUtil { private: //static SQLiteDBInterface sqlLiteDB; //static PerformanceSQLiteDBInterface perfDb; - static int collectRemotePerformanceData(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string hostId, std::string placeId); - static int collectLocalPerformanceData(std::string isVMStatManager, std::string isResourceAllocationRequired , std::string hostId, std::string placeId); + static void collectRemotePerformanceData(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string hostId, std::string placeId); + static void collectLocalPerformanceData(std::string isVMStatManager, std::string isResourceAllocationRequired , std::string hostId, std::string placeId); static int collectRemoteSLAResourceUtilization(std::string host, int port, std::string isVMStatManager, std::string isResourceAllocationRequired, std::string placeId, int elapsedTime, std::string masterIP); - static int collectLocalSLAResourceUtilization(std::string placeId, int elapsedTime); + static void collectLocalSLAResourceUtilization(std::string placeId, int elapsedTime); static ResourceConsumption retrieveRemoteResourceConsumption(std::string host, int port, std::string hostId, std::string placeId); static ResourceConsumption retrieveLocalResourceConsumption(std::string hostId, std::string placeId); diff --git a/src/performance/metrics/StatisticCollector.cpp b/src/performance/metrics/StatisticCollector.cpp index a36a0d44b..7df86195c 100644 --- a/src/performance/metrics/StatisticCollector.cpp +++ b/src/performance/metrics/StatisticCollector.cpp @@ -31,6 +31,7 @@ int StatisticCollector::init() { if (strncmp(line, "processor", 9) == 0) numProcessors++; } fclose(file); + return 0; } @@ -126,6 +127,7 @@ long StatisticCollector::getTotalMemoryAllocated() { } file.ignore(std::numeric_limits::max(), '\n'); } + return 0; } int StatisticCollector::getTotalNumberofCores() { diff --git a/src/performancedb/PerformanceSQLiteDBInterface.cpp b/src/performancedb/PerformanceSQLiteDBInterface.cpp index c58beb82f..3d735d9c2 100644 --- a/src/performancedb/PerformanceSQLiteDBInterface.cpp +++ b/src/performancedb/PerformanceSQLiteDBInterface.cpp @@ -27,11 +27,12 @@ int PerformanceSQLiteDBInterface::init() { return (-1); } else { perfdb_logger.log("Database opened successfully", "info"); + return 0; } } int PerformanceSQLiteDBInterface::finalize() { - sqlite3_close(database); + return sqlite3_close(database); } PerformanceSQLiteDBInterface::PerformanceSQLiteDBInterface() { @@ -76,6 +77,7 @@ int PerformanceSQLiteDBInterface::runInsert(std::string query) { if (rc != SQLITE_OK) { perfdb_logger.log("SQL Error: " + string(zErrMsg), "error"); sqlite3_free(zErrMsg); + return -1; } else { perfdb_logger.log("Insert operation done successfully", "info"); vector>> dbResults; @@ -86,6 +88,7 @@ int PerformanceSQLiteDBInterface::runInsert(std::string query) { if (rc2 != SQLITE_OK) { fprintf(stderr, "SQL error: %s\n", zErrMsg); sqlite3_free(zErrMsg); + return -1; } else { return std::stoi(dbResults[0][0].second); } diff --git a/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp b/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp index 020d0fa0e..5f8b025e7 100644 --- a/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp +++ b/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp @@ -17,7 +17,7 @@ limitations under the License. Logger predictor_logger; -int JasminGraphLinkPredictor::initiateLinkPrediction(std::string graphID, std::string path, std::string masterIP) { +void JasminGraphLinkPredictor::initiateLinkPrediction(std::string graphID, std::string path, std::string masterIP) { JasmineGraphServer *jasmineServer = new JasmineGraphServer(); std::map graphPartitionedHosts = jasmineServer->getGraphPartitionedHosts( @@ -88,7 +88,7 @@ int JasminGraphLinkPredictor::sendQueryToWorker(std::string host, int port, int bool result = true; std::cout << pthread_self() << " host : " << host << " port : " << port << " DPort : " << dataPort << std::endl; int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; diff --git a/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.h b/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.h index 66025d4eb..c56f8d4a6 100644 --- a/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.h +++ b/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.h @@ -23,7 +23,7 @@ limitations under the License. class JasminGraphLinkPredictor { public: - int initiateLinkPrediction(std::string graphID, std::string path, std::string masterIP); + void initiateLinkPrediction(std::string graphID, std::string path, std::string masterIP); int sendQueryToWorker(std::string host, int port, int dataPort, int selectedHostPartitionsNo, std::string graphID, std::string vertexCount, diff --git a/src/server/JasmineGraphInstance.cpp b/src/server/JasmineGraphInstance.cpp index fa1768f53..9bb291f0c 100644 --- a/src/server/JasmineGraphInstance.cpp +++ b/src/server/JasmineGraphInstance.cpp @@ -22,12 +22,14 @@ void *runInstanceService(void *dummyPt) { refToInstance->instanceService = new JasmineGraphInstanceService(); refToInstance->instanceService->run(refToInstance->profile, refToInstance->masterHostName, refToInstance->hostName, refToInstance->serverPort, refToInstance->serverDataPort); + return NULL; } void *runFileTransferService(void *dummyPt) { JasmineGraphInstance *refToInstance = (JasmineGraphInstance *) dummyPt; refToInstance->ftpService = new JasmineGraphInstanceFileTransferService(); refToInstance->ftpService->run(refToInstance->serverDataPort); + return NULL; } int JasmineGraphInstance::start_running(string profile, string hostName, string masterHost,int serverPort, int serverDataPort, string enableNmon) { @@ -56,12 +58,12 @@ int JasmineGraphInstance::start_running(string profile, string hostName, string pthread_join(instanceCommunicatorThread,NULL); pthread_join(instanceFileTransferThread,NULL); - + return 0; } bool JasmineGraphInstance::acknowledgeMaster(string masterHost, string workerIP, string workerPort) { int sockfd; - char data[300]; + char data[301]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -72,7 +74,7 @@ bool JasmineGraphInstance::acknowledgeMaster(string masterHost, string workerIP, if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return false; } if (masterHost.find('@') != std::string::npos) { @@ -154,17 +156,18 @@ bool JasmineGraphInstance::acknowledgeMaster(string masterHost, string workerIP, response = (data); if (response.compare(JasmineGraphInstanceProtocol::UPDATE_DONE) == 0) { - return 1; + return true; } } if (response.compare(JasmineGraphInstanceProtocol::OK) == 0) { - return 1; + return true; } } - return 0; + return false; } + return false; } void JasmineGraphInstance::startNmonAnalyzer(string enableNmon, int serverPort) { @@ -205,7 +208,7 @@ bool JasmineGraphInstance::sendFileThroughService(std::string host, int dataPort std::string filePath) { Utils utils; int sockfd; - char data[300]; + char data[301]; socklen_t len; struct sockaddr_in serv_addr; struct hostent *server; @@ -214,7 +217,7 @@ bool JasmineGraphInstance::sendFileThroughService(std::string host, int dataPort if (sockfd < 0) { std::cerr << "Cannot accept connection" << std::endl; - return 0; + return false; } server = gethostbyname(host.c_str()); @@ -231,6 +234,7 @@ bool JasmineGraphInstance::sendFileThroughService(std::string host, int dataPort serv_addr.sin_port = htons(dataPort); if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting to port " << dataPort << std::endl; + return false; } fileName = "jasminegraph-local_trained_model_store/"+fileName; @@ -247,7 +251,7 @@ bool JasmineGraphInstance::sendFileThroughService(std::string host, int dataPort if (fp == NULL) { printf("Error opening file\n"); close(sockfd); - return 0; + return false; } for (;;) { unsigned char buff[1024] = {0}; @@ -263,15 +267,19 @@ bool JasmineGraphInstance::sendFileThroughService(std::string host, int dataPort if (nread < 1024) { if (feof(fp)) //printf("End of file\n"); - if (ferror(fp)) + if (ferror(fp)){ printf("Error reading\n"); + return false; + } break; } } fclose(fp); close(sockfd); + return true; } + return false; } void JasmineGraphInstance::logLoadAverage(std::string name) { diff --git a/src/server/JasmineGraphInstanceFileTransferService.cpp b/src/server/JasmineGraphInstanceFileTransferService.cpp index 721e08dba..d69354380 100644 --- a/src/server/JasmineGraphInstanceFileTransferService.cpp +++ b/src/server/JasmineGraphInstanceFileTransferService.cpp @@ -23,7 +23,7 @@ void *filetransferservicesession(void *dummyPt) { filetransferservicesessionargs *sessionargs = (filetransferservicesessionargs *) dummyPt; int connFd = sessionargs->connFd; Utils utils; - char data[300]; + char data[301]; bzero(data, 301); read(connFd, data, 300); string fileName = (data); @@ -44,12 +44,13 @@ void *filetransferservicesession(void *dummyPt) { } } while (bytesReceived > 0); file.close(); + return NULL; } JasmineGraphInstanceFileTransferService::JasmineGraphInstanceFileTransferService() { } -int JasmineGraphInstanceFileTransferService::run(int dataPort) { +void JasmineGraphInstanceFileTransferService::run(int dataPort) { int listenFd; socklen_t len; @@ -60,7 +61,7 @@ int JasmineGraphInstanceFileTransferService::run(int dataPort) { listenFd = socket(AF_INET, SOCK_STREAM, 0); if (listenFd < 0) { std::cerr << "Cannot open socket" << std::endl; - return 0; + return; } bzero((char *) &svrAdd, sizeof(svrAdd)); @@ -79,7 +80,7 @@ int JasmineGraphInstanceFileTransferService::run(int dataPort) { //bind socket if (bind(listenFd, (struct sockaddr *) &svrAdd, sizeof(svrAdd)) < 0) { std::cerr << "Cannot bind on port " + dataPort << std::endl; - return 0; + return; } int connFd; listen(listenFd, 10); diff --git a/src/server/JasmineGraphInstanceFileTransferService.h b/src/server/JasmineGraphInstanceFileTransferService.h index 0f27b36c8..4b186a16c 100644 --- a/src/server/JasmineGraphInstanceFileTransferService.h +++ b/src/server/JasmineGraphInstanceFileTransferService.h @@ -37,7 +37,7 @@ class JasmineGraphInstanceFileTransferService { public: JasmineGraphInstanceFileTransferService(); - int run(int dataPort); + void run(int dataPort); }; diff --git a/src/server/JasmineGraphInstanceService.h b/src/server/JasmineGraphInstanceService.h index 3c154df4c..fb73f875e 100644 --- a/src/server/JasmineGraphInstanceService.h +++ b/src/server/JasmineGraphInstanceService.h @@ -119,7 +119,7 @@ class JasmineGraphInstanceService { static const string END_OF_MESSAGE; JasmineGraphInstanceService(); - int run(string profile, string masterHost, string hostName, int serverPort, int serverDataPort); + void run(string profile, string masterHost, string hostName, int serverPort, int serverDataPort); static bool isGraphDBExists(std::string graphId, std::string partitionId); static bool isInstanceCentralStoreExists(std::string graphId, std::string partitionId); diff --git a/src/util/Utils.cpp b/src/util/Utils.cpp index ea7a0a01b..1b0277c01 100644 --- a/src/util/Utils.cpp +++ b/src/util/Utils.cpp @@ -68,19 +68,11 @@ std::vector Utils::getFileContent(std::string file) { ifstream in(file); std::string str; - //map* result = new map(); vector *vec = new vector(); while (std::getline(in, str)) { - // output the line - //std::cout << str << std::endl; - // now we loop back and get the next line in 'str' - //if (str.length() > 0 && !(str.rfind("#", 0) == 0)) { if (str.length() > 0) { - //std::vector vec = split(str, '='); - //std::cout << vec.size() << std::endl; - //result->insert(std::pair(vec.at(0), vec.at(1))); vec->insert(vec->begin(), str); } } @@ -220,9 +212,12 @@ std::vector Utils::getListOfFilesInDirectory(const std::string dirN } pclose(input); if (!result.empty()) { - std::vector vec = split(result, '\r\n'); + std::vector vec = split(result, '\n'); for(std::vector::iterator it = vec.begin(); it != vec.end(); ++it){ std::string line = it->c_str(); + if (line.back() == '\r') { + line.pop_back(); + } if (line.rfind("-", 0) == 0) { std::string file = line.substr(line.find_last_of(' ') + 1); results.push_back(file); diff --git a/src/util/kafka/KafkaCC.cpp b/src/util/kafka/KafkaCC.cpp index 0b1692c58..d2deb7a56 100755 --- a/src/util/kafka/KafkaCC.cpp +++ b/src/util/kafka/KafkaCC.cpp @@ -66,4 +66,5 @@ void *KafkaConnector::startStream(string topicName, std::vector workerClients.at((int)partitionedEdge[1].second)->publish(edgeJson.dump()); } graphPartitioner.printStats(); + return NULL; } diff --git a/tests/integration/docker-compose.yml b/tests/integration/docker-compose.yml new file mode 100644 index 000000000..c16e27626 --- /dev/null +++ b/tests/integration/docker-compose.yml @@ -0,0 +1,27 @@ +version: '3.0' +services: + jasminegraph: + image: jasminegraph:test + ports: + - '7777:7777' + - '7778:7778' + volumes: + - '/var/run/docker.sock:/var/run/docker.sock:rw' + - './env/databases/metadb:/home/ubuntu/software/jasminegraph/metadb' + - './env/databases/performancedb:/home/ubuntu/software/jasminegraph/performancedb' + - './env/data:/var/tmp/data' + environment: + - TESTING=true + networks: + - jasminenet + command: --MODE 1 --MASTERIP 172.28.5.1 --WORKERS 2 --WORKERIP 172.28.5.1 --ENABLE_NMON false + +networks: + jasminenet: + name: jasminenet + driver: bridge + ipam: + config: + - subnet: 172.28.5.0/24 + ip_range: 172.28.5.0/24 + gateway: 172.28.5.1 diff --git a/tests/integration/env_init/data/powergrid.dl b/tests/integration/env_init/data/powergrid.dl new file mode 100755 index 000000000..7f337240c --- /dev/null +++ b/tests/integration/env_init/data/powergrid.dl @@ -0,0 +1,6594 @@ +8 6 +8 7 +9 8 +10 9 +13 5 +13 12 +14 13 +15 13 +16 14 +17 14 +19 18 +20 19 +29 14 +34 33 +35 34 +36 35 +37 36 +38 36 +39 36 +42 41 +47 36 +47 44 +47 45 +47 46 +50 10 +51 21 +53 24 +58 25 +58 41 +59 58 +60 59 +61 9 +62 31 +68 63 +68 64 +68 65 +69 35 +69 66 +69 68 +70 67 +70 69 +73 72 +75 9 +75 48 +77 76 +79 78 +80 79 +82 81 +83 13 +86 71 +86 76 +88 4 +88 55 +88 87 +89 87 +90 88 +91 73 +94 11 +94 26 +94 43 +94 92 +94 93 +95 94 +97 34 +97 40 +98 28 +98 42 +98 57 +98 74 +98 82 +100 98 +100 99 +101 48 +104 31 +106 48 +107 55 +108 70 +109 54 +109 78 +110 76 +110 86 +111 52 +112 72 +113 112 +115 114 +116 108 +117 116 +118 116 +119 52 +119 56 +120 5 +120 51 +122 121 +123 30 +123 92 +123 101 +123 122 +125 11 +125 98 +129 95 +129 113 +129 126 +129 127 +129 128 +130 19 +130 29 +131 26 +131 94 +135 98 +136 25 +139 26 +139 50 +139 131 +139 138 +140 30 +140 102 +140 123 +140 138 +140 139 +141 35 +141 140 +142 35 +142 141 +143 138 +144 96 +145 103 +146 136 +147 14 +147 54 +148 96 +148 111 +148 119 +149 56 +150 138 +151 85 +151 143 +152 56 +153 103 +153 124 +153 146 +154 60 +154 62 +154 153 +155 32 +155 154 +156 153 +157 36 +157 153 +157 154 +158 153 +159 154 +160 29 +161 27 +163 43 +163 162 +164 163 +165 162 +166 27 +167 41 +167 58 +170 77 +170 168 +170 169 +171 47 +171 95 +171 170 +172 52 +172 88 +173 124 +173 154 +174 32 +174 92 +174 104 +175 56 +175 119 +176 21 +176 166 +178 88 +178 107 +178 177 +179 177 +180 177 +181 42 +181 150 +184 46 +184 80 +184 105 +184 182 +184 183 +185 76 +186 106 +186 140 +187 169 +187 185 +188 61 +189 156 +189 174 +190 18 +190 103 +191 77 +191 150 +191 163 +192 111 +192 144 +193 157 +193 192 +194 51 +194 124 +194 145 +195 88 +196 145 +196 161 +198 56 +198 88 +198 149 +198 152 +199 20 +199 80 +199 179 +200 184 +200 198 +201 197 +201 198 +201 199 +202 40 +202 143 +203 26 +204 111 +204 195 +205 9 +205 50 +205 98 +205 115 +205 138 +205 188 +206 179 +207 108 +207 116 +207 129 +207 205 +207 206 +208 9 +208 125 +209 61 +210 101 +211 210 +212 210 +213 210 +215 72 +215 112 +215 214 +218 41 +218 83 +218 217 +221 83 +221 220 +222 104 +222 134 +223 137 +224 71 +224 137 +224 219 +225 216 +225 221 +227 169 +227 223 +228 187 +228 216 +229 137 +229 168 +229 226 +230 187 +230 226 +231 53 +231 73 +232 41 +232 124 +234 143 +234 233 +235 129 +236 134 +236 135 +237 236 +240 239 +242 241 +247 245 +247 246 +250 248 +250 249 +252 238 +252 251 +253 252 +255 254 +257 246 +259 256 +259 257 +261 260 +262 261 +267 261 +267 266 +269 268 +274 270 +274 271 +274 272 +274 273 +275 274 +280 249 +280 279 +281 264 +282 279 +284 242 +284 254 +284 282 +284 283 +285 255 +285 284 +286 276 +287 260 +289 251 +289 252 +290 288 +292 291 +295 279 +295 282 +296 284 +296 295 +298 246 +298 278 +298 293 +299 255 +299 258 +299 298 +300 294 +300 297 +302 279 +302 282 +302 295 +302 301 +305 249 +305 280 +305 284 +305 304 +306 258 +306 285 +306 305 +307 303 +308 265 +308 297 +310 257 +311 258 +311 310 +312 249 +312 280 +313 249 +313 279 +313 280 +313 282 +313 295 +313 302 +313 305 +313 312 +314 277 +315 314 +316 240 +316 285 +316 299 +316 303 +316 306 +316 315 +318 238 +318 317 +319 251 +320 319 +321 263 +321 320 +322 252 +322 319 +323 308 +325 274 +325 292 +325 324 +326 314 +327 240 +328 327 +329 254 +330 247 +330 329 +333 239 +333 332 +334 261 +334 264 +334 281 +335 244 +335 278 +335 298 +336 290 +336 318 +337 240 +337 253 +337 316 +337 336 +338 336 +339 338 +340 297 +340 308 +340 331 +341 340 +342 243 +342 277 +343 298 +343 342 +344 262 +344 311 +345 262 +345 311 +346 269 +346 341 +350 260 +350 266 +350 349 +351 241 +351 276 +351 287 +352 334 +352 347 +352 348 +352 351 +353 309 +353 332 +354 239 +354 353 +355 243 +355 332 +355 342 +355 353 +356 315 +356 355 +357 330 +358 309 +360 249 +360 257 +360 280 +361 244 +361 359 +362 269 +362 274 +362 292 +362 299 +362 361 +363 242 +364 242 +365 242 +365 296 +366 242 +366 284 +367 251 +368 257 +368 310 +369 260 +369 350 +370 251 +370 319 +370 367 +371 246 +372 272 +373 335 +374 353 +376 252 +377 357 +378 246 +378 278 +378 371 +378 375 +379 327 +380 331 +381 257 +381 360 +382 260 +384 383 +386 0 +386 385 +387 386 +391 390 +392 391 +393 384 +394 391 +395 0 +395 393 +396 393 +397 396 +398 396 +399 396 +400 396 +402 392 +402 401 +403 402 +405 404 +406 392 +406 405 +408 407 +409 391 +411 402 +411 410 +414 413 +415 413 +417 416 +419 395 +420 396 +421 418 +421 419 +421 420 +423 391 +425 392 +425 414 +425 424 +426 384 +426 420 +426 425 +427 426 +429 383 +430 388 +430 416 +430 423 +431 405 +431 409 +432 431 +433 431 +435 402 +435 434 +436 392 +436 402 +436 432 +437 389 +437 408 +439 402 +439 422 +439 438 +441 430 +441 440 +442 394 +442 441 +443 424 +444 416 +444 424 +445 383 +445 386 +446 386 +446 429 +447 384 +447 393 +447 426 +449 448 +450 416 +451 0 +451 408 +452 413 +452 428 +453 451 +454 383 +455 383 +455 454 +456 408 +456 419 +457 394 +457 405 +459 413 +459 428 +459 455 +460 405 +460 457 +461 435 +461 458 +462 383 +462 413 +463 453 +464 413 +464 443 +465 449 +465 456 +466 442 +467 449 +467 463 +468 413 +468 443 +468 450 +469 416 +469 430 +469 464 +470 429 +470 454 +472 431 +472 438 +472 471 +473 412 +473 438 +477 476 +479 478 +480 477 +480 479 +481 474 +481 479 +484 477 +484 483 +485 482 +485 484 +486 485 +489 482 +489 485 +491 481 +491 487 +492 478 +493 480 +493 484 +493 492 +494 482 +494 486 +495 482 +496 91 +496 484 +496 495 +497 485 +497 492 +498 478 +498 485 +499 214 +499 496 +501 500 +504 502 +504 503 +512 511 +513 511 +519 515 +520 516 +520 517 +520 518 +520 519 +522 116 +522 521 +523 504 +524 523 +525 523 +527 526 +528 524 +529 528 +530 525 +530 528 +531 530 +532 523 +532 526 +533 532 +534 511 +536 535 +537 536 +538 511 +538 534 +539 506 +539 507 +540 539 +541 539 +542 539 +543 539 +544 539 +545 509 +545 543 +545 544 +546 506 +546 507 +548 505 +548 532 +548 547 +549 501 +549 548 +550 511 +550 534 +550 542 +551 505 +551 511 +551 538 +551 548 +551 550 +552 548 +553 546 +554 546 +555 547 +555 552 +555 553 +555 554 +556 504 +556 532 +557 536 +558 546 +558 557 +559 535 +559 546 +561 510 +561 543 +561 544 +561 560 +562 558 +563 556 +563 557 +563 562 +564 504 +564 532 +565 506 +565 508 +565 543 +566 507 +566 508 +566 544 +568 532 +568 548 +568 567 +569 540 +569 541 +570 501 +570 522 +570 533 +570 569 +571 509 +572 509 +573 501 +573 532 +574 535 +578 577 +582 576 +583 582 +584 582 +585 581 +585 584 +587 586 +590 589 +591 589 +593 592 +594 578 +594 589 +595 594 +596 594 +597 588 +597 592 +598 597 +599 597 +600 597 +601 597 +602 597 +604 603 +605 604 +606 604 +609 608 +610 578 +610 607 +610 609 +611 609 +612 582 +613 612 +614 585 +614 613 +616 615 +618 587 +618 617 +619 614 +620 597 +622 621 +624 587 +624 623 +625 576 +626 581 +626 619 +628 594 +628 627 +630 592 +630 629 +632 631 +634 632 +634 633 +636 614 +636 635 +639 616 +639 632 +639 638 +640 576 +640 612 +641 640 +644 643 +645 582 +646 645 +648 636 +648 644 +648 647 +650 649 +652 584 +653 622 +653 639 +653 651 +653 652 +655 624 +655 654 +657 575 +657 597 +657 604 +657 609 +658 605 +658 628 +658 642 +658 656 +658 657 +659 575 +660 575 +662 609 +662 661 +664 579 +664 663 +666 605 +666 665 +667 584 +668 618 +668 624 +668 632 +668 667 +669 587 +669 655 +671 637 +672 584 +672 671 +673 672 +674 672 +676 614 +676 675 +679 587 +679 678 +680 584 +680 652 +680 667 +681 639 +681 679 +681 680 +682 680 +683 680 +685 639 +685 653 +685 681 +685 684 +687 644 +687 681 +687 686 +689 632 +689 655 +689 688 +691 604 +691 662 +691 690 +692 589 +692 666 +693 680 +694 692 +695 694 +696 630 +696 657 +697 696 +699 698 +700 612 +702 579 +702 675 +702 681 +702 700 +702 701 +703 587 +704 645 +704 670 +705 594 +707 706 +708 624 +708 681 +709 637 +709 706 +710 709 +712 658 +712 711 +713 637 +713 671 +713 704 +714 713 +716 715 +718 632 +718 668 +718 717 +720 580 +720 677 +720 716 +720 719 +722 610 +722 712 +722 721 +723 722 +725 580 +725 616 +725 634 +725 639 +725 650 +725 653 +725 677 +725 720 +725 724 +726 652 +726 667 +726 680 +726 692 +726 694 +726 725 +727 720 +728 637 +728 698 +729 728 +730 575 +732 689 +732 731 +734 702 +734 733 +736 622 +736 734 +736 735 +738 658 +738 692 +738 737 +740 739 +743 742 +744 741 +744 743 +745 743 +746 744 +748 740 +749 739 +750 740 +750 748 +751 748 +752 749 +753 750 +757 740 +757 750 +757 755 +757 756 +758 757 +759 742 +760 743 +760 759 +762 742 +762 759 +762 761 +763 739 +764 754 +766 765 +771 767 +771 770 +772 768 +772 769 +772 771 +773 771 +774 764 +775 748 +776 750 +777 743 +777 763 +778 759 +778 762 +779 742 +780 747 +780 762 +781 774 +781 780 +783 754 +783 780 +784 780 +785 770 +786 771 +786 776 +786 785 +787 756 +789 762 +789 779 +789 780 +789 788 +791 757 +791 783 +791 787 +793 792 +794 793 +795 779 +796 795 +797 770 +799 780 +799 798 +800 783 +801 800 +802 744 +803 754 +803 766 +803 780 +803 782 +803 787 +803 791 +804 743 +804 794 +804 795 +805 748 +805 749 +807 803 +807 806 +808 795 +809 808 +811 793 +811 810 +812 758 +813 758 +814 760 +814 763 +814 778 +815 740 +815 744 +815 763 +816 815 +817 774 +818 817 +819 818 +820 764 +820 819 +821 803 +822 809 +822 811 +823 758 +823 772 +824 758 +824 772 +826 825 +828 521 +828 827 +829 826 +832 521 +832 831 +834 829 +834 833 +836 829 +836 835 +837 828 +839 838 +840 839 +842 841 +844 825 +845 827 +846 844 +847 846 +848 847 +853 837 +853 838 +853 852 +854 833 +854 850 +854 851 +855 831 +855 849 +855 854 +856 855 +858 827 +859 854 +860 846 +860 855 +860 859 +861 843 +861 854 +862 833 +862 843 +863 843 +863 854 +864 854 +864 859 +865 844 +865 852 +866 833 +867 831 +868 831 +869 831 +870 846 +871 837 +872 837 +873 852 +874 833 +876 875 +877 827 +877 845 +878 875 +879 848 +880 846 +881 859 +881 875 +882 857 +883 859 +883 864 +883 882 +884 846 +884 883 +885 858 +885 871 +885 874 +886 848 +887 848 +888 848 +889 848 +891 833 +891 854 +891 881 +892 835 +892 878 +893 857 +893 875 +894 846 +894 876 +894 893 +895 831 +895 869 +895 876 +896 835 +896 892 +896 895 +897 874 +897 895 +898 850 +899 869 +900 846 +900 852 +900 880 +901 874 +902 852 +902 857 +902 890 +903 831 +903 845 +904 831 +905 831 +906 831 +907 849 +908 849 +909 849 +910 831 +911 847 +912 846 +917 912 +917 913 +917 914 +918 912 +918 915 +918 916 +919 831 +920 831 +921 864 +926 921 +926 922 +926 923 +927 921 +927 924 +927 925 +928 871 +928 878 +928 885 +928 901 +928 902 +929 872 +929 878 +929 890 +929 902 +929 928 +930 873 +930 878 +930 899 +931 882 +931 902 +932 831 +935 934 +936 934 +938 937 +940 939 +941 936 +942 941 +944 943 +945 944 +946 942 +947 946 +949 948 +950 948 +951 949 +951 950 +953 952 +954 937 +956 939 +957 956 +959 942 +959 958 +961 939 +962 949 +964 948 +965 960 +966 965 +968 967 +969 934 +969 935 +970 950 +971 951 +971 970 +973 954 +973 965 +973 972 +975 952 +978 951 +979 68 +980 979 +982 981 +983 953 +983 955 +984 939 +985 984 +987 960 +988 987 +989 80 +989 987 +991 963 +992 977 +993 958 +993 962 +993 992 +994 941 +994 990 +995 944 +995 969 +996 970 +997 184 +997 966 +997 989 +998 992 +999 994 +1000 951 +1001 996 +1002 1001 +1003 943 +1005 943 +1005 978 +1005 1002 +1006 945 +1006 959 +1006 968 +1006 997 +1006 1005 +1007 1005 +1008 1005 +1009 1005 +1010 937 +1010 975 +1010 986 +1011 953 +1011 991 +1011 1010 +1012 986 +1013 963 +1013 1012 +1014 933 +1014 941 +1014 1005 +1015 956 +1015 981 +1016 940 +1016 1015 +1017 1016 +1019 1018 +1021 965 +1021 969 +1021 973 +1021 1004 +1021 1020 +1022 1018 +1023 952 +1023 974 +1024 952 +1024 974 +1025 964 +1026 967 +1026 971 +1026 1000 +1026 1005 +1026 1025 +1027 1026 +1028 943 +1028 944 +1028 995 +1028 1004 +1030 69 +1030 105 +1030 953 +1030 963 +1030 1029 +1031 974 +1031 1019 +1032 1031 +1033 1030 +1034 950 +1034 976 +1034 998 +1035 1034 +1036 940 +1036 979 +1037 971 +1037 1005 +1038 1030 +1039 1030 +1040 1030 +1042 1041 +1043 949 +1043 1026 +1044 986 +1044 1012 +1044 1041 +1045 1003 +1045 1026 +1046 1019 +1046 1022 +1046 1031 +1047 948 +1047 977 +1047 992 +1048 948 +1048 976 +1049 958 +1049 993 +1049 1005 +1049 1035 +1050 937 +1050 954 +1050 956 +1050 984 +1050 1019 +1050 1022 +1050 1023 +1050 1024 +1051 940 +1051 1050 +1052 69 +1052 953 +1052 1032 +1052 1050 +1053 933 +1054 975 +1054 991 +1055 105 +1055 961 +1055 981 +1056 952 +1056 1010 +1056 1041 +1057 968 +1057 997 +1057 1006 +1058 945 +1058 1052 +1059 1022 +1059 1023 +1059 1024 +1059 1046 +1061 1060 +1062 1060 +1065 1063 +1068 1067 +1070 1069 +1073 1072 +1076 1074 +1076 1075 +1079 1078 +1086 1085 +1087 1085 +1088 1086 +1088 1087 +1090 1087 +1091 1065 +1091 1086 +1091 1088 +1091 1090 +1092 1091 +1094 1093 +1095 1093 +1097 1086 +1097 1096 +1098 1084 +1099 1098 +1101 1100 +1103 1102 +1106 1105 +1107 1106 +1108 1090 +1111 1110 +1116 1113 +1119 317 +1119 1065 +1119 1118 +1122 1121 +1124 811 +1124 822 +1125 427 +1127 1126 +1128 1126 +1135 1132 +1136 1106 +1137 1107 +1137 1136 +1138 1136 +1139 1136 +1142 1141 +1143 1103 +1143 1106 +1145 1105 +1148 1146 +1148 1147 +1150 1149 +1154 1081 +1156 1155 +1159 1074 +1159 1158 +1160 1063 +1161 1156 +1163 1122 +1163 1162 +1165 1090 +1166 1091 +1166 1147 +1166 1159 +1166 1165 +1167 1148 +1167 1166 +1168 1166 +1170 1152 +1170 1159 +1170 1169 +1171 1170 +1175 1170 +1176 1064 +1176 1119 +1177 1094 +1178 285 +1178 1177 +1179 1105 +1180 1106 +1183 488 +1184 1174 +1187 1129 +1189 1117 +1189 1188 +1190 1182 +1191 1072 +1191 1190 +1192 1073 +1192 1191 +1193 1098 +1195 1194 +1196 1069 +1197 1069 +1197 1154 +1197 1196 +1200 1199 +1201 488 +1201 1170 +1201 1175 +1203 1202 +1204 1202 +1207 1147 +1207 1206 +1208 1072 +1210 1109 +1211 1210 +1213 1212 +1214 793 +1216 411 +1216 1215 +1217 1075 +1220 1087 +1221 1156 +1222 1144 +1223 1087 +1224 1077 +1224 1082 +1224 1084 +1225 1224 +1226 1102 +1226 1129 +1227 812 +1228 813 +1230 744 +1230 800 +1231 1227 +1231 1228 +1231 1230 +1234 1189 +1234 1233 +1236 1235 +1237 1236 +1239 1232 +1239 1238 +1240 1108 +1241 1162 +1242 1133 +1243 1123 +1243 1131 +1244 1078 +1244 1167 +1246 1191 +1246 1232 +1247 1218 +1248 412 +1249 1106 +1251 1220 +1253 1204 +1253 1252 +1254 1222 +1254 1229 +1256 1249 +1257 800 +1258 1257 +1260 1156 +1260 1161 +1260 1259 +1262 1224 +1263 1261 +1265 1177 +1267 1107 +1267 1243 +1267 1244 +1267 1266 +1269 1070 +1269 1268 +1271 1270 +1273 1272 +1274 1272 +1275 1122 +1275 1150 +1276 1100 +1277 1101 +1277 1276 +1278 1276 +1279 1278 +1280 1072 +1281 1280 +1283 1150 +1283 1282 +1285 1096 +1289 1250 +1289 1287 +1289 1288 +1290 1205 +1291 1242 +1292 1221 +1292 1257 +1294 1293 +1295 1083 +1297 435 +1297 1252 +1297 1296 +1299 1163 +1299 1298 +1300 1069 +1300 1286 +1301 1140 +1301 1300 +1302 1298 +1304 1253 +1304 1294 +1304 1303 +1306 1078 +1306 1244 +1306 1294 +1306 1305 +1307 1275 +1308 1131 +1308 1243 +1308 1307 +1309 1170 +1309 1201 +1309 1209 +1309 1279 +1310 1309 +1311 1089 +1312 1311 +1313 1073 +1313 1078 +1313 1123 +1313 1267 +1313 1281 +1314 1072 +1315 1314 +1316 1309 +1317 1106 +1319 1318 +1322 1159 +1323 1106 +1323 1133 +1324 1323 +1326 1157 +1326 1225 +1326 1256 +1326 1325 +1327 1326 +1328 1326 +1329 1239 +1329 1299 +1330 1131 +1330 1192 +1330 1329 +1331 1063 +1332 1140 +1332 1319 +1334 1080 +1334 1099 +1334 1237 +1334 1333 +1335 1151 +1337 1336 +1338 1102 +1338 1323 +1340 1148 +1340 1178 +1340 1339 +1341 1339 +1343 1097 +1343 1252 +1343 1342 +1345 1140 +1345 1332 +1345 1344 +1346 1213 +1346 1333 +1348 1199 +1349 1198 +1349 1252 +1349 1348 +1350 1296 +1351 1085 +1352 1276 +1353 1091 +1353 1128 +1353 1257 +1353 1289 +1354 1353 +1355 1241 +1356 1151 +1356 1335 +1357 1152 +1357 1356 +1359 1206 +1361 1140 +1361 1273 +1361 1360 +1362 1361 +1363 1360 +1364 1203 +1364 1342 +1364 1350 +1365 1107 +1365 1244 +1365 1324 +1367 1085 +1369 1334 +1369 1368 +1371 1070 +1371 1362 +1371 1370 +1373 1269 +1373 1313 +1373 1365 +1373 1372 +1374 1323 +1374 1372 +1376 1375 +1377 1283 +1379 1097 +1379 1353 +1379 1378 +1382 1377 +1382 1381 +1383 1243 +1383 1382 +1384 1247 +1385 1218 +1386 1095 +1387 1177 +1387 1386 +1388 1367 +1389 1251 +1391 1334 +1391 1390 +1396 1334 +1396 1395 +1397 1381 +1397 1393 +1398 1182 +1398 1302 +1399 1388 +1400 1367 +1400 1378 +1400 1399 +1401 1088 +1401 1128 +1401 1400 +1402 804 +1402 1230 +1402 1257 +1403 1169 +1403 1171 +1403 1371 +1404 1393 +1405 1153 +1406 1317 +1406 1377 +1406 1405 +1407 1191 +1407 1219 +1409 1290 +1410 1268 +1412 1321 +1412 1411 +1413 1166 +1413 1391 +1416 1134 +1416 1159 +1416 1195 +1416 1322 +1416 1414 +1416 1415 +1417 1219 +1418 1067 +1419 1068 +1419 1410 +1419 1418 +1420 1085 +1420 1251 +1422 1102 +1422 1376 +1422 1406 +1422 1421 +1423 1243 +1423 1422 +1424 422 +1424 1326 +1425 1217 +1425 1390 +1426 1296 +1426 1348 +1426 1392 +1427 1342 +1429 1091 +1429 1119 +1429 1428 +1431 1430 +1432 1224 +1432 1263 +1432 1430 +1433 1306 +1433 1327 +1433 1431 +1434 1143 +1435 1164 +1435 1278 +1435 1352 +1436 1117 +1436 1309 +1436 1435 +1438 1166 +1438 1334 +1439 1390 +1440 1320 +1440 1439 +1441 1208 +1442 1103 +1442 1185 +1442 1441 +1443 1313 +1443 1442 +1444 1061 +1444 1062 +1444 1361 +1445 1371 +1445 1444 +1446 1083 +1446 1089 +1446 1095 +1446 1311 +1447 1094 +1447 1312 +1447 1347 +1447 1446 +1448 1341 +1449 1205 +1449 1348 +1449 1427 +1450 1218 +1450 1274 +1450 1361 +1451 1135 +1451 1372 +1451 1374 +1452 1148 +1452 1195 +1453 1116 +1453 1419 +1454 1116 +1454 1419 +1455 1418 +1456 1453 +1456 1455 +1457 1454 +1457 1455 +1458 1140 +1458 1319 +1459 1078 +1459 1111 +1459 1123 +1459 1267 +1459 1327 +1460 1104 +1461 1117 +1461 1234 +1461 1347 +1461 1448 +1461 1460 +1462 1339 +1462 1436 +1463 1117 +1463 1279 +1463 1462 +1466 1276 +1466 1352 +1466 1464 +1466 1465 +1467 1175 +1467 1183 +1467 1209 +1467 1316 +1468 1173 +1469 1072 +1469 1187 +1470 1409 +1471 1109 +1471 1363 +1472 1268 +1472 1451 +1473 1151 +1474 1142 +1474 1284 +1475 1474 +1476 1125 +1476 1308 +1476 1383 +1478 1085 +1478 1229 +1478 1389 +1478 1477 +1480 1479 +1481 564 +1482 564 +1483 1239 +1483 1329 +1484 1152 +1484 1170 +1484 1173 +1484 1468 +1485 1403 +1485 1484 +1486 1140 +1486 1170 +1486 1173 +1487 1173 +1487 1361 +1488 1092 +1488 1204 +1488 1231 +1488 1258 +1489 1151 +1489 1276 +1489 1278 +1489 1356 +1490 1098 +1490 1366 +1491 1145 +1493 1132 +1493 1492 +1495 1109 +1495 1370 +1496 1090 +1496 1108 +1497 1069 +1497 1472 +1498 1069 +1498 1410 +1499 1116 +1500 1365 +1500 1499 +1501 1161 +1501 1250 +1502 1334 +1502 1380 +1503 1083 +1504 1091 +1504 1176 +1505 1158 +1505 1245 +1505 1321 +1505 1412 +1506 1074 +1506 1159 +1506 1334 +1506 1380 +1507 1244 +1507 1506 +1508 1342 +1510 1082 +1510 1509 +1512 1198 +1512 1216 +1512 1506 +1513 1512 +1514 1506 +1515 1334 +1515 1394 +1516 1366 +1516 1439 +1517 1162 +1518 1174 +1518 1517 +1521 1195 +1521 1519 +1521 1520 +1522 1321 +1522 1415 +1523 1280 +1523 1494 +1524 1223 +1524 1229 +1525 1091 +1525 1166 +1525 1524 +1526 1284 +1526 1439 +1527 1320 +1528 1193 +1529 1528 +1530 1100 +1530 1151 +1530 1356 +1530 1473 +1531 1134 +1531 1170 +1531 1173 +1531 1487 +1531 1530 +1532 1238 +1532 1298 +1533 1530 +1534 1135 +1535 1286 +1535 1419 +1535 1480 +1536 1210 +1536 1530 +1537 1442 +1537 1494 +1538 1371 +1539 1371 +1540 1310 +1540 1340 +1540 1403 +1541 1167 +1541 1403 +1541 1452 +1541 1507 +1542 1060 +1543 1115 +1547 1544 +1548 1442 +1548 1547 +1552 1116 +1552 1369 +1553 1071 +1553 1546 +1554 1072 +1556 1089 +1556 1104 +1558 1335 +1558 1356 +1559 1080 +1559 1529 +1560 1081 +1561 1555 +1562 1298 +1562 1355 +1565 1492 +1566 1069 +1567 1566 +1568 1566 +1569 1272 +1569 1564 +1570 1255 +1573 1102 +1574 1573 +1575 1545 +1576 1124 +1577 1235 +1579 1112 +1579 1326 +1580 1326 +1581 1112 +1582 1581 +1584 1117 +1586 1272 +1588 1520 +1588 1587 +1593 1378 +1593 1576 +1594 1224 +1594 1511 +1595 1547 +1598 1455 +1598 1597 +1599 1584 +1599 1589 +1601 1600 +1603 1115 +1605 1132 +1609 1133 +1610 1134 +1611 1543 +1613 1612 +1615 1071 +1618 1570 +1619 1140 +1620 1140 +1620 1617 +1621 1491 +1622 1143 +1622 1550 +1622 1591 +1623 1622 +1624 1087 +1624 1367 +1625 1063 +1626 1272 +1627 1612 +1629 1296 +1629 1348 +1630 1090 +1631 1333 +1631 1577 +1632 1389 +1632 1524 +1634 1271 +1634 1331 +1638 1547 +1641 1162 +1644 1542 +1645 1578 +1645 1606 +1646 1166 +1647 1224 +1648 1604 +1649 1173 +1653 1554 +1654 1614 +1657 1579 +1659 1615 +1662 1623 +1662 1661 +1663 1337 +1663 1628 +1664 1627 +1666 1105 +1667 1635 +1667 1666 +1670 1554 +1670 1669 +1674 1607 +1677 1098 +1677 1333 +1677 1676 +1678 1194 +1678 1245 +1679 1209 +1679 1589 +1684 1158 +1684 1284 +1685 1572 +1685 1575 +1685 1670 +1686 1598 +1686 1603 +1687 1218 +1687 1673 +1688 1687 +1689 1219 +1689 1563 +1689 1642 +1691 1583 +1691 1690 +1692 1622 +1694 1528 +1695 1528 +1696 1149 +1699 1605 +1699 1643 +1700 1617 +1700 1620 +1701 1282 +1701 1592 +1702 1586 +1703 1635 +1705 1206 +1706 1675 +1708 1547 +1709 1226 +1710 1492 +1712 1557 +1713 1098 +1714 1689 +1716 1590 +1717 1104 +1719 1359 +1720 1554 +1721 1585 +1722 1662 +1722 1721 +1723 1235 +1724 1704 +1725 1242 +1725 1609 +1726 1242 +1727 1224 +1728 1082 +1728 1571 +1729 1630 +1730 1153 +1731 1098 +1731 1694 +1733 1547 +1734 1680 +1735 1181 +1735 1358 +1736 1157 +1736 1513 +1738 1636 +1738 1637 +1738 1737 +1739 1714 +1740 1554 +1740 1572 +1742 1653 +1743 1741 +1743 1742 +1744 1547 +1745 1565 +1745 1585 +1746 1224 +1748 1468 +1748 1747 +1749 1157 +1750 1082 +1751 1644 +1752 1649 +1752 1654 +1753 1104 +1754 1669 +1755 1726 +1756 1755 +1758 1734 +1759 1652 +1760 1491 +1760 1611 +1761 1346 +1762 1255 +1762 1528 +1763 1256 +1764 1582 +1765 1358 +1766 1640 +1767 1219 +1767 1766 +1770 1158 +1770 1212 +1771 1658 +1773 1604 +1773 1607 +1774 1155 +1774 1214 +1775 1360 +1776 1268 +1776 1698 +1776 1699 +1777 1165 +1778 1683 +1778 1727 +1779 1551 +1780 1703 +1781 1560 +1781 1612 +1782 1549 +1782 1758 +1782 1759 +1783 1437 +1784 422 +1785 1739 +1786 1280 +1786 1658 +1786 1685 +1787 1563 +1788 1650 +1789 1671 +1790 1653 +1790 1754 +1793 1741 +1793 1791 +1793 1792 +1794 1208 +1794 1441 +1795 1651 +1795 1708 +1795 1724 +1796 1794 +1796 1795 +1797 1651 +1797 1709 +1798 1255 +1798 1408 +1799 1224 +1799 1264 +1800 1286 +1800 1674 +1801 1288 +1802 1734 +1803 1291 +1803 1680 +1804 1640 +1804 1642 +1805 1298 +1805 1299 +1807 1300 +1807 1648 +1807 1800 +1808 1668 +1809 1063 +1809 1628 +1810 1106 +1810 1237 +1811 1438 +1811 1440 +1812 1307 +1813 1633 +1814 1309 +1816 1315 +1816 1672 +1816 1789 +1817 1316 +1818 1506 +1818 1515 +1819 1317 +1819 1561 +1820 1605 +1820 1661 +1821 1326 +1822 1325 +1822 1749 +1823 1604 +1824 1636 +1825 1118 +1825 1120 +1826 1659 +1826 1696 +1827 1660 +1828 1418 +1829 1707 +1830 1130 +1830 1710 +1831 1338 +1832 1544 +1833 1754 +1833 1769 +1834 1616 +1834 1682 +1835 1284 +1837 1114 +1838 1601 +1838 1831 +1839 1554 +1839 1808 +1840 1768 +1840 1839 +1841 1555 +1841 1703 +1842 1347 +1843 1713 +1844 1415 +1844 1522 +1845 1190 +1846 1557 +1847 1613 +1847 1757 +1847 1806 +1848 1633 +1848 1779 +1849 1719 +1849 1777 +1850 1661 +1851 1812 +1852 1066 +1852 1400 +1853 1165 +1853 1705 +1854 1590 +1855 1584 +1856 1584 +1857 1563 +1857 1689 +1858 1693 +1859 1353 +1860 1342 +1861 1690 +1862 1665 +1863 1127 +1864 1361 +1864 1646 +1865 1164 +1865 1753 +1866 1206 +1867 1359 +1867 1587 +1869 1692 +1869 1776 +1870 1709 +1870 1744 +1872 1871 +1873 1871 +1874 1142 +1874 1415 +1875 1681 +1876 1508 +1877 1106 +1877 1499 +1878 1685 +1878 1772 +1879 1652 +1880 1763 +1881 1325 +1881 1571 +1882 1619 +1882 1757 +1883 1654 +1883 1846 +1884 1439 +1885 1749 +1886 1776 +1888 1546 +1889 1716 +1889 1854 +1890 1554 +1890 1668 +1891 1199 +1891 1511 +1892 1200 +1892 1660 +1893 1380 +1895 1384 +1895 1385 +1895 1894 +1896 1711 +1896 1787 +1897 1655 +1897 1656 +1897 1673 +1897 1687 +1898 1760 +1899 1771 +1900 1783 +1901 1066 +1901 1900 +1902 1235 +1902 1618 +1903 1368 +1904 1712 +1904 1747 +1905 1075 +1905 1158 +1906 1676 +1907 1693 +1907 1786 +1908 1466 +1909 1644 +1909 1757 +1910 1785 +1911 1639 +1912 1219 +1912 1314 +1913 1248 +1913 1730 +1914 1098 +1914 1824 +1915 1665 +1915 1685 +1916 1647 +1917 1868 +1917 1893 +1918 1583 +1918 1691 +1919 1363 +1919 1495 +1920 1416 +1920 1814 +1921 1417 +1921 1711 +1921 1716 +1922 1600 +1923 1419 +1923 1821 +1924 1424 +1924 1885 +1925 1516 +1926 1526 +1928 1272 +1928 1586 +1929 1360 +1929 1682 +1930 1434 +1930 1591 +1930 1638 +1930 1721 +1930 1832 +1931 1550 +1932 1114 +1933 1863 +1934 1289 +1934 1933 +1935 1437 +1935 1933 +1936 1894 +1937 1936 +1938 1542 +1938 1929 +1940 1926 +1940 1939 +1941 1906 +1942 1081 +1942 1130 +1944 1932 +1944 1933 +1945 1725 +1946 1575 +1947 1780 +1948 1105 +1948 1621 +1949 1186 +1949 1524 +1950 1360 +1950 1564 +1950 1775 +1950 1897 +1951 1584 +1951 1855 +1951 1856 +1952 1458 +1952 1836 +1953 1463 +1954 1468 +1954 1614 +1954 1649 +1954 1883 +1955 1145 +1955 1718 +1956 1120 +1956 1160 +1957 1554 +1958 1899 +1959 1090 +1959 1788 +1960 1596 +1960 1899 +1961 1715 +1962 1776 +1963 1419 +1963 1962 +1964 1633 +1964 1823 +1964 1962 +1966 1965 +1967 1695 +1969 1067 +1969 1115 +1970 1608 +1970 1969 +1971 1155 +1972 1601 +1974 1430 +1975 1368 +1975 1723 +1976 1704 +1976 1795 +1977 1726 +1977 1927 +1978 1910 +1979 1523 +1979 1978 +1980 1408 +1980 1510 +1981 1843 +1982 1698 +1983 1408 +1983 1968 +1984 1491 +1985 1578 +1986 1492 +1986 1982 +1987 1442 +1987 1580 +1988 1494 +1989 1206 +1990 1903 +1991 1971 +1992 1257 +1992 1859 +1993 1551 +1993 1879 +1994 1291 +1994 1499 +1994 1993 +1995 1242 +1995 1499 +1995 1993 +1996 1801 +1997 1337 +1997 1729 +1998 1608 +1999 1502 +1999 1761 +1999 1868 +1999 1917 +1999 1943 +2000 1584 +2000 1589 +2000 1855 +2001 1602 +2001 1802 +2002 1060 +2002 1616 +2003 1626 +2003 1702 +2003 1928 +2004 1625 +2006 1828 +2007 1356 +2007 1706 +2008 1747 +2009 1973 +2010 1496 +2010 1973 +2010 2005 +2011 1782 +2011 1813 +2012 1584 +2012 1599 +2012 1951 +2013 1671 +2014 1623 +2015 1165 +2015 1650 +2016 1333 +2016 1425 +2017 1090 +2017 1351 +2018 2017 +2019 1511 +2019 1707 +2019 1965 +2020 1512 +2020 1827 +2020 2019 +2021 1124 +2021 1378 +2022 1513 +2023 1815 +2023 1858 +2025 1741 +2025 1793 +2025 2024 +2026 1990 +2026 1999 +2027 1516 +2027 1940 +2028 1071 +2029 1961 +2029 1962 +2030 1893 +2030 1943 +2031 1523 +2031 1697 +2031 1815 +2032 1769 +2033 1946 +2033 2032 +2034 1829 +2034 1965 +2035 1060 +2035 1644 +2036 1311 +2037 1206 +2037 1681 +2038 1596 +2038 1653 +2038 1958 +2039 1653 +2039 1862 +2040 1545 +2040 2039 +2041 1786 +2041 2032 +2042 1474 +2042 1765 +2043 1605 +2043 1820 +2044 1359 +2045 2044 +2046 1827 +2046 2020 +2047 1885 +2047 2020 +2047 2046 +2048 1592 +2049 1837 +2049 1996 +2050 1186 +2050 1478 +2051 1734 +2051 1977 +2052 1733 +2052 1772 +2053 1573 +2056 1953 +2059 2057 +2060 1307 +2060 2028 +2060 2057 +2061 1104 +2062 1100 +2062 1908 +2063 1147 +2064 1147 +2065 1609 +2067 1643 +2067 1662 +2067 1871 +2068 1649 +2069 1066 +2069 1428 +2070 1842 +2071 1095 +2072 1460 +2073 2072 +2074 1460 +2075 1186 +2075 2004 +2076 1210 +2076 1530 +2077 1446 +2078 1985 +2078 2038 +2079 1842 +2080 1725 +2080 1755 +2080 1927 +2081 1460 +2081 2055 +2083 2082 +2084 2056 +2084 2083 +2085 2082 +2085 2084 +2086 1205 +2086 1478 +2087 1583 +2087 1756 +2088 1760 +2088 1898 +2089 1945 +2089 2054 +2091 1095 +2092 1160 +2092 1639 +2094 2083 +2095 1460 +2095 2079 +2096 1093 +2096 1386 +2097 1323 +2097 1600 +2097 1690 +2097 2065 +2098 1323 +2098 1600 +2098 1861 +2098 1945 +2099 1574 +2099 1623 +2099 1838 +2100 1709 +2101 2070 +2101 2073 +2101 2074 +2104 1378 +2105 1460 +2106 1869 +2106 2058 +2107 2055 +2107 2061 +2107 2094 +2107 2105 +2108 1460 +2108 2073 +2109 1096 +2109 2104 +2110 1549 +2111 1715 +2112 1470 +2113 1410 +2113 1732 +2113 2110 +2114 1945 +2114 2001 +2115 1574 +2115 1623 +2116 1933 +2117 1732 +2117 1961 +2118 1451 +2118 1850 +2119 1451 +2119 1850 +2119 1922 +2119 2054 +2120 1278 +2120 1356 +2120 1489 +2121 1104 +2122 1842 +2122 2101 +2123 1460 +2124 1461 +2124 2063 +2125 1461 +2125 2064 +2126 1528 +2126 1968 +2127 2014 +2127 2102 +2128 1472 +2128 1873 +2129 1472 +2129 1872 +2129 2089 +2130 1602 +2130 1732 +2131 1473 +2133 1972 +2134 2090 +2134 2123 +2135 1093 +2135 2096 +2136 1717 +2137 1953 +2137 2082 +2137 2121 +2138 1309 +2138 1467 +2138 1489 +2139 1101 +2139 1309 +2139 1357 +2139 1489 +2140 1953 +2140 2066 +2140 2137 +2141 1285 +2141 1876 +2142 1554 +2142 2093 +2143 1953 +2143 2085 +2144 1460 +2144 2090 +2145 1887 +2145 2103 +2145 2131 +2145 2132 +2146 2102 +2146 2133 +2147 2146 +2148 1609 +2148 1945 +2149 1817 +2150 1589 +2150 1817 +2150 2149 +2151 1602 +2151 1922 +2151 2054 +2151 2114 +2151 2118 +2153 2128 +2153 2130 +2154 2106 +2154 2133 +2155 1831 +2155 2102 +2156 1321 +2156 1844 +2156 2136 +2157 1484 +2157 1614 +2157 1752 +2157 1887 +2157 2103 +2158 1298 +2158 1532 +2158 1562 +2159 1095 +2159 1386 +2161 1985 +2161 2160 +2162 1742 +2162 2152 +2162 2160 +2163 1664 +2163 1807 +2163 2111 +2164 1181 +2164 2112 +2165 2071 +2166 2071 +2167 1687 +2167 1702 +2169 2159 +2170 2159 +2173 1471 +2173 1530 +2175 1978 +2175 2031 +2175 2174 +2176 1100 +2176 1536 +2177 1928 +2178 2177 +2179 1100 +2179 1489 +2180 1172 +2180 1345 +2181 2180 +2182 1268 +2183 1747 +2183 2178 +2184 1164 +2184 1435 +2185 1309 +2186 1953 +2186 2066 +2187 1953 +2187 2066 +2188 1468 +2188 1471 +2189 1164 +2189 1352 +2190 2091 +2190 2096 +2190 2168 +2191 1311 +2191 2077 +2192 1311 +2192 2171 +2192 2172 +2192 2191 +2193 1413 +2193 1527 +2194 1224 +2194 1713 +2195 1117 +2195 1447 +2196 1930 +2196 2053 +2197 2182 +2198 2185 +2200 2199 +2201 2200 +2202 1506 +2203 1277 +2203 2201 +2204 2199 +2204 2202 +2207 802 +2210 2205 +2211 2205 +2212 2210 +2212 2211 +2213 395 +2213 2207 +2213 2212 +2222 2221 +2223 393 +2223 2221 +2223 2222 +2224 2222 +2228 2226 +2229 2220 +2229 2222 +2229 2223 +2230 2227 +2231 396 +2232 2221 +2234 2228 +2235 2223 +2238 2236 +2238 2237 +2242 2241 +2244 2208 +2244 2219 +2249 2242 +2249 2248 +2250 2248 +2251 2249 +2252 2249 +2253 2249 +2256 2247 +2261 2221 +2262 2235 +2262 2258 +2262 2259 +2262 2260 +2263 2230 +2268 2267 +2269 2267 +2270 2267 +2271 2268 +2272 2266 +2275 2273 +2275 2274 +2277 2276 +2281 2254 +2282 389 +2282 2212 +2282 2257 +2282 2264 +2282 2281 +2283 396 +2283 420 +2283 2282 +2284 2280 +2284 2282 +2284 2283 +2285 2239 +2286 2264 +2286 2285 +2288 2217 +2290 2276 +2291 2238 +2292 2255 +2292 2290 +2295 2221 +2298 2235 +2298 2262 +2298 2296 +2298 2297 +2300 2299 +2302 2282 +2303 2256 +2304 790 +2304 2282 +2305 2233 +2306 2263 +2306 2265 +2307 386 +2308 2246 +2309 2235 +2310 2242 +2310 2305 +2311 2253 +2312 520 +2312 2235 +2313 2239 +2314 2225 +2315 2245 +2315 2291 +2316 2288 +2317 2231 +2317 2316 +2320 2278 +2321 2222 +2321 2224 +2321 2314 +2321 2319 +2321 2320 +2322 2321 +2323 2321 +2324 2321 +2325 2240 +2325 2243 +2327 2255 +2327 2318 +2328 2235 +2328 2327 +2329 2326 +2329 2327 +2329 2328 +2330 2307 +2331 2285 +2332 2219 +2332 2244 +2332 2294 +2332 2318 +2333 2267 +2334 2272 +2334 2287 +2335 2243 +2336 2281 +2338 2336 +2341 2289 +2343 2298 +2344 69 +2344 2343 +2345 2217 +2346 2218 +2346 2311 +2346 2345 +2347 2218 +2347 2231 +2348 2293 +2348 2303 +2349 2335 +2350 2224 +2350 2349 +2351 840 +2352 2327 +2354 2302 +2354 2304 +2355 2242 +2357 2215 +2357 2231 +2357 2263 +2357 2337 +2358 2325 +2359 2227 +2359 2314 +2360 2234 +2361 2233 +2361 2279 +2362 2360 +2363 2340 +2363 2342 +2363 2362 +2364 2262 +2364 2312 +2364 2351 +2364 2363 +2365 2363 +2366 2240 +2366 2319 +2367 2293 +2367 2336 +2368 2238 +2368 2290 +2369 2235 +2369 2298 +2369 2368 +2370 2216 +2370 2249 +2370 2317 +2371 2278 +2371 2335 +2371 2358 +2372 2274 +2372 2282 +2372 2301 +2372 2354 +2373 2219 +2373 2332 +2374 2336 +2375 2282 +2375 2374 +2376 2221 +2376 2356 +2377 2290 +2377 2368 +2378 2374 +2379 2254 +2379 2378 +2380 2327 +2381 2267 +2381 2333 +2382 2206 +2382 2268 +2382 2289 +2382 2294 +2382 2341 +2382 2353 +2382 2381 +2383 2223 +2383 2235 +2383 2309 +2383 2328 +2383 2382 +2384 2382 +2385 2382 +2386 2247 +2386 2378 +2387 2216 +2387 2287 +2387 2355 +2388 2246 +2388 2308 +2388 2309 +2388 2339 +2388 2352 +2388 2353 +2388 2380 +2389 2276 +2389 2332 +2389 2368 +2390 2208 +2392 2285 +2392 2331 +2393 395 +2393 2321 +2393 2392 +2394 2391 +2394 2392 +2394 2393 +2395 2382 +2395 2390 +2396 2214 +2396 2238 +2397 2219 +2397 2373 +2398 2382 +2398 2397 +2399 2397 +2400 2397 +2401 2340 +2402 2221 +2402 2356 +2403 2221 +2403 2376 +2404 2225 +2404 2337 +2405 2221 +2405 2232 +2405 2295 +2405 2330 +2405 2392 +2406 2325 +2406 2349 +2407 2257 +2407 2274 +2407 2299 +2407 2300 +2408 2303 +2408 2386 +2409 2233 +2410 2409 +2411 2215 +2411 2355 +2412 2209 +2412 2249 +2413 752 +2414 753 +2414 2266 +2414 2279 +2414 2413 +2415 2308 +2416 2268 +2416 2415 +2417 777 +2417 790 +2418 2222 +2418 2384 +2418 2385 +2419 2339 +2419 2382 +2420 2246 +2420 2327 +2421 2245 +2422 2421 +2425 2424 +2426 490 +2432 2431 +2436 2434 +2439 2437 +2439 2438 +2443 2441 +2443 2442 +2447 1184 +2449 2439 +2451 2450 +2454 2453 +2457 2447 +2458 2456 +2458 2457 +2459 2425 +2459 2458 +2461 2460 +2463 2462 +2471 2434 +2471 2470 +2475 2474 +2476 2473 +2476 2474 +2477 2473 +2477 2474 +2480 2479 +2481 2479 +2482 2480 +2483 2474 +2485 2426 +2486 2464 +2487 2458 +2489 2428 +2489 2488 +2490 2435 +2493 2472 +2493 2492 +2495 2490 +2496 2485 +2498 2490 +2502 2446 +2502 2501 +2503 2475 +2503 2502 +2505 2484 +2508 2507 +2510 2509 +2511 2509 +2513 2498 +2515 2514 +2517 2516 +2518 2516 +2519 2425 +2519 2475 +2519 2508 +2519 2516 +2521 2443 +2521 2489 +2522 2505 +2524 2434 +2525 2458 +2527 2468 +2528 2486 +2529 2439 +2530 2500 +2531 2530 +2533 2520 +2534 2533 +2536 2535 +2538 2499 +2539 2538 +2542 490 +2542 2533 +2543 490 +2543 2464 +2543 2486 +2543 2528 +2544 2499 +2544 2538 +2545 2429 +2545 2448 +2548 490 +2548 2485 +2548 2537 +2548 2546 +2548 2547 +2549 2528 +2549 2539 +2550 2538 +2551 2452 +2551 2538 +2551 2549 +2551 2550 +2552 2474 +2552 2502 +2554 2529 +2554 2538 +2554 2545 +2555 2479 +2557 1131 +2557 2532 +2558 2459 +2558 2475 +2558 2519 +2558 2557 +2559 2446 +2559 2474 +2559 2483 +2559 2521 +2560 2454 +2561 2452 +2561 2468 +2561 2485 +2561 2494 +2561 2527 +2561 2550 +2562 57 +2562 81 +2562 133 +2564 2534 +2567 2566 +2575 2554 +2575 2574 +2576 2450 +2576 2488 +2578 2433 +2579 2500 +2579 2530 +2580 2579 +2581 2575 +2583 2489 +2583 2541 +2583 2582 +2586 2428 +2586 2436 +2586 2454 +2586 2461 +2586 2489 +2586 2524 +2586 2578 +2586 2585 +2588 2434 +2588 2472 +2588 2493 +2588 2577 +2588 2587 +2590 2432 +2590 2461 +2591 2459 +2591 2475 +2591 2480 +2592 2545 +2592 2575 +2593 2458 +2593 2459 +2593 2567 +2593 2569 +2593 2572 +2594 1308 +2595 2430 +2595 2497 +2595 2514 +2595 2515 +2595 2520 +2595 2533 +2596 2439 +2596 2469 +2596 2554 +2596 2584 +2597 2448 +2597 2575 +2599 2459 +2599 2519 +2599 2598 +2600 2527 +2601 2522 +2601 2575 +2602 2519 +2604 2445 +2604 2504 +2604 2560 +2604 2586 +2605 2594 +2606 2528 +2606 2539 +2606 2605 +2607 2606 +2608 2554 +2608 2584 +2608 2603 +2608 2607 +2609 2504 +2609 2604 +2611 2503 +2611 2523 +2611 2607 +2612 2528 +2612 2532 +2612 2606 +2612 2611 +2613 2508 +2614 2522 +2616 2443 +2616 2509 +2616 2615 +2617 2429 +2617 2456 +2617 2458 +2617 2487 +2617 2522 +2617 2525 +2617 2614 +2618 2605 +2618 2606 +2619 2434 +2620 2563 +2621 2556 +2622 2506 +2623 2434 +2623 2608 +2624 2434 +2624 2608 +2627 2443 +2627 2493 +2627 2509 +2627 2559 +2627 2625 +2627 2626 +2629 2536 +2631 2439 +2632 2487 +2633 2439 +2634 2631 +2636 2531 +2637 2545 +2637 2617 +2638 2435 +2638 2622 +2638 2635 +2639 2439 +2639 2469 +2640 2610 +2641 2521 +2641 2577 +2642 2474 +2643 2492 +2643 2501 +2644 2643 +2645 2473 +2645 2501 +2646 2492 +2647 2645 +2648 2644 +2648 2645 +2648 2646 +2649 2647 +2649 2648 +2651 2608 +2654 2463 +2654 2607 +2655 2426 +2656 2428 +2658 2564 +2659 2534 +2661 2433 +2662 2434 +2666 2569 +2667 2658 +2668 2434 +2668 2662 +2668 2663 +2669 2656 +2670 2435 +2672 2436 +2673 2672 +2674 2585 +2674 2672 +2677 2458 +2677 2565 +2677 2676 +2680 490 +2680 2679 +2681 2444 +2682 2439 +2683 2439 +2684 2662 +2685 2444 +2685 2445 +2686 2685 +2687 2449 +2691 2690 +2692 2574 +2693 2657 +2694 2452 +2697 2454 +2698 2434 +2699 2698 +2701 2434 +2701 2536 +2702 2434 +2702 2622 +2703 2458 +2703 2696 +2704 2593 +2705 2662 +2707 2444 +2708 2445 +2709 2455 +2709 2456 +2709 2700 +2710 2585 +2710 2674 +2712 2464 +2713 2464 +2714 2678 +2716 2465 +2717 2450 +2717 2465 +2717 2466 +2717 2467 +2717 2585 +2718 2468 +2719 2450 +2719 2717 +2720 2585 +2720 2717 +2721 2553 +2722 2585 +2723 2469 +2723 2721 +2725 2531 +2726 2531 +2726 2725 +2728 2542 +2729 2427 +2729 2498 +2730 2427 +2730 2490 +2731 2729 +2732 2730 +2733 2575 +2733 2607 +2736 2484 +2737 2736 +2738 2734 +2738 2736 +2738 2737 +2740 2655 +2740 2739 +2741 2485 +2741 2739 +2742 2741 +2743 2485 +2743 2486 +2744 2743 +2745 2703 +2755 2724 +2756 2724 +2757 2722 +2758 2687 +2759 2491 +2759 2659 +2760 2494 +2760 2652 +2760 2740 +2761 2495 +2762 2495 +2763 2495 +2764 2485 +2765 2533 +2765 2542 +2765 2764 +2766 2496 +2766 2655 +2766 2740 +2767 2497 +2768 2767 +2769 2497 +2769 2498 +2770 2769 +2772 2771 +2775 2500 +2776 2500 +2777 2506 +2778 2686 +2779 2724 +2779 2737 +2780 2671 +2780 2771 +2781 2727 +2781 2771 +2781 2780 +2782 2504 +2783 2505 +2784 2783 +2785 2505 +2785 2783 +2785 2784 +2787 2696 +2787 2703 +2787 2786 +2788 2666 +2789 2527 +2789 2620 +2790 2563 +2790 2608 +2791 2544 +2792 2530 +2792 2791 +2793 2447 +2793 2457 +2794 2575 +2794 2607 +2795 2513 +2795 2652 +2795 2670 +2795 2760 +2796 2671 +2798 2797 +2799 490 +2799 2664 +2799 2665 +2800 2797 +2800 2798 +2800 2799 +2801 2553 +2802 2506 +2804 2527 +2804 2528 +2805 2804 +2806 2522 +2806 2736 +2807 2522 +2809 2553 +2810 2478 +2810 2515 +2810 2706 +2811 2715 +2812 2574 +2813 2524 +2813 2662 +2813 2684 +2814 2447 +2815 2527 +2816 2431 +2817 2565 +2818 2817 +2819 2662 +2820 2798 +2820 2800 +2821 2533 +2821 2534 +2822 2821 +2823 2533 +2823 2534 +2824 2823 +2825 2655 +2825 2820 +2826 2561 +2827 2735 +2828 2540 +2828 2541 +2828 2827 +2832 490 +2832 2543 +2833 2832 +2834 490 +2834 2542 +2834 2829 +2835 490 +2835 2542 +2835 2830 +2836 490 +2836 2542 +2836 2831 +2837 2662 +2837 2691 +2837 2819 +2838 2455 +2838 2724 +2838 2779 +2839 2724 +2839 2779 +2839 2796 +2839 2838 +2840 2706 +2840 2760 +2840 2810 +2841 2537 +2842 2778 +2842 2808 +2843 2544 +2843 2553 +2843 2809 +2844 2544 +2845 2553 +2846 2687 +2846 2723 +2847 2548 +2848 2548 +2849 2550 +2850 2550 +2851 2849 +2851 2850 +2852 2551 +2852 2851 +2853 2550 +2854 2550 +2855 2549 +2856 2549 +2857 2724 +2857 2756 +2857 2779 +2857 2838 +2858 2545 +2858 2846 +2859 2858 +2860 2545 +2860 2846 +2861 2860 +2862 2545 +2862 2846 +2863 2862 +2864 2478 +2864 2810 +2865 2820 +2865 2825 +2866 2819 +2870 2553 +2870 2554 +2871 2553 +2871 2554 +2872 2553 +2872 2554 +2873 2872 +2874 2529 +2874 2553 +2875 2874 +2876 2870 +2877 2871 +2878 2760 +2878 2815 +2878 2840 +2880 2585 +2880 2722 +2881 2697 +2881 2879 +2882 2560 +2882 2880 +2882 2881 +2883 2561 +2883 2740 +2883 2760 +2883 2840 +2883 2878 +2885 2439 +2885 2617 +2886 2617 +2887 2885 +2888 2886 +2889 2585 +2889 2722 +2889 2757 +2889 2880 +2890 2674 +2891 2691 +2892 2564 +2894 2565 +2894 2893 +2895 2568 +2895 2569 +2896 2570 +2896 2704 +2897 2896 +2898 2571 +2898 2572 +2899 2572 +2899 2573 +2900 2561 +2900 2883 +2901 2900 +2902 2578 +2903 2813 +2904 2575 +2905 2575 +2906 2574 +2907 2575 +2908 2553 +2908 2584 +2908 2657 +2908 2693 +2908 2843 +2909 2593 +2909 2594 +2910 2909 +2911 2585 +2911 2586 +2912 2590 +2914 2675 +2914 2851 +2916 2530 +2916 2657 +2916 2792 +2917 2529 +2917 2597 +2917 2874 +2918 2530 +2918 2596 +2918 2657 +2918 2908 +2918 2916 +2920 2538 +2920 2544 +2921 2694 +2922 2553 +2922 2801 +2923 2544 +2923 2791 +2923 2913 +2925 2924 +2926 2916 +2926 2918 +2927 2596 +2927 2918 +2928 2596 +2928 2918 +2929 2926 +2930 2457 +2932 2740 +2932 2841 +2932 2847 +2933 2600 +2934 2596 +2934 2636 +2935 2841 +2935 2932 +2936 2574 +2936 2601 +2936 2687 +2936 2692 +2936 2846 +2937 2851 +2937 2924 +2938 2924 +2938 2937 +2939 2465 +2940 2842 +2941 2565 +2941 2567 +2942 2678 +2942 2691 +2942 2714 +2942 2891 +2943 2603 +2944 2662 +2944 2819 +2944 2837 +2945 2944 +2946 2799 +2947 2799 +2948 2490 +2948 2629 +2949 490 +2950 2949 +2952 2542 +2952 2728 +2952 2820 +2952 2825 +2952 2865 +2953 2604 +2953 2605 +2954 2953 +2955 2604 +2956 2444 +2956 2604 +2956 2955 +2957 2711 +2957 2955 +2958 2485 +2958 2548 +2959 2607 +2959 2662 +2959 2819 +2959 2866 +2960 2606 +2960 2608 +2961 2960 +2963 2609 +2963 2962 +2964 2575 +2964 2601 +2965 2640 +2965 2915 +2966 2471 +2966 2619 +2966 2640 +2967 2447 +2967 2781 +2967 2814 +2968 2781 +2968 2967 +2969 2662 +2969 2837 +2970 2614 +2971 2553 +2971 2715 +2971 2811 +2971 2845 +2972 2574 +2972 2692 +2972 2936 +2973 2617 +2973 2722 +2974 2617 +2974 2618 +2975 2974 +2976 2619 +2976 2813 +2976 2867 +2976 2903 +2977 2787 +2977 2814 +2978 2620 +2978 2715 +2978 2971 +2979 2623 +2979 2695 +2980 2624 +2980 2943 +2981 2774 +2981 2842 +2982 2628 +2982 2803 +2983 2814 +2983 2977 +2984 2680 +2985 2984 +2986 2629 +2986 2810 +2986 2878 +2986 2883 +2987 2629 +2989 2488 +2989 2576 +2990 2628 +2990 2984 +2990 2988 +2991 2439 +2991 2463 +2993 2622 +2994 2938 +2995 2553 +2995 2801 +2996 2893 +2997 2542 +2997 2798 +2997 2800 +2997 2951 +2998 2880 +2999 2553 +3000 2893 +3001 2671 +3001 2781 +3002 2773 +3002 3001 +3003 2686 +3003 2774 +3003 2981 +3004 2457 +3004 2671 +3004 2780 +3005 2520 +3005 2533 +3005 2595 +3005 2670 +3007 3006 +3008 2670 +3008 3005 +3009 2727 +3009 2781 +3010 2736 +3010 2806 +3011 2457 +3011 2780 +3011 2967 +3012 2703 +3012 2745 +3012 2793 +3012 2814 +3014 2493 +3014 2577 +3014 3013 +3016 2493 +3016 2502 +3016 3015 +3017 2490 +3017 2494 +3017 2496 +3017 2513 +3017 2534 +3017 2764 +3017 2826 +3018 2846 +3019 2654 +3020 2932 +3021 2694 +3022 2694 +3023 2897 +3024 2660 +3025 2840 +3026 2671 +3026 2796 +3028 2864 +3029 2694 +3033 2936 +3034 2936 +3034 3033 +3035 2952 +3036 2515 +3036 2810 +3038 2851 +3038 2914 +3040 2653 +3041 2740 +3041 2760 +3041 2883 +3041 2932 +3041 3037 +3042 2740 +3042 2932 +3042 3041 +3043 2450 +3043 2576 +3045 2522 +3045 3044 +3047 2522 +3047 2931 +3047 3046 +3048 3027 +3049 2505 +3049 2601 +3049 3027 +3050 2687 +3051 2922 +3052 2973 +3054 2979 +3055 2537 +3055 2548 +3056 3005 +3057 2715 +3058 2884 +3060 2489 +3060 2608 +3061 2725 +3061 2726 +3062 2728 +3063 2959 +3064 2733 +3066 2964 +3067 2702 +3068 2542 +3070 3069 +3071 3024 +3073 3046 +3073 3070 +3073 3072 +3075 3044 +3075 3074 +3076 2783 +3077 2657 +3077 2693 +3078 2499 +3079 2813 +3080 2857 +3081 2746 +3081 3072 +3082 2747 +3083 2748 +3083 3074 +3084 2749 +3084 3069 +3085 2750 +3085 3074 +3086 2751 +3086 3071 +3087 2752 +3088 2753 +3088 3075 +3089 2754 +3089 3070 +3090 2484 +3090 2688 +3091 2484 +3091 2689 +3093 2697 +3094 2444 +3094 2956 +3095 2585 +3095 2880 +3096 2553 +3096 2843 +3096 2908 +3097 2574 +3098 2687 +3098 3050 +3099 2687 +3099 2758 +3100 2766 +3101 3031 +3101 3082 +3101 3090 +3102 3032 +3102 3087 +3102 3091 +3103 2704 +3104 2662 +3104 2837 +3104 2969 +3105 2455 +3105 2724 +3105 3039 +3106 2815 +3107 2986 +3108 2794 +3109 2959 +3109 3063 +3110 2796 +3111 2879 +3111 2881 +3112 2533 +3112 2542 +3112 2765 +3113 2500 +3113 2530 +3113 2579 +3114 2651 +3115 2489 +3115 2603 +3116 2813 +3116 3079 +3117 2879 +3117 2881 +3117 3111 +3118 2993 +3119 2993 +3119 3118 +3120 2864 +3121 2959 +3122 2864 +3122 2987 +3122 3028 +3123 2538 +3124 2538 +3125 3004 +3126 2851 +3126 2852 +3127 3092 +3128 2553 +3128 3030 +3128 3059 +3128 3092 +3128 3123 +3128 3124 +3128 3127 +3129 3030 +3129 3059 +3129 3127 +3129 3128 +3130 2851 +3130 2852 +3130 3126 +3131 2819 +3131 2837 +3131 2944 +3132 2970 +3133 2697 +3134 2697 +3134 3133 +3135 2868 +3135 3046 +3136 2869 +3137 3044 +3137 3071 +3137 3136 +3138 2915 +3140 2938 +3141 2553 +3142 2815 +3143 2671 +3143 3001 +3144 3117 +3145 2692 +3146 2563 +3146 2884 +3147 2563 +3147 2884 +3148 2959 +3148 3063 +3148 3109 +3149 2553 +3149 3128 +3150 2798 +3150 2800 +3151 2800 +3152 2796 +3152 2839 +3153 2878 +3153 2883 +3153 2986 +3154 2545 +3154 2575 +3155 2656 +3156 2851 +3156 2852 +3156 2914 +3156 2937 +3156 3139 +3157 2595 +3157 3005 +3158 2585 +3158 2717 +3159 3065 +3161 2959 +3161 3121 +3163 2927 +3164 2928 +3165 3009 +3166 3072 +3167 2919 +3167 3069 +3168 2807 +3169 2939 +3170 2941 +3171 2693 +3172 2497 +3173 2846 +3173 2936 +3173 3018 +3174 2542 +3174 2932 +3174 3020 +3174 3160 +3175 2797 +3176 2655 +3177 2825 +3178 2655 +3178 2825 +3179 2533 +3179 2595 +3180 2692 +3180 3145 +3181 2530 +3181 2918 +3186 2529 +3186 2874 +3186 2917 +3186 3065 +3186 3159 +3186 3185 +3187 2554 +3187 2633 +3187 3184 +3188 2607 +3188 2653 +3188 3183 +3189 2449 +3189 2886 +3189 3182 +3190 2697 +3190 2881 +3191 2978 +3192 2978 +3193 2737 +3194 3174 +3195 2842 +3196 2991 +3197 2880 +3197 2992 +3197 2998 +3197 3053 +3197 3162 +3198 2815 +3198 2878 +3199 2585 +3199 2710 +3200 2662 +3200 2819 +3200 2944 +3201 2660 +3201 3071 +3202 3065 +3202 3159 +3202 3186 +3203 2977 +3204 2632 +3205 2576 +3206 2446 +3207 2542 +3207 2728 +3208 2641 +3209 3008 +3210 2711 +3211 2798 +3211 2800 +3211 2997 +3212 2643 +3213 2846 +3213 3018 +3213 3173 +3214 2488 +3215 2585 +3215 2674 +3215 2710 +3216 2472 +3217 2476 +3218 2477 +3218 3217 +3219 2483 +3220 2711 +3221 2670 +3221 3005 +3221 3008 +3222 2798 +3222 2800 +3223 2939 +3224 2493 +3225 2493 +3226 2502 +3227 2502 +3228 2455 +3228 2838 +3229 2512 +3230 2880 +3230 2998 +3230 3197 +3231 2515 +3232 2983 +3233 2521 +3234 2526 +3235 2983 +3235 3232 +3236 2644 +3237 2644 +3238 2806 +3238 3010 +3239 2645 +3240 2645 +3241 2936 +3242 2559 +3243 2559 +3244 2465 +3244 2716 +3245 2893 +3245 2996 +3246 3117 +3246 3144 +3247 2577 +3247 3007 +3248 2577 +3249 3122 +3250 2839 +3250 3152 +3251 2589 +3251 3234 +3252 2488 +3252 3214 +3253 2798 +3253 2800 +3254 2646 +3255 2647 +3256 2647 +3257 2647 +3258 2647 +3259 2647 +3260 2647 +3261 2648 +3262 2692 +3263 2711 +3263 2957 +3264 3009 +3265 2728 +3265 2952 +3266 2616 +3266 3229 +3266 3234 +3266 3251 +3267 2787 +3267 2977 +3268 2700 +3269 3008 +3269 3209 +3270 2697 +3270 3133 +3270 3134 +3271 2500 +3272 2630 +3272 3219 +3273 2649 +3274 2649 +3275 2852 +3276 2851 +3276 2852 +3276 2914 +3276 3038 +3276 3275 +3277 2576 +3277 3205 +3278 2852 +3279 2465 +3279 2716 +3279 3244 +3280 2914 +3281 2574 +3281 3097 +3282 3281 +3283 2631 +3283 3188 +3284 2553 +3284 2801 +3284 3030 +3284 3128 +3284 3129 +3284 3141 +3286 2693 +3286 2792 +3286 3171 +3286 3285 +3287 2727 +3288 2611 +3288 2650 +3289 2611 +3289 2650 +3290 3288 +3291 3289 +3292 2552 +3295 3294 +3297 3296 +3299 3298 +3310 3297 +3310 3309 +3312 3311 +3314 3295 +3314 3299 +3314 3313 +3317 3316 +3321 3312 +3323 3322 +3325 3296 +3326 3297 +3328 3321 +3328 3327 +3329 3299 +3331 3323 +3331 3330 +3333 3297 +3333 3310 +3333 3312 +3333 3332 +3334 3294 +3336 3312 +3336 3317 +3336 3335 +3342 3324 +3342 3340 +3342 3341 +3344 3307 +3345 3323 +3348 3347 +3349 3337 +3349 3347 +3351 3312 +3351 3336 +3352 3317 +3355 3315 +3355 3354 +3357 3310 +3357 3356 +3359 3312 +3359 3358 +3360 3320 +3360 3346 +3361 3352 +3361 3360 +3362 3352 +3365 3329 +3365 3352 +3366 3316 +3368 3367 +3369 3368 +3370 3368 +3379 3378 +3380 3378 +3388 3294 +3392 3317 +3393 3317 +3395 3358 +3401 3400 +3402 3347 +3402 3401 +3403 3345 +3410 3406 +3410 3407 +3411 3293 +3411 3408 +3411 3409 +3411 3410 +3413 3342 +3417 3416 +3418 3319 +3420 3307 +3421 3317 +3423 3353 +3425 3423 +3426 3423 +3426 3424 +3429 3337 +3429 3428 +3430 3416 +3431 3373 +3431 3374 +3431 3375 +3431 3416 +3431 3417 +3432 3355 +3432 3376 +3433 3296 +3435 3314 +3435 3331 +3437 3355 +3440 3299 +3441 3299 +3444 3442 +3445 3386 +3446 3300 +3446 3301 +3447 3445 +3448 3445 +3450 3302 +3454 3322 +3454 3453 +3455 3311 +3456 3404 +3457 3456 +3458 3456 +3460 3310 +3462 3461 +3463 3462 +3464 3309 +3464 3463 +3465 3309 +3465 3459 +3465 3462 +3466 3329 +3466 3359 +3467 3306 +3468 3303 +3468 3304 +3468 3305 +3468 3412 +3468 3415 +3468 3467 +3469 3307 +3469 3468 +3470 3307 +3470 3468 +3471 3321 +3472 3329 +3472 3344 +3473 3318 +3474 3308 +3475 3363 +3477 3310 +3478 3310 +3479 3468 +3480 3377 +3481 3480 +3483 3316 +3484 3310 +3484 3312 +3485 3436 +3485 3484 +3486 3353 +3486 3485 +3487 3486 +3488 3293 +3491 3490 +3496 3493 +3497 3319 +3497 3452 +3498 3329 +3498 3488 +3499 3493 +3499 3494 +3499 3497 +3500 3493 +3500 3495 +3500 3497 +3501 3494 +3501 3495 +3501 3497 +3502 3414 +3502 3467 +3503 3467 +3506 3296 +3506 3505 +3510 3507 +3511 3509 +3512 3510 +3512 3511 +3513 3508 +3513 3511 +3515 3498 +3516 3371 +3517 3411 +3519 3411 +3520 3517 +3523 3370 +3525 3497 +3525 3524 +3526 3468 +3527 3438 +3527 3467 +3528 3422 +3529 3341 +3529 3434 +3531 3530 +3532 3420 +3534 3400 +3536 3316 +3536 3482 +3538 3298 +3538 3537 +3540 3307 +3542 3320 +3544 3473 +3545 3449 +3545 3489 +3546 3320 +3547 3320 +3550 3503 +3550 3514 +3551 3414 +3551 3514 +3552 3294 +3553 1 +3553 3422 +3554 3401 +3556 3544 +3557 3316 +3557 3521 +3558 3299 +3558 3329 +3560 3486 +3560 3512 +3561 3328 +3561 3351 +3562 3383 +3562 3542 +3563 3353 +3563 3511 +3564 3324 +3564 3434 +3564 3512 +3564 3563 +3565 3399 +3565 3418 +3567 3371 +3567 3436 +3567 3485 +3568 3296 +3569 3355 +3571 3522 +3572 3325 +3573 3319 +3573 3343 +3574 3319 +3574 3343 +3576 3326 +3577 3568 +3577 3576 +3578 3576 +3579 3364 +3579 3559 +3580 3308 +3580 3330 +3580 3389 +3581 3330 +3582 3329 +3583 2 +3583 3343 +3584 3517 +3585 3584 +3586 1 +3586 3329 +3587 1 +3587 3329 +3588 3438 +3588 3569 +3589 3572 +3589 3575 +3590 3356 +3590 3439 +3591 3384 +3591 3468 +3592 3468 +3593 3293 +3593 3312 +3596 3308 +3597 3596 +3598 3351 +3598 3471 +3600 3426 +3601 3355 +3601 3570 +3601 3571 +3604 3541 +3605 3555 +3605 3603 +3606 3605 +3607 3320 +3608 3371 +3608 3427 +3609 3400 +3609 3555 +3610 3315 +3610 3431 +3611 3604 +3612 3352 +3612 3548 +3612 3582 +3613 3468 +3614 3442 +3614 3468 +3615 3451 +3615 3591 +3616 3332 +3616 3506 +3617 3545 +3618 3545 +3619 3429 +3620 3316 +3620 3467 +3621 3371 +3621 3455 +3622 3301 +3622 3345 +3623 3427 +3623 3523 +3624 3590 +3625 3315 +3625 3398 +3625 3583 +3626 3412 +3626 3497 +3627 3307 +3627 3419 +3627 3498 +3628 3337 +3628 3599 +3629 3334 +3631 3302 +3631 3630 +3632 3312 +3632 3321 +3634 3338 +3635 3634 +3637 1 +3637 3525 +3637 3636 +3638 3343 +3638 3355 +3639 3343 +3641 3640 +3643 3339 +3645 3309 +3645 3644 +3646 3453 +3647 3343 +3647 3344 +3648 3343 +3648 3344 +3649 3618 +3650 3492 +3651 3554 +3651 3650 +3652 3307 +3652 3352 +3653 3541 +3654 3308 +3654 3539 +3654 3581 +3655 3353 +3655 3564 +3656 3315 +3656 3396 +3656 3397 +3656 3639 +3657 3433 +3657 3572 +3658 3405 +3659 3343 +3659 3415 +3660 3603 +3661 3347 +3661 3609 +3662 3592 +3662 3613 +3663 3349 +3663 3456 +3663 3651 +3665 3437 +3665 3526 +3666 3410 +3666 3518 +3667 3541 +3668 3322 +3669 3611 +3669 3649 +3670 3532 +3671 3351 +3671 3421 +3672 3302 +3672 3337 +3673 3350 +3673 3351 +3674 3350 +3674 3351 +3675 3399 +3675 3491 +3675 3553 +3675 3565 +3676 3411 +3676 3418 +3677 3319 +3677 3410 +3678 3347 +3678 3641 +3679 3487 +3680 3679 +3681 3679 +3682 3404 +3682 3661 +3683 3356 +3683 3633 +3684 3413 +3684 3484 +3685 3683 +3686 3401 +3686 3658 +3688 3350 +3689 3351 +3690 3390 +3691 3690 +3692 3308 +3692 3552 +3692 3691 +3693 3313 +3693 3597 +3694 3391 +3695 3431 +3695 3432 +3695 3694 +3696 3504 +3697 3312 +3697 3331 +3697 3696 +3698 3321 +3698 3689 +3699 3480 +3699 3675 +3700 3350 +3700 3514 +3701 3350 +3701 3514 +3702 3351 +3702 3670 +3703 3530 +3703 3536 +3705 3330 +3705 3619 +3705 3704 +3706 3533 +3706 3549 +3707 3706 +3708 3301 +3708 3556 +3708 3707 +3709 3346 +3709 3394 +3709 3607 +3710 3449 +3710 3476 +3712 3410 +3712 3711 +3713 3327 +3713 3711 +3714 3355 +3715 3355 +3716 3355 +3716 3365 +3717 3535 +3717 3542 +3718 3576 +3719 3566 +3719 3599 +3719 3602 +3721 3635 +3722 3332 +3722 3356 +3722 3631 +3722 3633 +3722 3645 +3722 3683 +3722 3721 +3723 3356 +3723 3685 +3724 3317 +3724 3540 +3725 3358 +3725 3359 +3726 3358 +3726 3585 +3726 3594 +3726 3664 +3727 3358 +3727 3491 +3727 3595 +3728 3687 +3729 3347 +3729 3728 +3730 3360 +3731 3568 +3731 3576 +3732 3504 +3732 3621 +3733 3426 +3733 3486 +3734 3494 +3735 3495 +3736 3607 +3737 3445 +3737 3446 +3737 3489 +3737 3720 +3738 3511 +3738 3600 +3739 3483 +3739 3522 +3740 3327 +3740 3382 +3740 3443 +3741 3538 +3741 3629 +3742 3328 +3742 3515 +3743 3661 +3744 3562 +3745 3667 +3745 3668 +3746 3537 +3747 3403 +3748 3403 +3748 3747 +3754 3753 +3755 3753 +3757 3756 +3759 3758 +3761 3760 +3762 3750 +3762 3751 +3764 3762 +3765 3763 +3766 3763 +3767 3750 +3769 483 +3769 692 +3770 113 +3770 3769 +3772 3771 +3773 3752 +3774 3753 +3776 3775 +3777 3775 +3778 3749 +3778 3755 +3781 726 +3781 3779 +3781 3780 +3782 3770 +3783 3771 +3784 3754 +3784 3761 +3784 3783 +3785 3781 +3785 3783 +3785 3784 +3787 3785 +3787 3786 +3788 3761 +3788 3762 +3789 3763 +3789 3787 +3790 3780 +3792 3757 +3792 3758 +3792 3775 +3792 3791 +3793 3750 +3793 3751 +3794 3793 +3795 3773 +3795 3794 +3797 3774 +3797 3776 +3797 3777 +3797 3784 +3797 3796 +3798 3781 +3798 3785 +3799 3796 +3800 3797 +3801 3766 +3801 3781 +3802 3795 +3803 3802 +3804 3752 +3804 3802 +3807 3806 +3809 3775 +3811 3810 +3813 3812 +3816 3779 +3817 3816 +3819 3815 +3821 3810 +3821 3815 +3822 3792 +3823 3822 +3825 3771 +3825 3824 +3828 3827 +3830 3829 +3831 3811 +3831 3814 +3832 3830 +3833 3832 +3835 3834 +3836 3783 +3837 3829 +3838 3766 +3838 3767 +3838 3768 +3838 3806 +3838 3813 +3839 3838 +3840 3838 +3841 3783 +3842 3783 +3842 3824 +3843 3812 +3843 3840 +3844 3807 +3844 3838 +3844 3843 +3847 3771 +3847 3846 +3849 3815 +3849 3831 +3850 3834 +3851 3779 +3851 3850 +3853 3852 +3854 3796 +3855 3779 +3855 3834 +3856 3827 +3856 3853 +3857 3786 +3857 3809 +3859 3847 +3859 3858 +3861 3853 +3862 3838 +3863 3774 +3863 3805 +3863 3826 +3863 3834 +3863 3851 +3864 3805 +3864 3811 +3864 3863 +3866 3865 +3868 3783 +3868 3859 +3870 3781 +3870 3782 +3870 3869 +3871 3779 +3872 3845 +3872 3867 +3873 3845 +3874 3873 +3875 3808 +3876 3796 +3877 3796 +3877 3876 +3878 3875 +3879 3783 +3879 3834 +3880 3818 +3881 3822 +3882 3881 +3883 3758 +3885 3884 +3886 3786 +3887 3796 +3888 3854 +3888 3887 +3889 3817 +3890 3817 +3890 3887 +3891 3786 +3892 3875 +3893 3779 +3893 3823 +3894 3808 +3895 3788 +3895 3789 +3895 3829 +3895 3830 +3895 3837 +3895 3848 +3895 3867 +3895 3872 +3895 3874 +3896 3786 +3896 3820 +3898 3812 +3898 3897 +3900 3829 +3900 3895 +3900 3899 +3901 3807 +3901 3862 +3902 3860 +3902 3891 +3903 3825 +3903 3860 +3903 3874 +3903 3902 +3904 3793 +3904 3865 +3904 3866 +3904 3878 +3904 3884 +3904 3885 +3904 3894 +3905 3785 +3905 3904 +3906 3838 +3906 3866 +3907 3836 +3907 3863 +3908 3814 +3908 3826 +3909 3888 +3909 3890 +3910 3883 +3911 3872 +3912 3823 +3912 3855 +3913 3823 +3914 3861 +3914 3885 +3915 3871 +3915 3893 +3916 3796 +3916 3871 +3916 3877 +3916 3881 +3917 3882 +3917 3910 +3917 3916 +3918 3801 +3918 3826 +3918 3836 +3918 3898 +3918 3911 +3919 3833 +3919 3895 +3920 3848 +3920 3895 +3921 3775 +3921 3809 +3922 3775 +3922 3792 +3922 3913 +3923 3839 +3923 3897 +3924 3923 +3925 3880 +3925 3901 +3925 3908 +3926 3762 +3927 3848 +3927 3895 +3927 3903 +3928 3802 +3928 3804 +3929 3873 +3930 3757 +3930 3809 +3931 3757 +3931 3930 +3932 3749 +3932 3762 +3933 3897 +3933 3918 +3934 3796 +3935 3762 +3935 3788 +3936 3752 +3936 3802 +3937 3790 +3937 3797 +3938 3766 +3938 3803 +3938 3892 +3939 3798 +3940 3798 +3941 3798 +3943 3768 +3943 3778 +3943 3942 +3944 3802 +3944 3827 +3945 3809 +3946 3763 +3950 3949 +3956 3948 +3957 3956 +3959 3958 +3962 3960 +3962 3961 +3963 3956 +3965 3957 +3965 3964 +3966 3954 +3969 3955 +3969 3967 +3969 3968 +3971 3969 +3971 3970 +3972 3970 +3973 3947 +3975 3950 +3975 3951 +3978 3948 +3979 3957 +3979 3959 +3979 3976 +3979 3977 +3979 3978 +3980 3951 +3980 3979 +3982 518 +3983 3953 +3983 3981 +3984 3973 +3985 3966 +3985 3984 +3986 3985 +3987 426 +3987 3985 +3989 3957 +3991 3990 +3992 3972 +3994 3975 +3995 3954 +3995 3973 +3997 3959 +3997 3996 +3998 3949 +3999 3958 +3999 3963 +4000 3953 +4000 3983 +4001 4000 +4002 3965 +4003 3991 +4004 3962 +4005 3972 +4006 3988 +4007 4006 +4008 3957 +4008 3959 +4011 3959 +4012 3948 +4012 3992 +4013 3992 +4016 3958 +4016 3996 +4017 4011 +4018 4009 +4020 3979 +4020 4000 +4020 4002 +4020 4019 +4021 3992 +4022 2717 +4023 2717 +4023 3960 +4024 2939 +4025 3990 +4025 4015 +4026 4024 +4027 3979 +4028 4005 +4028 4012 +4029 3971 +4029 4000 +4029 4014 +4029 4028 +4030 4001 +4031 3957 +4031 4029 +4031 4030 +4032 4029 +4033 3993 +4033 4015 +4033 4026 +4034 3960 +4034 4003 +4034 4022 +4034 4033 +4035 2342 +4035 3982 +4036 4004 +4036 4010 +4037 4009 +4037 4018 +4038 3981 +4038 4014 +4038 4036 +4038 4037 +4039 4030 +4039 4036 +4040 3952 +4041 3966 +4041 4030 +4041 4040 +4042 4041 +4043 4041 +4045 3961 +4045 4044 +4046 4009 +4046 4045 +4047 3962 +4047 4002 +4047 4010 +4048 3988 +4049 4007 +4049 4040 +4049 4048 +4050 3998 +4052 4051 +4053 4050 +4053 4051 +4055 3955 +4055 4054 +4056 3955 +4056 4007 +4057 4034 +4058 4015 +4058 4057 +4060 4059 +4061 4059 +4062 3954 +4062 4061 +4063 3966 +4063 4060 +4064 3954 +4064 3966 +4065 3995 +4065 4060 +4066 4041 +4066 4065 +4067 3982 +4068 3994 +4068 4067 +4069 4052 +4070 4052 +4071 4060 +4072 3971 +4073 4072 +4074 4073 +4075 4073 +4076 4073 +4078 3974 +4078 3986 +4078 4077 +4079 4009 +4080 4029 +4080 4036 +4080 4038 +4080 4047 +4080 4079 +4084 4082 +4084 4083 +4086 4081 +4086 4084 +4086 4085 +4089 4088 +4090 4084 +4090 4086 +4092 4091 +4099 2556 +4099 4084 +4101 4100 +4102 4093 +4104 4103 +4105 4069 +4105 4070 +4105 4095 +4106 4096 +4106 4105 +4107 4106 +4109 4106 +4109 4108 +4110 4099 +4111 481 +4112 129 +4112 4111 +4113 475 +4114 4113 +4116 4092 +4118 4117 +4120 108 +4120 522 +4120 4119 +4121 4090 +4121 4110 +4124 4118 +4124 4122 +4124 4123 +4128 4125 +4128 4126 +4128 4127 +4129 2440 +4129 2562 +4131 4130 +4133 4132 +4135 4134 +4136 4097 +4138 4110 +4138 4134 +4138 4137 +4143 4121 +4143 4140 +4143 4141 +4143 4142 +4144 4106 +4145 526 +4146 4144 +4146 4145 +4147 4098 +4147 4106 +4148 2440 +4148 4114 +4149 4114 +4150 4121 +4151 4102 +4151 4139 +4151 4147 +4152 4094 +4152 4103 +4152 4151 +4154 4118 +4154 4138 +4154 4153 +4156 4110 +4156 4132 +4156 4154 +4156 4155 +4157 4137 +4158 4134 +4159 4118 +4159 4154 +4160 4090 +4162 4086 +4162 4138 +4162 4158 +4162 4161 +4163 4119 +4163 4152 +4164 570 +4164 4120 +4164 4163 +4165 4152 +4166 4087 +4168 4167 +4169 4167 +4171 4147 +4171 4170 +4172 2621 +4172 4087 +4172 4099 +4172 4115 +4172 4162 +4173 474 +4173 4111 +4173 4149 +4174 4164 +4175 4139 +4176 4175 +4179 842 +4179 4120 +4179 4164 +4179 4177 +4179 4178 +4181 4166 +4182 4180 +4183 4182 +4184 4107 +4185 4184 +4186 4128 +4187 4089 +4187 4115 +4187 4180 +4188 4089 +4188 4166 +4188 4187 +4189 4092 +4193 4154 +4193 4162 +4193 4172 +4193 4190 +4193 4191 +4193 4192 +4194 4156 +4194 4172 +4196 4131 +4196 4167 +4196 4180 +4196 4187 +4196 4195 +4199 3763 +4199 3785 +4199 3803 +4199 3905 +4199 4197 +4199 4198 +4200 4097 +4201 4111 +4201 4128 +4202 4121 +4202 4150 +4202 4199 +4203 4187 +4204 4147 +4204 4171 +4206 4101 +4206 4160 +4206 4199 +4207 4164 +4207 4174 +4207 4206 +4208 4092 +4208 4166 +4209 4151 +4210 4181 +4211 564 +4211 4115 +4211 4133 +4211 4187 +4212 4151 +4213 4112 +4213 4207 +4214 4166 +4214 4189 +4215 4151 +4216 4163 +4216 4215 +4217 4090 +4217 4160 +4217 4206 +4218 4087 +4218 4172 +4218 4187 +4218 4194 +4218 4205 +4219 2543 +4219 4164 +4219 4218 +4221 4111 +4221 4128 +4221 4201 +4221 4220 +4222 4097 +4222 4136 +4222 4221 +4223 4157 +4224 4138 +4225 4103 +4226 4182 +4227 4101 +4227 4199 +4228 4157 +4229 4157 +4230 4158 +4231 4158 +4232 4158 +4233 4157 +4234 4193 +4235 4203 +4236 4203 +4238 4137 +4239 4117 +4240 4117 +4241 4100 +4242 4155 +4243 4110 +4243 4237 +4244 4100 +4245 4097 +4246 4097 +4247 4246 +4248 4246 +4249 4155 +4251 4161 +4252 4127 +4253 4153 +4254 4195 +4256 4203 +4257 4195 +4258 4155 +4259 4137 +4260 4100 +4261 4203 +4262 4203 +4264 4214 +4264 4255 +4264 4263 +4265 2621 +4265 4250 +4266 4195 +4267 4087 +4268 4111 +4269 4160 +4270 4224 +4271 4224 +4272 4224 +4273 4224 +4274 4224 +4275 4224 +4279 4094 +4279 4276 +4279 4277 +4279 4278 +4280 4175 +4281 4098 +4282 4098 +4283 4098 +4284 4188 +4285 4093 +4285 4119 +4286 4204 +4287 4204 +4288 4165 +4289 4165 +4290 4180 +4291 4279 +4292 4291 +4293 4291 +4294 4291 +4295 4181 +4296 4181 +4297 4181 +4298 4181 +4299 4088 +4300 4186 +4301 4218 +4302 4301 +4303 4301 +4304 4202 +4305 4102 +4305 4212 +4306 4102 +4307 4305 +4308 4209 +4309 4209 +4310 4209 +4311 4209 +4312 4209 +4313 4210 +4314 4210 +4315 4210 +4316 4210 +4317 2556 +4317 2621 +4317 4101 +4317 4128 +4317 4174 +4317 4186 +4317 4221 +4318 4299 +4319 4299 +4320 4114 +4321 4284 +4322 4284 +4323 4129 +4324 4129 +4325 4148 +4326 4149 +4331 4328 +4331 4329 +4335 4332 +4335 4334 +4336 4332 +4340 4332 +4340 4333 +4340 4339 +4341 321 +4342 4327 +4342 4336 +4342 4338 +4345 4336 +4345 4342 +4345 4343 +4346 4328 +4346 4336 +4346 4345 +4347 4332 +4347 4335 +4347 4336 +4347 4345 +4351 4350 +4352 4344 +4355 4333 +4357 4333 +4357 4340 +4357 4346 +4357 4356 +4359 4333 +4359 4351 +4359 4358 +4360 4346 +4361 4336 +4361 4343 +4361 4345 +4362 253 +4363 4352 +4363 4362 +4364 4358 +4364 4359 +4365 4342 +4365 4345 +4367 4366 +4368 4342 +4368 4345 +4368 4365 +4368 4367 +4369 4363 +4370 4363 +4371 4359 +4371 4364 +4372 4359 +4372 4361 +4372 4364 +4372 4365 +4372 4371 +4373 4336 +4373 4343 +4373 4345 +4373 4361 +4373 4364 +4373 4365 +4373 4372 +4374 4341 +4374 4352 +4374 4367 +4374 4369 +4374 4370 +4375 4327 +4375 4342 +4375 4368 +4376 4341 +4376 4352 +4376 4367 +4376 4374 +4377 4329 +4377 4346 +4377 4353 +4377 4357 +4380 4359 +4380 4371 +4380 4379 +4381 4332 +4381 4335 +4381 4336 +4381 4345 +4381 4346 +4381 4347 +4381 4352 +4381 4375 +4383 4333 +4383 4359 +4383 4364 +4384 4344 +4384 4352 +4384 4374 +4384 4376 +4385 4332 +4385 4344 +4385 4384 +4386 4337 +4386 4384 +4387 4327 +4388 4359 +4391 4332 +4391 4333 +4391 4355 +4391 4372 +4391 4383 +4391 4389 +4391 4390 +4392 4327 +4392 4352 +4392 4367 +4392 4369 +4392 4370 +4392 4374 +4392 4376 +4392 4384 +4395 4333 +4395 4336 +4395 4340 +4395 4345 +4395 4361 +4395 4372 +4395 4373 +4395 4383 +4395 4391 +4395 4393 +4396 4353 +4396 4373 +4396 4391 +4396 4394 +4396 4395 +4397 4371 +4397 4382 +4398 4332 +4398 4335 +4398 4347 +4398 4352 +4398 4381 +4399 4343 +4399 4365 +4399 4382 +4400 4332 +4400 4340 +4401 4330 +4401 4344 +4401 4352 +4401 4384 +4401 4392 +4402 4332 +4402 4335 +4402 4337 +4402 4347 +4402 4349 +4402 4381 +4402 4384 +4402 4386 +4402 4398 +4402 4401 +4403 4355 +4403 4383 +4404 4342 +4404 4354 +4404 4367 +4404 4368 +4405 4361 +4405 4373 +4406 4345 +4406 4361 +4407 4331 +4407 4346 +4407 4357 +4408 4344 +4408 4352 +4408 4381 +4408 4384 +4408 4401 +4409 4345 +4409 4360 +4410 4327 +4410 4354 +4410 4392 +4410 4404 +4411 4342 +4411 4368 +4412 4353 +4412 4373 +4413 4332 +4413 4344 +4413 4352 +4413 4384 +4413 4385 +4413 4401 +4413 4408 +4414 4404 +4415 263 +4415 4378 +4415 4386 +4416 4351 +4416 4358 +4416 4359 +4416 4371 +4416 4380 +4417 4346 +4417 4348 +4417 4357 +4418 4346 +4418 4361 +4419 4345 +4419 4361 +4421 4420 +4423 238 +4424 4422 +4425 353 +4426 354 +4428 326 +4429 4427 +4430 4426 +4431 309 +4432 4422 +4433 4431 +4435 290 +4435 4421 +4435 4432 +4435 4434 +4436 4421 +4436 4435 +4437 1119 +4439 4436 +4439 4437 +4439 4438 +4441 4437 +4441 4439 +4441 4440 +4442 4421 +4442 4436 +4442 4441 +4443 4427 +4443 4442 +4444 830 +4445 22 +4445 2562 +4446 23 +4446 84 +4446 91 +4446 475 +4446 493 +4448 49 +4448 85 +4448 521 +4448 2562 +4448 4445 +4448 4447 +4454 4451 +4454 4452 +4455 4453 +4456 4455 +4457 843 +4458 514 +4458 521 +4458 569 +4458 829 +4458 837 +4458 856 +4458 2440 +4458 4119 +4458 4444 +4458 4448 +4458 4454 +4458 4455 +4458 4457 +4459 99 +4459 4458 +4461 24 +4461 84 +4461 132 +4461 2562 +4461 4446 +4461 4460 +4462 826 +4462 4444 +4462 4449 +4462 4450 +4463 4458 +4464 4458 +4465 4458 +4466 4458 +4474 4473 +4475 4471 +4476 3362 +4476 4474 +4477 4476 +4478 3378 +4479 4478 +4481 4480 +4483 4482 +4485 4467 +4485 4468 +4485 4478 +4485 4480 +4487 4486 +4491 2423 +4492 4491 +4496 4485 +4499 4498 +4500 4490 +4500 4498 +4501 4483 +4501 4500 +4503 4502 +4506 4505 +4507 2241 +4507 4469 +4508 4473 +4509 3363 +4509 4489 +4510 4493 +4514 4513 +4517 4516 +4518 4512 +4520 4519 +4521 4520 +4522 4504 +4526 4469 +4528 4527 +4529 4488 +4530 4485 +4533 4486 +4535 2248 +4535 4507 +4535 4534 +4536 2248 +4540 4484 +4541 4534 +4542 4508 +4542 4531 +4543 4492 +4545 4523 +4545 4528 +4546 4506 +4547 4497 +4547 4533 +4549 4548 +4550 4486 +4552 2409 +4553 4467 +4553 4495 +4554 4516 +4554 4522 +4559 4475 +4561 4503 +4561 4557 +4562 4488 +4563 2423 +4565 4564 +4567 4537 +4567 4566 +4568 4553 +4570 3364 +4571 4570 +4573 2249 +4573 4572 +4574 4477 +4574 4573 +4575 4508 +4576 4549 +4579 4524 +4579 4544 +4579 4555 +4580 4491 +4581 4513 +4582 3352 +4582 4492 +4582 4581 +4584 4491 +4584 4551 +4585 4515 +4586 4551 +4587 4585 +4588 4487 +4588 4540 +4589 4504 +4589 4585 +4589 4586 +4590 4471 +4590 4482 +4592 4520 +4592 4555 +4594 4574 +4595 4574 +4596 4494 +4596 4532 +4597 4519 +4597 4538 +4598 4513 +4598 4579 +4600 4505 +4601 4485 +4602 4469 +4602 4564 +4602 4565 +4603 3331 +4605 4473 +4605 4604 +4606 4497 +4606 4547 +4607 4512 +4608 4607 +4610 4489 +4611 4531 +4611 4593 +4611 4602 +4612 4562 +4613 4468 +4613 4512 +4614 4516 +4614 4570 +4616 4493 +4617 4473 +4617 4503 +4618 4534 +4619 4605 +4620 4520 +4620 4522 +4621 4570 +4621 4577 +4622 4560 +4622 4562 +4622 4583 +4623 4583 +4624 4550 +4624 4600 +4625 4619 +4626 4469 +4626 4510 +4627 4552 +4628 3643 +4628 4476 +4628 4571 +4630 4607 +4631 2241 +4631 4536 +4632 2409 +4633 4621 +4634 2355 +4635 4592 +4636 4508 +4636 4610 +4637 4569 +4637 4619 +4638 4548 +4639 4470 +4640 4565 +4641 4602 +4641 4640 +4642 4637 +4643 4511 +4643 4557 +4643 4615 +4644 4608 +4644 4643 +4645 4641 +4646 4473 +4648 4490 +4648 4549 +4648 4556 +4649 2409 +4649 4627 +4650 4531 +4651 4532 +4651 4541 +4651 4569 +4652 2249 +4652 4474 +4652 4552 +4652 4573 +4652 4644 +4652 4651 +4653 4629 +4654 4523 +4654 4601 +4654 4615 +4654 4653 +4655 3336 +4655 4479 +4655 4481 +4655 4608 +4656 4574 +4656 4655 +4657 4590 +4659 4495 +4659 4524 +4659 4581 +4660 2387 +4660 4493 +4660 4506 +4660 4658 +4661 4517 +4661 4577 +4662 4476 +4662 4543 +4662 4628 +4662 4661 +4664 4509 +4664 4633 +4664 4663 +4665 4591 +4666 4554 +4667 4567 +4668 4645 +4669 4491 +4669 4515 +4670 4556 +4671 4472 +4672 4630 +4673 4534 +4674 4499 +4674 4647 +4674 4671 +4675 4542 +4675 4646 +4676 4470 +4676 4528 +4676 4672 +4677 3360 +4677 4560 +4678 3361 +4678 4476 +4678 4677 +4679 4562 +4679 4568 +4683 4616 +4683 4634 +4683 4682 +4684 4563 +4684 4677 +4686 4525 +4686 4537 +4686 4609 +4686 4667 +4686 4685 +4687 4530 +4687 4657 +4688 4484 +4688 4660 +4689 4639 +4689 4670 +4690 4608 +4690 4689 +4691 4518 +4691 4689 +4694 4588 +4694 4692 +4695 2414 +4695 4693 +4695 4694 +4696 4512 +4699 4520 +4699 4697 +4699 4698 +4700 4546 +4700 4558 +4700 4658 +4701 4554 +4702 4494 +4702 4511 +4703 4487 +4703 4606 +4711 4704 +4713 4707 +4714 4705 +4714 4710 +4716 4706 +4716 4707 +4719 4552 +4719 4706 +4720 4717 +4722 4534 +4722 4578 +4723 4591 +4723 4651 +4723 4722 +4724 4710 +4727 4712 +4727 4715 +4727 4725 +4728 4708 +4728 4709 +4728 4712 +4728 4717 +4729 4708 +4729 4709 +4731 4718 +4732 4713 +4732 4719 +4733 4627 +4733 4708 +4735 4711 +4735 4724 +4736 4720 +4736 4727 +4737 4718 +4738 4731 +4738 4734 +4739 4649 +4739 4721 +4739 4737 +4740 4733 +4742 4739 +4742 4741 +4743 2209 +4743 4632 +4744 4734 +4745 4705 +4745 4733 +4746 4704 +4746 4708 +4747 4740 +4747 4741 +4748 4728 +4748 4730 +4749 2409 +4749 4726 +4750 4649 +4751 4715 +4751 4721 +4751 4730 +4751 4744 +4751 4750 +4752 4708 +4753 2409 +4753 4649 +4754 4725 +4754 4749 +4754 4753 +4755 4721 +4756 4726 +4757 4733 +4758 4755 +4759 3334 +4759 4525 +4761 4570 +4761 4760 +4763 4539 +4763 4566 +4764 4500 +4765 4500 +4766 4470 +4767 4496 +4767 4529 +4768 4522 +4768 4762 +4769 4767 +4770 4769 +4771 4538 +4771 4681 +4771 4685 +4772 4482 +4773 4609 +4774 4727 +4775 4727 +4776 4620 +4777 4761 +4778 4518 +4779 4667 +4780 4779 +4781 4691 +4782 4518 +4784 4726 +4784 4749 +4784 4783 +4786 4626 +4786 4785 +4788 4588 +4789 4540 +4791 4616 +4791 4790 +4792 4788 +4793 4703 +4793 4792 +4794 4787 +4794 4793 +4795 4792 +4796 4469 +4797 4493 +4798 4497 +4799 4542 +4799 4675 +4800 4520 +4801 4520 +4802 4520 +4803 4526 +4804 4526 +4805 4538 +4806 4538 +4807 4538 +4808 4539 +4809 4539 +4811 4561 +4812 4755 +4813 4564 +4814 4564 +4815 4564 +4816 4541 +4817 4816 +4818 4697 +4820 4575 +4820 4599 +4820 4602 +4820 4819 +4821 4640 +4822 4798 +4823 4673 +4823 4810 +4824 4780 +4825 4681 +4826 4532 +4826 4651 +4826 4680 +4827 4670 +4827 4782 +4830 3322 +4831 3331 +4831 4830 +4832 4477 +4836 4835 +4837 2312 +4837 4832 +4837 4836 +4841 4832 +4841 4840 +4842 4840 +4843 4840 +4844 4841 +4845 3454 +4845 4830 +4847 4834 +4848 4846 +4848 4847 +4849 2396 +4849 4836 +4850 3381 +4850 3385 +4854 2265 +4854 4853 +4855 980 +4855 4851 +4859 2365 +4859 4856 +4859 4857 +4860 4852 +4860 4858 +4860 4859 +4861 3295 +4861 4537 +4862 3543 +4863 4862 +4864 3318 +4865 3337 +4866 4537 +4866 4828 +4866 4829 +4867 4474 +4867 4840 +4867 4861 +4867 4866 +4868 4867 +4869 4867 +4871 4856 +4873 4848 +4873 4872 +4874 4829 +4875 3341 +4875 3369 +4876 3333 +4876 3342 +4876 4483 +4876 4875 +4877 4863 +4878 3372 +4878 3387 +4878 4847 +4878 4862 +4879 4864 +4879 4878 +4880 4870 +4881 4838 +4881 4878 +4882 138 +4882 4852 +4883 3348 +4883 4848 +4883 4876 +4884 4828 +4884 4836 +4884 4874 +4885 3642 +4885 3649 +4885 4874 +4885 4877 +4886 4885 +4887 4841 +4887 4864 +4887 4886 +4888 3345 +4888 4886 +4889 4832 +4889 4887 +4889 4888 +4890 4838 +4890 4872 +4891 4873 +4892 4851 +4893 68 +4893 4871 +4893 4891 +4893 4892 +4894 1030 +4894 4893 +4896 4833 +4897 2214 +4897 4828 +4897 4836 +4897 4854 +4898 4833 +4899 4831 +4899 4898 +4900 4848 +4900 4880 +4900 4888 +4902 1033 +4902 4879 +4902 4901 +4903 4839 +4904 4838 +4904 4839 +4905 4872 +4905 4903 +4907 4901 +4907 4906 +4908 4850 +4908 4906 +4909 4850 +4909 4901 +4913 4870 +4914 4878 +4914 4910 +4915 4880 +4916 4834 +4917 4872 +4918 4913 +4919 4908 +4920 4878 +4921 4901 +4921 4911 +4922 4850 +4922 4917 +4923 4834 +4923 4865 +4923 4912 +4924 4878 +4924 4910 +4924 4918 +4925 4867 +4925 4895 +4925 4899 +4926 4896 +4926 4898 +4927 4695 +4928 776 +4928 4927 +4929 4928 +4930 3 +4931 4930 +4934 782 +4934 4932 +4934 4933 +4935 4932 +4937 4930 +4937 4935 +4938 4929 +4938 4936 +4939 4933 +4940 819 +4940 4939 diff --git a/tests/integration/env_init/databases/metadb/jasminegraph_meta.db b/tests/integration/env_init/databases/metadb/jasminegraph_meta.db new file mode 100755 index 0000000000000000000000000000000000000000..20c5eae836de10839301043975658e1b7123d1ec GIT binary patch literal 61440 zcmeI53wWGmmB+uC`R><38$v0Up|sL0X*)AXni4LhK&X|{mbM5LAx)EMI&GSSTqp$r zC*b4EfVi#|*9*#e!^^VX?;@_NpzEWux+~xfRD1+iS5(wRMfd#w@8mLR-Nk41QSnX4 z0Z07JG*V|*&DjEyp&y5>Q~14joZ4{ zb#KXT+_Wvb@uCeIvYWT8zhLc_?b-9Yx3^}8diNEx&t1FaoM*4yl3iBlXqonF%}$IA z4)^x=jP#E0o^ff*BWp{xmx` z^VaN@#nJKNRei$~L*v=A*RK>bLU z+kM{Ji#BY_?&=*JE6&_Meqdyl-uYZhi+gqIwrAEpeFjxCxo*N~UbrxIV~Iy@|M2ME z;;4EI8xGxKb#ZZaneXk`Jv=rpn;D;Wc!%s_aTqI(%2w_f86Fjf>5Y~xwNKg!vMh<^@tY>6m=U}OChj;d-O&hw`ZlrU+D(H9Q z&+~e?aI@gDY)5G-NQ>Wc{yw|;_lS(;%BR+=fi2FC)UtlS6Y>Xr1$Appl`|l&nLvXEtD` z2M>eLDgUQ4)U&@dzPqP?Vq|QJ=q-_%zUpbOpLWy={DBnM9NEpMoRZqkgEn@>p#1pK zGgiD}qBzu7obxnjICOIcmjSY^a%W3CXx#b-O78z3X4A9n=A})kvC?_lXvlXnvtT;~ zKJT!oCHRE2vq9KWb}~-$(xs{Lg;Z?zH*2$Pvq7ubBh%l8PJLH3g{j#jochkRHQQet z>l-bN;M=%HwzeeiH4grs0!<#Vj@-XdeY-rjeD%%pVq8{VwP(IymoMJ#G@o`_YO;IQ zMj0EQ=r0ZTj2HKf^r*|_-1D90j*ir1hR@X(%%0u7@&$G3o6*Bv^BdGUoJV%qbO8Ax zIc-l#(wd#V)YAz0`nM9T*?QEeFTm5_6$vl+gMAf_upsl~2mO~NwF4;I@fkcJ0V$wk?;yV?u#`=9)&zBzw`x$y32jTC7AL(|GNkrzc#-|%Q} zLkwJ)6Jm8&TV92bI|pzl=6*VNc6N2N)hG84nhRbh_n&;kMe6=Sd&9gd_VkYJD-Ee% zKCc|#H?mS33hlE~DRgzLo~foD(E3W#IVxa2m(MkXJa>5i5Ps1-wh}{gBDHlD8d3|s zZgf#r5#|4qwa``Q=<3MTD?9aQ-=HWFzi<8H?;rC!&8MzelggwrO=E+-W4jxQ=9LxW zSB-DmJ&|2IF_6u7WD9Lw`9fEFz1}$kvPZ-N8zh}tku#(FeqAW6$jSdzyY{#anI$c= z?CR|+%CDdIHcV6;7(UE2`L2AYiZ*AO{PZSDC-<7EOWvMu=Pb>O&ZyTiF2BwhFOD`$ zQonZSM6$07^?ltqQBHR2bUkOh+FbJZ@ttj$DRbxiHrA7F8W?D6m_?rB;4}!9>*#7b z^>CHQKu3M%G*47sh2JRQc`%Hp6}~VnyE>PWVEFq*$j$6v=3yA=e`N&O!Sx*E(%%>- zmNRvQ4P#(vV!Svw*xObI$G*~miP4Gvl^c3@uH;XA%kdlGmFwzm%f)Y`FtU8=d0QSU zae@304Z`GQL&>(1V+p|vIe*T8>?|lK18L)ltIhP<_o+2c-FiY#eI*QIWO#pZbYQg9 zuU6!DBsA?M>ojMUTvvYeVW-b^2?9C2IsXE4;V1Ll)~UA`3lGTb^44S+W2Jo~gT?8o z4MQ$AUpp;VacFdSXnOQ;N_E3yd2wHFX>cVUm-7lYY#qe;_H2HYY|5_ox*Ag?st>G^ z!#O3>OShTUYgZJwql{Y9#cS4hD$$+2V>4+UE)h7a=o`DTF?f5YIt{W0hYYmipvpjC z9;u`;j2esgKo-N8DqaC?_>a%E=^1=j`1$|W$mKr5gX&n_gXnCA$ zZkERv9CegDUfCqS3ou3&ERe@N^XJQB|B*+^a#X z5Mb2DkMixFCyy&!S00x+_{;sp@?jW9S@;Y7c_#jTf1Z_*M?amGM-#tCHIq*p$)}Tl zOTLx-F!_*N&~I7+t$55;J5FbelQwPc-m-Sv`b`_xZtycQM#t`Rk1#Vv%f?L`XAR@$|5Wm@A^+(& zt$e+BUG0`RX3@aF*d_XT$Hf#lBQ z&B<-a!Q`f7GPyb#O-k|_02e2ll6A?NWL2^}S&|%^EJ(t{jDHpXBz`RZR{UUmU;LT) z6Y&S*e~RB6-xj|jzB#@jz9t@v_r$&NCGqC?+3}iqRlGc28Xp%gh=VvC{WAJV^jP$8 zbbs{4=-%k==mXK6(VL>zMhBytqRHq$bVXE(dZX>p=4f4XX0$3=5iO05jpj!|lnH+s z{v`Z<_^t4P@QdNS;oac}!aKt^g|7_{hBt+i;nm@2SPFN97l)g|b>W#|N7x!J36Blu zhklp}o(z5*JQ_R{d?oloa8K~D;61@xgVzVQ1~&(j!BxRc88+!@tcx=-=d*{r&zvzu&*qztCUjpW(Orr}!uO zNBfCydB5_0>^DIq#pn4|(tO-t4``dzn}9uJh^vw>mdFlg4|k z9d9*Rp_MlO+x#!{yXM!;FPWb)KW@I?{73T*=HHvQm@hJ4V2+x*&CAV;%njz*=4x|= zxzs$?JkoSCzsdY8^MlN{GY@3Gkok1xW1074-kNz`<`tQnGn1LCGDDeS=J}bene~}9 znT||r=A_KROp>wEzfS)&{g~`!_2x_tnn{w%txDUId&TndtL(`=Vz{|g&SVK=g;l0A zxf@p7s*E!^04opwU1E7T@h^(u7R0|_d5M1?tU`zQ@8q=(@$VJO%Xiq5JH&8vV)Ves zcRG`o!ztG(H(mxS-zhgfA68qZ+<2*2UZK;Te4ZF?PW-oHtN{N@l$ZEl3@Z=+=ZfX! z#Q!2OnAkRYp^&ZgLLpmVvG5DUV&R*`VBwoE#=s_O~B>yvEvEDPp zV!fw}!F*1m7wYYz7wSC~7VBLt7VGU4gY~Y$80+nT#d_OevEDYZSZ_fL#?LD+iJybT zdROuq>Rllg>s>Ae>utptt2~8XSf#gn`}Ub3poFvcoRR$h|zvtY5xrDCzlC1Nm( zljwyi7t;$>o(PLoX2oKaCy2o+kH;9RJPsDCJQfzKTqG8&JVp%0U#Pq!{?V{lWizj# z%A>?$l}%!>$^{%lZSygP+K%Ly)OG~MSlc}1CAlWBSX(R>Ym3C-+#$VCTR<<==EGub zo>;8S6@#@o7-MZVEY@bhVr`~atSuu35Rgn20+g{3kPO?dOpsw~l>su9KS-t)0w`ntAQ|HmWQ-4xsr*4Q zl|N9%{6RA2PmnQxfK25NlBxWGGUgAGF}?yB^a03J{veskA1Gt~AQ|%~$hds~GL8X1+Xo<1S%YNE8YE+Uf{gJAG8~99K&G+= z$(S`r#;gf4?ht|uTb&@oRwu|9iy&jJ1R1wFL58hPkYTG6WXzQyW3B`lw>m+Ftxk|3 zK0(I#1Q~NB$ar`OG8|rl42KsWqnh9tt5q1o8UbT!4}fDzO@NGQf@4$@98-spAY+CE z88ZaPs3thZ_~4j2BLo>UB*>T{Kt?seF&;*845g7{ER7tabmSPNBgY^eIR@#-F-k{{ zF)?xsi4kL>94RKz0WoF;h;d^QV#o;$LrNeR)))MuEBHly$S-68d_f(+3*rD>)CTC{ z@gTa80LTSlz%A$kYB4IP#RL?!BmqDR2>@A00KnqB02Y@8z{0%X73L+aPS%E2n` zZ?FpU0#%ropn|I86jlS6;?@SHFfS;DdC4f02}EH!01DHAPb{;}r;I~9p-j*T(}7Kx z4rpST3QaPdB9oK}Fkw1i2`djOVHQ9Mvk*xribO(D01}G=kT45)gjwn|G9AJQMS(>u z3M|4bKoMpEh!C9^LUd4wO9cusIw*wbU=X5%K&$}-;!-IBNeuuHq60sW4Dg{cfDfZ~ zz<@Gf52AuRhzjm7D!9X_iaQb&*g;f42T_3>1_N>!49Gz+00+Uq8wMk9AOLZL?F`x= z7+8Z~Kn-I6HHZPwAO-WEP0;Db9w1>C!N8|i)G%OO1bi$ab#GYzCn4{Z)I1Lg%UEtZ zJ#W)7%!WZ0e~Yz<5PkBg$mKr5gX_!BB{O3HVenj&fBXBeHGs|)hcHq*#&#$rpqQ;Y`Z zoH)wUuepm(SDM(Kt{iOZ4{XP2|_LuF?+MlpLXy0kS(SDWv zxAu$eYwa<+Wbd#qwl~`6+Ff?eKG{CrUSRvSVg17TFY6KOtJZziz1GLA_gQbZZns`( z-D2HnU2Tn61J>o%HtRXoSyrdD!dhY-W6iT1^Ec)b=J(Bq&HK$Sn4dB~V!q3~!+f22 z(5#s+H22F^({F#Z3fMLF>uu|_YpP*yr&D9c-n=yRuCZlrPP(ht*t54F-PLQVX|MRR zYj2zQtG2!HN8es)qAmXD+$-(C#UH(U(Y?Kf-o0pgUSsdxHu$4?ukuIx-c%0$Xy8kK zH1Ks1pACG`WW0tBzRDjxe3ifI;w$ml#uxsok1zb$$d~!ElP~jOD_`WpUcPzpXEWa% z{MpTy`Kxxm$cO!W;jbF{ia$E~vT1vbJ$=zWyvC-!XvtkeS6?)|uA!?h8qe0y)|c&M zYi#U`zS1>z_C>4X8e03J3vmstebFemhTgvH>04uWUo;}FvAr+4`qt3j7p-t>=Zll4 z-|7`=O#DY+(SH~g*0(w&7X9~$!T5t1gPzsBu;{-B7X3?NF`wOH(0>49^xvhtB%dNI z=F=}0$}Frz^{oPCILKA733mH2g+1@uuQEl zVTOZT1VmJC{wEnmZ?<*%%~z*Miq%NssfZLRlqW(B49>Uz%r^rl;PA?fimR} zmZ?<&%;*o6F+NeoRRYSCKUk*x0W;c zru+dj`U7UnpDbg1vW%+=mdTx>B4EZ<1Q$s6)@wf0%lxQvJ8#f zt7I8YZ51rzsjUKLTvfn~@yRmAC(C$h!7_FWuL5RVRltm^N|y12f@RbWD5G{jnJ6Z6 zlVv?GHL;oiB95AmeHRqy=ns@JK2WAk1X)IZvW)&<8S??k=ns@B zf3l2(Q7nVjU>V~BWn4?3Oyy6OA%2A{L;e-84E`0M4Ea}pGRCivWmwA!S%$T&fMrY2$Cs(pp5wdW%MV>=&wiyg+Vfv4^YPVKp9rBLXu$z zRuswL50WW=pp5=N8S_^pgTEpf{6R9F#tKlz6$HwtFiD2fQUS@x*a}d_(^vt^xPm|# zSCAybX{>-`WNZZ}<7upbWn4j^jPXe_#s|sB*a}d_(^vt^xPm|#R}dtlPyiXXZUrPG ohAKoEw=Ph|!a*_?4v_KaRX{T3Uq_j26`+j%AQ|HWWZ3He1LBdEV*mgE literal 0 HcmV?d00001 diff --git a/tests/integration/env_init/databases/performancedb/jasminegraph_performance.db b/tests/integration/env_init/databases/performancedb/jasminegraph_performance.db new file mode 100755 index 0000000000000000000000000000000000000000..04fba59319897cce12f73d8ed66bd02f3a4b1f9d GIT binary patch literal 49152 zcmeI)O>g5w7zgl~q^*;-sh30K1JcH=x}uR*Q4++a<+5a}h^^?RkfuOEi{o|N*4iYt z9A}q3a7cUQz=3N&12+zEM&c77A-Kbd11FBmjN`=4x&aQX`to<{#`Qe*%=7ciq@!+k z|ASr2Gu0#8?dqQTCb>l@CGV&zA>@ed%WPj{dy)`3WUq5<4>lSc%y>N_h5J8eq#sFY z;XJvrpLw|acZnCCsET&sl zyOrLlH*4?K8fty7sn!p6ckiar_FZDLov-`IInZ5*oa)ebj!bMuRNxk!JzERPNC_}>JE zpL`)Hxg0%9h6V)dlHSpcZChxC~?s}GI z**(p$2R$zm&4C#`NLg$-bm)ZPC-Gq2xkiTx;vzDAVb)Qe4{8 zL9-2f!k*5DT97HL&>W4v;M8;5eQLTfnVX-R#z3g}!*w#i<5D&5`>C>w*u>^f9MkQM zKf4f3H9lx|s#aTE6?t$M&Q69ih?%oqmWj*qs;#|=5=u-&S&=M)nXhN%R zy6hc8b8MHj@xy9k`(d@AZm8vAQO)x~YB{l|2kg4o0;{ie^}feTAMEYz)~a=Jm%b)i z;+njoXyKHCpA35|8h*4XDcLMNdu{yG`8^U*2!1MX;K#AhEq^%v`}9~A&frPMG9p=c z?4fit-jNO4HT&bLc!qwN-#5kse=0T6K9-q3t&d**VU8cJe(2tWV=5P$##AOHaf zKmY;|fB*y_009U<00Izz00bZa0SG|g<_O^T|2OAZBU1=K00Izz00bZa0SG_<0uZ?I z0tqIt#CH6j2sgef0006IfB*y_009U<00Izz00bZa0SG_<0uX=z1Rwwb2tWV=5P$## yuA%_{_y1J>ldw;05P$##AOHafKmY;|fB*y_009VG8-Zmik+e(`w3MLVC;tYdHp)o= literal 0 HcmV?d00001 diff --git a/tests/integration/test.py b/tests/integration/test.py new file mode 100644 index 000000000..8fd77ea62 --- /dev/null +++ b/tests/integration/test.py @@ -0,0 +1,121 @@ +""" +Copyright 2023 JasmineGraph Team +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import sys +import socket +import logging + +logging.getLogger().setLevel(logging.INFO) + +HOST = '127.0.0.1' +PORT = 7777 # The port used by the server + +LIST=b'lst' +ADGR=b'adgr' +EMPTY=b'empty' +RMGR=b'rmgr' +VCNT=b'vcnt' +ECNT=b'ecnt' +TRIAN=b'trian' +SHDN=b'shdn' +SEND=b'send' +DONE=b'done' +LINE_END=b'\r\n' + +def recv_all(sock, n_bytes): + buffer = bytearray() + read = 0 + while read < n_bytes: + received = sock.recv(n_bytes - read) + if received: + read += len(received) + buffer.extend(received) + return bytes(buffer) + +def expect_response(sock, expected): + global passedAll + data = recv_all(sock, len(expected)) + print(data.decode('utf-8'), end='') + if data != expected: + logging.warning(f'Output mismatch\nexpected : {expected}\nreceived : {data}') + passedAll = False + return False + return True + +def send_and_expect_response(sock, testName, send, expected, exitOnFail=False): + global failedTests + sock.sendall(send + LINE_END) + print(send.decode('utf-8')) + if not expect_response(sock, expected + LINE_END): + failedTests.append(testName) + if exitOnFail: + print() + logging.fatal('Failed some tests,', file=sys.stderr) + print(*failedTests, sep='\n', file=sys.stderr) + sys.exit(1) + +passedAll = True +failedTests = [] + +with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + sock.connect((HOST, PORT)) + + print() + logging.info("Testing lst") + send_and_expect_response(sock, 'Initial lst', LIST, EMPTY) + + print() + logging.info("Testing adgr") + send_and_expect_response(sock, 'adgr', ADGR, SEND, exitOnFail=True) + send_and_expect_response(sock, 'adgr', b'powergrid|/var/tmp/data/powergrid.dl', DONE, exitOnFail=True) + + print() + logging.info("Testing lst after adgr") + send_and_expect_response(sock, "lst after adgr", LIST, b'|1|powergrid|/var/tmp/data/powergrid.dl|op|') + + print() + logging.info("Testing ecnt") + send_and_expect_response(sock, "ecnt", ECNT, b'graphid-send') + send_and_expect_response(sock, "ecnt", b'1', b'6594') + + print() + logging.info("Testing vcnt") + send_and_expect_response(sock, "vcnt", VCNT, b'graphid-send') + send_and_expect_response(sock, "vcnt", b'1', b'4941') + + print() + logging.info("Testing trian") + send_and_expect_response(sock, "trian", TRIAN, b'grap', exitOnFail=True) + send_and_expect_response(sock, "trian", b'1', b'priority(>=1)', exitOnFail=True) + send_and_expect_response(sock, "trian", b'1', b'651') + + print() + logging.info("Testing rmgr") + send_and_expect_response(sock, 'rmgr', RMGR, SEND) + send_and_expect_response(sock, 'rmgr', b'1', DONE) + + print() + logging.info("Testing lst after rmgr") + send_and_expect_response(sock, 'lst after rmgr', LIST, EMPTY) + + print() + logging.info("Shutting down") + sock.sendall(SHDN + LINE_END) + + if passedAll: + print() + logging.info('Passed all tests') + else: + print() + logging.critical('Failed some tests') + print(*failedTests, sep='\n', file=sys.stderr) \ No newline at end of file From 8e1a0f535e8318fd0d9a2943fbaba053bd008a20 Mon Sep 17 00:00:00 2001 From: Kandeeban Date: Tue, 8 Aug 2023 11:50:08 +0530 Subject: [PATCH 30/45] Fix Issues in testing phase --- GraphSAGE/requirements | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/GraphSAGE/requirements b/GraphSAGE/requirements index 55793c4a2..9f286d51f 100644 --- a/GraphSAGE/requirements +++ b/GraphSAGE/requirements @@ -1,23 +1,23 @@ -absl-py-1.4.0 -astor-0.8.1 -backports.weakref-1.0.post1 -bleach-6.0.0 -decorator-5.1.1 -enum34-1.1.10 -funcsigs-1.0.2 -gast-0.4.0 -grpcio-1.56.0 -html5lib-1.1 -Markdown-3.4.3 -mock-5.1.0 -networkx-3.1 -numpy-1.24.3 -pbr-5.11.1 -protobuf-4.23.4 -scikit-learn-1.3.0 -scipy-1.11.1 -six-1.16.0 -tensorboard-2.13.0 -tensorflow-2.13.0 -termcolor-2.3.0 -Werkzeug-2.3.6 +absl-py==1.4.0 +astor==0.8.1 +backports.weakref==1.0.post1 +bleach==6.0.0 +decorator==5.1.1 +enum34==1.1.10 +funcsigs==1.0.2 +gast==0.4.0 +grpcio==1.56.0 +html5lib==1.1 +Markdown==3.4.3 +mock==5.1.0 +networkx==3.1 +numpy==1.24.3 +pbr==5.11.1 +protobuf==4.23.4 +scikit-learn==1.3.0 +scipy==1.11.1 +six==1.16.0 +tensorboard==2.13.0 +tensorflow==2.13.0 +termcolor==2.3.0 +Werkzeug==2.3.6 From 84fc70245e9bc2ddcce496672c0089180ecd1a07 Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Tue, 8 Aug 2023 12:01:21 +0530 Subject: [PATCH 31/45] Moved timeout value to TIMEOUT_SECONDS variable --- test-docker.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test-docker.sh b/test-docker.sh index 7f36a8b33..639a55e6e 100755 --- a/test-docker.sh +++ b/test-docker.sh @@ -1,10 +1,11 @@ #!/bin/bash PROJECT_ROOT="$(pwd)" -mkdir -p logs/ - +TIMEOUT_SECONDS=600 run_id="$(date +%y%m%d_%H%M%S)" +mkdir -p logs/ + stop_and_remove_containers () { docker ps -q | xargs docker kill &>/dev/null docker container prune -f &>/dev/null @@ -28,7 +29,7 @@ while ! nc -zvn 127.0.0.1 7777 &>/dev/null; do sleep .2 done -timeout 600 python3 -u tests/integration/test.py |& tee "logs/${run_id}_test.txt" +timeout "${TIMEOUT_SECONDS}" python3 -u tests/integration/test.py |& tee "logs/${run_id}_test.txt" exit_code="${PIPESTATUS[0]}" rm -rf tests/integration/env stop_and_remove_containers From c2f21513db22f3312cbf081b4f96b9c83a0b0dc5 Mon Sep 17 00:00:00 2001 From: Kandeeban Date: Tue, 8 Aug 2023 20:35:29 +0530 Subject: [PATCH 32/45] Merge latest updates in testing --- Dockerfile | 15 +++++++++++---- tests/integration/test.py | 32 +++++++++++++++++--------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1dfe2f94f..cb6cc8ae5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,11 +40,18 @@ ENV JASMINEGRAPH_HOME="/home/ubuntu/software/jasminegraph" RUN mkdir /home/ubuntu/software/jasminegraph WORKDIR /home/ubuntu/software/jasminegraph -COPY ./GraphSAGE/requirements ./GraphSAGE/requirements +COPY ./GraphSAGE ./GraphSAGE RUN pip install -r ./GraphSAGE/requirements -COPY . . -RUN mkdir /home/ubuntu/datasets + +COPY ./conf ./conf +COPY ./src ./src +COPY ./src_python ./src_python +COPY ./build.sh ./build.sh +COPY ./CMakeLists.txt ./CMakeLists.txt +COPY ./main.cpp ./main.cpp +COPY ./main.h ./main.h +COPY ./run-docker.sh ./run-docker.sh RUN sh build.sh ENTRYPOINT ["/home/ubuntu/software/jasminegraph/run-docker.sh"] -CMD ["bash"] \ No newline at end of file +CMD ["bash"] diff --git a/tests/integration/test.py b/tests/integration/test.py index 8fd77ea62..3131d2b4f 100644 --- a/tests/integration/test.py +++ b/tests/integration/test.py @@ -32,24 +32,26 @@ DONE=b'done' LINE_END=b'\r\n' -def recv_all(sock, n_bytes): +def expect_response(sock, expected): + global passedAll buffer = bytearray() read = 0 - while read < n_bytes: - received = sock.recv(n_bytes - read) + expected_len = len(expected) + while read < expected_len: + received = sock.recv(expected_len - read) + received_len = len(received) if received: - read += len(received) + if received != expected[read:read + received_len]: + buffer.extend(received) + data = bytes(buffer) + logging.warning(f'Output mismatch\nexpected : {expected}\nreceived : {data}') + passedAll = False + return False + read += received_len buffer.extend(received) - return bytes(buffer) - -def expect_response(sock, expected): - global passedAll - data = recv_all(sock, len(expected)) + data = bytes(buffer) print(data.decode('utf-8'), end='') - if data != expected: - logging.warning(f'Output mismatch\nexpected : {expected}\nreceived : {data}') - passedAll = False - return False + assert data == expected return True def send_and_expect_response(sock, testName, send, expected, exitOnFail=False): @@ -60,7 +62,7 @@ def send_and_expect_response(sock, testName, send, expected, exitOnFail=False): failedTests.append(testName) if exitOnFail: print() - logging.fatal('Failed some tests,', file=sys.stderr) + logging.fatal('Failed some tests,') print(*failedTests, sep='\n', file=sys.stderr) sys.exit(1) @@ -118,4 +120,4 @@ def send_and_expect_response(sock, testName, send, expected, exitOnFail=False): else: print() logging.critical('Failed some tests') - print(*failedTests, sep='\n', file=sys.stderr) \ No newline at end of file + print(*failedTests, sep='\n', file=sys.stderr) From 42f113ae01cfd68844039fb5428b2d1ce97a537d Mon Sep 17 00:00:00 2001 From: Kandeeban Date: Wed, 9 Aug 2023 22:13:01 +0530 Subject: [PATCH 33/45] Debugging Testing --- Dockerfile | 2 ++ test-docker.sh | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb6cc8ae5..46974a17b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,6 +42,8 @@ WORKDIR /home/ubuntu/software/jasminegraph COPY ./GraphSAGE ./GraphSAGE RUN pip install -r ./GraphSAGE/requirements +RUN pip install joblib +RUN pip install threadpoolctl COPY ./conf ./conf COPY ./src ./src diff --git a/test-docker.sh b/test-docker.sh index edd0c0597..d12065fc7 100755 --- a/test-docker.sh +++ b/test-docker.sh @@ -1,13 +1,17 @@ #!/bin/bash - +set -ex PROJECT_ROOT="$(pwd)" -mkdir -p logs/ - +TIMEOUT_SECONDS=600 run_id="$(date +%y%m%d_%H%M%S)" +mkdir -p logs/ + stop_and_remove_containers () { - docker ps -q | xargs docker kill &>/dev/null - docker container prune -f &>/dev/null + if [ "$(docker ps -q)" ]; then + docker ps -a -q | xargs docker rm -f &>/dev/null + else + echo "No containers to stop and remove." + fi } build_and_run_docker () { @@ -21,15 +25,15 @@ cd tests/integration rm -rf env cp -r env_init env cd "$PROJECT_ROOT" -build_and_run_docker &>/dev/null +build_and_run_docker #&>/dev/null # sleep until server starts listening while ! nc -zvn 127.0.0.1 7777 &>/dev/null; do sleep .2 done -timeout 1800 python3 -u tests/integration/test.py |& tee "logs/${run_id}_test.txt" +timeout "${TIMEOUT_SECONDS}" python3.11 -u tests/integration/test.py |& tee "logs/${run_id}_test.txt" exit_code="${PIPESTATUS[0]}" rm -rf tests/integration/env stop_and_remove_containers -exit "$exit_code" \ No newline at end of file +exit "$exit_code" From 50aa858dd3b544e5a284aa72045ae70760dc970d Mon Sep 17 00:00:00 2001 From: Kandeeban Date: Wed, 9 Aug 2023 22:34:16 +0530 Subject: [PATCH 34/45] Fix minor bug --- test-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-docker.sh b/test-docker.sh index a3cc2122d..c407184a0 100755 --- a/test-docker.sh +++ b/test-docker.sh @@ -32,7 +32,7 @@ while ! nc -zvn 127.0.0.1 7777 &>/dev/null; do sleep .2 done -timeout "${TIMEOUT_SECONDS}" python3.11 -u tests/integration/test.py |& tee "logs/${run_id}_test.txt" +timeout "${TIMEOUT_SECONDS}" python3 -u tests/integration/test.py |& tee "logs/${run_id}_test.txt" exit_code="${PIPESTATUS[0]}" rm -rf tests/integration/env stop_and_remove_containers From 890e668c7813038b9d5dfe9ec0553be47c7c2227 Mon Sep 17 00:00:00 2001 From: Kandeeban Date: Wed, 9 Aug 2023 22:54:47 +0530 Subject: [PATCH 35/45] Debug Workflow Failure --- test-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-docker.sh b/test-docker.sh index c407184a0..35ab71987 100755 --- a/test-docker.sh +++ b/test-docker.sh @@ -25,7 +25,7 @@ cd tests/integration rm -rf env cp -r env_init env cd "$PROJECT_ROOT" -build_and_run_docker &>/dev/null +build_and_run_docker #&>/dev/null # sleep until server starts listening while ! nc -zvn 127.0.0.1 7777 &>/dev/null; do From da58133663f2ea71e8bd466edc212d10fae830e9 Mon Sep 17 00:00:00 2001 From: Miyuru Dayarathna Date: Wed, 16 Aug 2023 22:52:40 +0530 Subject: [PATCH 36/45] Change to use base image with ubuntu 22 --- CMakeLists.txt | 5 +++-- Dockerfile | 40 +--------------------------------------- 2 files changed, 4 insertions(+), 41 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 65d3e2951..8ef32b009 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,9 +53,10 @@ target_link_libraries(JasmineGraph sqlite3) target_link_libraries(JasmineGraph pthread) target_link_libraries(JasmineGraph rdkafka) target_link_libraries(JasmineGraph Threads::Threads) +target_link_libraries(JasmineGraph fmt) target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libxerces-c.so) target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libflatbuffers.a) -target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libjsoncpp.a) +target_link_libraries(JasmineGraph /usr/lib/x86_64-linux-gnu/libjsoncpp.so) target_link_libraries(JasmineGraph /usr/local/lib/libcppkafka.so) set(PYTHON_EXECUTABLE "/usr/bin/python3.11") @@ -65,4 +66,4 @@ set(PYTHON_LIBRARIES "/usr/lib/x86_64-linux-gnu/libpython3.11.so") include_directories(${PYTHON_INCLUDE_DIRS}) include_directories(${PYTHON_DIRECTORIES}) target_link_libraries(JasmineGraph ${PYTHON_LIBRARIES}) -target_link_libraries(JasmineGraph m) +target_link_libraries(JasmineGraph m) \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index fa1599090..90c5a4d89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,40 +1,4 @@ -FROM ubuntu:focal -WORKDIR /home/ubuntu -RUN mkdir software -WORKDIR /home/ubuntu/software - -RUN apt-get update -RUN apt-get install --no-install-recommends -y apt-transport-https -RUN apt-get update -RUN apt-get install --no-install-recommends -y curl gnupg2 ca-certificates software-properties-common nlohmann-json3-dev - -RUN apt-get install --no-install-recommends -y git cmake build-essential sqlite3 libsqlite3-dev libssl-dev librdkafka-dev libboost-all-dev libtool libxerces-c-dev libflatbuffers-dev -RUN add-apt-repository ppa:deadsnakes/ppa -RUN apt-get install --no-install-recommends -y python3.11-dev -RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py -RUN apt-get install --no-install-recommends -y libjsoncpp-dev libspdlog-dev pigz -RUN python3.11 get-pip.py - -RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - -RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -RUN apt-get update -RUN apt-get install --no-install-recommends -y docker-ce-cli - -RUN git clone --single-branch --depth 1 https://github.com/mfontanini/cppkafka.git - -WORKDIR /home/ubuntu/software -RUN git clone --single-branch --depth 1 --branch v5.1.1-DistDGL-v0.5 https://github.com/KarypisLab/METIS.git -WORKDIR /home/ubuntu/software/METIS -RUN git submodule update --init -RUN make config shared=1 cc=gcc prefix=/usr/local -RUN make install - -RUN mkdir /home/ubuntu/software/cppkafka/build -WORKDIR /home/ubuntu/software/cppkafka/build -RUN cmake .. -RUN make -j4 -RUN make install - +FROM miyurud/jasminegraph ENV HOME="/home/ubuntu" ENV JASMINEGRAPH_HOME="/home/ubuntu/software/jasminegraph" @@ -43,8 +7,6 @@ WORKDIR /home/ubuntu/software/jasminegraph COPY ./GraphSAGE ./GraphSAGE RUN pip install -r ./GraphSAGE/requirements -RUN pip install joblib -RUN pip install threadpoolctl COPY ./conf ./conf COPY ./src ./src From 9ba7f50669b5f8efeb26a4eee7bf853c37ddcf3c Mon Sep 17 00:00:00 2001 From: Miyuru Dayarathna Date: Thu, 17 Aug 2023 22:25:19 +0530 Subject: [PATCH 37/45] Migrate to gcc 11 --- Dockerfile | 1 - GraphSAGE/requirements | 2 -- src/localstore/JasmineGraphLocalStore.h | 1 + src/metadb/SQLiteDBInterface.h | 1 + 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 90c5a4d89..9164abf05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,6 @@ FROM miyurud/jasminegraph ENV HOME="/home/ubuntu" ENV JASMINEGRAPH_HOME="/home/ubuntu/software/jasminegraph" -RUN mkdir /home/ubuntu/software/jasminegraph WORKDIR /home/ubuntu/software/jasminegraph COPY ./GraphSAGE ./GraphSAGE diff --git a/GraphSAGE/requirements b/GraphSAGE/requirements index 9f286d51f..3d164e28f 100644 --- a/GraphSAGE/requirements +++ b/GraphSAGE/requirements @@ -14,10 +14,8 @@ networkx==3.1 numpy==1.24.3 pbr==5.11.1 protobuf==4.23.4 -scikit-learn==1.3.0 scipy==1.11.1 six==1.16.0 tensorboard==2.13.0 -tensorflow==2.13.0 termcolor==2.3.0 Werkzeug==2.3.6 diff --git a/src/localstore/JasmineGraphLocalStore.h b/src/localstore/JasmineGraphLocalStore.h index 91514eb11..64d2bc722 100644 --- a/src/localstore/JasmineGraphLocalStore.h +++ b/src/localstore/JasmineGraphLocalStore.h @@ -16,6 +16,7 @@ limitations under the License. #include #include +#include using std::map; using std::unordered_set; diff --git a/src/metadb/SQLiteDBInterface.h b/src/metadb/SQLiteDBInterface.h index 755ccb824..857bff7dd 100644 --- a/src/metadb/SQLiteDBInterface.h +++ b/src/metadb/SQLiteDBInterface.h @@ -17,6 +17,7 @@ limitations under the License. #include "../util/sqlite3/sqlite3.h" #include #include +#include class SQLiteDBInterface { private: From 381bc3a8871530e3e18f66a0a84091e714d4cdde Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Fri, 18 Aug 2023 00:51:38 +0530 Subject: [PATCH 38/45] Show run log only if tests fail --- test-docker.sh | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/test-docker.sh b/test-docker.sh index 35ab71987..f8591aa35 100755 --- a/test-docker.sh +++ b/test-docker.sh @@ -2,7 +2,11 @@ set -ex PROJECT_ROOT="$(pwd)" TIMEOUT_SECONDS=600 -run_id="$(date +%y%m%d_%H%M%S)" +RUN_ID="$(date +%y%m%d_%H%M%S)" + +BUILD_LOG="logs/${RUN_ID}_build.txt" +RUN_LOG="logs/${RUN_ID}_run.txt" +TEST_LOG="logs/${RUN_ID}_test.txt" mkdir -p logs/ @@ -17,23 +21,53 @@ stop_and_remove_containers () { build_and_run_docker () { stop_and_remove_containers cd "$PROJECT_ROOT" - docker build -t jasminegraph:test . |& tee "logs/${run_id}_build.txt" - docker compose -f tests/integration/docker-compose.yml up |& tee "logs/${run_id}_run.txt" & + docker build -t jasminegraph:test . |& tee "$BUILD_LOG" + build_status="${PIPESTATUS[0]}" + if [ "$build_status" != '0' ]; then + set +e + echo + echo -e '\e[31;1mERROR: Build failed\e[0m' + rm -rf tests/integration/env + exit "$build_status" + fi + docker compose -f tests/integration/docker-compose.yml up |& tee "$RUN_LOG" &>/dev/null & } cd tests/integration rm -rf env cp -r env_init env cd "$PROJECT_ROOT" -build_and_run_docker #&>/dev/null +build_and_run_docker # sleep until server starts listening +cur_timestamp="$(date +%s)" +end_timestamp="$((cur_timestamp + TIMEOUT_SECONDS))" while ! nc -zvn 127.0.0.1 7777 &>/dev/null; do - sleep .2 + if [ "$(date +%s)" -gt "$end_timestamp" ]; then + set +e + echo "JasmineGraph is not listening" + echo "Build log:" + cat "$BUILD_LOG" + echo "Build log:" + cat "$RUN_LOG" + rm -rf tests/integration/env + stop_and_remove_containers + exit 1 + fi + sleep .5 done -timeout "${TIMEOUT_SECONDS}" python3 -u tests/integration/test.py |& tee "logs/${run_id}_test.txt" +timeout "$TIMEOUT_SECONDS" python3 -u tests/integration/test.py |& tee "$TEST_LOG" exit_code="${PIPESTATUS[0]}" +set +e +if [ "$exit_code" == '124' ]; then + echo + echo -e '\e[31;1mERROR: Test Timeout\e[0m' + echo +fi +if [ "$exit_code" != '0' ]; then + cat "$RUN_LOG" +fi rm -rf tests/integration/env stop_and_remove_containers exit "$exit_code" From e253f7daa46d98a7ddcd9c51007ec3abca16e389 Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Wed, 23 Aug 2023 22:47:56 +0530 Subject: [PATCH 39/45] Retry connect() with a delay if failed --- .gitignore | 2 +- Dockerfile | 8 ++-- run-docker.sh | 2 +- .../incremental/DataPublisher.cpp | 3 +- src/frontend/JasmineGraphFrontEnd.cpp | 4 +- .../executor/impl/TriangleCountExecutor.cpp | 12 ++--- .../trainer/JasminGraphTrainingInitiator.cpp | 2 +- src/performance/metrics/PerformanceUtil.cpp | 10 ++-- .../JasminGraphLinkPredictor.cpp | 2 +- src/server/JasmineGraphInstance.cpp | 4 +- src/server/JasmineGraphInstanceService.cpp | 14 +++--- src/server/JasmineGraphServer.cpp | 46 +++++++++---------- src/util/Utils.cpp | 11 +++++ src/util/Utils.h | 27 +++++------ 14 files changed, 80 insertions(+), 67 deletions(-) diff --git a/.gitignore b/.gitignore index 3a7fb3f62..809b30a07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -tests/env/ +tests/integration/env/ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 diff --git a/Dockerfile b/Dockerfile index 9164abf05..c2dd95011 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,13 +8,13 @@ COPY ./GraphSAGE ./GraphSAGE RUN pip install -r ./GraphSAGE/requirements COPY ./conf ./conf -COPY ./src ./src -COPY ./src_python ./src_python COPY ./build.sh ./build.sh +COPY ./run-docker.sh ./run-docker.sh COPY ./CMakeLists.txt ./CMakeLists.txt -COPY ./main.cpp ./main.cpp +COPY ./src_python ./src_python COPY ./main.h ./main.h -COPY ./run-docker.sh ./run-docker.sh +COPY ./main.cpp ./main.cpp +COPY ./src ./src RUN sh build.sh ENTRYPOINT ["/home/ubuntu/software/jasminegraph/run-docker.sh"] diff --git a/run-docker.sh b/run-docker.sh index 4e4cf178f..a2fb5baf4 100755 --- a/run-docker.sh +++ b/run-docker.sh @@ -69,7 +69,7 @@ else fi fi -export LD_LIBRARY_PATH=/home/ubuntu/software/METIS/build/libmetis +export LD_LIBRARY_PATH=/usr/local/lib if [ $MODE -eq 1 ] ; then ./JasmineGraph "docker" $MODE $MASTERIP $WORKERS $WORKERIP $ENABLE_NMON diff --git a/src/centralstore/incremental/DataPublisher.cpp b/src/centralstore/incremental/DataPublisher.cpp index acd93f729..246c34d7a 100644 --- a/src/centralstore/incremental/DataPublisher.cpp +++ b/src/centralstore/incremental/DataPublisher.cpp @@ -15,6 +15,7 @@ #include "../../server/JasmineGraphInstanceProtocol.h" #include "../../util/logger/Logger.h" +#include "../../util/Utils.h" Logger data_publisher_logger; @@ -36,7 +37,7 @@ DataPublisher::DataPublisher(int worker_port, std::string worker_address) { if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { data_publisher_logger.error("Socket creation error!"); } - if (connect(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) { data_publisher_logger.error("Connection Failed!"); } } diff --git a/src/frontend/JasmineGraphFrontEnd.cpp b/src/frontend/JasmineGraphFrontEnd.cpp index 67ee9a583..5230134a2 100755 --- a/src/frontend/JasmineGraphFrontEnd.cpp +++ b/src/frontend/JasmineGraphFrontEnd.cpp @@ -2016,7 +2016,7 @@ void JasmineGraphServer::pageRank(std::string graphID, double alpha, int iterati (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cout << "ERROR connecting" << std::endl; //TODO::exit } @@ -2206,7 +2206,7 @@ void JasmineGraphServer::egoNet(std::string graphID) { (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cout << "ERROR connecting" << std::endl; //TODO::exit } diff --git a/src/frontend/core/executor/impl/TriangleCountExecutor.cpp b/src/frontend/core/executor/impl/TriangleCountExecutor.cpp index 89a1253f4..832c21d87 100644 --- a/src/frontend/core/executor/impl/TriangleCountExecutor.cpp +++ b/src/frontend/core/executor/impl/TriangleCountExecutor.cpp @@ -329,7 +329,7 @@ long TriangleCountExecutor::getTriangleCount(int graphId, std::string host, int (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; } @@ -821,7 +821,7 @@ string TriangleCountExecutor::isFileAccessibleToWorker(std::string graphId, std: (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(atoi(aggregatorPort.c_str())); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } @@ -970,7 +970,7 @@ std::string TriangleCountExecutor::copyCompositeCentralStoreToAggregator(std::st (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(atoi(aggregatorPort.c_str())); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } @@ -1151,7 +1151,7 @@ TriangleCountExecutor::countCompositeCentralStoreTriangles(std::string aggregato (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(atoi(aggregatorPort.c_str())); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } @@ -1363,7 +1363,7 @@ std::string TriangleCountExecutor::copyCentralStoreToAggregator(std::string aggr (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(atoi(aggregatorPort.c_str())); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } @@ -1548,7 +1548,7 @@ string TriangleCountExecutor::countCentralStoreTriangles(std::string aggregatorH (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(atoi(aggregatorPort.c_str())); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } diff --git a/src/ml/trainer/JasminGraphTrainingInitiator.cpp b/src/ml/trainer/JasminGraphTrainingInitiator.cpp index 4baa0e249..baaca54ff 100644 --- a/src/ml/trainer/JasminGraphTrainingInitiator.cpp +++ b/src/ml/trainer/JasminGraphTrainingInitiator.cpp @@ -114,7 +114,7 @@ bool JasminGraphTrainingInitiator::initiateTrain(std::string host, int port, int (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } diff --git a/src/performance/metrics/PerformanceUtil.cpp b/src/performance/metrics/PerformanceUtil.cpp index c17de4bb0..db9c6350f 100644 --- a/src/performance/metrics/PerformanceUtil.cpp +++ b/src/performance/metrics/PerformanceUtil.cpp @@ -226,7 +226,7 @@ void PerformanceUtil::collectRemotePerformanceData(std::string host, int port, s (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; } @@ -382,7 +382,7 @@ int PerformanceUtil::collectRemoteSLAResourceUtilization(std::string host, int p (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; } @@ -542,7 +542,7 @@ ResourceConsumption PerformanceUtil::retrieveRemoteResourceConsumption(std::stri (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; } @@ -1061,7 +1061,7 @@ void PerformanceUtil::initiateCollectingRemoteSLAResourceUtilization(std::string (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; } @@ -1137,7 +1137,7 @@ std::string PerformanceUtil::requestRemoteLoadAverages(std::string host, int por (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; } diff --git a/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp b/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp index 5f8b025e7..1efd50398 100644 --- a/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp +++ b/src/query/algorithms/linkprediction/JasminGraphLinkPredictor.cpp @@ -116,7 +116,7 @@ int JasminGraphLinkPredictor::sendQueryToWorker(std::string host, int port, int (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } diff --git a/src/server/JasmineGraphInstance.cpp b/src/server/JasmineGraphInstance.cpp index 9bb291f0c..49e91cfbe 100644 --- a/src/server/JasmineGraphInstance.cpp +++ b/src/server/JasmineGraphInstance.cpp @@ -94,7 +94,7 @@ bool JasmineGraphInstance::acknowledgeMaster(string masterHost, string workerIP, (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(Conts::JASMINEGRAPH_BACKEND_PORT); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; } @@ -232,7 +232,7 @@ bool JasmineGraphInstance::sendFileThroughService(std::string host, int dataPort (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(dataPort); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting to port " << dataPort << std::endl; return false; } diff --git a/src/server/JasmineGraphInstanceService.cpp b/src/server/JasmineGraphInstanceService.cpp index d565e0a43..9708ce8e4 100644 --- a/src/server/JasmineGraphInstanceService.cpp +++ b/src/server/JasmineGraphInstanceService.cpp @@ -927,7 +927,7 @@ void *instanceservicesession(void *dummyPt) { (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cout << "ERROR connecting" << std::endl; //TODO::exit } @@ -2926,7 +2926,7 @@ int JasmineGraphInstanceService::collectTrainedModelThreadFunction(instanceservi serv_addr.sin_family = AF_INET; bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; // TODO::exit } @@ -3296,7 +3296,7 @@ bool JasmineGraphInstanceService::duplicateCentralStore(int thisWorkerPort, int (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { instance_logger.log("ERROR connecting", "error"); //TODO::exit } @@ -3488,7 +3488,7 @@ bool JasmineGraphInstanceService::sendFileThroughService(std::string host, int d (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(dataPort); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting to port " << dataPort << std::endl; } @@ -3601,7 +3601,7 @@ map calculateOutDegreeDist(string graphID, string partitionID, int s (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cout << "ERROR connecting" << std::endl; //TODO::exit } @@ -3816,7 +3816,7 @@ map calculateInDegreeDist(string graphID, string partitionID, int se (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cout << "ERROR connecting" << std::endl; //TODO::exit } @@ -4057,7 +4057,7 @@ void calculateEgoNet(string graphID, string partitionID, (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cout << "ERROR connecting" << std::endl; //TODO::exit } diff --git a/src/server/JasmineGraphServer.cpp b/src/server/JasmineGraphServer.cpp index f0d019528..311cf5181 100644 --- a/src/server/JasmineGraphServer.cpp +++ b/src/server/JasmineGraphServer.cpp @@ -521,7 +521,7 @@ void JasmineGraphServer::resolveOperationalGraphs(){ (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(workerPort); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } @@ -703,7 +703,7 @@ void JasmineGraphServer::shutdown_workers() { (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } @@ -863,7 +863,7 @@ bool JasmineGraphServer::batchUploadFile(std::string host, int port, int dataPor (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } @@ -1058,7 +1058,7 @@ bool JasmineGraphServer::batchUploadCentralStore(std::string host, int port, int (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; } @@ -1296,7 +1296,7 @@ bool JasmineGraphServer::batchUploadAttributeFile(std::string host, int port, in (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; } @@ -1494,7 +1494,7 @@ bool JasmineGraphServer::batchUploadCentralAttributeFile(std::string host, int p (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; } @@ -1692,7 +1692,7 @@ bool JasmineGraphServer::batchUploadCompositeCentralstoreFile(std::string host, (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; } @@ -1885,7 +1885,7 @@ bool JasmineGraphServer::sendFileThroughService(std::string host, int dataPort, (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(dataPort); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting to port " << dataPort << std::endl; } @@ -2207,7 +2207,7 @@ int JasmineGraphServer::removeFragmentThroughService(string host, int port, stri (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } @@ -2315,7 +2315,7 @@ int JasmineGraphServer::removePartitionThroughService(string host, int port, str (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cerr << "ERROR connecting" << std::endl; //TODO::exit } @@ -2685,7 +2685,7 @@ void JasmineGraphServer::inDegreeDistribution(std::string graphID) { (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cout << "ERROR connecting" << std::endl; //TODO::exit } @@ -2798,7 +2798,7 @@ void JasmineGraphServer::outDegreeDistribution(std::string graphID) { (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cout << "ERROR connecting" << std::endl; //TODO::exit } @@ -2928,7 +2928,7 @@ void JasmineGraphServer::duplicateCentralStore(std::string graphID) { (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { std::cout << "ERROR connecting" << std::endl; //TODO::exit } @@ -3239,7 +3239,7 @@ bool JasmineGraphServer::initiateTrain(std::string host, int port, int dataPort, Utils utils; bool result = true; int sockfd; - char data[FED_DATA_LENGTH]; + char data[FED_DATA_LENGTH + 1]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -3267,7 +3267,7 @@ bool JasmineGraphServer::initiateTrain(std::string host, int port, int dataPort, (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { server_logger.log("ERROR connecting", "error"); //TODO::exit } @@ -3351,7 +3351,7 @@ bool JasmineGraphServer::initiateServer(std::string host, int port, int dataPort (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { server_logger.log("ERROR connecting", "error"); //TODO::exit } @@ -3426,7 +3426,7 @@ bool JasmineGraphServer::initiateClient(std::string host, int port, int dataPort (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { server_logger.log("ERROR connecting", "error"); //TODO::exit } @@ -3501,7 +3501,7 @@ bool JasmineGraphServer::initiateAggregator(std::string host, int port, int data (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { server_logger.log("ERROR connecting", "error"); //TODO::exit } @@ -3577,7 +3577,7 @@ bool JasmineGraphServer::initiateOrgServer(std::string host, int port, int dataP (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { server_logger.log("Error connecting", "error"); //TODO::exit } @@ -3659,7 +3659,7 @@ bool JasmineGraphServer::receiveGlobalWeights(std::string host, int port, std::s while (true){ - if (!(connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0)) { + if (!(Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0)) { break; } } @@ -3730,7 +3730,7 @@ bool JasmineGraphServer::mergeFiles(std::string host, int port, int dataPort,std Utils utils; bool result = true; int sockfd; - char data[FED_DATA_LENGTH]; + char data[FED_DATA_LENGTH + 1]; bool loop = false; socklen_t len; struct sockaddr_in serv_addr; @@ -3758,7 +3758,7 @@ bool JasmineGraphServer::mergeFiles(std::string host, int port, int dataPort,std (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { server_logger.log("ERROR connecting", "error"); //TODO::exit } @@ -3842,7 +3842,7 @@ bool JasmineGraphServer::sendTrainCommand(std::string host, int port, std::strin (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); - if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { + if (Utils::connect_wrapper(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { server_logger.log("ERROR connecting", "error"); //TODO::exit } diff --git a/src/util/Utils.cpp b/src/util/Utils.cpp index 1b0277c01..55f0a5c98 100644 --- a/src/util/Utils.cpp +++ b/src/util/Utils.cpp @@ -594,3 +594,14 @@ std::string Utils::checkFlag(std::string flagPath){ infile.close(); return bitVal; } + +int Utils::connect_wrapper(int sock, const sockaddr *addr, socklen_t slen) { + int retry = 0; + do { + if (retry) sleep(retry * 2); + if (connect(sock, addr, slen) == 0) { + return 0; + } + } while (retry++ < 4); + return -1; +} diff --git a/src/util/Utils.h b/src/util/Utils.h index 1334962c0..8de6432a9 100644 --- a/src/util/Utils.h +++ b/src/util/Utils.h @@ -13,22 +13,23 @@ limitations under the License. #ifndef JASMINEGRAPH_UTILS_H #define JASMINEGRAPH_UTILS_H -#include -#include -#include #include +#include +#include +#include //#include "../frontend/JasmineGraphFrontEnd.h" -#include "../performancedb/PerformanceSQLiteDBInterface.h" -#include "../metadb/SQLiteDBInterface.h" +#include +#include #include + +#include "../metadb/SQLiteDBInterface.h" +#include "../performancedb/PerformanceSQLiteDBInterface.h" #include "Conts.h" -#include using std::map; -class Utils -{ - public: +class Utils { + public: struct worker { std::string workerID; std::string hostname; @@ -49,8 +50,7 @@ class Utils static std::vector split(const std::string &, char delimiter); - std::string trim_copy(const std::string &, - const std::string &); + std::string trim_copy(const std::string &, const std::string &); bool parseBoolean(const std::string str); @@ -92,7 +92,7 @@ class Utils static void assignPartitionsToWorkers(int numberOfWorkers, SQLiteDBInterface sqlite); static void updateSLAInformation(PerformanceSQLiteDBInterface perfSqlite, std::string graphId, int partitionCount, - long newSlaValue, std::string command, std::string category); + long newSlaValue, std::string command, std::string category); void editFlagZero(std::string flagPath); @@ -100,6 +100,7 @@ class Utils std::string checkFlag(std::string flagPath); + static int connect_wrapper(int sock, const sockaddr *addr, socklen_t slen); }; -#endif //JASMINEGRAPH_UTILS_H +#endif // JASMINEGRAPH_UTILS_H From d87f199ad052824479e05a8ed75752d122159d43 Mon Sep 17 00:00:00 2001 From: Miyuru Dayarathna Date: Wed, 23 Aug 2023 23:16:57 +0530 Subject: [PATCH 40/45] Update readme --- README.md | 77 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index 9d9c01f85..5d13ecf7e 100755 --- a/README.md +++ b/README.md @@ -7,81 +7,8 @@ ## 1. Introduction JasmineGraph is a C/C++ based distributed graph database server. It has been developed following the [Acacia](https://github.com/miyurud/Acacia) graph database server architecture. JasmineGraph can be run on single computer as well as on a compute cluster. -## 2. Building JasmineGraph on Single Computer -**Prerequisites** -The following build tools, applications, and libraries need to be installed before building JasmineGraph. The CMakeLists.txt file's entries need to be updated to match with the installation locations of the dependencies. For examole, if you install SpdLog in a directory called "software" in your Linux system you may have to add a line as "include_directories("$ENV{HOME}/software/spdlog/include")" to get the SpdLog's header files associated with you build process. - -- GCC 9.1.0 (recommended) or above -- Cmake version 3.10.3 or above -- Google Flat Buffers (https://github.com/google/flatbuffers) - - Clone the flatbuffers repository to $ENV{HOME}/software - - Checkout Tag [v1.12.0](https://github.com/google/flatbuffers/archive/v1.12.0.zip) - - Follow https://google.github.io/flatbuffers/flatbuffers_guide_building.html link to build flatbuffers -- Metis - - First, clone the GKlib package from the following URL and build it and install it following the [guidelines](https://github.com/KarypisLab/GKlib#readme). [GKlib](https://github.com/KarypisLab/GKlib.git). - - Download Metis version 5.1.1 sources from this [URL](https://github.com/KarypisLab/METIS/archive/refs/tags/v5.1.1-DistDGL-v0.5.zip). - - Build and install the Metis following the [guidelines](https://github.com/KarypisLab/METIS#building-and-installing-metis). - - Path for `metis.h` header could be set by updating the environment variables as follows, - `export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/home/username/local/include` -- SpdLog (https://github.com/gabime/spdlog) - - Clone or download the repository from the above link - - Issue "cmake ." - - Issue "make" followed by "sudo make install" -- SQLite3 (https://www.sqlite.org/download.html) - - Download the `sqlite-autoconf-3390200` from this [URL](https://www.sqlite.org/2022/sqlite-autoconf-3390200.tar.gz). - - Extract `sqlite-autoconf-3390200.tar.gz` to some location. E.g., `/media/user/software/sqlite-autoconf-3390200-install` - - Change to that location and run `./configure --prefix=/media/user/software/sqlite-autoconf-3390200` - - Issue "make" followed by "sudo make install" - - Once installed specify the `target_link_libraries` path to `libsqlite3`. - E.g., `target_link_libraries(JasmineGraph /media/user/software/sqlite-autoconf-3390200/lib/libsqlite3.so)` -- cppkafka (https://github.com/mfontanini/cppkafka) - - Install librdkafka - Follow the Readme in (https://github.com/edenhill/librdkafka) - use `sudo apt install librdkafka-dev` - - Install boost library - use `sudo apt-get install libboost-all-dev` - - Follow the guidelines in (https://github.com/mfontanini/cppkafka#compiling) - use cppkafka release [v0.3.1](https://github.com/mfontanini/cppkafka/archive/refs/tags/v0.3.1.zip) - - When doing the above step for `cmake ..` use of `cmake ..` should be sufficient enough - - Once cppkafka is built install it by running `sudo make install` from the build directory -- Xerces-c-3.2.2 (https://xerces.apache.org/xerces-c/) - - Intallation guide is available at http://xerces.apache.org/xerces-c/build-3.html - - [Download](https://xerces.apache.org/xerces-c/download.cgi) the [archive](https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-3.2.3.zip) from the xerces.apache.org website - - Unzip the archive xerces-c-3.2.3.zip to a location like `/media/user/software/xerces-c-3.2.3-install` - - When configuring Xerces skip the use of transcoder ICU by using the flag `--disable-transcoder-icu` - - E.g., `./configure --prefix=/media/user/software/xerces-c-3.2.3 --disable-transcoder-icu` - - - Run `cmake .` & `sudo make install` - - Once installed specify the `target_link_libraries` path to xerces. -- Jsoncpp(https://github.com/open-source-parsers/jsoncpp) - - Install the release https://github.com/open-source-parsers/jsoncpp/releases/tag/1.8.4 - - Issue "cmake ." - - Issue "make" followed by "sudo make install" -- pigz (optional) - - pigz, which stands for Parallel Implementation of GZip, is a fully functional - replacement for gzip that exploits multiple processors and multiple cores to - the hilt when compressing data. - - JasmineGraph by default uses pigz for file compression and decompression. - - However, if pigz is not found, gzip is used instead. - - Download pigz from (http://zlib.net/pigz/) or (https://github.com/madler/pigz.git). - - Type "make" in pigz directory to build the "pigz" executable. - - Add pigz executable's path to ~/.bashrc file and refresh. -- nlohmann_json (https://github.com/nlohmann/json) - - Download the nolhmann latest release sources i:e [v3.9.1.zip](https://github.com/nlohmann/json/archive/refs/tags/v3.9.1.zip) - - Create a directory in your software directory named `nlohmann_json` - - Extract the `include.zip` to `nlohmann_json` directory - - Issue "cmake ." - - Issue "make" followed by "sudo make install" -- python3.11 (https://www.python.org/downloads/release/python-3110/) - - Read this [blog](https://computingforgeeks.com/how-to-install-python-on-ubuntu-linux/) for more details on setting up python3.11 -- Recent versions of TensorFlow, numpy, scipy, sklearn, and networkx are required (but networkx must be <=1.11). You can install all the required packages using the following command: - - pip install -r ./GraphSAGE/requirements - -First, this repository should be cloned into one of your computer's local directory. Then change directory to jasminegraph and run ./build.sh to build the JasmineGraph executable. - -## 3. Running JasmineGraph -JasmineGraph can be run by executing the run.sh script. This will start master on your local computer while workers are created in the list of the hosts mentioned in the conf/hosts.txt file. - -## 4. Building and Running JasmineGraph on Docker +## 2. Building and Running JasmineGraph on Docker JasmineGraph can be run inside a docker image. After cloning the project, build the image as follows: docker build -t jasminegraph . @@ -92,7 +19,7 @@ Run the image by providing the appropriate volume mount paths and parameters: docker run -v "/var/run/docker.sock:/var/run/docker.sock:rw" -v "/root/.ssh:/home/user/.ssh" -v "/tmp:/tmp" -v "/var/tmp/jasminegraph-localstore:/var/tmp/jasminegraph-localstore" -v "/var/tmp/jasminegraph-aggregate:/var/tmp/jasminegraph-aggregate" -v "/home/user/Documents/jasminegraph/metadb:/home/ubuntu/software/jasminegraph/metadb" -v "/home/user/Documents/MSc/jasminegraph/performancedb:/home/ubuntu/software/jasminegraph/performancedb" -p 7777:7777 -p 7778:7778 jasminegraph --MODE 1 --MASTERIP --WORKERS 4 --WORKERIP --ENABLE_NMON false -## 5. Contact Information +## 3. Contact Information Please contact [Miyuru Dayarathna](miyurud at yahoo dot co dot uk) for further information. Please let us know about bug reports or any further improvements you wish to have in JasmineGraph. From e02803b2a8ca056c742ac1b4e9bb980055198107 Mon Sep 17 00:00:00 2001 From: Miyuru Dayarathna Date: Fri, 25 Aug 2023 23:18:01 +0530 Subject: [PATCH 41/45] Fix startup sql error --- src/server/JasmineGraphServer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/JasmineGraphServer.cpp b/src/server/JasmineGraphServer.cpp index 311cf5181..ffed6248c 100644 --- a/src/server/JasmineGraphServer.cpp +++ b/src/server/JasmineGraphServer.cpp @@ -2631,6 +2631,11 @@ void JasmineGraphServer::addInstanceDetailsToPerformanceDB(std::string host, std } hostString = hostString.substr(0, hostString.length() - 1); + + if (hostString.length() == 0) { + return; + } + insertPlaceQuery = insertPlaceQuery + hostString; this->performanceSqlite.runInsert(insertPlaceQuery); From 409ede87829539382c5b23cb575e5345ccc02aff Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Mon, 28 Aug 2023 19:45:35 +0530 Subject: [PATCH 42/45] Prevent mounting /var/tmp to workers when running tests --- src/server/JasmineGraphServer.cpp | 85 ++++++++++++++++++++----------- 1 file changed, 55 insertions(+), 30 deletions(-) diff --git a/src/server/JasmineGraphServer.cpp b/src/server/JasmineGraphServer.cpp index ffed6248c..15cf64c43 100644 --- a/src/server/JasmineGraphServer.cpp +++ b/src/server/JasmineGraphServer.cpp @@ -326,40 +326,65 @@ void JasmineGraphServer::startRemoteWorkers(std::vector workerPortsVector, popen(serverStartScript.c_str(),"r"); } } else if (profile == "docker") { - std::string image_tag; char *env_testing = getenv("TESTING"); - if (env_testing == NULL || strcasecmp(env_testing, "true") != 0) { - image_tag = "latest"; - } else { - image_tag = "test"; - } + bool is_testing = (env_testing != NULL && strcasecmp(env_testing, "true") == 0); for (int i =0 ; i < workerPortsVector.size() ; i++) { if (masterHost == host || host == "localhost") { - serverStartScript = "docker run -v " + instanceDataFolder + ":" + instanceDataFolder + - " -v " + aggregateDataFolder + ":" + aggregateDataFolder + - " -v " + nmonFileLocation + ":" + nmonFileLocation + - " -v " + graphsagelocation + ":" + graphsagelocation + - " -v " + instanceDataFolder + "/" + to_string(i) + "/logs" + ":" + "/home/ubuntu/software/jasminegraph/logs" + " -p " + - std::to_string(workerPortsVector.at(i)) + ":" + - std::to_string(workerPortsVector.at(i)) + " -p " + - std::to_string(workerDataPortsVector.at(i)) + ":" + - std::to_string(workerDataPortsVector.at(i)) + " jasminegraph:" + image_tag + " --MODE 2 --HOST_NAME " + host + - " --MASTERIP " + masterHost + " --SERVER_PORT " + - std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + - std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; + if (is_testing) { + serverStartScript = "docker run -p " + + std::to_string(workerPortsVector.at(i)) + ":" + + std::to_string(workerPortsVector.at(i)) + " -p " + + std::to_string(workerDataPortsVector.at(i)) + ":" + + std::to_string(workerDataPortsVector.at(i)) + + " -e WORKER_ID=" + to_string(i) + + " jasminegraph:test --MODE 2 --HOST_NAME " + host + + " --MASTERIP " + masterHost + " --SERVER_PORT " + + std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + + std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; + } else { + serverStartScript = "docker run -v " + instanceDataFolder + ":" + instanceDataFolder + + " -v " + aggregateDataFolder + ":" + aggregateDataFolder + + " -v " + nmonFileLocation + ":" + nmonFileLocation + + " -v " + graphsagelocation + ":" + graphsagelocation + + " -v " + instanceDataFolder + "/" + to_string(i) + "/logs" + ":" + "/home/ubuntu/software/jasminegraph/logs" + " -p " + + std::to_string(workerPortsVector.at(i)) + ":" + + std::to_string(workerPortsVector.at(i)) + " -p " + + std::to_string(workerDataPortsVector.at(i)) + ":" + + std::to_string(workerDataPortsVector.at(i)) + + " -e WORKER_ID=" + to_string(i) + + " jasminegraph:latest --MODE 2 --HOST_NAME " + host + + " --MASTERIP " + masterHost + " --SERVER_PORT " + + std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + + std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; + } } else { - serverStartScript = "docker -H ssh://" + host + " run -v " + instanceDataFolder + ":" + instanceDataFolder + - " -v " + aggregateDataFolder + ":" + aggregateDataFolder + - " -v " + nmonFileLocation + ":" + nmonFileLocation + - " -v " + graphsagelocation + ":" + graphsagelocation + - " -v " + instanceDataFolder + "/" + to_string(i) + "/logs" + ":" + "/home/ubuntu/software/jasminegraph/logs" + " -p " + - std::to_string(workerPortsVector.at(i)) + ":" + - std::to_string(workerPortsVector.at(i)) + " -p " + - std::to_string(workerDataPortsVector.at(i)) + ":" + - std::to_string(workerDataPortsVector.at(i)) + " jasminegraph:" + image_tag + " --MODE 2 --HOST_NAME " + host + - " --MASTERIP " + masterHost + " --SERVER_PORT " + - std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + - std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; + if (is_testing) { + serverStartScript = "docker -H ssh://" + host + " run -p " + + std::to_string(workerPortsVector.at(i)) + ":" + + std::to_string(workerPortsVector.at(i)) + " -p " + + std::to_string(workerDataPortsVector.at(i)) + ":" + + std::to_string(workerDataPortsVector.at(i)) + + " -e WORKER_ID=" + to_string(i) + + " jasminegraph:test --MODE 2 --HOST_NAME " + host + + " --MASTERIP " + masterHost + " --SERVER_PORT " + + std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + + std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; + } else { + serverStartScript = "docker -H ssh://" + host + " run -v " + instanceDataFolder + ":" + instanceDataFolder + + " -v " + aggregateDataFolder + ":" + aggregateDataFolder + + " -v " + nmonFileLocation + ":" + nmonFileLocation + + " -v " + graphsagelocation + ":" + graphsagelocation + + " -v " + instanceDataFolder + "/" + to_string(i) + "/logs" + ":" + "/home/ubuntu/software/jasminegraph/logs" + " -p " + + std::to_string(workerPortsVector.at(i)) + ":" + + std::to_string(workerPortsVector.at(i)) + " -p " + + std::to_string(workerDataPortsVector.at(i)) + ":" + + std::to_string(workerDataPortsVector.at(i)) + + " -e WORKER_ID=" + to_string(i) + + " jasminegraph:latest --MODE 2 --HOST_NAME " + host + + " --MASTERIP " + masterHost + " --SERVER_PORT " + + std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + + std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; + } } server_logger.log(serverStartScript, "info"); popen(serverStartScript.c_str(),"r"); From a869a858df55818494f8b126561635feeb54824d Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Mon, 28 Aug 2023 19:46:42 +0530 Subject: [PATCH 43/45] Show worker_id/master and thread_id in log entries --- src/util/logger/Logger.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/util/logger/Logger.cpp b/src/util/logger/Logger.cpp index ffed4dddc..149c3ffac 100644 --- a/src/util/logger/Logger.cpp +++ b/src/util/logger/Logger.cpp @@ -13,14 +13,33 @@ limitations under the License. #include "Logger.h" +#include #include #include #include +#include + +#include + +using namespace std; + +static string get_worker_name(); auto logger = spdlog::stdout_color_mt("logger"); auto daily_logger = spdlog::daily_logger_mt("JasmineGraph", "logs/server_logs.log", 00, 01); +string worker_name = get_worker_name(); + +static string get_worker_name() { + char *worker_id = getenv("WORKER_ID"); + if (worker_id) { + return string("WORKER ") + string(worker_id); + } + return string("MASTER"); +} void Logger::log(std::string message, const std::string log_type) { + pthread_t tid = pthread_self(); + message = "[" + worker_name + " : " + to_string(tid) + "] " + message; if (log_type.compare("info") == 0) { daily_logger->info(message); logger->info(message); From 314105b9b8d3ea91e083d170d3829aa3da8239dc Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Mon, 28 Aug 2023 20:56:30 +0530 Subject: [PATCH 44/45] Improved efficiency of Utils::getJasmineGraphProperty() using an unordered_map to cache property values --- src/util/Utils.cpp | 32 +++++++++++++++++++------------- src/util/Utils.h | 8 +++++++- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/util/Utils.cpp b/src/util/Utils.cpp index 55f0a5c98..0a4b89a0b 100644 --- a/src/util/Utils.cpp +++ b/src/util/Utils.cpp @@ -24,6 +24,8 @@ limitations under the License. using namespace std; Logger util_logger; +unordered_map Utils::propertiesMap; + map Utils::getBatchUploadFileList(std::string file) { std::vector batchUploadFileContent = getFileContent(file); std::vector::iterator iterator1 = batchUploadFileContent.begin(); @@ -81,24 +83,28 @@ std::vector Utils::getFileContent(std::string file) { }; std::string Utils::getJasmineGraphProperty(std::string key) { - std::vector::iterator it; - vector vec = getFileContent("conf/jasminegraph-server.properties"); - it = vec.begin(); - - for (it = vec.begin(); it < vec.end(); it++) { - std::string item = *it; - if (item.length() > 0 && !(item.rfind("#", 0) == 0)) { - std::vector vec2 = split(item, '='); - if (vec2.at(0).compare(key) == 0) { - if (item.substr(item.length() - 1, item.length()).compare("=") != 0) { - return vec2.at(1); + if (Utils::propertiesMap.empty()) { + std::vector::iterator it; + vector vec = getFileContent("conf/jasminegraph-server.properties"); + it = vec.begin(); + + for (it = vec.begin(); it < vec.end(); it++) { + std::string item = *it; + if (item.length() > 0 && !(item.rfind("#", 0) == 0)) { + std::vector vec2 = split(item, '='); + if (vec2.size() == 2){ + Utils::propertiesMap[vec2.at(0)] = vec2.at(1); } else { - return " "; + Utils::propertiesMap[vec2.at(0)] = string(" "); } } } } - + unordered_map::iterator it = Utils::propertiesMap.find(key); + if(it != Utils::propertiesMap.end()) + { + return it->second; + } return NULL; } diff --git a/src/util/Utils.h b/src/util/Utils.h index 8de6432a9..475fb0c40 100644 --- a/src/util/Utils.h +++ b/src/util/Utils.h @@ -16,10 +16,12 @@ limitations under the License. #include #include #include +#include #include //#include "../frontend/JasmineGraphFrontEnd.h" -#include #include +#include + #include #include "../metadb/SQLiteDBInterface.h" @@ -27,8 +29,12 @@ limitations under the License. #include "Conts.h" using std::map; +using std::unordered_map; class Utils { + private: + static unordered_map propertiesMap; + public: struct worker { std::string workerID; From cc4ce91970596f9351543aed696dd006d1760461 Mon Sep 17 00:00:00 2001 From: thevindu-w Date: Thu, 31 Aug 2023 19:09:51 +0530 Subject: [PATCH 45/45] Save worker logs --- Dockerfile | 3 +- src/server/JasmineGraphServer.cpp | 6 ++-- test-docker.sh | 53 +++++++++++++++++++++------- tests/integration/docker-compose.yml | 1 + tests/integration/test.py | 1 + 5 files changed, 48 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index c2dd95011..7c7aca6a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,6 @@ WORKDIR /home/ubuntu/software/jasminegraph COPY ./GraphSAGE ./GraphSAGE RUN pip install -r ./GraphSAGE/requirements -COPY ./conf ./conf COPY ./build.sh ./build.sh COPY ./run-docker.sh ./run-docker.sh COPY ./CMakeLists.txt ./CMakeLists.txt @@ -17,5 +16,7 @@ COPY ./main.cpp ./main.cpp COPY ./src ./src RUN sh build.sh +COPY ./conf ./conf + ENTRYPOINT ["/home/ubuntu/software/jasminegraph/run-docker.sh"] CMD ["bash"] diff --git a/src/server/JasmineGraphServer.cpp b/src/server/JasmineGraphServer.cpp index 15cf64c43..3e64cc0c3 100644 --- a/src/server/JasmineGraphServer.cpp +++ b/src/server/JasmineGraphServer.cpp @@ -340,7 +340,8 @@ void JasmineGraphServer::startRemoteWorkers(std::vector workerPortsVector, " jasminegraph:test --MODE 2 --HOST_NAME " + host + " --MASTERIP " + masterHost + " --SERVER_PORT " + std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + - std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; + std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon + + " >/tmp/worker_logs/worker_" + to_string(i) + ".log 2>&1"; } else { serverStartScript = "docker run -v " + instanceDataFolder + ":" + instanceDataFolder + " -v " + aggregateDataFolder + ":" + aggregateDataFolder + @@ -368,7 +369,8 @@ void JasmineGraphServer::startRemoteWorkers(std::vector workerPortsVector, " jasminegraph:test --MODE 2 --HOST_NAME " + host + " --MASTERIP " + masterHost + " --SERVER_PORT " + std::to_string(workerPortsVector.at(i)) + " --SERVER_DATA_PORT " + - std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon; + std::to_string(workerDataPortsVector.at(i)) + " --ENABLE_NMON " + enableNmon + + " >/tmp/worker_logs/worker_" + to_string(i) + ".log 2>&1"; } else { serverStartScript = "docker -H ssh://" + host + " run -v " + instanceDataFolder + ":" + instanceDataFolder + " -v " + aggregateDataFolder + ":" + aggregateDataFolder + diff --git a/test-docker.sh b/test-docker.sh index f8591aa35..35f7ad120 100755 --- a/test-docker.sh +++ b/test-docker.sh @@ -1,14 +1,24 @@ #!/bin/bash set -ex PROJECT_ROOT="$(pwd)" +TEST_ROOT="${PROJECT_ROOT}/tests/integration" TIMEOUT_SECONDS=600 RUN_ID="$(date +%y%m%d_%H%M%S)" +LOG_DIR="${PROJECT_ROOT}/logs/${RUN_ID}" +while [ -d "$LOG_DIR"]; do + tmp_id="$((${tmp_id}+1))" + new_run="${RUN_ID}_${tmp_id}" + LOG_DIR="${PROJECT_ROOT}/logs/${RUN_ID}" +done +RUN_ID='' + +mkdir -p "${PROJECT_ROOT}/logs" +mkdir "$LOG_DIR" -BUILD_LOG="logs/${RUN_ID}_build.txt" -RUN_LOG="logs/${RUN_ID}_run.txt" -TEST_LOG="logs/${RUN_ID}_test.txt" +BUILD_LOG="${LOG_DIR}/build.log" +RUN_LOG="${LOG_DIR}/run_master.log" +TEST_LOG="${LOG_DIR}/test.log" -mkdir -p logs/ stop_and_remove_containers () { if [ "$(docker ps -q)" ]; then @@ -24,18 +34,19 @@ build_and_run_docker () { docker build -t jasminegraph:test . |& tee "$BUILD_LOG" build_status="${PIPESTATUS[0]}" if [ "$build_status" != '0' ]; then - set +e + set +ex echo echo -e '\e[31;1mERROR: Build failed\e[0m' - rm -rf tests/integration/env + rm -rf "${TEST_ROOT}/env" exit "$build_status" fi - docker compose -f tests/integration/docker-compose.yml up |& tee "$RUN_LOG" &>/dev/null & + docker compose -f "${TEST_ROOT}/docker-compose.yml" up |& tee "$RUN_LOG" &>/dev/null & } -cd tests/integration +cd "$TEST_ROOT" rm -rf env cp -r env_init env +mkdir -p env/logs cd "$PROJECT_ROOT" build_and_run_docker @@ -44,30 +55,46 @@ cur_timestamp="$(date +%s)" end_timestamp="$((cur_timestamp + TIMEOUT_SECONDS))" while ! nc -zvn 127.0.0.1 7777 &>/dev/null; do if [ "$(date +%s)" -gt "$end_timestamp" ]; then - set +e + set +ex echo "JasmineGraph is not listening" echo "Build log:" cat "$BUILD_LOG" echo "Build log:" cat "$RUN_LOG" - rm -rf tests/integration/env + rm -rf "${TEST_ROOT}/env" stop_and_remove_containers exit 1 fi sleep .5 done -timeout "$TIMEOUT_SECONDS" python3 -u tests/integration/test.py |& tee "$TEST_LOG" +timeout "$TIMEOUT_SECONDS" python3 -u "${TEST_ROOT}/test.py" |& tee "$TEST_LOG" exit_code="${PIPESTATUS[0]}" -set +e +set +ex if [ "$exit_code" == '124' ]; then echo echo -e '\e[31;1mERROR: Test Timeout\e[0m' echo fi + +cd "$TEST_ROOT" +for f in env/logs/*; do + fname="$(basename ${f})" + cp "$f" "${LOG_DIR}/run_${fname}" +done +cd "$LOG_DIR" if [ "$exit_code" != '0' ]; then + echo + echo -e '\e[33;1mMaster log:\e[0m' cat "$RUN_LOG" + + for f in run_worker_*; do + echo + echo -e '\e[33;1m'"${f:4:-4}"' log:\e[0m' + cat "$f" + done fi -rm -rf tests/integration/env + +rm -rf "${TEST_ROOT}/env" stop_and_remove_containers exit "$exit_code" diff --git a/tests/integration/docker-compose.yml b/tests/integration/docker-compose.yml index c16e27626..5f132eb42 100644 --- a/tests/integration/docker-compose.yml +++ b/tests/integration/docker-compose.yml @@ -10,6 +10,7 @@ services: - './env/databases/metadb:/home/ubuntu/software/jasminegraph/metadb' - './env/databases/performancedb:/home/ubuntu/software/jasminegraph/performancedb' - './env/data:/var/tmp/data' + - './env/logs:/tmp/worker_logs' environment: - TESTING=true networks: diff --git a/tests/integration/test.py b/tests/integration/test.py index 3131d2b4f..ed337d905 100644 --- a/tests/integration/test.py +++ b/tests/integration/test.py @@ -121,3 +121,4 @@ def send_and_expect_response(sock, testName, send, expected, exitOnFail=False): print() logging.critical('Failed some tests') print(*failedTests, sep='\n', file=sys.stderr) + sys.exit(1)