• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java UnassignRegionResponse类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.apache.hadoop.hbase.protobuf.generated.MasterProtos.UnassignRegionResponse的典型用法代码示例。如果您正苦于以下问题:Java UnassignRegionResponse类的具体用法?Java UnassignRegionResponse怎么用?Java UnassignRegionResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

UnassignRegionResponse类属于org.apache.hadoop.hbase.protobuf.generated.MasterProtos包,在下文中一共展示了UnassignRegionResponse类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: unassignRegion

点赞 2

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.UnassignRegionResponse; //导入依赖的package包/类
@Override
public UnassignRegionResponse unassignRegion(RpcController controller,
    UnassignRegionRequest req) throws ServiceException {
  try {
    final byte [] regionName = req.getRegion().getValue().toByteArray();
    RegionSpecifierType type = req.getRegion().getType();
    final boolean force = req.getForce();
    UnassignRegionResponse urr = UnassignRegionResponse.newBuilder().build();

    master.checkInitialized();
    if (type != RegionSpecifierType.REGION_NAME) {
      LOG.warn("unassignRegion specifier type: expected: " + RegionSpecifierType.REGION_NAME
        + " actual: " + type);
    }
    Pair<HRegionInfo, ServerName> pair =
      MetaTableAccessor.getRegion(master.getConnection(), regionName);
    if (pair == null) throw new UnknownRegionException(Bytes.toString(regionName));
    HRegionInfo hri = pair.getFirst();
    if (master.cpHost != null) {
      if (master.cpHost.preUnassign(hri, force)) {
        return urr;
      }
    }
    LOG.debug(master.getClientIdAuditPrefix() + " unassign " + hri.getRegionNameAsString()
        + " in current location if it is online and reassign.force=" + force);
    master.assignmentManager.unassign(hri, force);
    if (master.assignmentManager.getRegionStates().isRegionOffline(hri)) {
      LOG.debug("Region " + hri.getRegionNameAsString()
          + " is not online on any region server, reassigning it.");
      master.assignRegion(hri);
    }
    if (master.cpHost != null) {
      master.cpHost.postUnassign(hri, force);
    }

    return urr;
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
}
 

开发者ID:fengchen8086,
项目名称:ditb,
代码行数:41,
代码来源:MasterRpcServices.java

示例2: unassignRegion

点赞 2

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.UnassignRegionResponse; //导入依赖的package包/类
@Override
public UnassignRegionResponse unassignRegion(RpcController controller, UnassignRegionRequest req)
throws ServiceException {
  try {
    final byte [] regionName = req.getRegion().getValue().toByteArray();
    RegionSpecifierType type = req.getRegion().getType();
    final boolean force = req.getForce();
    UnassignRegionResponse urr = UnassignRegionResponse.newBuilder().build();

    checkInitialized();
    if (type != RegionSpecifierType.REGION_NAME) {
      LOG.warn("unassignRegion specifier type: expected: " + RegionSpecifierType.REGION_NAME
        + " actual: " + type);
    }
    Pair<HRegionInfo, ServerName> pair =
      MetaReader.getRegion(this.catalogTracker, regionName);
    if (pair == null) throw new UnknownRegionException(Bytes.toString(regionName));
    HRegionInfo hri = pair.getFirst();
    if (cpHost != null) {
      if (cpHost.preUnassign(hri, force)) {
        return urr;
      }
    }
    LOG.debug(getClientIdAuditPrefix() + " unassign " + hri.getRegionNameAsString()
        + " in current location if it is online and reassign.force=" + force);
    this.assignmentManager.unassign(hri, force);
    if (this.assignmentManager.getRegionStates().isRegionOffline(hri)) {
      LOG.debug("Region " + hri.getRegionNameAsString()
          + " is not online on any region server, reassigning it.");
      assignRegion(hri);
    }
    if (cpHost != null) {
      cpHost.postUnassign(hri, force);
    }

    return urr;
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
}
 

开发者ID:tenggyut,
项目名称:HIndex,
代码行数:41,
代码来源:HMaster.java

示例3: unassignRegion

点赞 2

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.UnassignRegionResponse; //导入依赖的package包/类
@Override
public UnassignRegionResponse unassignRegion(RpcController controller,
    UnassignRegionRequest req) throws ServiceException {
  try {
    final byte [] regionName = req.getRegion().getValue().toByteArray();
    RegionSpecifierType type = req.getRegion().getType();
    final boolean force = req.getForce();
    UnassignRegionResponse urr = UnassignRegionResponse.newBuilder().build();

    master.checkInitialized();
    if (type != RegionSpecifierType.REGION_NAME) {
      LOG.warn("unassignRegion specifier type: expected: " + RegionSpecifierType.REGION_NAME
        + " actual: " + type);
    }
    Pair<HRegionInfo, ServerName> pair =
      MetaReader.getRegion(master.getCatalogTracker(), regionName);
    if (pair == null) throw new UnknownRegionException(Bytes.toString(regionName));
    HRegionInfo hri = pair.getFirst();
    if (master.cpHost != null) {
      if (master.cpHost.preUnassign(hri, force)) {
        return urr;
      }
    }
    LOG.debug(master.getClientIdAuditPrefix() + " unassign " + hri.getRegionNameAsString()
        + " in current location if it is online and reassign.force=" + force);
    master.assignmentManager.unassign(hri, force);
    if (master.assignmentManager.getRegionStates().isRegionOffline(hri)) {
      LOG.debug("Region " + hri.getRegionNameAsString()
          + " is not online on any region server, reassigning it.");
      master.assignRegion(hri);
    }
    if (master.cpHost != null) {
      master.cpHost.postUnassign(hri, force);
    }

    return urr;
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
}
 

开发者ID:shenli-uiuc,
项目名称:PyroDB,
代码行数:41,
代码来源:MasterRpcServices.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)