public class ReplicationOperationsImpl extends Object implements ReplicationOperations
Constructor and Description |
---|
ReplicationOperationsImpl(ClientContext context) |
Modifier and Type | Method and Description |
---|---|
void |
addPeer(String name,
String replicaType)
Defines a cluster with the given name and the given name system.
|
void |
drain(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.
|
void |
drain(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 boolean |
getMasterDrain(TInfo tinfo,
TCredentials rpcCreds,
String tableName,
Set<String> wals) |
protected String |
getTableId(Connector conn,
String tableName) |
Set<String> |
referencedFiles(String tableName)
Gets all of the referenced files for a table from the metadata table.
|
void |
removePeer(String name)
Removes a cluster with the given name.
|
public ReplicationOperationsImpl(ClientContext context)
public void addPeer(String name, String replicaType) throws AccumuloException, AccumuloSecurityException, PeerExistsException
ReplicationOperations
addPeer
in interface ReplicationOperations
name
- Unique name for the clusterreplicaType
- Class name to use to replicate the dataAccumuloException
AccumuloSecurityException
PeerExistsException
public void removePeer(String name) throws AccumuloException, AccumuloSecurityException, PeerNotFoundException
ReplicationOperations
removePeer
in interface ReplicationOperations
name
- Name of the cluster to removeAccumuloException
AccumuloSecurityException
PeerNotFoundException
public void drain(String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
ReplicationOperations
drain
in interface ReplicationOperations
tableName
- The table to wait forAccumuloException
AccumuloSecurityException
TableNotFoundException
public void drain(String tableName, Set<String> wals) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
ReplicationOperations
drain
in interface ReplicationOperations
tableName
- The table to wait forAccumuloException
AccumuloSecurityException
TableNotFoundException
protected boolean getMasterDrain(TInfo tinfo, TCredentials rpcCreds, String tableName, Set<String> wals) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
protected String getTableId(Connector conn, String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
public Set<String> referencedFiles(String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
ReplicationOperations
ReplicationOperations.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 Set
of files for a table at some time, and later provide that Set
to ReplicationOperations.drain(String,Set)
to wait
for all of those files to be replicated.
referencedFiles
in interface ReplicationOperations
AccumuloException
AccumuloSecurityException
TableNotFoundException
Copyright © 2011–2016 The Apache Software Foundation. All rights reserved.