| | |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2016 ForgeRock AS. |
| | | * Portions Copyright 2025 3A Systems LLC. |
| | | */ |
| | | package org.opends.server.replication.service; |
| | | |
| | |
| | | import java.util.Map.Entry; |
| | | import java.util.Set; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.TimeoutException; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | |
| | | protected volatile long generationId; |
| | | |
| | | /** |
| | | * Thread pool for export thread tasks |
| | | */ |
| | | private final ExecutorService exportThreadPool = Executors.newCachedThreadPool(); |
| | | |
| | | /** |
| | | * Returns the {@link CSNGenerator} that will be used to |
| | | * generate {@link CSN} for this domain. |
| | | * |
| | |
| | | // Do this work in a thread to allow replay thread continue working |
| | | ExportThread exportThread = new ExportThread( |
| | | initReqMsg.getSenderID(), initReqMsg.getInitWindow()); |
| | | exportThread.start(); |
| | | exportThreadPool.execute(() -> { |
| | | Thread.currentThread().setName(exportThread.getName()); |
| | | exportThread.run(); |
| | | }); |
| | | } |
| | | } |
| | | |
| | |
| | | This server is not the initiator of the export so there is |
| | | nothing more to do locally. |
| | | */ |
| | | if (logger.isTraceEnabled()) { |
| | | logger.trace(LocalizableMessage.raw("[IE] got exception" + getName()), de); |
| | | } |
| | | } |
| | | |
| | | if (logger.isTraceEnabled()) |
| | |
| | | { |
| | | broker.stop(); |
| | | } |
| | | try { |
| | | exportThreadPool.shutdown(); |
| | | boolean timedOut = exportThreadPool.awaitTermination(100, TimeUnit.SECONDS); |
| | | logger.info(LocalizableMessage.raw("export pool termination timed out: " + timedOut)); |
| | | } catch (InterruptedException e) { |
| | | // Give up waiting. |
| | | } |
| | | |
| | | // Stop the listener thread |
| | | if (listenerThread != null) |