public abstract class Database extends Object
| Constructor and Description |
|---|
Database() |
protected abstract Set<Uid32> fetchAllEntryTableUids() throws CloudproofException
Implementation of this method is only required to compact the index
Set of all Uid32CloudproofException - if anything goes wrongprotected abstract Map<Uid32,EntryTableValue> fetchEntries(List<Uid32> uids) throws CloudproofException
Uid32. If a line does not exist, there should be not
entry in the returned map.
Implementation of this method is always required (to search, update or compact the index)
uids - the unique Uid32s used as line idMap of Uid32 to EntryTableValueCloudproofException - if anything goes wrongprotected abstract Map<Uid32,ChainTableValue> fetchChains(List<Uid32> uids) throws CloudproofException
Uid32. If a line does not exist, there should be not
entry in the returned map.
Implementation of this method is only required to search or compact the index
uids - the unique Uid32s used as line idMap of Uid32 to ChainTableValueCloudproofException - if anything goes wrongprotected abstract Map<Uid32,EntryTableValue> upsertEntries(Map<Uid32,EntryTableValues> uidsAndValues) throws CloudproofException
The EntryTableValues structure contains both the new value to be upserted and the previous value known at
the time of fetch. To avoid concurrency issues, the new value of an existing Uid32 must not be
updated if the current value in the database does not match the previous value of the structure. In such a case,
the Uid32 and the current database value must be returned as part of the returned Map. *
Implementation of this method is only required to update or compact the index
See the Redis and Sqlite implementations for implementation examples
uidsAndValues - a Map of Uid32 to EntryTableValuesUid32 that could not be updated and the current database value for the entry.CloudproofException - if anything goes wrongprotected abstract void upsertChains(Map<Uid32,ChainTableValue> uidsAndValues) throws CloudproofException
Implementation of this method is only required to update or compact the index
uidsAndValues - a Map of Uid32 to ChainTableValueCloudproofException - if anything goes wrongprotected abstract void updateTables(List<Uid32> removedChains, Map<Uid32,EntryTableValue> newEntries, Map<Uid32,ChainTableValue> newChains) throws CloudproofException
Option 1
Keep the database small but prevent using the index during the _update_lines_.During a small duration, the index tables are much bigger but users can continue using the index during the _update_lines`.
*
Implementation of this method is only required to compact the index
removedChains - a list of lines to remove from the Chain TablenewEntries - a list of lines to add to the Entry Table (after it has been dropped)newChains - a list of lines to add to the Chain TableCloudproofException - if anything goes wrongprotected abstract List<Location> listRemovedLocations(List<Location> locations) throws CloudproofException
Location no longer exist in the main database/storage and return them. *
Implementation of this method is only required to compact the index
locations - the list to check for existenceCloudproofException - if anything goes wrongprotected abstract boolean searchProgress(List<IndexedValue> indexedValues) throws CloudproofException
The user should return false to immediately have the search return and stop further progressing down the graph. *
Implementation of this method is only required to search the index
indexedValues - A list of IndexedValue already found by the searchCloudproofException - if anything goes wrongpublic FindexNativeWrapper.FetchAllEntryTableUidsCallback fetchAllEntryTableUidsCallback()
public FindexNativeWrapper.FetchEntryCallback fetchEntryCallback()
public FindexNativeWrapper.FetchChainCallback fetchChainCallback()
public FindexNativeWrapper.UpsertEntryCallback upsertEntryCallback()
public FindexNativeWrapper.UpsertChainCallback upsertChainCallback()
public FindexNativeWrapper.UpdateLinesCallback updateLinesCallback()
public FindexNativeWrapper.ListRemovedLocationsCallback listRemoveLocationsCallback()
public FindexNativeWrapper.ProgressCallback progressCallback()
Copyright © 2022. All rights reserved.