Class ReplicationOperationsImpl
- java.lang.Object
-
- org.apache.accumulo.core.clientImpl.ReplicationOperationsImpl
-
- All Implemented Interfaces:
ReplicationOperations
public class ReplicationOperationsImpl extends Object implements ReplicationOperations
-
-
Constructor Summary
Constructors Constructor Description ReplicationOperationsImpl(ClientContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPeer(String name, String replicaType)Defines a cluster with the given name and the given name system.voiddrain(String tableName)Waits for a table to be fully replicated, given the state of files pending replication for the provided table at the point in time which this method is invoked.voiddrain(String tableName, Set<String> wals)Given the provided set of files that are pending replication for a table, wait for those files to be fully replicated to all configured peers.protected booleangetMasterDrain(TInfo tinfo, TCredentials rpcCreds, String tableName, Set<String> wals)protected TableIdgetTableId(AccumuloClient client, String tableName)Set<String>referencedFiles(String tableName)Gets all of the referenced files for a table from the metadata table.voidremovePeer(String name)Removes a cluster with the given name.
-
-
-
Constructor Detail
-
ReplicationOperationsImpl
public ReplicationOperationsImpl(ClientContext context)
-
-
Method Detail
-
addPeer
public void addPeer(String name, String replicaType) throws AccumuloException, AccumuloSecurityException
Description copied from interface:ReplicationOperationsDefines a cluster with the given name and the given name system.- Specified by:
addPeerin interfaceReplicationOperations- Parameters:
name- Unique name for the clusterreplicaType- Class name to use to replicate the data- Throws:
AccumuloExceptionAccumuloSecurityException
-
removePeer
public void removePeer(String name) throws AccumuloException, AccumuloSecurityException
Description copied from interface:ReplicationOperationsRemoves a cluster with the given name.- Specified by:
removePeerin interfaceReplicationOperations- Parameters:
name- Name of the cluster to remove- Throws:
AccumuloExceptionAccumuloSecurityException
-
drain
public void drain(String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
Description copied from interface:ReplicationOperationsWaits for a table to be fully replicated, given the state of files pending replication for the provided table at the point in time which this method is invoked.- Specified by:
drainin interfaceReplicationOperations- Parameters:
tableName- The table to wait for- Throws:
AccumuloExceptionAccumuloSecurityExceptionTableNotFoundException
-
drain
public void drain(String tableName, Set<String> wals) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
Description copied from interface:ReplicationOperationsGiven the provided set of files that are pending replication for a table, wait for those files to be fully replicated to all configured peers. This allows for the accurate calculation when a table, at a given point in time, has been fully replicated.- Specified by:
drainin interfaceReplicationOperations- Parameters:
tableName- The table to wait for- Throws:
AccumuloExceptionAccumuloSecurityExceptionTableNotFoundException
-
getMasterDrain
protected boolean getMasterDrain(TInfo tinfo, TCredentials rpcCreds, String tableName, Set<String> wals) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
-
getTableId
protected TableId getTableId(AccumuloClient client, String tableName) throws TableNotFoundException
- Throws:
TableNotFoundException
-
referencedFiles
public Set<String> referencedFiles(String tableName) throws TableNotFoundException
Description copied from interface:ReplicationOperationsGets all of the referenced files for a table from the metadata table. The result of this method is intended to be directly supplied toReplicationOperations.drain(String, Set). This helps determine when all data from a given point in time has been fully replicated.This also allows callers to get the
Setof files for a table at some time, and later provide thatSettoReplicationOperations.drain(String,Set)to wait for all of those files to be replicated.- Specified by:
referencedFilesin interfaceReplicationOperations- Throws:
TableNotFoundException
-
-