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


Java FSEditLog.setRuntimeForTesting方法代码示例

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


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

示例1: setUp

import org.apache.hadoop.hdfs.server.namenode.FSEditLog; //导入方法依赖的package包/类
public void setUp(Configuration confg, MiniJournalCluster jCluster,
    String name)
    throws Exception {
  LOG.info("START TEST : " + name);
  
  handler = new TestAvatarQJMFailuresHandler();
  InjectionHandler.set(handler);

  FSEditLog.setRuntimeForTesting(Runtime.getRuntime());
  conf = confg;
  if (jCluster == null) {
    cluster = new MiniAvatarCluster.Builder(conf).numDataNodes(1)
        .enableQJM(true).build();
  } else {
    cluster = new MiniAvatarCluster.Builder(conf).numDataNodes(1)
        .enableQJM(true).setJournalCluster(jCluster).build();
  }
  fs = cluster.getFileSystem();
  journalCluster = cluster.getJournalCluster();
  
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:22,代码来源:TestAvatarQJMFailures.java

示例2: processNamenodesForShutdown

import org.apache.hadoop.hdfs.server.namenode.FSEditLog; //导入方法依赖的package包/类
private void processNamenodesForShutdown(Collection<Thread> threads) {
  Runtime runtime = Runtime.getRuntime();
  runtime = spy(runtime);
  doNothing().when(runtime).exit(anyInt());
  FSEditLog.setRuntimeForTesting(runtime);
  for (NameNodeInfo nnInfo : nameNodes) {
    Thread st = new Thread(new ShutDownUtil(nnInfo));
    st.start();
    threads.add(st);
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:12,代码来源:MiniDFSCluster.java

示例3: testJournalClusterFailureWhenRequired

import org.apache.hadoop.hdfs.server.namenode.FSEditLog; //导入方法依赖的package包/类
/**
 * Tests that if the journal cluster is marked as required, we cannot
 * tolerate its failure.
 */
@Test
public void testJournalClusterFailureWhenRequired() throws Exception {
  Configuration conf = new Configuration();
  journalCluster = new MiniJournalCluster.Builder(conf).numJournalNodes(
      3).build();
  String journalURI = journalCluster.getQuorumJournalURI(
      MiniAvatarCluster.JID).toString();
  conf.set("dfs.name.edits.dir.required", journalURI + "/zero," + journalURI
      + "/one");

  setUp(conf, journalCluster, "testJournalClusterFailureWhenRequired");

  // spy the runtime
  Runtime runtime = Runtime.getRuntime();
  runtime = spy(runtime);
  doNothing().when(runtime).exit(anyInt());
  FSEditLog.setRuntimeForTesting(runtime);


  // Kill standby to ensure only 1 runtime.exit();
  cluster.killStandby();
  journalCluster.shutdown();
  fs.create(new Path("/test1"));

  // verify failure.
  verify(runtime, times(1)).exit(anyInt());
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:32,代码来源:TestAvatarQJMFailures.java

示例4: setUp

import org.apache.hadoop.hdfs.server.namenode.FSEditLog; //导入方法依赖的package包/类
public void setUp(String name) throws Exception {
  LOG.info("START TEST : " + name);
  
  handler = new TestAvatarQJMFailuresHandler();
  InjectionHandler.set(handler);

  FSEditLog.setRuntimeForTesting(Runtime.getRuntime());
  conf = new Configuration();
  cluster = new MiniAvatarCluster.Builder(conf).numDataNodes(1)
        .enableQJM(true).build();
  fs = cluster.getFileSystem();
  journalCluster = cluster.getJournalCluster();
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:14,代码来源:TestAvatarQJMFailures2.java

示例5: setUp

import org.apache.hadoop.hdfs.server.namenode.FSEditLog; //导入方法依赖的package包/类
private void setUp(String name) throws Exception {
  LOG.info("------------------- test: " + name + " START ----------------");
  conf = new Configuration();
  conf.setLong("fs.checkpoint.period", 3600);

  cluster = new MiniAvatarCluster(conf, 2, true, null, null);
  fs = cluster.getFileSystem();

  // spy the runtime
  runtime = Runtime.getRuntime();
  runtime = spy(runtime);
  doNothing().when(runtime).exit(anyInt());
  FSEditLog.setRuntimeForTesting(runtime);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:15,代码来源:TestAvatarCheckpointingFailure.java


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