Sie sind auf Seite 1von 14

ZooKeeper Eclipse Plug-in (pre-release)

Author: Mark Masse

Author Contact Info


mark.s.masse@gmail.com
http://www.linkedin.com/in/markmasse

Overview
The ZooKeeper Eclipse Plug-in is intended to be a full-featured browser and editor for ZooKeeper.

History
I began development of the ZooKeeper Eclipse Plug-in in late December 2009. I am still new at working with ZooKeeper and
this is also my first attempt at creating an Eclipse Plug-in. This is a “side-project” that I have worked on in my spare time.
Thus far I have been the sole developer (and graphic designer) for this plug-in.

Dependencies
The ZooKeeper Plug-in depends on:

• The ZooKeeper Java API version 3.2.2. Specifically on the libraries: zookeeper-3.2.2.jar and log4j-1.2.15.jar. These
are the only Java dependencies introduced so far.
• The Eclipse Platform version 3.5.0.

Release Plans
I intend to have an open source release of this plug-in. Beyond that, I haven’t thought much about the how and where. I am
new to both the ZooKeeper and the Eclipse Plug-in communities so I would appreciate some guidance. Ultimately I imagine
that there will be an Eclipse Update Site and that users will download and update the plug-in that way.

Features
The ZooKeeper Eclipse Plug-in has many features, some of which are completed and others which are still on the “TODO” list.
The following is a summary of many of the key, already completed features.

ZooKeeper Connections
• Creation of new ZooKeeper connections via a Wizard. Wizard supports naming the connection, specifying the session
timeout, an optional Znode root path (ZooKeeper’s “chroot” feature), and a list of servers.
• Management of multiple ZooKeeper connections with the connection details stored in the Plug-in user’s local
directory.
• Each ZooKeeper connection is displayed as root tree nodes in the Plug-in’s ZooKeeper Explorer view.
• Optional support for a JMX connection for each server specified in the ZooKeeper connection ensemble.

ZooKeeper Explorer View


• The main singleton view for the Plug-in.
• Tree view displaying the ZooKeeper connections as root nodes with sub-nodes for the Servers and the root znode
(“/”).
• Lazy loading of data via SWT’s “virtual” tree widget allowing the plug-in to efficiently manage the amount of data
requested from the ZooKeeper connection and loaded into the UI. Specifically, znodes (stat, data, and child paths)
are loaded on demand when the tree is expanded.
Editors
• In Eclipse, the primary data viewers are called “Editors”. The ZooKeeper Plug-in currently provides editors for the
following data types:
o Znode. A multi-page editor with pages to display/edit a znode’s: data, children, ACL, and stat. Znode data
may be exported and edited in external files. Znode data can be imported (replaced) from the contents of a
file.
o Various JMX data viewers that currently offer jconsole-like views of the ZooKeeper JMX API.
o Znode “Table Editor” that allows for multiple znodes to be edited in a spreadsheet-like way.

Model/View Design
• Data is loaded and managed via a model/view framework that enables the updating of views whenever the data
model is changed. As an example of this, changes to znodes are reflected immediately via ZooKeeper’s Watcher
capability being extended into the Plug-in’s model view framework. The bottom line is that user’s rarely if ever need
to manually “click the Refresh button” to see the latest version of ZooKeeper (and JMX) data.

Screens
The screens below should provide an overall sense of the ZooKeeper Plug-in’s current capabilities.
Creating a new ZooKeeper Connection via the Wizard…

Adding a server to the ZooKeeper Connection…


ZooKeeper Explorer view…
ZooKeeper Explorer view (on the left). Viewing or editing znode data as a file (on the right)…

Note that the znode data may also be edited as text by selecting that Edit Mode’s radio button.
ZooKeeper Explorer view’s context menu for a selected (parent) znode…
The second tab (Children) selected inside the znode editor…
The third tab (ACL) selected inside the znode editor…
The fourth tab (Stat) selected inside the znode editor…
Creating a new znode via the wizard…
Setting the initial ACL via the second page of the “New Znode Wizard”…
Editing multiple znodes in the table editor...

Note that the second column (“Data”) provides an in-line text editor for the selected row. Also has full keyboard traversal to
enable speedy editing.
One of the JMX views (MBean)…

Future Plans
I have a pretty large TODO list that I am working from, but generally…

• Feature-wise, I need to create a few more editors.


• I also want to clean up the comments and add decent javadoc.
• Add logging to the Eclipse Error Log view.
• Write unit tests... I regret not starting off with a more test-driven approach.
• Separate the code a bit so that the JMX portion can be turned into a stand-alone JMX plug-in or an extension for
other plug-ins.
• Create a build script.
• Release it.

Das könnte Ihnen auch gefallen