Code Monkey home page Code Monkey logo

oak-crdt's Introduction

Conflict handling with Oak Demo

This is the demo code for the presentation Conflict handling with Oak.

Build with Maven 3 and Java 7 (or higher):

mvn clean install

The test cases give a good indication on how the individual conflict handlers are intended to work.

Alternatively there is an interactive Scala shell, which can be used for experimenting with a transient repository including all conflict handlers from this project (Atomic counter, Last writer wins, multi value register and atomic set). To start the shell type:

java -jar target/oak-crdt-*-jar-with-dependencies.jar

The shell is based on the Ammonite REPL and has all Oak dependencies embedded. Some useful predefined bindings can be imported from michid.crdt.Demo:

@ import michid.crdt.Demo._
import michid.crdt.Demo._

The predefined repository instance is then available:

@ repository.getDescriptorKeys
res0: Array[String] = Array(
  "jcr.repository.name",
  "option.versioning.supported",
  ...

The newSession binding provides a convenient shortcut for opening new sessions on that repository:

@ val s = newSession
s: javax.jcr.Session = session-8
@ val r = s.getRootNode
r: javax.jcr.Node = Node[NodeDelegate{tree=/: { jcr:primaryType = rep:root, mv = { ... }, set = { ... }, oak:index = { ... }, jcr:system = { ... }, count = { ... }, ...}}]

See the demo scripts in src/main/resources for further examples.

Links

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.