本文整理汇总了Java中org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState.MAJOR_AND_MINOR属性的典型用法代码示例。如果您正苦于以下问题:Java CompactionState.MAJOR_AND_MINOR属性的具体用法?Java CompactionState.MAJOR_AND_MINOR怎么用?Java CompactionState.MAJOR_AND_MINOR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState
的用法示例。
在下文中一共展示了CompactionState.MAJOR_AND_MINOR属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCompactionState
/**
* Find out if a given region is in compaction now.
*
* @param regionId
* @return a CompactionState
*/
public static CompactionState getCompactionState(
final long regionId) {
Long key = Long.valueOf(regionId);
AtomicInteger major = majorCompactions.get(key);
AtomicInteger minor = minorCompactions.get(key);
int state = 0;
if (minor != null && minor.get() > 0) {
state += 1; // use 1 to indicate minor here
}
if (major != null && major.get() > 0) {
state += 2; // use 2 to indicate major here
}
switch (state) {
case 3: // 3 = 2 + 1, so both major and minor
return CompactionState.MAJOR_AND_MINOR;
case 2:
return CompactionState.MAJOR;
case 1:
return CompactionState.MINOR;
default:
return CompactionState.NONE;
}
}
示例2: getCompactionState
@Override public CompactionState getCompactionState() {
boolean hasMajor = majorInProgress.get() > 0, hasMinor = minorInProgress.get() > 0;
return (hasMajor ?
(hasMinor ? CompactionState.MAJOR_AND_MINOR : CompactionState.MAJOR) :
(hasMinor ? CompactionState.MINOR : CompactionState.NONE));
}
示例3: getCompactionState
/**
* @return if a given region is in compaction now.
*/
public CompactionState getCompactionState() {
boolean hasMajor = majorInProgress.get() > 0, hasMinor = minorInProgress.get() > 0;
return (hasMajor ? (hasMinor ? CompactionState.MAJOR_AND_MINOR : CompactionState.MAJOR)
: (hasMinor ? CompactionState.MINOR : CompactionState.NONE));
}
示例4: getCompactionState
/**
* @return if a given region is in compaction now.
*/
public CompactionState getCompactionState() {
boolean hasMajor = majorInProgress.get() > 0, hasMinor = minorInProgress.get() > 0;
return (hasMajor ? (hasMinor ? CompactionState.MAJOR_AND_MINOR : CompactionState.MAJOR)
: (hasMinor ? CompactionState.MINOR : CompactionState.NONE));
}
示例5: isMajorCompacting
@SuppressWarnings("UnusedParameters")
public static boolean isMajorCompacting(Args args, HBaseAdmin admin, String tableName)
throws IOException, InterruptedException {
CompactionState compactionState = admin.getCompactionState(tableName);
return compactionState == CompactionState.MAJOR_AND_MINOR || compactionState == CompactionState.MAJOR;
}