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


Java MiniJournalCluster.createSpyingQJM方法代码示例

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


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

示例1: setup

import org.apache.hadoop.hdfs.qjournal.MiniJournalCluster; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
  conf = new Configuration();
  // Don't retry connections - it just slows down the tests.
  conf.setInt("ipc.client.connect.max.retries", 0);
  conf.setLong(JournalConfigKeys.DFS_QJOURNAL_CONNECT_TIMEOUT_KEY, 100);

  cluster = new MiniJournalCluster.Builder(conf)
      .numJournalNodes(NUM_JOURNALS).build();
  qjm = MiniJournalCluster.createSpyingQJM(conf, cluster);
  qjm.transitionJournal(FAKE_NSINFO, Transition.FORMAT, null);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:13,代码来源:TestQJMRecovery.java

示例2: setup

import org.apache.hadoop.hdfs.qjournal.MiniJournalCluster; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
  conf = new Configuration();
  // Don't retry connections - it just slows down the tests.
  conf.setInt("ipc.client.connect.max.retries", 0);
  conf.setLong(JournalConfigKeys.DFS_QJOURNAL_CONNECT_TIMEOUT_KEY, 100);

  cluster = new MiniJournalCluster.Builder(conf).build();

  qjm = MiniJournalCluster.createSpyingQJM(conf, cluster);
  qjm.transitionJournal(QJMTestUtil.FAKE_NSINFO, Transition.FORMAT, null);
  qjm.recoverUnfinalizedSegments();
  assertEquals(1, qjm.getLoggerSetForTests().getEpoch());
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:15,代码来源:TestQJMWriteRead.java

示例3: testReaderWhileAnotherWritesFinalized

import org.apache.hadoop.hdfs.qjournal.MiniJournalCluster; //导入方法依赖的package包/类
@Test
public void testReaderWhileAnotherWritesFinalized() throws Exception {
  QuorumJournalManager readerQjm = MiniJournalCluster.createSpyingQJM(conf,
      cluster);
  List<EditLogInputStream> streams = Lists.newArrayList();
  readerQjm.selectInputStreams(streams, 0, false, true);
  assertEquals(0, streams.size());
  int numTxns = 10;

  List<FSEditLogOp> txns = new ArrayList<FSEditLogOp>();
  writeRandomSegment(cluster, qjm, 0, numTxns, true, txns);

  readerQjm.selectInputStreams(streams, 0, false, true);
  try {
    assertEquals(1, streams.size());
    // Validate the actual stream contents.
    EditLogInputStream stream = streams.get(0);
    assertEquals(0, stream.getFirstTxId());
    assertEquals(numTxns - 1, stream.getLastTxId());

    verifyEdits(streams, 0, numTxns - 1, txns, false);
    assertNull(stream.readOp());
  } finally {
    IOUtils.cleanup(LOG, streams.toArray(new Closeable[0]));
    streams.clear();
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:28,代码来源:TestQJMWriteRead.java

示例4: testReaderWhileAnotherWritesInProgress

import org.apache.hadoop.hdfs.qjournal.MiniJournalCluster; //导入方法依赖的package包/类
@Test
public void testReaderWhileAnotherWritesInProgress() throws Exception {
  QuorumJournalManager readerQjm = MiniJournalCluster.createSpyingQJM(conf,
      cluster);
  List<EditLogInputStream> streams = Lists.newArrayList();
  readerQjm.selectInputStreams(streams, 0, false, true);
  assertEquals(0, streams.size());
  int numTxns = 10;

  List<FSEditLogOp> txns = new ArrayList<FSEditLogOp>();
  writeRandomSegment(cluster, qjm, 0, numTxns, false, txns);

  // allow in-progress stream
  readerQjm.selectInputStreams(streams, 0, true, false);
  try {
    assertEquals(1, streams.size());
    // Validate the actual stream contents.
    EditLogInputStream stream = streams.get(0);
    assertEquals(0, stream.getFirstTxId());

    // for inprogress, we can read only up to second last one
    assertEquals(numTxns - 2, stream.getLastTxId());

    verifyEdits(streams, 0, numTxns - 1, txns, true);
    assertNull(stream.readOp());
  } finally {
    IOUtils.cleanup(LOG, streams.toArray(new Closeable[0]));
    streams.clear();
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:31,代码来源:TestQJMWriteRead.java

示例5: createSpyingQJM

import org.apache.hadoop.hdfs.qjournal.MiniJournalCluster; //导入方法依赖的package包/类
public static QuorumJournalManager createSpyingQJM(Configuration conf,
    MiniJournalCluster cluster, String JID, NamespaceInfo FAKE_NSINFO)
    throws IOException, URISyntaxException {
  return MiniJournalCluster.createSpyingQJM(conf, cluster);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:6,代码来源:TestQuorumJournalManager.java


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