本文整理匯總了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();
}
示例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();
}
示例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;
}
});
}
示例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();
}
示例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();
}
示例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;
}
});
}
示例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;
}
});
}