Java 类org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileResponse 实例源码

项目:ditb    文件:RSRpcServices.java   
/**
 * Atomically bulk load several HFiles into an open region
 * @return true if successful, false is failed but recoverably (no action)
 * @throws ServiceException if failed unrecoverably
 */
@Override
public BulkLoadHFileResponse bulkLoadHFile(final RpcController controller,
    final BulkLoadHFileRequest request) throws ServiceException {
  try {
    checkOpen();
    requestCount.increment();
    Region region = getRegion(request.getRegion());
    List<Pair<byte[], String>> familyPaths = new ArrayList<Pair<byte[], String>>();
    for (FamilyPath familyPath: request.getFamilyPathList()) {
      familyPaths.add(new Pair<byte[], String>(familyPath.getFamily().toByteArray(),
        familyPath.getPath()));
    }
    boolean bypass = false;
    if (region.getCoprocessorHost() != null) {
      bypass = region.getCoprocessorHost().preBulkLoadHFile(familyPaths);
    }
    boolean loaded = false;
    if (!bypass) {
      loaded = region.bulkLoadHFiles(familyPaths, request.getAssignSeqNum(), null);
    }
    if (region.getCoprocessorHost() != null) {
      loaded = region.getCoprocessorHost().postBulkLoadHFile(familyPaths, loaded);
    }
    BulkLoadHFileResponse.Builder builder = BulkLoadHFileResponse.newBuilder();
    builder.setLoaded(loaded);
    return builder.build();
  } catch (IOException ie) {
    throw new ServiceException(ie);
  }
}
项目:ditb    文件:ProtobufUtil.java   
/**
 * A helper to bulk load a list of HFiles using client protocol.
 *
 * @param client
 * @param familyPaths
 * @param regionName
 * @param assignSeqNum
 * @return true if all are loaded
 * @throws IOException
 */
public static boolean bulkLoadHFile(final ClientService.BlockingInterface client,
    final List<Pair<byte[], String>> familyPaths,
    final byte[] regionName, boolean assignSeqNum) throws IOException {
  BulkLoadHFileRequest request =
    RequestConverter.buildBulkLoadHFileRequest(familyPaths, regionName, assignSeqNum);
  try {
    BulkLoadHFileResponse response =
      client.bulkLoadHFile(null, request);
    return response.getLoaded();
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
}
项目:pbase    文件:RSRpcServices.java   
/**
 * Atomically bulk load several HFiles into an open region
 *
 * @return true if successful, false is failed but recoverably (no action)
 * @throws IOException if failed unrecoverably
 */
@Override
public BulkLoadHFileResponse bulkLoadHFile(final RpcController controller,
                                           final BulkLoadHFileRequest request) throws ServiceException {
    try {
        checkOpen();
        requestCount.increment();
        HRegion region = getRegion(request.getRegion());
        List<Pair<byte[], String>> familyPaths = new ArrayList<Pair<byte[], String>>();
        for (FamilyPath familyPath : request.getFamilyPathList()) {
            familyPaths.add(new Pair<byte[], String>(familyPath.getFamily().toByteArray(),
                    familyPath.getPath()));
        }
        boolean bypass = false;
        if (region.getCoprocessorHost() != null) {
            bypass = region.getCoprocessorHost().preBulkLoadHFile(familyPaths);
        }
        boolean loaded = false;
        if (!bypass) {
            loaded = region.bulkLoadHFiles(familyPaths, request.getAssignSeqNum());
        }
        if (region.getCoprocessorHost() != null) {
            loaded = region.getCoprocessorHost().postBulkLoadHFile(familyPaths, loaded);
        }
        BulkLoadHFileResponse.Builder builder = BulkLoadHFileResponse.newBuilder();
        builder.setLoaded(loaded);
        return builder.build();
    } catch (IOException ie) {
        throw new ServiceException(ie);
    }
}
项目:pbase    文件:ProtobufUtil.java   
/**
 * A helper to bulk load a list of HFiles using client protocol.
 *
 * @param client
 * @param familyPaths
 * @param regionName
 * @param assignSeqNum
 * @return true if all are loaded
 * @throws IOException
 */
public static boolean bulkLoadHFile(final ClientService.BlockingInterface client,
    final List<Pair<byte[], String>> familyPaths,
    final byte[] regionName, boolean assignSeqNum) throws IOException {
  BulkLoadHFileRequest request =
    RequestConverter.buildBulkLoadHFileRequest(familyPaths, regionName, assignSeqNum);
  try {
    BulkLoadHFileResponse response =
      client.bulkLoadHFile(null, request);
    return response.getLoaded();
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
}
项目:HIndex    文件:HRegionServer.java   
/**
 * Atomically bulk load several HFiles into an open region
 * @return true if successful, false is failed but recoverably (no action)
 * @throws IOException if failed unrecoverably
 */
@Override
public BulkLoadHFileResponse bulkLoadHFile(final RpcController controller,
    final BulkLoadHFileRequest request) throws ServiceException {
  try {
    checkOpen();
    requestCount.increment();
    HRegion region = getRegion(request.getRegion());
    List<Pair<byte[], String>> familyPaths = new ArrayList<Pair<byte[], String>>();
    for (FamilyPath familyPath: request.getFamilyPathList()) {
      familyPaths.add(new Pair<byte[], String>(familyPath.getFamily().toByteArray(),
        familyPath.getPath()));
    }
    boolean bypass = false;
    if (region.getCoprocessorHost() != null) {
      bypass = region.getCoprocessorHost().preBulkLoadHFile(familyPaths);
    }
    boolean loaded = false;
    if (!bypass) {
      loaded = region.bulkLoadHFiles(familyPaths, request.getAssignSeqNum());
    }
    if (region.getCoprocessorHost() != null) {
      loaded = region.getCoprocessorHost().postBulkLoadHFile(familyPaths, loaded);
    }
    BulkLoadHFileResponse.Builder builder = BulkLoadHFileResponse.newBuilder();
    builder.setLoaded(loaded);
    return builder.build();
  } catch (IOException ie) {
    throw new ServiceException(ie);
  }
}
项目:HIndex    文件:ProtobufUtil.java   
/**
 * A helper to bulk load a list of HFiles using client protocol.
 *
 * @param client
 * @param familyPaths
 * @param regionName
 * @param assignSeqNum
 * @param controller
 * @return true if all are loaded
 * @throws IOException
 */
public static boolean bulkLoadHFile(final ClientService.BlockingInterface client,
    final List<Pair<byte[], String>> familyPaths, final byte[] regionName, boolean assignSeqNum,
    PayloadCarryingRpcController controller) throws IOException {
  BulkLoadHFileRequest request =
    RequestConverter.buildBulkLoadHFileRequest(familyPaths, regionName, assignSeqNum);
  try {
    BulkLoadHFileResponse response =
      client.bulkLoadHFile(controller, request);
    return response.getLoaded();
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
}
项目:PyroDB    文件:RSRpcServices.java   
/**
 * Atomically bulk load several HFiles into an open region
 * @return true if successful, false is failed but recoverably (no action)
 * @throws IOException if failed unrecoverably
 */
@Override
public BulkLoadHFileResponse bulkLoadHFile(final RpcController controller,
    final BulkLoadHFileRequest request) throws ServiceException {
  try {
    checkOpen();
    requestCount.increment();
    HRegion region = getRegion(request.getRegion());
    List<Pair<byte[], String>> familyPaths = new ArrayList<Pair<byte[], String>>();
    for (FamilyPath familyPath: request.getFamilyPathList()) {
      familyPaths.add(new Pair<byte[], String>(familyPath.getFamily().toByteArray(),
        familyPath.getPath()));
    }
    boolean bypass = false;
    if (region.getCoprocessorHost() != null) {
      bypass = region.getCoprocessorHost().preBulkLoadHFile(familyPaths);
    }
    boolean loaded = false;
    if (!bypass) {
      loaded = region.bulkLoadHFiles(familyPaths, request.getAssignSeqNum());
    }
    if (region.getCoprocessorHost() != null) {
      loaded = region.getCoprocessorHost().postBulkLoadHFile(familyPaths, loaded);
    }
    BulkLoadHFileResponse.Builder builder = BulkLoadHFileResponse.newBuilder();
    builder.setLoaded(loaded);
    return builder.build();
  } catch (IOException ie) {
    throw new ServiceException(ie);
  }
}
项目:PyroDB    文件:ProtobufUtil.java   
/**
 * A helper to bulk load a list of HFiles using client protocol.
 *
 * @param client
 * @param familyPaths
 * @param regionName
 * @param assignSeqNum
 * @return true if all are loaded
 * @throws IOException
 */
public static boolean bulkLoadHFile(final ClientService.BlockingInterface client,
    final List<Pair<byte[], String>> familyPaths,
    final byte[] regionName, boolean assignSeqNum) throws IOException {
  BulkLoadHFileRequest request =
    RequestConverter.buildBulkLoadHFileRequest(familyPaths, regionName, assignSeqNum);
  try {
    BulkLoadHFileResponse response =
      client.bulkLoadHFile(null, request);
    return response.getLoaded();
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
}
项目:c5    文件:HRegionServer.java   
/**
 * Atomically bulk load several HFiles into an open region
 * @return true if successful, false is failed but recoverably (no action)
 * @throws IOException if failed unrecoverably
 */
@Override
public BulkLoadHFileResponse bulkLoadHFile(final RpcController controller,
    final BulkLoadHFileRequest request) throws ServiceException {
  try {
    requestCount.increment();
    HRegion region = getRegion(request.getRegion());
    List<Pair<byte[], String>> familyPaths = new ArrayList<Pair<byte[], String>>();
    for (FamilyPath familyPath: request.getFamilyPathList()) {
      familyPaths.add(new Pair<byte[], String>(familyPath.getFamily().toByteArray(),
        familyPath.getPath()));
    }
    boolean bypass = false;
    if (region.getCoprocessorHost() != null) {
      bypass = region.getCoprocessorHost().preBulkLoadHFile(familyPaths);
    }
    boolean loaded = false;
    if (!bypass) {
      loaded = region.bulkLoadHFiles(familyPaths, request.getAssignSeqNum());
    }
    if (region.getCoprocessorHost() != null) {
      loaded = region.getCoprocessorHost().postBulkLoadHFile(familyPaths, loaded);
    }
    BulkLoadHFileResponse.Builder builder = BulkLoadHFileResponse.newBuilder();
    builder.setLoaded(loaded);
    return builder.build();
  } catch (IOException ie) {
    throw new ServiceException(ie);
  }
}
项目:c5    文件:ProtobufUtil.java   
/**
 * A helper to bulk load a list of HFiles using client protocol.
 *
 * @param client
 * @param familyPaths
 * @param regionName
 * @param assignSeqNum
 * @return true if all are loaded
 * @throws IOException
 */
public static boolean bulkLoadHFile(final ClientService.BlockingInterface client,
    final List<Pair<byte[], String>> familyPaths,
    final byte[] regionName, boolean assignSeqNum) throws IOException {
  BulkLoadHFileRequest request =
    RequestConverter.buildBulkLoadHFileRequest(familyPaths, regionName, assignSeqNum);
  try {
    BulkLoadHFileResponse response =
      client.bulkLoadHFile(null, request);
    return response.getLoaded();
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
}
项目:DominoHBase    文件:ProtobufUtil.java   
/**
 * A helper to bulk load a list of HFiles using client protocol.
 *
 * @param client
 * @param familyPaths
 * @param regionName
 * @param assignSeqNum
 * @return true if all are loaded
 * @throws IOException
 */
public static boolean bulkLoadHFile(final ClientProtocol client,
    final List<Pair<byte[], String>> familyPaths,
    final byte[] regionName, boolean assignSeqNum) throws IOException {
  BulkLoadHFileRequest request =
    RequestConverter.buildBulkLoadHFileRequest(familyPaths, regionName, assignSeqNum);
  try {
    BulkLoadHFileResponse response =
      client.bulkLoadHFile(null, request);
    return response.getLoaded();
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
}
项目:DominoHBase    文件:HRegionServer.java   
/**
 * Atomically bulk load several HFiles into an open region
 * @return true if successful, false is failed but recoverably (no action)
 * @throws IOException if failed unrecoverably
 */
@Override
public BulkLoadHFileResponse bulkLoadHFile(final RpcController controller,
    final BulkLoadHFileRequest request) throws ServiceException {
  try {
    requestCount.increment();
    HRegion region = getRegion(request.getRegion());
    List<Pair<byte[], String>> familyPaths = new ArrayList<Pair<byte[], String>>();
    for (FamilyPath familyPath: request.getFamilyPathList()) {
      familyPaths.add(new Pair<byte[], String>(familyPath.getFamily().toByteArray(),
        familyPath.getPath()));
    }
    boolean bypass = false;
    if (region.getCoprocessorHost() != null) {
      bypass = region.getCoprocessorHost().preBulkLoadHFile(familyPaths);
    }
    boolean loaded = false;
    if (!bypass) {
      loaded = region.bulkLoadHFiles(familyPaths, request.getAssignSeqNum());
    }
    if (region.getCoprocessorHost() != null) {
      loaded = region.getCoprocessorHost().postBulkLoadHFile(familyPaths, loaded);
    }
    BulkLoadHFileResponse.Builder builder = BulkLoadHFileResponse.newBuilder();
    builder.setLoaded(loaded);
    return builder.build();
  } catch (IOException ie) {
    throw new ServiceException(ie);
  }
}
项目:ditb    文件:MockRegionServer.java   
@Override
public BulkLoadHFileResponse bulkLoadHFile(RpcController controller,
    BulkLoadHFileRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:ditb    文件:TestClientNoCluster.java   
@Override
public BulkLoadHFileResponse bulkLoadHFile(
    RpcController controller, BulkLoadHFileRequest request)
    throws ServiceException {
  throw new NotImplementedException();
}
项目:pbase    文件:MockRegionServer.java   
@Override
public BulkLoadHFileResponse bulkLoadHFile(RpcController controller,
    BulkLoadHFileRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:pbase    文件:TestClientNoCluster.java   
@Override
public BulkLoadHFileResponse bulkLoadHFile(
    RpcController controller, BulkLoadHFileRequest request)
    throws ServiceException {
  throw new NotImplementedException();
}
项目:HIndex    文件:MockRegionServer.java   
@Override
public BulkLoadHFileResponse bulkLoadHFile(RpcController controller,
    BulkLoadHFileRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:HIndex    文件:TestClientNoCluster.java   
@Override
public BulkLoadHFileResponse bulkLoadHFile(
    RpcController controller, BulkLoadHFileRequest request)
    throws ServiceException {
  throw new NotImplementedException();
}
项目:PyroDB    文件:MockRegionServer.java   
@Override
public BulkLoadHFileResponse bulkLoadHFile(RpcController controller,
    BulkLoadHFileRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:PyroDB    文件:TestClientNoCluster.java   
@Override
public BulkLoadHFileResponse bulkLoadHFile(
    RpcController controller, BulkLoadHFileRequest request)
    throws ServiceException {
  throw new NotImplementedException();
}
项目:c5    文件:MockRegionServer.java   
@Override
public BulkLoadHFileResponse bulkLoadHFile(RpcController controller,
    BulkLoadHFileRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:c5    文件:TestClientNoCluster.java   
@Override
public BulkLoadHFileResponse bulkLoadHFile(
    RpcController controller, BulkLoadHFileRequest request)
    throws ServiceException {
  throw new NotImplementedException();
}
项目:DominoHBase    文件:MockRegionServer.java   
@Override
public BulkLoadHFileResponse bulkLoadHFile(RpcController controller,
    BulkLoadHFileRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}