本文整理汇总了Java中org.apache.hadoop.hdfs.server.common.Storage.STORAGE_TMP_PREVIOUS属性的典型用法代码示例。如果您正苦于以下问题:Java Storage.STORAGE_TMP_PREVIOUS属性的具体用法?Java Storage.STORAGE_TMP_PREVIOUS怎么用?Java Storage.STORAGE_TMP_PREVIOUS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.hadoop.hdfs.server.common.Storage
的用法示例。
在下文中一共展示了Storage.STORAGE_TMP_PREVIOUS属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testStartingWithUpgradeInProgressSucceeds
/**
* Make sure that an HA NN will start if a previous upgrade was in progress.
*/
@Test
public void testStartingWithUpgradeInProgressSucceeds() throws Exception {
MiniDFSCluster cluster = null;
try {
cluster = new MiniDFSCluster.Builder(conf)
.nnTopology(MiniDFSNNTopology.simpleHATopology())
.numDataNodes(0)
.build();
// Simulate an upgrade having started.
for (int i = 0; i < 2; i++) {
for (URI uri : cluster.getNameDirs(i)) {
File prevTmp = new File(new File(uri), Storage.STORAGE_TMP_PREVIOUS);
LOG.info("creating previous tmp dir: " + prevTmp);
assertTrue(prevTmp.mkdirs());
}
}
cluster.restartNameNodes();
} finally {
if (cluster != null) {
cluster.shutdown();
}
}
}