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


Java YouAreDeadException类代码示例

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


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

示例1: regionServerReport

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
void regionServerReport(ServerName sn,
    ServerLoad sl) throws YouAreDeadException {
  checkIsDead(sn, "REPORT");
  if (null == this.onlineServers.replace(sn, sl)) {
    // Already have this host+port combo and its just different start code?
    // Just let the server in. Presume master joining a running cluster.
    // recordNewServer is what happens at the end of reportServerStartup.
    // The only thing we are skipping is passing back to the regionserver
    // the ServerName to use. Here we presume a master has already done
    // that so we'll press on with whatever it gave us for ServerName.
    if (!checkAndRecordNewServer(sn, sl)) {
      LOG.info("RegionServerReport ignored, could not record the server: " + sn);
      return; // Not recorded, so no need to move on
    }
  }
  updateLastFlushedSequenceIds(sn, sl);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:ServerManager.java

示例2: checkIsDead

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
/**
 * If this server is on the dead list, reject it with a YouAreDeadException.
 * If it was dead but came back with a new start code, remove the old entry
 * from the dead list.
 * @param serverName
 * @param what START or REPORT
 * @throws org.apache.hadoop.hbase.YouAreDeadException
 */
private void checkIsDead(final ServerName serverName, final String what)
    throws YouAreDeadException {
  if (this.deadservers.isDeadServer(serverName)) {
    // host name, port and start code all match with existing one of the
    // dead servers. So, this server must be dead.
    String message = "Server " + what + " rejected; currently processing " +
        serverName + " as dead server";
    LOG.debug(message);
    throw new YouAreDeadException(message);
  }
  // remove dead server with same hostname and port of newly checking in rs after master
  // initialization.See HBASE-5916 for more information.
  if ((this.services == null || ((HMaster) this.services).isInitialized())
      && this.deadservers.cleanPreviousInstance(serverName)) {
    // This server has now become alive after we marked it as dead.
    // We removed it's previous entry from the dead list to reflect it.
    LOG.debug(what + ":" + " Server " + serverName + " came back up," +
        " removed it from the dead servers list");
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:29,代码来源:ServerManager.java

示例3: regionServerReport

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
void regionServerReport(ServerName sn, HServerLoad hsl)
throws YouAreDeadException, PleaseHoldException {
  checkIsDead(sn, "REPORT");
  if (!this.onlineServers.containsKey(sn)) {
    // Already have this host+port combo and its just different start code?
    checkAlreadySameHostPort(sn);
    // Just let the server in. Presume master joining a running cluster.
    // recordNewServer is what happens at the end of reportServerStartup.
    // The only thing we are skipping is passing back to the regionserver
    // the ServerName to use. Here we presume a master has already done
    // that so we'll press on with whatever it gave us for ServerName.
    recordNewServer(sn, hsl);
  } else {
    this.onlineServers.put(sn, hsl);
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:17,代码来源:ServerManager.java

示例4: checkIsDead

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
/**
 * If this server is on the dead list, reject it with a YouAreDeadException.
 * If it was dead but came back with a new start code, remove the old entry
 * from the dead list.
 * @param serverName
 * @param what START or REPORT
 * @throws YouAreDeadException
 */
private void checkIsDead(final ServerName serverName, final String what)
    throws YouAreDeadException {
  if (this.deadservers.isDeadServer(serverName)) {
    // host name, port and start code all match with existing one of the
    // dead servers. So, this server must be dead.
    String message = "Server " + what + " rejected; currently processing " +
        serverName + " as dead server";
    LOG.debug(message);
    throw new YouAreDeadException(message);
  }

  // remove dead server with same hostname and port of newly checking in rs after master
  // initialization.See HBASE-5916 for more information.
  if ((this.services == null || ((HMaster) this.services).isInitialized())
      && this.deadservers.cleanPreviousInstance(serverName)) {
    // This server has now become alive after we marked it as dead.
    // We removed it's previous entry from the dead list to reflect it.
    LOG.debug(what + ":" + " Server " + serverName + " came back up," +
        " removed it from the dead servers list");
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:30,代码来源:ServerManager.java

示例5: tryRegionServerReport

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
void tryRegionServerReport() throws IOException {
  if (!keepLooping() && hbaseMaster == null) {
    // the current server is stopping
    return;
  }
  HServerLoad hsl = buildServerLoad();
  // Why we do this?
  this.requestCount.set(0);
  try {
    this.hbaseMaster.regionServerReport(this.serverNameFromMasterPOV.getVersionedBytes(), hsl);
  } catch (IOException ioe) {
    if (ioe instanceof RemoteException) {
      ioe = ((RemoteException) ioe).unwrapRemoteException();
    }
    if (ioe instanceof YouAreDeadException) {
      // This will be caught and handled as a fatal error in run()
      throw ioe;
    }
    // Couldn't connect to the master, get location from zk and reconnect
    // Method blocks until new master is found or we are stopped
    getMaster();
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:24,代码来源:HRegionServer.java

示例6: tryRegionServerReport

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
void tryRegionServerReport()
throws IOException {
  if (!keepLooping() && hbaseMaster == null) {
    // the current server is stopping
    return;
  }
  HServerLoad hsl = buildServerLoad();
  // Why we do this?
  this.requestCount.set(0);
  try {
    this.hbaseMaster.regionServerReport(this.serverNameFromMasterPOV.getVersionedBytes(), hsl);
  } catch (IOException ioe) {
    if (ioe instanceof RemoteException) {
      ioe = ((RemoteException)ioe).unwrapRemoteException();
    }
    if (ioe instanceof YouAreDeadException) {
      // This will be caught and handled as a fatal error in run()
      throw ioe;
    }
    // Couldn't connect to the master, get location from zk and reconnect
    // Method blocks until new master is found or we are stopped
    getMaster();
  }
}
 
开发者ID:wanhao,项目名称:IRIndex,代码行数:25,代码来源:HRegionServer.java

示例7: regionServerReport

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
@VisibleForTesting
public void regionServerReport(ServerName sn,
    ServerLoad sl) throws YouAreDeadException {
  checkIsDead(sn, "REPORT");
  if (null == this.onlineServers.replace(sn, sl)) {
    // Already have this host+port combo and its just different start code?
    // Just let the server in. Presume master joining a running cluster.
    // recordNewServer is what happens at the end of reportServerStartup.
    // The only thing we are skipping is passing back to the regionserver
    // the ServerName to use. Here we presume a master has already done
    // that so we'll press on with whatever it gave us for ServerName.
    if (!checkAndRecordNewServer(sn, sl)) {
      LOG.info("RegionServerReport ignored, could not record the server: " + sn);
      return; // Not recorded, so no need to move on
    }
  }
  updateLastFlushedSequenceIds(sn, sl);
}
 
开发者ID:apache,项目名称:hbase,代码行数:19,代码来源:ServerManager.java

示例8: checkIsDead

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
/**
 * If this server is on the dead list, reject it with a YouAreDeadException.
 * If it was dead but came back with a new start code, remove the old entry
 * from the dead list.
 * @param serverName
 * @param what START or REPORT
 * @throws org.apache.hadoop.hbase.YouAreDeadException
 */
private void checkIsDead(final ServerName serverName, final String what)
    throws YouAreDeadException {
  if (this.deadservers.isDeadServer(serverName)) {
    // host name, port and start code all match with existing one of the
    // dead servers. So, this server must be dead.
    String message = "Server " + what + " rejected; currently processing " +
        serverName + " as dead server";
    LOG.debug(message);
    throw new YouAreDeadException(message);
  }
  // remove dead server with same hostname and port of newly checking in rs after master
  // initialization.See HBASE-5916 for more information.
  if ((this.master == null || this.master.isInitialized())
      && this.deadservers.cleanPreviousInstance(serverName)) {
    // This server has now become alive after we marked it as dead.
    // We removed it's previous entry from the dead list to reflect it.
    LOG.debug(what + ":" + " Server " + serverName + " came back up," +
        " removed it from the dead servers list");
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:29,代码来源:ServerManager.java

示例9: testReportRSWithWrongRegion

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
@Test(timeout = 120000)
public void testReportRSWithWrongRegion() throws Exception {
  final TableName tableName = TableName.valueOf(this.name.getMethodName());

  List<HRegionInfo> tableRegions = createTable(tableName);

  final ServerName sn = ServerName.parseVersionedServerName(
      ServerName.valueOf("1.example.org", 1, System.currentTimeMillis()).getVersionedBytes());

  // make fake request with a region assigned to different RS
  RegionServerStatusProtos.RegionServerReportRequest.Builder request =
      makeRSReportRequestWithRegions(sn, tableRegions.get(1));

  // sending fake request to master
  // TODO: replace YouAreDeadException with appropriate exception as and when necessary
  exception.expect(ServiceException.class);
  exception.expectCause(isA(YouAreDeadException.class));
  RegionServerStatusProtos.RegionServerReportResponse response =
      master.getMasterRpcServices().regionServerReport(null, request.build());
}
 
开发者ID:apache,项目名称:hbase,代码行数:21,代码来源:TestRogueRSAssignment.java

示例10: checkIsDead

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
/**
 * If this server is on the dead list, reject it with a YouAreDeadException.
 * If it was dead but came back with a new start code, remove the old entry
 * from the dead list.
 * @param serverName
 * @param what START or REPORT
 * @throws YouAreDeadException
 */
private void checkIsDead(final ServerName serverName, final String what)
    throws YouAreDeadException {
  if (this.deadservers.isDeadServer(serverName)) {
    // host name, port and start code all match with existing one of the
    // dead servers. So, this server must be dead.
    String message = "Server " + what + " rejected; currently processing " +
        serverName + " as dead server";
    LOG.debug(message);
    throw new YouAreDeadException(message);
  }

  if (this.deadservers.cleanPreviousInstance(serverName)) {
    // This server has now become alive after we marked it as dead.
    // We removed it's previous entry from the dead list to reflect it.
    LOG.debug(what + ":" + " Server " + serverName + " came back up," +
        " removed it from the dead servers list");
  }
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:27,代码来源:ServerManager.java

示例11: tryRegionServerReport

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
void tryRegionServerReport()
throws IOException {
  HServerLoad hsl = buildServerLoad();
  // Why we do this?
  this.requestCount.set(0);
  try {
    this.hbaseMaster.regionServerReport(this.serverNameFromMasterPOV.getVersionedBytes(), hsl);
  } catch (IOException ioe) {
    if (ioe instanceof RemoteException) {
      ioe = ((RemoteException)ioe).unwrapRemoteException();
    }
    if (ioe instanceof YouAreDeadException) {
      // This will be caught and handled as a fatal error in run()
      throw ioe;
    }
    // Couldn't connect to the master, get location from zk and reconnect
    // Method blocks until new master is found or we are stopped
    getMaster();
  }
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:21,代码来源:HRegionServer.java

示例12: regionServerReport

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
void regionServerReport(ServerName sn,
    ServerLoad sl) throws YouAreDeadException {
  checkIsDead(sn, "REPORT");
  if (!this.onlineServers.containsKey(sn)) {
    // Already have this host+port combo and its just different start code?
    // Just let the server in. Presume master joining a running cluster.
    // recordNewServer is what happens at the end of reportServerStartup.
    // The only thing we are skipping is passing back to the regionserver
    // the ServerName to use. Here we presume a master has already done
    // that so we'll press on with whatever it gave us for ServerName.
    if (!checkAlreadySameHostPortAndRecordNewServer(sn, sl)) {
      LOG.info("RegionServerReport ignored, could not record the sever: " + sn);
      return; // Not recorded, so no need to move on
    }
  } else {
    this.onlineServers.put(sn, sl);
  }
  updateLastFlushedSequenceIds(sn, sl);
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:20,代码来源:ServerManager.java

示例13: regionServerReport

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
void regionServerReport(ServerName sn, ServerLoad sl)
throws YouAreDeadException, PleaseHoldException {
  checkIsDead(sn, "REPORT");
  if (!this.onlineServers.containsKey(sn)) {
    // Already have this host+port combo and its just different start code?
    checkAlreadySameHostPort(sn);
    // Just let the server in. Presume master joining a running cluster.
    // recordNewServer is what happens at the end of reportServerStartup.
    // The only thing we are skipping is passing back to the regionserver
    // the ServerName to use. Here we presume a master has already done
    // that so we'll press on with whatever it gave us for ServerName.
    recordNewServer(sn, sl);
  } else {
    this.onlineServers.put(sn, sl);
  }
  updateLastFlushedSequenceIds(sn, sl);
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:18,代码来源:ServerManager.java

示例14: checkIsDead

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
/**
 * If this server is on the dead list, reject it with a YouAreDeadException.
 * If it was dead but came back with a new start code, remove the old entry
 * from the dead list.
 * @param serverName
 * @param what START or REPORT
 * @throws YouAreDeadException
 */
private void checkIsDead(final ServerName serverName, final String what)
    throws YouAreDeadException {
  if (this.deadservers.isDeadServer(serverName)) {
    // host name, port and start code all match with existing one of the
    // dead servers. So, this server must be dead.
    String message = "Server " + what + " rejected; currently processing " +
        serverName + " as dead server";
    LOG.debug(message);
    throw new YouAreDeadException(message);
  }
  // remove dead server with same hostname and port of newly checking in rs after master
  // initialization.See HBASE-5916 for more information.
  if ((this.services == null || ((HMaster) this.services).isInitialized())
      && this.deadservers.cleanPreviousInstance(serverName)) {
    // This server has now become alive after we marked it as dead.
    // We removed it's previous entry from the dead list to reflect it.
    LOG.debug(what + ":" + " Server " + serverName + " came back up," +
        " removed it from the dead servers list");
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:29,代码来源:ServerManager.java

示例15: tryRegionServerReport

import org.apache.hadoop.hbase.YouAreDeadException; //导入依赖的package包/类
void tryRegionServerReport(long reportStartTime, long reportEndTime)
throws IOException {
  HBaseProtos.ServerLoad sl = buildServerLoad(reportStartTime, reportEndTime);
  try {
    RegionServerReportRequest.Builder request = RegionServerReportRequest.newBuilder();
    ServerName sn = ServerName.parseVersionedServerName(
      this.serverNameFromMasterPOV.getVersionedBytes());
    request.setServer(ProtobufUtil.toServerName(sn));
    request.setLoad(sl);
    this.hbaseMaster.regionServerReport(null, request.build());
  } catch (ServiceException se) {
    IOException ioe = ProtobufUtil.getRemoteException(se);
    if (ioe instanceof YouAreDeadException) {
      // This will be caught and handled as a fatal error in run()
      throw ioe;
    }
    // Couldn't connect to the master, get location from zk and reconnect
    // Method blocks until new master is found or we are stopped
    getMaster();
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:22,代码来源:HRegionServer.java


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