Giter Site home page Giter Site logo

wendysuly / cmarmotta Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wastl/cmarmotta

0.0 1.0 0.0 471 KB

High Performance Marmotta Backend implementation in C++ (using gRPC and LevelDB)

License: Apache License 2.0

CMake 1.17% C++ 93.24% Java 4.76% Protocol Buffer 0.80% C 0.03%

cmarmotta's Introduction

Apache Marmotta LevelDB/C++ Backend

This repository implements an experimental high-performance backend for Apache Marmotta using LevelDB as storage and gRPC as communication channel between the Java frontend and the C++ backend.

If it proves to be useful, the repository will eventually be merged into the main development branch of Apache Marmotta

Dependencies (C++)

To compile the C++ backend, you need to have the following dependencies installed:

  • libraptor (used for parsing/serializing in C++)
  • librasqal (used for server-side SPARQL evaluation)
  • libglog (logging)
  • libgflags (command line arguments)
  • libleveldb (database backend)
  • libgrpc (gRPC runtime)
  • libprotobuf (messaging, data model)

With the exception of libgrpc and libprotobuf, all libraries are available in Linux repositories. Debian:

apt-get install libraptor2-dev librasqal3-dev libgoogle-glog-dev libgflags-dev libleveldb-dev

The backend uses the new Proto 3 format and the gRPC SDK. These need to be installed separately, please follow the instructions at https://github.com/grpc/grpc.

Compilation (C++)

The backend uses cmake to compile the modules. Create a new directory build, run cmake, and run make:

mkdir build && cd build
cmake ..
make

Compilation (Java)

The frontend is compiled with Maven and depends on many Apache Marmotta modules to work. Build it with

cd java
mvn clean install

Running C++ Backend

Start the backend from the cmake build directory as follows:

./service/marmotta_persistence -db /path/to/database -port 10000

The binary accepts many different options. Please see --help for details.

Running Sharding

The repository contains an experimental implementation of a sharding server that proxies and distributes requests based on a hash calculation over statements. In heavy load environments, this is potentially much faster than running a single persistence backend. The setup requires several persistence backends (shards) and a sharding proxy. To experiment, you can start these on the same machine as follows:

./service/marmotta_persistence -db /path/to/shard1 -port 10001
./service/marmotta_persistence -db /path/to/shard2 -port 10002
./sharding/marmotta_sharding --port 10000 --backends localhost:10001,localhost:10002

You can then access the sharding server through Marmotta like the persistence server. Running all instances on the same host is only useful for testing. In production environments, you would of course run all three (or more) instances on different hosts. Note that the number and order of backends should not change once data has been imported, because otherwise the hashing algorithm will do the wrong thing.

Running Apache Marmotta

A preconfigured version of Apache Marmotta is available in java/webapp. It connects to localhost:10000 by default and can be started with:

mvn tomcat7:run

Afterwards, point your browser to localhost:8080.

Command Line Client

A C++ command line client is available for very fast bulk imports and simple queries. To import a large turtle file, run:

./client/marmotta_client --format=turtle import file.ttl

The client connects by default to localhost:10000 (change with --host and --port flags).

cmarmotta's People

Contributors

wastl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.