HBASE-21181 Use the same filesystem for wal archive directory and wal directory
Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
parent
1c8c7e10f8
commit
2c19b04274
|
@ -200,7 +200,8 @@ public class WALProcedureStore extends ProcedureStoreBase {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
this(conf,
|
this(conf,
|
||||||
new Path(CommonFSUtils.getWALRootDir(conf), MASTER_PROCEDURE_LOGDIR),
|
new Path(CommonFSUtils.getWALRootDir(conf), MASTER_PROCEDURE_LOGDIR),
|
||||||
new Path(CommonFSUtils.getRootDir(conf), HConstants.HREGION_OLDLOGDIR_NAME), leaseRecovery);
|
new Path(CommonFSUtils.getWALRootDir(conf), HConstants.HREGION_OLDLOGDIR_NAME),
|
||||||
|
leaseRecovery);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
@ -1189,6 +1190,11 @@ public class WALProcedureStore extends ProcedureStoreBase {
|
||||||
return this.walDir;
|
return this.walDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@VisibleForTesting
|
||||||
|
Path getWalArchiveDir() {
|
||||||
|
return this.walArchiveDir;
|
||||||
|
}
|
||||||
|
|
||||||
public FileSystem getFileSystem() {
|
public FileSystem getFileSystem() {
|
||||||
return this.fs;
|
return this.fs;
|
||||||
}
|
}
|
||||||
|
|
|
@ -898,6 +898,22 @@ public class TestWALProcedureStore {
|
||||||
assertEquals("WALs=" + procStore.getActiveLogs(), 1, procStore.getActiveLogs().size());
|
assertEquals("WALs=" + procStore.getActiveLogs(), 1, procStore.getActiveLogs().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testWALDirAndWALArchiveDir() throws IOException {
|
||||||
|
Configuration conf = htu.getConfiguration();
|
||||||
|
procStore = createWALProcedureStore(conf);
|
||||||
|
assertEquals(procStore.getFileSystem(), procStore.getWalArchiveDir().getFileSystem(conf));
|
||||||
|
}
|
||||||
|
|
||||||
|
private WALProcedureStore createWALProcedureStore(Configuration conf) throws IOException {
|
||||||
|
return new WALProcedureStore(conf, new WALProcedureStore.LeaseRecovery() {
|
||||||
|
@Override
|
||||||
|
public void recoverFileLease(FileSystem fs, Path path) throws IOException {
|
||||||
|
// no-op
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private LoadCounter restartAndAssert(long maxProcId, long runnableCount,
|
private LoadCounter restartAndAssert(long maxProcId, long runnableCount,
|
||||||
int completedCount, int corruptedCount) throws Exception {
|
int completedCount, int corruptedCount) throws Exception {
|
||||||
return ProcedureTestingUtility.storeRestartAndAssert(procStore, maxProcId,
|
return ProcedureTestingUtility.storeRestartAndAssert(procStore, maxProcId,
|
||||||
|
|
Loading…
Reference in New Issue