|
@@ -96,7 +96,6 @@ public class TestSecurityTokenEditLog extends TestCase {
|
|
cluster.waitActive();
|
|
cluster.waitActive();
|
|
fileSys = cluster.getFileSystem();
|
|
fileSys = cluster.getFileSystem();
|
|
final FSNamesystem namesystem = cluster.getNamesystem();
|
|
final FSNamesystem namesystem = cluster.getNamesystem();
|
|
- namesystem.getDelegationTokenSecretManager().startThreads();
|
|
|
|
|
|
|
|
for (Iterator<URI> it = cluster.getNameDirs().iterator(); it.hasNext(); ) {
|
|
for (Iterator<URI> it = cluster.getNameDirs().iterator(); it.hasNext(); ) {
|
|
File dir = new File(it.next().getPath());
|
|
File dir = new File(it.next().getPath());
|
|
@@ -110,6 +109,7 @@ public class TestSecurityTokenEditLog extends TestCase {
|
|
editLog.setBufferCapacity(2048);
|
|
editLog.setBufferCapacity(2048);
|
|
editLog.close();
|
|
editLog.close();
|
|
editLog.open();
|
|
editLog.open();
|
|
|
|
+ namesystem.getDelegationTokenSecretManager().startThreads();
|
|
|
|
|
|
// Create threads and make them run transactions concurrently.
|
|
// Create threads and make them run transactions concurrently.
|
|
Thread threadId[] = new Thread[NUM_THREADS];
|
|
Thread threadId[] = new Thread[NUM_THREADS];
|
|
@@ -129,13 +129,13 @@ public class TestSecurityTokenEditLog extends TestCase {
|
|
}
|
|
}
|
|
|
|
|
|
editLog.close();
|
|
editLog.close();
|
|
- editLog.open();
|
|
|
|
|
|
|
|
// Verify that we can read in all the transactions that we have written.
|
|
// Verify that we can read in all the transactions that we have written.
|
|
// If there were any corruptions, it is likely that the reading in
|
|
// If there were any corruptions, it is likely that the reading in
|
|
// of these transactions will throw an exception.
|
|
// of these transactions will throw an exception.
|
|
//
|
|
//
|
|
namesystem.getDelegationTokenSecretManager().stopThreads();
|
|
namesystem.getDelegationTokenSecretManager().stopThreads();
|
|
|
|
+ int numKeys = namesystem.getDelegationTokenSecretManager().getNumberOfKeys();
|
|
for (Iterator<StorageDirectory> it =
|
|
for (Iterator<StorageDirectory> it =
|
|
fsimage.dirIterator(NameNodeDirType.EDITS); it.hasNext();) {
|
|
fsimage.dirIterator(NameNodeDirType.EDITS); it.hasNext();) {
|
|
File editFile = FSImage.getImageFile(it.next(), NameNodeFile.EDITS);
|
|
File editFile = FSImage.getImageFile(it.next(), NameNodeFile.EDITS);
|
|
@@ -143,9 +143,9 @@ public class TestSecurityTokenEditLog extends TestCase {
|
|
int numEdits = namesystem.getEditLog().loadFSEdits(
|
|
int numEdits = namesystem.getEditLog().loadFSEdits(
|
|
new EditLogFileInputStream(editFile));
|
|
new EditLogFileInputStream(editFile));
|
|
assertTrue("Verification for " + editFile + " failed. " +
|
|
assertTrue("Verification for " + editFile + " failed. " +
|
|
- "Expected " + (NUM_THREADS * opsPerTrans * NUM_TRANSACTIONS + 2) + " transactions. "+
|
|
|
|
|
|
+ "Expected " + (NUM_THREADS * opsPerTrans * NUM_TRANSACTIONS + numKeys) + " transactions. "+
|
|
"Found " + numEdits + " transactions.",
|
|
"Found " + numEdits + " transactions.",
|
|
- numEdits == NUM_THREADS * opsPerTrans * NUM_TRANSACTIONS +2);
|
|
|
|
|
|
+ numEdits == NUM_THREADS * opsPerTrans * NUM_TRANSACTIONS +numKeys);
|
|
|
|
|
|
}
|
|
}
|
|
} finally {
|
|
} finally {
|