當前位置: 首頁>>代碼示例>>Java>>正文


Java TruncateTableRequest類代碼示例

本文整理匯總了Java中org.apache.hadoop.hbase.protobuf.generated.MasterProtos.TruncateTableRequest的典型用法代碼示例。如果您正苦於以下問題:Java TruncateTableRequest類的具體用法?Java TruncateTableRequest怎麽用?Java TruncateTableRequest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TruncateTableRequest類屬於org.apache.hadoop.hbase.protobuf.generated.MasterProtos包,在下文中一共展示了TruncateTableRequest類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: truncateTable

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.TruncateTableRequest; //導入依賴的package包/類
@Override
public TruncateTableResponse truncateTable(RpcController controller, TruncateTableRequest request)
    throws ServiceException {
  try {
    master.truncateTable(
      ProtobufUtil.toTableName(request.getTableName()),
      request.getPreserveSplits(),
      request.getNonceGroup(),
      request.getNonce());
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
  return TruncateTableResponse.newBuilder().build();
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:15,代碼來源:MasterRpcServices.java

示例2: buildTruncateTableRequest

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.TruncateTableRequest; //導入依賴的package包/類
/**
 * Creates a protocol buffer TruncateTableRequest
 *
 * @param tableName name of table to truncate
 * @param preserveSplits True if the splits should be preserved
 * @return a TruncateTableRequest
 */
public static TruncateTableRequest buildTruncateTableRequest(
    final TableName tableName,
    final boolean preserveSplits,
    final long nonceGroup,
    final long nonce) {
  TruncateTableRequest.Builder builder = TruncateTableRequest.newBuilder();
  builder.setTableName(ProtobufUtil.toProtoTableName(tableName));
  builder.setPreserveSplits(preserveSplits);
  builder.setNonceGroup(nonceGroup);
  builder.setNonce(nonce);
  return builder.build();
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:20,代碼來源:RequestConverter.java

示例3: truncateTable

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.TruncateTableRequest; //導入依賴的package包/類
/**
 * Truncate a table.
 * Synchronous operation.
 *
 * @param tableName name of table to truncate
 * @param preserveSplits True if the splits should be preserved
 * @throws IOException if a remote or network exception occurs
 */
@Override
public void truncateTable(final TableName tableName, final boolean preserveSplits)
    throws IOException {
  executeCallable(new MasterCallable<Void>(getConnection()) {
    @Override
    public Void call(int callTimeout) throws ServiceException {
      TruncateTableRequest req = RequestConverter.buildTruncateTableRequest(
        tableName, preserveSplits, ng.getNonceGroup(), ng.newNonce());
      master.truncateTable(null, req);
      return null;
    }
  });
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:22,代碼來源:HBaseAdmin.java

示例4: truncateTable

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.TruncateTableRequest; //導入依賴的package包/類
@Override
public TruncateTableResponse truncateTable(RpcController controller, TruncateTableRequest request)
    throws ServiceException {
  try {
    master.truncateTable(ProtobufUtil.toTableName(request.getTableName()),
      request.getPreserveSplits());
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
  return TruncateTableResponse.newBuilder().build();
}
 
開發者ID:grokcoder,項目名稱:pbase,代碼行數:12,代碼來源:MasterRpcServices.java

示例5: buildTruncateTableRequest

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.TruncateTableRequest; //導入依賴的package包/類
/**
 * Creates a protocol buffer TruncateTableRequest
 *
 * @param tableName name of table to truncate
 * @param preserveSplits True if the splits should be preserved
 * @return a TruncateTableRequest
 */
public static TruncateTableRequest buildTruncateTableRequest(final TableName tableName,
      boolean preserveSplits) {
  TruncateTableRequest.Builder builder = TruncateTableRequest.newBuilder();
  builder.setTableName(ProtobufUtil.toProtoTableName(tableName));
  builder.setPreserveSplits(preserveSplits);
  return builder.build();
}
 
開發者ID:grokcoder,項目名稱:pbase,代碼行數:15,代碼來源:RequestConverter.java

示例6: truncateTable

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.TruncateTableRequest; //導入依賴的package包/類
/**
 * Truncate a table.
 * Synchronous operation.
 *
 * @param tableName name of table to truncate
 * @param preserveSplits True if the splits should be preserved
 * @throws IOException if a remote or network exception occurs
 */
@Override
public void truncateTable(final TableName tableName, final boolean preserveSplits)
    throws IOException {
  executeCallable(new MasterCallable<Void>(getConnection()) {
    @Override
    public Void call(int callTimeout) throws ServiceException {
      TruncateTableRequest req = RequestConverter.buildTruncateTableRequest(
        tableName, preserveSplits);
      master.truncateTable(null, req);
      return null;
    }
  });
}
 
開發者ID:grokcoder,項目名稱:pbase,代碼行數:22,代碼來源:HBaseAdmin.java

示例7: truncateTable

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.TruncateTableRequest; //導入依賴的package包/類
/**
 * Truncate a table.
 * Synchronous operation.
 *
 * @param tableName name of table to truncate
 * @param preserveSplits True if the splits should be preserved
 * @throws IOException if a remote or network exception occurs
 */
public void truncateTable(final TableName tableName, final boolean preserveSplits)
    throws IOException {
  executeCallable(new MasterCallable<Void>(getConnection()) {
    @Override
    public Void call(int callTimeout) throws ServiceException {
      TruncateTableRequest req = RequestConverter.buildTruncateTableRequest(
        tableName, preserveSplits);
      master.truncateTable(null, req);
      return null;
    }
  });
}
 
開發者ID:shenli-uiuc,項目名稱:PyroDB,代碼行數:21,代碼來源:HBaseAdmin.java


注:本文中的org.apache.hadoop.hbase.protobuf.generated.MasterProtos.TruncateTableRequest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。