Giter Club home page Giter Club logo

linkedin-zookeeper's Introduction

Introduction

The project represents a set of utility classes and wrappers around ZooKeeper.

Download

You can download pre-built binaries directly from the github downloads page

  • org.linkedin.zookeeper-server-<version>.tgz: A simple to use prepackaged zookeeper distribution:

      ./bin/zkServer.sh start
    
  • org.linkedin.zookeeper-cli-<version>.tgz: A command line (similar to the one bundled with ZooKeeper) with the idea of having a syntax very close to a 'regular' shell:

        zk.sh ls /a/b/c
        zk.sh du /a/b/d
        zk.sh put localFile.txt /a/b/c
        zk.sh cat /a/b/c
        etc...
    

Compilation

In order to compile the code you need

At the top simply run

gradle test

which should compile and run all the tests.

IDE Support

You can issue the command (at the top)

gradle idea

which will use the gradle IDEA plugin to create the right set of modules in order to open the project in IntelliJ IDEA.

Directory structure

  • org.linkedin.zookeeper-impl: Contains a set of utility classes and wrappers to make it easier to use ZooKeeper:

    • IZooKeeper is an interface/abstraction to ZooKeeper (which is (unfortunately) a class)
    • IZKClient (which extends from IZooKeeper) adds a host of convenient calls and lifecycle listeners
    • ZooKeeperURLHandler is a URL handler which knows how to handle zookeeper:/a/b/c type urls
    • ZooKeeperTreeTracker (the core of this project) essentially keeps an in memory replica of a portion of a tree or entire subtree with easy to use listeners (NodeEventsListener and ErrorListener): you get notified when nodes are added, updated or deleted (you never deal with ZooKeeper watchers, nor have to set them over and over!). You can see a good example of how to use this class in the glu project org.linkedin.glu.agent.tracker.AgentsTrackerImpl
    • StandaloneZooKeeperServer: a simple class to start a standalone ZooKeeper server (simple to use in testing)

Javadoc: org.linkedin.zookeeper-impl

  • org.linkedin.zookeeper-cli-impl: A command line (similar to the one bundled with ZooKeeper) with the idea of having a syntax very close to a 'regular' shell:

      zk.sh ls /a/b/c
      zk.sh du /a/b/d
      zk.sh put localFile.txt /a/b/c
      zk.sh cat /a/b/c
      etc...
    
  • org.linkedin.zookeeper-cli: Create the packaged version of the cli.

  • org.linkedin.zookeeper-server: Simply create a packaged server which is easy to install and start. Useful in dev.

  1. Installing/Running locally

To install the zookeeper server:

cd org.linkedin.zookeeper-server
gradle package-install

then go to the install directory and run

./bin/zkServer start

To install the zookeeper cli:

cd org.linkedin.zookeeper-cli
gradle package-install

then go to the install directory and run (to see help)

./bin/zk.sh -h

and then try

./bin/zk.sh ls /

which returns

zookeeper

Note: it should work on any Linux/Unix based system (developped/tested on Mac OS X)

Build configuration

The project uses the org.linkedin.userConfig plugin and as such can be configured

Example:
~/.userConfig.properties
top.build.dir="/Volumes/Disk2/deployment/${userConfig.project.name}"
top.install.dir="/export/content/${userConfig.project.name}"
top.release.dir="/export/content/repositories/release"
top.publish.dir="/export/content/repositories/publish"

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.