Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added data structure discussion

...

/**
* Adds a new node to the elastic config store.
 */
CompletableFuture<Boolean> addNode(ConfigStoreType store, ConfigNodePath path, ConfigNode node);
 /**
* Removes a node from the elastic config store.
*/
CompletableFuture<ConfigNode> removeNode(ConfigStoreType store, ConfigNodePath path);
/**
* Creates/Updates a node in the elastic config store.
*/
CompletableFuture<ConfigNode> updateNode(ConfigStoreType store, ConfigNodePath path, ConfigNode node);
/**
* Creates nodes in the elastic config store, recursively by creating
* all missing intermediate nodes in the path.
*/
CompletableFuture<Boolean> createRecursive(ConfigStoreType store,ConfigNodePath path, ConfigNode node);
/**
* Delete nodes in the elastic config store, recursively by deleting all
* intermediate nodes in the path.
*/
CompletableFuture<Boolean> deleteRecursive(ConfigStoreType store, ConfigNodePath path);
/**
* Creates/Updates nodes in the elastic config store, recursively by creating
* all missing intermediate nodes in the path.
*/
CompletableFuture<Boolean> updateRecursive(ConfigStoreType store, ConfigNodePath path, ConfigNode node);
/**
* Returns a value node or subtree under the given path.
*/
CompletableFuture<ConfigNode> getNode(ConfigStoreType store, ConfigNodePath path, TraversalMode mode, ConfigFilter filter);
/**
* Returns the number of children under the given path, excluding
* the node at the path.
*/
CompletableFuture<Integer> getNumberOfChildren(ConfigStoreType store, ConfigNodePath path, ConfigFilter filter);
/**
* Registers a listener to be notified when the subtree rooted at
* the specified path is modified.
*/
CompletableFuture<Void> addConfigListener(ConfigStoreType store, ConfigNodePath path, ElasticConfigListener listener);
/**
* Unregisters a previously added listener.
*/
CompletableFuture<Void> removeConfigListener(ElasticConfigListener listener);

Use Case

In its current state, the following use case is planned to be supported

 

Data Structure

This subsystem makes use of the DocumentTree primitive.  The primitive consists of an implementation of AsyncDocumentTree (AtomixDocumentTree) residing on the client machine which submits commands to the remote Copycat state machine (AtomixDocumentTreeState), responsible for maintaining distributed state.  The commands submitted to the primitive are found in AtomixDocumentTreeCommands, it should be noted that there will not necessarily be a one to one correspondence between the commands provided in the AsyncDocumentTree API and the command classes, in many cases a single command class can encapsulate the functionality of several API methods.

Behavior

The DocumentTree primitive supports a tree structure which allows nodes with arbitrary numbers of children.  The primitive also provides efficient prefix filtering which enables listening for notifications from specified subtrees.  Despite the possibility of nodes with extremely large numbers of children sorting the sets of children stored by each node in the tree structure would enable quick O(log n) retrieval (enabled by the use of binary search within the child set).  The structure supports sequential query consistency, slightly relaxing the consistency in order to provide greater availability.

Next Steps