Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.bazaarvoice.emodb.sor.api;
import com.bazaarvoice.emodb.sor.delta.Delta;
import javax.annotation.Nullable;
import java.net.URI;
import java.time.Duration;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
/**
* Primary interface for reading and writing objects in the System of Record (SoR).
*
* Design notes todo:
*
For performance, add batch APIs for all operations, especially {@link #get} and
* {@link #update}. The DataStore may be able to take advantage of APIs in the
* underlying data store that yield higher throughput when operating on multiple
* pieces of content at a time.
*/
public interface DataStore {
/**
* Retrieves metadata about up to {@code limit} tables. The records will be returned in a deterministic
* order but not sorted alphabetically by key. If {@code fromTableExclusive} is not null, the list will
* start with the first table that follows the specified key in the returned sort order.
*
* Note: clients are strongly encouraged to use the version of this method wrapped by the
* {@code com.bazaarvoice.emodb.sor.client.DataStoreStreaming} class which will restart the iterator in the
* event that the connection to the EmoDB server is lost while streaming results.
*/
Iterator
listTables(@Nullable String fromTableExclusive, long limit);
/**
* Retrieves the list of table events that are not published on the databus.
*/
Iterator listUnpublishedDatabusEvents(Date fromInclusive, Date toExclusive);
/**
* Creates a logical table in the data store.
*
* @throws TableExistsException if the table exists already with different options or a different template.
*/
void createTable(String table, TableOptions options, Map template, Audit audit)
throws TableExistsException;
/**
* Drops the specified table and all data associated with it.
*/
void dropTable(String table, Audit audit)
throws UnknownTableException;
/**
* Makes a best effort to permanently delete all data from the specified table. This method is not safe for use
* with the databus or megabus--it does not generate events and resets the version number of all content to zero.
* Useful for debugging/testing, but not intended for use in production.
*/
void purgeTableUnsafe(String table, Audit audit)
throws UnknownTableException;
/**
* Returns true if the specified table exists.
*/
boolean getTableExists(String table);
/**
* Returns true if the specified table is available to the current data center.
*/
boolean isTableAvailable(String table);
/**
* Returns the table metadata.
*/
Table getTableMetadata(String table);
/**
* Returns the template associated with a table.
*/
Map getTableTemplate(String table)
throws UnknownTableException;
/**
* Replaces the template for an existing table.
*/
void setTableTemplate(String table, Map template, Audit audit)
throws UnknownTableException;
/**
* Returns the storage options associated with a table.
*/
TableOptions getTableOptions(String table)
throws UnknownTableException;
/**
* Returns an estimate of the number of distinct records ever written to the specified table. This will include
* records that have been deleted by writing a Delete delta.
*
* Useful for debugging/testing, but not intended for use in production because it performs an unbounded amount of work.
* Please do not use this method to monitor your data in production!
*/
long getTableApproximateSize(String table) throws UnknownTableException;
long getTableApproximateSize(String table, int limit) throws UnknownTableException;
/**
* Retrieves the current version of a piece of content from the data store.
* Uses {@link ReadConsistency#STRONG}.
*/
Map get(String table, String key);
/**
* Retrieves the current version of a piece of content from the data store.
*/
Map get(String table, String key, ReadConsistency consistency);
/**
* Retrieves all recorded history for a piece of content in the data store.
*/
Iterator getTimeline(String table, String key, boolean includeContentData, boolean includeAuditInformation,
@Nullable UUID start, @Nullable UUID end, boolean reversed, long limit,
ReadConsistency consistency);
/**
* Retrieves up to {@code limit} records from the specified table. The records will be returned in a deterministic
* order but not sorted alphabetically by key. If {@code fromKeyExclusive} is not null, the scan will start with
* the first record that follows the specified key in the returned sort order.
*
* Note: clients are strongly encouraged to use the version of this method wrapped by the
* {@code com.bazaarvoice.emodb.sor.client.DataStoreStreaming} class which will restart the iterator in the
* event that the connection to the EmoDB server is lost while streaming results.
*/
Iterator