RegisterSign In

API Documentation: Interface ConsensusDDBConnection

Package: com.mckoi.network

Encapsulates the communication functions necessary to talk with a distributed network from the deterministic environment of a consensus function (com.mckoi.network.ConsensusProcessor) of a path instance.

Methods Summary

DataAddress getCurrentSnapshot()
DataAddress[] getHistoricalSnapshots(long time_start, long time_end)
DataAddress[] getSnapshotsSince(DataAddress root_node)
KeyObjectTransaction createTransaction(DataAddress root_node)
DataAddress flushTransaction(KeyObjectTransaction transaction)
void publishToPath(DataAddress root_node)

Method Details

DataAddress getCurrentSnapshot()

Returns the root node of the most current published version of the database path instance. This method will be expected to return the root node of the current snapshot and is absolutely certain to be the most current version of the database. Since the consensus function operates as a serial process and the current snapshot can only be updated by the consensus function, there is an implied certainty that the returned snapshot will be the most current.

DataAddress[] getHistoricalSnapshots(long time_start, long time_end)

Returns an historical set of root nodes published on this path instance between the times given, where the time values follow the conventions of System.currentTimeMillis().

The accuracy of the root nodes returned from this method follows the same conventions described in the 'getCurrentSnapshot' function.

DataAddress[] getSnapshotsSince(DataAddress root_node)

Returns the list of every snapshot state that has been published since the given root node (but not including). If no new snapshot states have been made then an empty array is returned.

The accuracy of the information returned from this method follows the same conventions described in the 'getCurrentSnapshot' function.

KeyObjectTransaction createTransaction(DataAddress root_node)

Given the address of a root node, creates a KeyObjectTransaction object that allows access and mutation of the database locally.

DataAddress flushTransaction(KeyObjectTransaction transaction)

Flushes modifications made to a transaction out to the network storage machines, and returns a unique DataAddress that references the root node of the flushed transaction. Once a transaction is flushed, the information in the transaction may be freely shared to other remote clients that have access to the network simply by sharing the DataAddress object.

The structure 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 unless they also flush the change and pass around the root node DataAddress of the structure with the changes.

Note that this function will always have a network time cost since the information must be written to the network (to multiple machines). Additionally, using this function will always result in storage resources on the network being consumed.

void publishToPath(DataAddress root_node)

Publishes a transaction snapshot as the most recent version of this database path instance on the root server. This makes the given published root node the new current version as returned by 'getCurrentSnapshot'.

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 - 2020 Diehl and Associates, Inc. All rights reserved.