| | |
| | | InterruptedException, ExecutionException |
| | | { |
| | | this.rootContainer = rootContainer; |
| | | DiskSpaceMonitor tmpMonitor = null; |
| | | DiskSpaceMonitor dbMonitor = null; |
| | | try { |
| | | try |
| | | { |
| | | reader = new LDIFReader(importConfiguration, rootContainer); |
| | |
| | | throw new InitializationException(message, ioe); |
| | | } |
| | | |
| | | DiskSpaceMonitor tmpMonitor = |
| | | tmpMonitor = |
| | | new DiskSpaceMonitor(backendConfiguration.getBackendId() |
| | | + " backend import tmp directory", tempDir, backendConfiguration |
| | | .getDiskLowThreshold(), |
| | |
| | | getFileForPath(backendConfiguration.getDBDirectory()); |
| | | File backendDirectory = |
| | | new File(parentDirectory, backendConfiguration.getBackendId()); |
| | | DiskSpaceMonitor dbMonitor = |
| | | dbMonitor = |
| | | new DiskSpaceMonitor(backendConfiguration.getBackendId() |
| | | + " backend import DB directory", backendDirectory, |
| | | backendConfiguration.getDiskLowThreshold(), backendConfiguration |
| | |
| | | dbMonitor.initializeMonitorProvider(null); |
| | | DirectoryServer.registerMonitorProvider(dbMonitor); |
| | | |
| | | try |
| | | { |
| | | Message message = |
| | | NOTE_JEB_IMPORT_STARTING.get(DirectoryServer.getVersionString(), |
| | | BUILD_ID, REVISION_NUMBER); |
| | |
| | | .get(), reader.getEntriesIgnored(), reader.getEntriesRejected(), |
| | | migratedCount, importTime / 1000, rate); |
| | | logError(message); |
| | | return new LDIFImportResult(reader.getEntriesRead(), reader |
| | | .getEntriesRejected(), reader.getEntriesIgnored()); |
| | | } |
| | | finally |
| | | { |
| | | reader.close(); |
| | | StaticUtils.close(reader); |
| | | if (!skipDNValidation) |
| | | { |
| | | try |
| | | { |
| | | tmpEnv.shutdown(); |
| | | } |
| | | catch (Exception ignored) |
| | | { |
| | | // Do nothing. |
| | | } |
| | | } |
| | | if (tmpMonitor != null) |
| | | { |
| | | DirectoryServer.deregisterMonitorProvider(tmpMonitor); |
| | | DirectoryServer.deregisterMonitorProvider(dbMonitor); |
| | | tmpMonitor.finalizeMonitorProvider(); |
| | | } |
| | | if (dbMonitor != null) |
| | | { |
| | | DirectoryServer.deregisterMonitorProvider(dbMonitor); |
| | | dbMonitor.finalizeMonitorProvider(); |
| | | } |
| | | return new LDIFImportResult(reader.getEntriesRead(), reader |
| | | .getEntriesRejected(), reader.getEntriesIgnored()); |
| | | } |
| | | } |
| | | |
| | | private void recursiveDelete(File dir) |