use of org.apache.hadoop.hbase.client.RpcRetryingCallerFactory in project hbase by apache.
the class WALEditsReplaySink method replayEdits.
private void replayEdits(final HRegionLocation regionLoc, final HRegionInfo regionInfo, final List<Entry> entries) throws IOException {
try {
RpcRetryingCallerFactory factory = RpcRetryingCallerFactory.instantiate(conf, null);
ReplayServerCallable<ReplicateWALEntryResponse> callable = new ReplayServerCallable<>(this.conn, this.rpcControllerFactory, this.tableName, regionLoc, entries);
factory.<ReplicateWALEntryResponse>newCaller().callWithRetries(callable, this.replayTimeout);
} catch (IOException ie) {
if (skipErrors) {
LOG.warn(HConstants.HREGION_EDITS_REPLAY_SKIP_ERRORS + "=true so continuing replayEdits with error:" + ie.getMessage());
} else {
throw ie;
}
}
}
use of org.apache.hadoop.hbase.client.RpcRetryingCallerFactory 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);
}
}
Aggregations