本文整理汇总了Java中org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription.Type方法的典型用法代码示例。如果您正苦于以下问题:Java SnapshotDescription.Type方法的具体用法?Java SnapshotDescription.Type怎么用?Java SnapshotDescription.Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription
的用法示例。
在下文中一共展示了SnapshotDescription.Type方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: snapshot
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; //导入方法依赖的package包/类
public static void snapshot(Admin admin,
final String snapshotName, final String tableName,
SnapshotDescription.Type type, int numTries) throws IOException {
int tries = 0;
CorruptedSnapshotException lastEx = null;
while (tries++ < numTries) {
try {
admin.snapshot(snapshotName, TableName.valueOf(tableName), type);
return;
} catch (CorruptedSnapshotException cse) {
LOG.warn("Got CorruptedSnapshotException", cse);
lastEx = cse;
}
}
throw lastEx;
}
示例2: getMaxMasterTimeout
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; //导入方法依赖的package包/类
/**
* @param conf {@link Configuration} from which to check for the timeout
* @param type type of snapshot being taken
* @param defaultMaxWaitTime Default amount of time to wait, if none is in the configuration
* @return the max amount of time the master should wait for a snapshot to complete
*/
public static long getMaxMasterTimeout(Configuration conf, SnapshotDescription.Type type,
long defaultMaxWaitTime) {
String confKey;
switch (type) {
case DISABLED:
default:
confKey = MASTER_SNAPSHOT_TIMEOUT_MILLIS;
}
return Math.max(conf.getLong(confKey, defaultMaxWaitTime),
conf.getLong(SNAPSHOT_TIMEOUT_MILLIS_KEY, defaultMaxWaitTime));
}
示例3: snapshot
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription; //导入方法依赖的package包/类
public void snapshot(final String snapshotName,
final String tableName,
SnapshotDescription.Type type) throws IOException, SnapshotCreationException,
IllegalArgumentException {
snapshot(snapshotName, TableName.valueOf(tableName), type);
}