Git Product home page Git Product logo

zookeeper's Introduction

Recent Projects

I'm currently learning Rust in my spare time by writing a terminal-based text editor, ped. This led to the development of a simple command-line utility, keyb, to echo bytes generated by keystrokes.

During the COVID lockdown, I decided to learn a bit more about electronics. This eventually led to building an Arduino-based GPS-synchronized clock (hardware and software) of which four generations have since been released. In what was perhaps a serendipitous encounter, an electrical engineer hailing from Moldova found this project and made an online connection. Our ongoing collaboration has led to a number of improvements in both hardware and software.

I'm also very lazily working on updates to a ZooKeeper CLI to incorpoate recent enhancements to the latest ZooKeeper server. The CLI project was started years ago to achieve two objectives: first, to implement a nontrivial purely functional Scala program; second, to radically improve upon the undeniably horrendous user experience of an application, zkCli.sh, that shipped with ZooKeeper. Seriously, this is a much better CLI. And, it looks as though the maintainers of ZooKeeper have taken a hint and incorporated some of these features. If anyone is interested in taking over this project, please reach out to me.

I also enjoy learning new programming languages when I have time to invest. In doing so, I typically port my RPN compiler and interpreter that was originally written in Scala. The most recent languages were Kotlin and Clojure with ports of the original project here and here, respectively. The next language on deck is Rust.

zookeeper's People

Contributors

ajrnz avatar davidledwards avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zookeeper's Issues

Upgrade to Java 11

Move from Java 8 to Java 11.

This may also entail packaging of OpenJDK libraries as part of the CLI distribution, though need to verify that license terms are not violated.

superfluous output in command mode

When I use zk in command mode (with -c), to get the content of a node
and pipe it through another command (such as jq), I have to filter out the
"connecting to..." message.

Maybe that message should be suppressed when -c is used.

Display command-level usage information from command line

Usage information for specific commands, such as ls or rm, can only be seen from the zk> command line, which implies that the user must connect to a valid ZooKeeper server. This presents an obvious problem when users simply want to see syntax. I should probably write a man page as well, but undecided right now.

Support regexes when removing znodes

I have a use case where I'd like to be able to remove nodes in a path that match a specific regex. Essentially I'd to do something like the following:

zk> rm -r -f fakeTest*

And have it remove all of the nodes in the current path that matched the path regex.

Send log messages generated by ZK to external file

Log messages are currently being suppressed since ZK pollutes the console, which doesn't provide a good experience for the user. Rather than continue suppressing, the idea is to quietly send messages to /tmp in a session-specific file. If the user wants to see them, then the config command will be enhanced to show the path of the log file. Also, we probably want to give users the ability to specify the path on the command line.

Quote escaping

Hi. Love the CLI. But I can't seem to come up with a way to have double quotes in a value when
setting with (e.g.):

 zk -c 'set -f /params "params:\"value: {key: 10}\""' localhost

...except for putting the value into a file and using @file. Maybe if I could say @stdin and pipe my value into it, that would do.

Implement Zookeeper Persitent/Persistent-Recursive watches

Hi,

I would be interested in being able to use Persistent-Recursive watch within your library.
This feature (introduced in Zookeeper 3.6) allows to set watches that does not expires upon 1 event, and (in the case of Persistent-recursive) allows to receive details of a change within a znode's tree, see: https://zookeeper.apache.org/doc/r3.8.4/zookeeperProgrammers.html#sc_WatchPersistentRecursive

Since the zookeeper java API allows to set this watch with the addWatch function, I think it should be pretty straightforward to implement it within your SynchronousWatchableZK/AsynchronousWatchableZK classes.

I can submit a PR if you are interested.

setacl does not work

zk> setacl -s -f /yarn/rmstore/ZKRMStateRoot *
: invalid ACL syntax
zk> setacl -s -f /yarn/rmstore/ZKRMStateRoot world:

world:*: invalid ACL syntax
zk> setacl -s -f /yarn/rmstore/ZKRMStateRoot world:rwcda
world:rwcda: invalid ACL syntax

or any variation thereof

Recursive parameter value is inverted on observe function

Hi,

When executing the following code:

Try(zk.sync.create("/sample", Array[Byte](), ACL.AnyoneAll, Persistent))
zk.sync.watch {
  case e => log.debug(e.toString)
} observe ("/sample", true)
Try(zk.sync.create("/sample/sample1", Array[Byte](), ACL.AnyoneAll, Persistent))

I notice i've got a ChildrenChanged Event, which should not happend in PersistentRecursive mode (All Children event are treated as NodeEvent => https://zookeeper.apache.org/doc/r3.7.2/apidocs/zookeeper-server/org/apache/zookeeper/AddWatchMode.html#PERSISTENT_RECURSIVE).

Looking at the code from the observe function, I noticed that if the recursive parameter is set to true, the mode that is selected is PERSISTENT, and not PERSISTENT_RECURSIVE, where it should be the other way around, since the parameter name for the boolean is recursive.

def observe(path: String, recursive: Boolean = false): Unit = {
  val mode = if (recursive) AddWatchMode.PERSISTENT else AddWatchMode.PERSISTENT_RECURSIVE
  zk.addWatch(path, watcher, mode)
}

Specifying path with '/' incorrectly parses

When downloading and using the latest zookeeper-cli, when I try to specify a default path that contains multiple segments it fails stating that the path cannot end with the "/" character even though it does not.

$ ./zk node.example.com -p /kafka/wolfe
internal error: Path must not end with / character
>> stack trace
java.lang.IllegalArgumentException: Path must not end with / character
    at org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:58)
    at org.apache.zookeeper.client.ConnectStringParser.<init>(ConnectStringParser.java:57)
    at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:443)
    at com.loopfor.zookeeper.Zookeeper$.apply(Zookeeper.scala:737)
    at com.loopfor.zookeeper.Zookeeper$.apply(Zookeeper.scala:713)
    at com.loopfor.zookeeper.cli.CLI$.run(CLI.scala:103)
    at com.loopfor.zookeeper.cli.CLI$.main(CLI.scala:33)
    at com.loopfor.zookeeper.cli.CLI.main(CLI.scala)

rm -r -f reports "node has children"

I have a parent node which has 3 children nodes - each has some data in it. I expected rm -r -f can remove the parent node along with all its children, however it didn't. It just reported "node has children" like below.

zk> ls /healthCompact/mao-zk-1
depman
gyoji
health
zk> rm -r -f /healthCompact/mao-zk-1
/healthCompact/mao-zk-1: node has children

Is the expectation wrong?

Develop higher order patterns library

The idea is to develop a functional library layered over zookeeper-client that implements a variety of common patterns with ZooKeeper, such as leader election, locks, and so on. The ZooKeeper project site has a decent collection of those patterns (recipes) described here, though there are no specific plans to implement all of them. I will likely experiment with leader election first since this seems to be a very common pattern.

Extra trailing '/'s cause a "JLine support is disabled" error

When tab completing to browse through a hierarchy in zookeeper, I found that having an additional trailing slash after a path causes the client to start behaving weirdly.

E.g. In the following output, the TAB key is hit once after each "/" is appended to the string to be autocompleted:
ganderson@ganderson:~$ zookeeper-client
Connecting to localhost:2181
log4j:WARN No appenders could be found for logger (org.apache.zookeeper.ZooKeeper).
log4j:WARN Please initialize the log4j system properly.
Welcome to ZooKeeper!
JLine support is enabled

WATCHER::

WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] ls /

hbase zookeeper
[zk: localhost:2181(CONNECTED) 0] ls /hbase/

splitlog unassigned table94 rs backup-masters draining table
[zk: localhost:2181(CONNECTED) 0] ls /hbase//JLine support is disabled

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.