Giter Club home page Giter Club logo

robindb's Introduction

RobinDB

SSTable implement in Java

usage

mvn clean package -DskipTests=true 

After build success , then distribution package will be generated.

To start the startup script under RobinDB-{version}/startup directory

basic command

Open browser , visit ip:8888, post a request to put a key value

curl -H "Content-Type:application/json" -X POST -d '{"key":"Hello","val":"RobinDB"}' 'http://ip:8888/put'

Then get the result , using a get request

curl 'http://ip:8888/get/{key}'

To remove a key , using delete request

curl -X DELETE 'http://ip:8888/delete/{key}'

Using only SSTable embeded in pure java code

Include maven dependency

<dependency>
    <groupId>com.ido.robin</groupId>
    <artifactId>core</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

Then create a SSTable instance to manage content

SSTable ssTable = new SSTable();
ssTable.put("test","client");
ssTable.flush();
System.out.println(ssTable.get("test"));
ssTable.close();
1. support expire data
    SSTable ssTable = new SSTable();
    long expireTime = 10;
    ssTable.put("test","client",expireTime);
    System.out.println(ssTable.get("test"));
    ssTable.close();
2. SSTablePlus support storing object data convenient
    SSTblePlus ssTable = new SSTblePlus();
    Person p = new Person();
    ssTable.putObject("key",p);
    Person result = ssTable.getObject("key");

Support Add and Remove server node dynamically

To add a new node to serve
curl -H "Content-Type:application/json" -X POST -d '{"host":"new-host","port":"server-port","httpPort":"the-server-port""}' 'http://ip:8888/node/add'

after the command return success response , then a new server is added to serve.

To remove a existed node

And send blow command to remove a serving node

curl -H "Content-Type:application/json" -X DELETE -d '{"host":"new-host","port":"server-port"}' 'http://ip:8888/node/delete'

robindb's People

Contributors

albert-hugo avatar idofree avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

robindb's Issues

add node info to "/state " response

in the /state response, it would be nice to add some node info so that the UI can aggregate the result to make a new UI componet showing total meta data info of a node.

update the method 'handleHttpRequest' of CoordinatorHandler

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.