当前位置: 首页>>代码示例>>Java>>正文


Java CompactionState.MINOR属性代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState.MINOR属性的典型用法代码示例。如果您正苦于以下问题:Java CompactionState.MINOR属性的具体用法?Java CompactionState.MINOR怎么用?Java CompactionState.MINOR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState的用法示例。


在下文中一共展示了CompactionState.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;
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:29,代码来源:CompactionRequest.java

示例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));
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:6,代码来源:HRegion.java

示例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));
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:8,代码来源:HRegion.java

示例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));
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:8,代码来源:HRegion.java

示例5: isMajorCompacting

public static boolean isMajorCompacting(Args args, HBaseAdmin admin, String tableName)
    throws IOException, InterruptedException {
    CompactionState compactionState = admin.getCompactionState(tableName);
    return !(compactionState == CompactionState.NONE || compactionState == CompactionState.MINOR);
}
 
开发者ID:kakao,项目名称:hbase-tools,代码行数:5,代码来源:CommandAdapter.java


注:本文中的org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState.MINOR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。