/** * Await for any pending finished writes on the children paths. * * @param paths Paths to check. */ void await(GridGgfsPath... paths) { assert paths != null; for (Map.Entry<GridGgfsPath, GridGgfsFileWorker> workerEntry : workerMap.entrySet()) { GridGgfsPath workerPath = workerEntry.getKey(); boolean await = false; for (GridGgfsPath path : paths) { if (workerPath.isSubDirectoryOf(path) || workerPath.isSame(path)) { await = true; break; } } if (await) { GridGgfsFileWorkerBatch batch = workerEntry.getValue().currentBatch(); if (batch != null) { try { batch.awaitIfFinished(); } catch (GridException ignore) { // No-op. } } } } }
/** * Await for any pending finished writes on the children paths. * * @param paths Paths to check. */ void await(GridGgfsPath... paths) { assert paths != null; for (Map.Entry<GridGgfsPath, GridGgfsFileWorker> workerEntry : workerMap.entrySet()) { GridGgfsPath workerPath = workerEntry.getKey(); boolean await = false; for (GridGgfsPath path : paths) { if (workerPath.isSubDirectoryOf(path) || workerPath.isSame(path)) { await = true; break; } } if (await) { GridGgfsFileWorkerBatch batch = workerEntry.getValue().currentBatch(); if (batch != null) { try { batch.awaitIfFinished(); } catch (GridException ignore) { // No-op. } } } } }