Search in sources :

Example 1 with HBaseRpcControllerImpl

use of org.apache.hadoop.hbase.ipc.HBaseRpcControllerImpl in project hbase by apache.

the class ReplicationProtbufUtil method replicateWALEntry.

/**
   * A helper to replicate a list of WAL entries using admin protocol.
   * @param admin Admin service
   * @param entries Array of WAL entries to be replicated
   * @param replicationClusterId Id which will uniquely identify source cluster FS client
   *          configurations in the replication configuration directory
   * @param sourceBaseNamespaceDir Path to source cluster base namespace directory
   * @param sourceHFileArchiveDir Path to the source cluster hfile archive directory
   * @throws java.io.IOException
   */
public static void replicateWALEntry(final AdminService.BlockingInterface admin, final Entry[] entries, String replicationClusterId, Path sourceBaseNamespaceDir, Path sourceHFileArchiveDir) throws IOException {
    Pair<AdminProtos.ReplicateWALEntryRequest, CellScanner> p = buildReplicateWALEntryRequest(entries, null, replicationClusterId, sourceBaseNamespaceDir, sourceHFileArchiveDir);
    HBaseRpcController controller = new HBaseRpcControllerImpl(p.getSecond());
    try {
        admin.replicateWALEntry(controller, p.getFirst());
    } catch (org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException e) {
        throw ProtobufUtil.handleRemoteException(e);
    }
}
Also used : HBaseRpcController(org.apache.hadoop.hbase.ipc.HBaseRpcController) HBaseRpcControllerImpl(org.apache.hadoop.hbase.ipc.HBaseRpcControllerImpl) CellScanner(org.apache.hadoop.hbase.CellScanner) SizedCellScanner(org.apache.hadoop.hbase.io.SizedCellScanner)

Aggregations

CellScanner (org.apache.hadoop.hbase.CellScanner)1 SizedCellScanner (org.apache.hadoop.hbase.io.SizedCellScanner)1 HBaseRpcController (org.apache.hadoop.hbase.ipc.HBaseRpcController)1 HBaseRpcControllerImpl (org.apache.hadoop.hbase.ipc.HBaseRpcControllerImpl)1