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


Java FSEditLogTestUtil.createTempEditsFile方法代码示例

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


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

示例1: testGetInputStreamNoValidationNoCheckLastTxId

import org.apache.hadoop.hdfs.server.namenode.FSEditLogTestUtil; //导入方法依赖的package包/类
@Test
public void testGetInputStreamNoValidationNoCheckLastTxId() throws Exception {
  setupTest("test-get-input-stream-no-validation-no-check-last-txid");
  File tempEditsFile = FSEditLogTestUtil.createTempEditsFile(
      "test-get-input-stream-with-validation");
  try {
    EditLogOutputStream bkeos = bkjm.startLogSegment(1);
    EditLogOutputStream elfos =
        new EditLogFileOutputStream(tempEditsFile, null);
    elfos.create();
    FSEditLogTestUtil.populateStreams(1, 100, bkeos, elfos);
    EditLogInputStream bkeis =
        getJournalInputStreamDontCheckLastTxId(bkjm, 1);
    EditLogInputStream elfis = new EditLogFileInputStream(tempEditsFile);
    Map<String, EditLogInputStream> streamByName =
        ImmutableMap.of("BookKeeper", bkeis, "File", elfis);
    FSEditLogTestUtil.assertStreamsAreEquivalent(100, streamByName);
  } finally {
    if (!tempEditsFile.delete()) {
      LOG.warn("Unable to delete edits file: " +
          tempEditsFile.getAbsolutePath());
    }
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:25,代码来源:TestBookKeeperJournalManager.java

示例2: setUp

import org.apache.hadoop.hdfs.server.namenode.FSEditLogTestUtil; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();

  // Remember the size of the flush buffer so that we can reset it
  // in tearDown() in case any of the tests alter it
  origSizeFlushBuffer = FSEditLog.sizeFlushBuffer;

  // Create a temp file to use for comparison of BookKeeper based
  // input stream and the file based input stream
  tempEditsFile = FSEditLogTestUtil.createTempEditsFile(
      "testBookKeeperEditLogInputStream");
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:14,代码来源:TestBookKeeperEditLogInputStream.java

示例3: testGetInputStreamWithValidation

import org.apache.hadoop.hdfs.server.namenode.FSEditLogTestUtil; //导入方法依赖的package包/类
@Test
public void testGetInputStreamWithValidation() throws Exception {
  setupTest("test-get-input-stream-with-validation");
  File tempEditsFile = FSEditLogTestUtil.createTempEditsFile(
      "test-get-input-stream-with-validation");
  try {
    TestBKJMInjectionHandler h = new TestBKJMInjectionHandler();
    InjectionHandler.set(h);
    EditLogOutputStream bkeos = bkjm.startLogSegment(1);
    EditLogOutputStream elfos =
        new EditLogFileOutputStream(tempEditsFile, null);
    elfos.create();
    FSEditLogTestUtil.populateStreams(1, 100, bkeos, elfos);
    EditLogInputStream bkeis =
        FSEditLogTestUtil.getJournalInputStream(bkjm, 1, true);
    EditLogInputStream elfis = new EditLogFileInputStream(tempEditsFile);
    Map<String, EditLogInputStream> streamByName =
        ImmutableMap.of("BookKeeper", bkeis, "File", elfis);
    FSEditLogTestUtil.assertStreamsAreEquivalent(100, streamByName);
    assertNotNull("Log was validated", h.logValidation);
    assertEquals("numTrasactions validated correctly",
        100, h.logValidation.getNumTransactions());
    assertEquals("endTxId validated correctly",
        100, h.logValidation.getEndTxId());
  } finally {
    if (!tempEditsFile.delete()) {
      LOG.warn("Unable to delete edits file: " +
          tempEditsFile.getAbsolutePath());
    }
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:32,代码来源:TestBookKeeperJournalManager.java

示例4: setUp

import org.apache.hadoop.hdfs.server.namenode.FSEditLogTestUtil; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  tempEditsFile = FSEditLogTestUtil.createTempEditsFile(
      "testBookKeeperEditLogOutputStream");
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:7,代码来源:TestBookKeeperEditLogOutputStream.java


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