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


Java Server.abort方法代码示例

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


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

示例1: testFailoverDeadServerCversionChange

import org.apache.hadoop.hbase.Server; //导入方法依赖的package包/类
@Test
public void testFailoverDeadServerCversionChange() throws Exception {
  LOG.debug("testFailoverDeadServerCversionChange");

  conf.setBoolean(HConstants.ZOOKEEPER_USEMULTI, true);
  final Server s0 = new DummyServer("cversion-change0.example.org");
  ReplicationQueues repQueues =
      ReplicationFactory.getReplicationQueues(s0.getZooKeeper(), conf, s0);
  repQueues.init(s0.getServerName().toString());
  // populate some znodes in the peer znode
  files.add("log1");
  files.add("log2");
  for (String file : files) {
    repQueues.addLog("1", file);
  }
  // simulate queue transfer
  Server s1 = new DummyServer("cversion-change1.example.org");
  ReplicationQueues rq1 =
      ReplicationFactory.getReplicationQueues(s1.getZooKeeper(), s1.getConfiguration(), s1);
  rq1.init(s1.getServerName().toString());

  ReplicationQueuesClient client =
      ReplicationFactory.getReplicationQueuesClient(s1.getZooKeeper(), s1.getConfiguration(), s1);

  int v0 = client.getQueuesZNodeCversion();
  rq1.claimQueues(s0.getServerName().getServerName());
  int v1 = client.getQueuesZNodeCversion();
  // cversion should increased by 1 since a child node is deleted
  assertEquals(v0 + 1, v1);

  s0.abort("", null);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:33,代码来源:TestReplicationSourceManager.java

示例2: testClaimQueues

import org.apache.hadoop.hbase.Server; //导入方法依赖的package包/类
@Test
public void testClaimQueues() throws Exception {
  LOG.debug("testNodeFailoverWorkerCopyQueuesFromRSUsingMulti");
  conf.setBoolean(HConstants.ZOOKEEPER_USEMULTI, true);
  final Server server = new DummyServer("hostname0.example.org");
  ReplicationQueues rq =
      ReplicationFactory.getReplicationQueues(server.getZooKeeper(), server.getConfiguration(),
        server);
  rq.init(server.getServerName().toString());
  // populate some znodes in the peer znode
  files.add("log1");
  files.add("log2");
  for (String file : files) {
    rq.addLog("1", file);
  }
  // create 3 DummyServers
  Server s1 = new DummyServer("dummyserver1.example.org");
  Server s2 = new DummyServer("dummyserver2.example.org");
  Server s3 = new DummyServer("dummyserver3.example.org");

  // create 3 DummyNodeFailoverWorkers
  DummyNodeFailoverWorker w1 = new DummyNodeFailoverWorker(
      server.getServerName().getServerName(), s1);
  DummyNodeFailoverWorker w2 = new DummyNodeFailoverWorker(
      server.getServerName().getServerName(), s2);
  DummyNodeFailoverWorker w3 = new DummyNodeFailoverWorker(
      server.getServerName().getServerName(), s3);

  latch = new CountDownLatch(3);
  // start the threads
  w1.start();
  w2.start();
  w3.start();
  // make sure only one is successful
  int populatedMap = 0;
  // wait for result now... till all the workers are done.
  latch.await();
  populatedMap += w1.isLogZnodesMapPopulated() + w2.isLogZnodesMapPopulated()
      + w3.isLogZnodesMapPopulated();
  assertEquals(1, populatedMap);
  server.abort("", null);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:43,代码来源:TestReplicationSourceManager.java

示例3: testNodeFailoverDeadServerParsing

import org.apache.hadoop.hbase.Server; //导入方法依赖的package包/类
@Test
public void testNodeFailoverDeadServerParsing() throws Exception {
  LOG.debug("testNodeFailoverDeadServerParsing");
  conf.setBoolean(HConstants.ZOOKEEPER_USEMULTI, true);
  final Server server = new DummyServer("ec2-54-234-230-108.compute-1.amazonaws.com");
  ReplicationQueues repQueues =
      ReplicationFactory.getReplicationQueues(server.getZooKeeper(), conf, server);
  repQueues.init(server.getServerName().toString());
  // populate some znodes in the peer znode
  files.add("log1");
  files.add("log2");
  for (String file : files) {
    repQueues.addLog("1", file);
  }

  // create 3 DummyServers
  Server s1 = new DummyServer("ip-10-8-101-114.ec2.internal");
  Server s2 = new DummyServer("ec2-107-20-52-47.compute-1.amazonaws.com");
  Server s3 = new DummyServer("ec2-23-20-187-167.compute-1.amazonaws.com");

  // simulate three servers fail sequentially
  ReplicationQueues rq1 =
      ReplicationFactory.getReplicationQueues(s1.getZooKeeper(), s1.getConfiguration(), s1);
  rq1.init(s1.getServerName().toString());
  SortedMap<String, SortedSet<String>> testMap =
      rq1.claimQueues(server.getServerName().getServerName());
  ReplicationQueues rq2 =
      ReplicationFactory.getReplicationQueues(s2.getZooKeeper(), s2.getConfiguration(), s2);
  rq2.init(s2.getServerName().toString());
  testMap = rq2.claimQueues(s1.getServerName().getServerName());
  ReplicationQueues rq3 =
      ReplicationFactory.getReplicationQueues(s3.getZooKeeper(), s3.getConfiguration(), s3);
  rq3.init(s3.getServerName().toString());
  testMap = rq3.claimQueues(s2.getServerName().getServerName());

  ReplicationQueueInfo replicationQueueInfo = new ReplicationQueueInfo(testMap.firstKey());
  List<String> result = replicationQueueInfo.getDeadRegionServers();

  // verify
  assertTrue(result.contains(server.getServerName().getServerName()));
  assertTrue(result.contains(s1.getServerName().getServerName()));
  assertTrue(result.contains(s2.getServerName().getServerName()));

  server.abort("", null);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:46,代码来源:TestReplicationSourceManager.java


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