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


Java RegionState.isOpened方法代码示例

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


在下文中一共展示了RegionState.isOpened方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: process

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
@Override
public void process() {
  // Code to defend against case where we get SPLIT before region open
  // processing completes; temporary till we make SPLITs go via zk -- 0.92.
  RegionState regionState = this.assignmentManager.getRegionStates()
    .getRegionTransitionState(regionInfo.getEncodedName());
  boolean openedNodeDeleted = false;
  if (regionState != null && regionState.isOpened()) {
    openedNodeDeleted = deleteOpenedNode(expectedVersion);
    if (!openedNodeDeleted) {
      LOG.error("Znode of region " + regionInfo.getShortNameToLog() + " could not be deleted.");
    }
  } else {
    LOG.warn("Skipping the onlining of " + regionInfo.getShortNameToLog() +
      " because regions is NOT in RIT -- presuming this is because it SPLIT");
  }
  if (!openedNodeDeleted) {
    if (this.assignmentManager.getZKTable().isDisablingOrDisabledTable(regionInfo.getTable())) {
      debugLog(regionInfo, "Opened region "
          + regionInfo.getShortNameToLog() + " but "
          + "this table is disabled, triggering close of region");
      assignmentManager.unassign(regionInfo);
    }
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:26,代码来源:OpenedRegionHandler.java

示例2: process

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
@Override
public void process() {
  // Code to defend against case where we get SPLIT before region open
  // processing completes; temporary till we make SPLITs go via zk -- 0.92.
  RegionState regionState = this.assignmentManager.getRegionStates()
    .getRegionTransitionState(regionInfo.getEncodedName());
  boolean openedNodeDeleted = false;
  if (regionState != null && regionState.isOpened()) {
    openedNodeDeleted = deleteOpenedNode(expectedVersion);
    if (!openedNodeDeleted) {
      LOG.error("Znode of region " + regionInfo.getShortNameToLog() + " could not be deleted.");
    }
  } else {
    LOG.warn("Skipping the onlining of " + regionInfo.getShortNameToLog() +
      " because regions is NOT in RIT -- presuming this is because it SPLIT");
  }
  if (!openedNodeDeleted) {
    if (this.assignmentManager.getTableStateManager().isTableState(regionInfo.getTable(),
      ZooKeeperProtos.Table.State.DISABLED, ZooKeeperProtos.Table.State.DISABLING)) {
      debugLog(regionInfo, "Opened region "
          + regionInfo.getShortNameToLog() + " but "
          + "this table is disabled, triggering close of region");
      assignmentManager.unassign(regionInfo);
    }
  }
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:27,代码来源:OpenedRegionHandler.java

示例3: commitOpenOnMasterSide

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
@Override
public boolean commitOpenOnMasterSide(AssignmentManager assignmentManager,
                                      HRegionInfo regionInfo,
                                      OpenRegionDetails ord) {
  boolean committedSuccessfully = true;

  // Code to defend against case where we get SPLIT before region open
  // processing completes; temporary till we make SPLITs go via zk -- 0.92.
  RegionState regionState = assignmentManager.getRegionStates()
    .getRegionTransitionState(regionInfo.getEncodedName());
  boolean openedNodeDeleted = false;
  if (regionState != null && regionState.isOpened()) {
    openedNodeDeleted = deleteOpenedNode(regionInfo, ord);
    if (!openedNodeDeleted) {
      LOG.error("Znode of region " + regionInfo.getShortNameToLog() + " could not be deleted.");
    }
  } else {
    LOG.warn("Skipping the onlining of " + regionInfo.getShortNameToLog() +
      " because regions is NOT in RIT -- presuming this is because it SPLIT");
  }
  if (!openedNodeDeleted) {
    if (assignmentManager.getTableStateManager().isTableState(regionInfo.getTable(),
        ZooKeeperProtos.Table.State.DISABLED, ZooKeeperProtos.Table.State.DISABLING)) {
      debugLog(regionInfo, "Opened region "
        + regionInfo.getShortNameToLog() + " but "
        + "this table is disabled, triggering close of region");
      committedSuccessfully = false;
    }
  }

  return committedSuccessfully;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:33,代码来源:ZkOpenRegionCoordination.java

示例4: getMetaRegionLocation

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
/**
 * Gets the meta region location, if available.  Does not block.
 * @param zkw zookeeper connection to use
 * @return server name or null if we failed to get the data.
 */
public ServerName getMetaRegionLocation(final ZooKeeperWatcher zkw) {
  try {
    RegionState state = getMetaRegionState(zkw);
    return state.isOpened() ? state.getServerName() : null;
  } catch (KeeperException ke) {
    return null;
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:14,代码来源:MetaTableLocator.java

示例5: getMetaRegionLocation

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
/**
 * Gets the meta region location, if available.  Does not block.
 * @param zkw zookeeper connection to use
 * @return server name or null if we failed to get the data.
 */
@Nullable
public ServerName getMetaRegionLocation(final ZooKeeperWatcher zkw) {
  try {
    RegionState state = getMetaRegionState(zkw);
    return state.isOpened() ? state.getServerName() : null;
  } catch (KeeperException ke) {
    return null;
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:15,代码来源:MetaTableLocator.java

示例6: getReopenStatus

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
/**
 * Used by the client (via master) to identify if all regions have the schema updates
 *
 * @param tableName
 * @return Pair indicating the status of the alter command (pending/total)
 * @throws IOException
 */
public Pair<Integer, Integer> getReopenStatus(TableName tableName) {
  if (isTableDisabled(tableName)) return new Pair<Integer, Integer>(0, 0);

  final List<RegionState> states = regionStates.getTableRegionStates(tableName);
  int ritCount = 0;
  for (RegionState regionState: states) {
    if (!regionState.isOpened()) ritCount++;
  }
  return new Pair<Integer, Integer>(ritCount, states.size());
}
 
开发者ID:apache,项目名称:hbase,代码行数:18,代码来源:AssignmentManager.java

示例7: getMetaRegionLocation

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
/**
 * Gets the meta region location, if available.  Does not block.
 * @param zkw zookeeper connection to use
 * @return server name or null if we failed to get the data.
 */
public ServerName getMetaRegionLocation(final ZKWatcher zkw) {
  try {
    RegionState state = getMetaRegionState(zkw);
    return state.isOpened() ? state.getServerName() : null;
  } catch (KeeperException ke) {
    return null;
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:14,代码来源:MetaTableLocator.java

示例8: process

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
@Override
public void process() {
  // Code to defend against case where we get SPLIT before region open
  // processing completes; temporary till we make SPLITs go via zk -- 0.92.
  RegionState regionState = this.assignmentManager.getRegionStates()
    .getRegionTransitionState(regionInfo.getEncodedName());
  boolean openedNodeDeleted = false;
  if (regionState != null && regionState.isOpened()) {
    openedNodeDeleted = deleteOpenedNode(expectedVersion);
    if (!openedNodeDeleted) {
      LOG.error("The znode of region " + regionInfo.getRegionNameAsString()
          + " could not be deleted.");
    }
  } else {
    LOG.warn("Skipping the onlining of " + regionInfo.getRegionNameAsString() +
      " because regions is NOT in RIT -- presuming this is because it SPLIT");
  }
  if (!openedNodeDeleted) {
    if (this.assignmentManager.getZKTable().isDisablingOrDisabledTable(
        regionInfo.getTableNameAsString())) {
      debugLog(regionInfo, "Opened region "
          + regionInfo.getRegionNameAsString() + " but "
          + "this table is disabled, triggering close of region");
      assignmentManager.unassign(regionInfo);
    }
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:28,代码来源:OpenedRegionHandler.java


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