RegisterSign In

API Documentation: Abstract Class MckoiDDBClient

Package: com.mckoi.network

The client object for interacting with a Mckoi distributed network. This interface encapsulates the primary functions needed for transactional operations with a MckoiDDB network.

It is intended for implementations of this object to be long lived and maintain various static information about network interactions, such as node caches.

Use com.mckoi.network.MckoiDDBClientUtils to create instances of this object.

Methods Summary

long getMaximumTransactionNodeCacheHeapSize()
void setMaximumTransactionNodeCacheHeapSize(long size_in_bytes)
NetworkProfile getNetworkProfile(String su_password)
TreeReportNode createDiagnosticGraph(KeyObjectTransaction t) throws IOException
void createReachabilityList(PrintWriter warning_log, DataAddress root_node, OrderedList64Bit discovered_node_list)
DataAddress createEmptyDatabase()
String[] queryAllNetworkPaths()
String getConsensusFunction(String path_name)
DataAddress getCurrentSnapshot(String path_name)
KeyObjectTransaction createTransaction(DataAddress root_node)
KeyObjectTransaction createEmptyTransaction()
DataAddress flushTransaction(KeyObjectTransaction transaction)
DataAddress performCommit(String path_name, DataAddress proposal) throws CommitFaultException
void disposeTransaction(KeyObjectTransaction transaction)
DataAddress[] getHistoricalSnapshots(String path_name, long time_start, long time_end)
void finalize() throws Throwable

Method Details

long getMaximumTransactionNodeCacheHeapSize()

Returns the maximum amount of heap memory in the local JVM allowed to be used to cache transaction node data writes before a commit. If this heap space is exhausted during a transaction interaction in which a lot of data is being written, node data will be flushed from the cache to the network to make additional room.

void setMaximumTransactionNodeCacheHeapSize(long size_in_bytes)

Sets the maximum amount of heap memory in the local JVM allowed to be used to cache transaction node data writes before a commit. If this heap space is exhausted during a transaction interaction in which a lot of data is being written, node data will be flushed from the cache to the network to make additional room.

NetworkProfile getNetworkProfile(String su_password)

Returns a NetworkProfile object that allows low level inspection and modification of the MckoiDDB network. Note that the network configuration will still need to be set in the returned object before it can be used.

Note: This object is intended to be used by administrators. Do not use it unless you know what you are doing.

TreeReportNode createDiagnosticGraph(KeyObjectTransaction t)

Returns a TreeReportNode object used for diagnostic/reporting the meta-data of a transaction tree..

void createReachabilityList(PrintWriter warning_log, DataAddress root_node, OrderedList64Bit discovered_node_list)

Traverses the nodes in a tree recursively adding any nodes that aren't in the given list into the list (in sorted order). This is used for reachability determination for garbage collection.

DataAddress createEmptyDatabase()

Persists an empty database into the network and returns a DataAddress object that references the root address of the empty database.

String[] queryAllNetworkPaths()

Queries the manager server and returns the list of path instances currently available on active root servers. This method will actively query the network so the result should be cached by the user if frequent use of this information is needed.

String getConsensusFunction(String path_name)

Returns the name of the consensus function for the given database path.

DataAddress getCurrentSnapshot(String path_name)

Returns the root node of the most current published version of the named path instance in the network. If the path instance is not found on the network, an exception is generated.

KeyObjectTransaction createTransaction(DataAddress root_node)

Given a DataAddress of a root node in the network, creates and returns a new transaction object that can be used to access and modify the data stored there.

KeyObjectTransaction createEmptyTransaction()

Creates a new transaction object that contains an empty database, useful for managing temporary structures that are never flushed.

DataAddress flushTransaction(KeyObjectTransaction transaction)

Flushes modifications made to a transaction out to the network storage machines and returns a DataAddress of the root node of the flushed data.

The object referenced by the DataAddress is immutible in the sense that once a DataAddress has been created for a transation it may be passed around to other clients freely and they may modify the changes but their modifications will not be visible to anyone else.

DataAddress performCommit(String path_name, DataAddress proposal)

Performs a commit operation of the given path instance with the given proposal. The proposal is represented as a DataAddress which should be the result of a flushed transaction. The proposal is formatted in such a way that the consensus processor assigned for the path on the root server will understand how to interpret it.

Throws CommitFaultException if the consensus processor rejected the proposal.

void disposeTransaction(KeyObjectTransaction transaction)

Disposes the KeyObjectTransaction previously created by the createTransaction method of this object. This is intended as a way to help reclaim resources associated with a transaction, but it is not required to call this.

DataAddress[] getHistoricalSnapshots(String path_name, long time_start, long time_end)

Returns an historical set of root nodes published to the root server between the times given, where the time values follow the conventions of System.currentTimeMillis().

Note that the returned root nodes may not be completely accurate because the mechanism that records the time for each commit does not follow a strict requirement for accuracy. For example, if a root server managing commits for a path instance fails over to a new host, the clock on the new host may be out of sync with the previous host thus it may appear that some commits have happened at the same time and not in a serial sequence.

Therefore consider the nodes returned by this method to be a reasonable approximation of all the snapshot states committed in the given time span.

void finalize()

The text on this page is licensed under the Creative Commons Attribution 3.0 License. Java is a registered trademark of Oracle and/or its affiliates.
Mckoi is Copyright © 2000 - 2018 Diehl and Associates, Inc. All rights reserved.