int numDirs = getNumStorageDirs();
RollbackThread[] rollbackThreads = new RollbackThread[numDirs];
// start to rollback
for (int i=0; i<numDirs; i++) {
final StorageDirectory sd = this.getStorageDir(i);
RollbackThread thread = new RollbackThread(sd, nsInfo, new NameSpaceSliceStorage());
thread.start();
rollbackThreads[i] = thread;
}
// wait for rollback to be done
for (RollbackThread thread : rollbackThreads) {
try {
thread.join();
} catch (InterruptedException e) {
return;
}
}
// check for errors