| | |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * Copyright 2015 ForgeRock AS. |
| | | * Copyright 2015-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.backends.pluggable; |
| | | |
| | |
| | | newThreadFactory(null, SORTER_THREAD_NAME, true)); |
| | | final LDIFReaderSource source = |
| | | new LDIFReaderSource(rootContainer, importConfig, PHASE1_IMPORTER_THREAD_NAME, threadCount); |
| | | final File tempDir = prepareTempDir(backendCfg, importConfig.getTmpDirectory()); |
| | | try (final Importer dbStorage = rootContainer.getStorage().startImport(); |
| | | final BufferPool bufferPool = new BufferPool(nbBuffer, bufferSize)) |
| | | { |
| | | final File tempDir = prepareTempDir(backendCfg, importConfig.getTmpDirectory()); |
| | | final Collection<EntryContainer> entryContainers = rootContainer.getEntryContainers(); |
| | | final AbstractTwoPhaseImportStrategy importStrategy = importConfig.getSkipDNValidation() |
| | | ? new SortAndImportWithoutDNValidation(entryContainers, dbStorage, tempDir, bufferPool, sorter) |
| | |
| | | finally |
| | | { |
| | | sorter.shutdown(); |
| | | recursiveDelete(tempDir); |
| | | } |
| | | logger.info(NOTE_IMPORT_PHASE_STATS, importer.getTotalTimeInMillis() / 1000, importer.getPhaseOneTimeInMillis() |
| | | / 1000, importer.getPhaseTwoTimeInMillis() / 1000); |
| | |
| | | final int threadCount = Runtime.getRuntime().availableProcessors(); |
| | | final int nbBuffer = 2 * indexesToRebuild.size() * threadCount; |
| | | final int bufferSize = computeBufferSize(nbBuffer, availableMemory); |
| | | final File tempDir = prepareTempDir(backendCfg, tmpDirectory); |
| | | |
| | | final ExecutorService sorter = Executors.newFixedThreadPool( |
| | | Runtime.getRuntime().availableProcessors(), |
| | | newThreadFactory(null, SORTER_THREAD_NAME, true)); |
| | | |
| | | final OnDiskMergeImporter importer; |
| | | final File tempDir = prepareTempDir(backendCfg, tmpDirectory); |
| | | try (final Importer dbStorage = rootContainer.getStorage().startImport(); |
| | | final BufferPool bufferPool = new BufferPool(nbBuffer, bufferSize)) |
| | | { |
| | |
| | | finally |
| | | { |
| | | sorter.shutdown(); |
| | | recursiveDelete(tempDir); |
| | | } |
| | | |
| | | final long totalTime = importer.getTotalTimeInMillis(); |