UpgradeThread[] upgradeThreads = new UpgradeThread[sds.size()];
// start to upgrade
for (int i=0; i<upgradeThreads.length; i++) {
final StorageDirectory sd = sds.get(i);
final StorageInfo si = sdsInfo.get(i);
UpgradeThread thread = new UpgradeThread(sd, si, nsInfo);
thread.start();
upgradeThreads[i] = thread;
}
// wait for upgrade to be done
for (UpgradeThread thread : upgradeThreads) {
try {
thread.join();
} catch (InterruptedException e) {
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
}
}
// check for errors