Source:
void start() throws InterruptedException { long startTimeMs = time.milliseconds(); try { File mountPath = new File(disk.getMountPath()); if (mountPath.exists()) { List<Thread> startupThreads = new ArrayList<>(); final AtomicInteger numFailures = new AtomicInteger(0); for (final Map.Entry<PartitionId, BlobStore> partitionAndStore : stores.entrySet()) { Thread thread = Utils.newThread("store-startup-" + partitionAndStore.getKey(), () -> { try { partitionAndStore.getValue().start(); } catch (Exception e) { numFailures.incrementAndGet(); metrics.totalStoreStartFailures.inc(); logger.error("Exception while starting store for the partition" + partitionAndStore.getKey(), e); } }, false); thread.start(); startupThreads.add(thread); } for (Thread startupThread : startupThreads) { startupThread.join(); } if (numFailures.get() > 0) { logger.error( "Could not start " + numFailures.get() + " out of " + stores.size() + " stores on the disk " + disk); } ; try { List<DiskSpaceRequirements> requirementsList = new ArrayList<>(); for (BlobStore blobStore : stores.values()) { DiskSpaceRequirements requirements = blobStore.getDiskSpaceRequirements(); if (requirements != null) { requirementsList.add(requirements); } } diskSpaceAllocator.initializePool(requirementsList); } catch (StoreException e) { logger.error("Error while starting DiskSpaceAllocator", e); } compactionManager.enable(); } else { metrics.diskMountPathFailures.inc(); metrics.totalStoreStartFailures.inc(stores.size()); logger.error("Mount path does not exist: " + mountPath + " ; cannot start stores on this disk"); } } finally { metrics.diskStartTimeMs.update(time.milliseconds() - startTimeMs); } }

Target:
void start() throws InterruptedException { long startTimeMs = time.milliseconds(); final AtomicInteger numStoreFailures = new AtomicInteger(0); try { checkMountPathAccessible(); List<Thread> startupThreads = new ArrayList<>(); for (final Map.Entry<PartitionId, BlobStore> partitionAndStore : stores.entrySet()) { Thread thread = Utils.newThread("store-startup-" + partitionAndStore.getKey(), () -> { try { partitionAndStore.getValue().start(); } catch (Exception e) { numStoreFailures.incrementAndGet(); logger.error("Exception while starting store for the partition" + partitionAndStore.getKey(), e); } }, false); thread.start(); startupThreads.add(thread); } for (Thread startupThread : startupThreads) { startupThread.join(); } if (numStoreFailures.get() > 0) { logger.error( "Could not start " + numStoreFailures.get() + " out of " + stores.size() + " stores on the disk " + disk); } List<DiskSpaceRequirements> requirementsList = new ArrayList<>(); for (BlobStore blobStore : stores.values()) { if (blobStore.isStarted()) { DiskSpaceRequirements requirements = blobStore.getDiskSpaceRequirements(); if (requirements != null) { requirementsList.add(requirements); } } } diskSpaceAllocator.initializePool(requirementsList); compactionManager.enable(); running = true; } catch (StoreException e) { logger.error("Error while starting the DiskManager for " + disk.getMountPath() + " ; no stores will be accessible on this disk.", e); } finally { if (!running) { metrics.totalStoreStartFailures.inc(stores.size()); metrics.diskDownCount.inc(); } else { metrics.totalStoreStartFailures.inc(numStoreFailures.get()); } metrics.diskStartTimeMs.update(time.milliseconds() - startTimeMs); } }