Search in sources :

Example 1 with RegionReplicaReplayCallable

use of org.apache.hadoop.hbase.replication.regionserver.RegionReplicaReplicationEndpoint.RegionReplicaReplayCallable in project hbase by apache.

the class TestRegionReplicaReplicationEndpointNoMaster method replicateUsingCallable.

private void replicateUsingCallable(ClusterConnection connection, Queue<Entry> entries) throws IOException, RuntimeException {
    Entry entry;
    while ((entry = entries.poll()) != null) {
        byte[] row = CellUtil.cloneRow(entry.getEdit().getCells().get(0));
        RegionLocations locations = connection.locateRegion(tableName, row, true, true);
        RegionReplicaReplayCallable callable = new RegionReplicaReplayCallable(connection, RpcControllerFactory.instantiate(connection.getConfiguration()), table.getName(), locations.getRegionLocation(1), locations.getRegionLocation(1).getRegionInfo(), row, Lists.newArrayList(entry), new AtomicLong());
        RpcRetryingCallerFactory factory = RpcRetryingCallerFactory.instantiate(connection.getConfiguration());
        factory.<ReplicateWALEntryResponse>newCaller().callWithRetries(callable, 10000);
    }
}
Also used : RegionLocations(org.apache.hadoop.hbase.RegionLocations) Entry(org.apache.hadoop.hbase.wal.WAL.Entry) AtomicLong(java.util.concurrent.atomic.AtomicLong) RpcRetryingCallerFactory(org.apache.hadoop.hbase.client.RpcRetryingCallerFactory) RegionReplicaReplayCallable(org.apache.hadoop.hbase.replication.regionserver.RegionReplicaReplicationEndpoint.RegionReplicaReplayCallable)

Aggregations

AtomicLong (java.util.concurrent.atomic.AtomicLong)1 RegionLocations (org.apache.hadoop.hbase.RegionLocations)1 RpcRetryingCallerFactory (org.apache.hadoop.hbase.client.RpcRetryingCallerFactory)1 RegionReplicaReplayCallable (org.apache.hadoop.hbase.replication.regionserver.RegionReplicaReplicationEndpoint.RegionReplicaReplayCallable)1 Entry (org.apache.hadoop.hbase.wal.WAL.Entry)1