public interface PersistenceStorageEngine

This class provides an interface to a persistent cache. The persistence cache persists user writes, cached server data and the corresponding completeness tree. There exists one PersistentCache per repo.

Public Method Summary

abstract void
abstract void
close()
abstract void
deleteTrackedQuery(long trackedQueryId)
abstract void
abstract List<TrackedQuery>
abstract Set<ChildKey>
loadTrackedQueryKeys(long trackedQueryId)
abstract Set<ChildKey>
loadTrackedQueryKeys(Set<Long> trackedQueryIds)
abstract List<UserWriteRecord>
loadUserWrites()
Return a list of all writes that were persisted
abstract void
mergeIntoServerCache(Path path, CompoundWrite children)
Update the server cache at the given path with the given children, merging each one into the cache.
abstract void
mergeIntoServerCache(Path path, Node node)
Update the server cache at the given path with the given node, merging each child into the cache.
abstract void
overwriteServerCache(Path path, Node node)
Overwrite the server cache at the given path with the given node.
abstract void
pruneCache(Path root, PruneForest pruneForest)
abstract void
removeAllUserWrites()
Removes all user writes
abstract void
removeUserWrite(long writeId)
Remove a write with the given write id.
abstract void
abstract void
abstract void
saveTrackedQueryKeys(long trackedQueryId, Set<ChildKey> keys)
abstract void
saveUserMerge(Path path, CompoundWrite children, long writeId)
Save a user merge
abstract void
saveUserOverwrite(Path path, Node node, long writeId)
Save a user overwrite
abstract Node
serverCache(Path path)
Loads all data at a path.
abstract long
abstract void
abstract void
updateTrackedQueryKeys(long trackedQueryId, Set<ChildKey> added, Set<ChildKey> removed)

Public Methods

public abstract void beginTransaction ()

public abstract void close ()

public abstract void deleteTrackedQuery (long trackedQueryId)

Parameters
trackedQueryId

public abstract void endTransaction ()

public abstract List<TrackedQuery> loadTrackedQueries ()

public abstract Set<ChildKey> loadTrackedQueryKeys (long trackedQueryId)

Parameters
trackedQueryId

public abstract Set<ChildKey> loadTrackedQueryKeys (Set<Long> trackedQueryIds)

Parameters
trackedQueryIds

public abstract List<UserWriteRecord> loadUserWrites ()

Return a list of all writes that were persisted

Returns
  • The list of writes

public abstract void mergeIntoServerCache (Path path, CompoundWrite children)

Update the server cache at the given path with the given children, merging each one into the cache.

Parameters
path The path for this merge
children The children to update

public abstract void mergeIntoServerCache (Path path, Node node)

Update the server cache at the given path with the given node, merging each child into the cache.

Parameters
path The path to update
node The node to merge into the cache.

public abstract void overwriteServerCache (Path path, Node node)

Overwrite the server cache at the given path with the given node.

Parameters
path The path to update
node The node to write to the cache.

public abstract void pruneCache (Path root, PruneForest pruneForest)

Parameters
root
pruneForest

public abstract void removeAllUserWrites ()

Removes all user writes

public abstract void removeUserWrite (long writeId)

Remove a write with the given write id.

Parameters
writeId The write id to remove

public abstract void resetPreviouslyActiveTrackedQueries (long lastUse)

Parameters
lastUse

public abstract void saveTrackedQuery (TrackedQuery trackedQuery)

Parameters
trackedQuery

public abstract void saveTrackedQueryKeys (long trackedQueryId, Set<ChildKey> keys)

Parameters
trackedQueryId
keys

public abstract void saveUserMerge (Path path, CompoundWrite children, long writeId)

Save a user merge

Parameters
path The path for this merge
children The children for this merge
writeId The write id that was used for this merge

public abstract void saveUserOverwrite (Path path, Node node, long writeId)

Save a user overwrite

Parameters
path The path for this write
node The node for this write
writeId The write id that was used for this write

public abstract Node serverCache (Path path)

Loads all data at a path. It has no knowledge of whether the data is "complete" or not.

Parameters
path The path at which to load the node.
Returns
  • The node that was loaded.

public abstract long serverCacheEstimatedSizeInBytes ()

public abstract void setTransactionSuccessful ()

public abstract void updateTrackedQueryKeys (long trackedQueryId, Set<ChildKey> added, Set<ChildKey> removed)

Parameters
trackedQueryId
added
removed