public interface Persistence extends Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(File homeDir) |
ChildNodeEntriesMap |
readCNEMap(Id id) |
StoredCommit |
readCommit(Id id) |
Id[] |
readIds()
Return an array of ids, where the first is the head id (as stored
with
writeHead(Id)) and the second is the highest commit
id found or null. |
void |
readNode(StoredNode node)
Read a node from storage.
|
Id |
writeCNEMap(ChildNodeEntries map) |
void |
writeCommit(Id id,
Commit commit)
Persist a commit with an id provided by the caller.
|
void |
writeHead(Id id) |
Id |
writeNode(Node node) |
Id[] readIds() throws Exception
writeHead(Id)) and the second is the highest commit
id found or null.
This method is not guaranteed to deliver "live" results, after something is written to the storage, so it should better be used once after initialization.
Exception - if an error occursvoid readNode(StoredNode node) throws NotFoundException, Exception
node - node to read, with id given in StoredNode.getId()NotFoundException - if no such node is foundException - if some other error occursChildNodeEntriesMap readCNEMap(Id id) throws NotFoundException, Exception
NotFoundExceptionExceptionId writeCNEMap(ChildNodeEntries map) throws Exception
ExceptionStoredCommit readCommit(Id id) throws NotFoundException, Exception
NotFoundExceptionExceptionCopyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.