本文整理汇总了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());
}
}
}
示例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");
}
示例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());
}
}
}
示例4: setUp
import org.apache.hadoop.hdfs.server.namenode.FSEditLogTestUtil; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
super.setUp();
tempEditsFile = FSEditLogTestUtil.createTempEditsFile(
"testBookKeeperEditLogOutputStream");
}