Search in sources :

Example 1 with ReplicationGroupAdmin

use of com.sleepycat.je.rep.util.ReplicationGroupAdmin in project qpid-broker-j by apache.

the class ReplicatedEnvironmentFacade method createReplicationGroupAdmin.

private ReplicationGroupAdmin createReplicationGroupAdmin() {
    final Set<InetSocketAddress> helpers = new HashSet<InetSocketAddress>();
    final ReplicationConfig repConfig = getEnvironment().getRepConfig();
    helpers.addAll(repConfig.getHelperSockets());
    helpers.add(HostPortPair.getSocket(HostPortPair.getString(repConfig.getNodeHostname(), repConfig.getNodePort())));
    return new ReplicationGroupAdmin(_configuration.getGroupName(), helpers);
}
Also used : ReplicationConfig(com.sleepycat.je.rep.ReplicationConfig) InetSocketAddress(java.net.InetSocketAddress) ReplicationGroupAdmin(com.sleepycat.je.rep.util.ReplicationGroupAdmin) HashSet(java.util.HashSet)

Example 2 with ReplicationGroupAdmin

use of com.sleepycat.je.rep.util.ReplicationGroupAdmin in project qpid-broker-j by apache.

the class BDBHAVirtualHostNodeImpl method onDelete.

@Override
protected ListenableFuture<Void> onDelete() {
    final Set<InetSocketAddress> helpers = getRemoteNodeAddresses();
    return doAfterAlways(closeVirtualHostIfExists(), () -> {
        closeEnvironment();
        DurableConfigurationStore configurationStore = getConfigurationStore();
        if (configurationStore != null) {
            configurationStore.closeConfigurationStore();
            configurationStore.onDelete(BDBHAVirtualHostNodeImpl.this);
            getEventLogger().message(getVirtualHostNodeLogSubject(), HighAvailabilityMessages.DELETE(getName(), String.valueOf(Outcome.SUCCESS)));
        }
        if (!helpers.isEmpty()) {
            try {
                new ReplicationGroupAdmin(_groupName, helpers).removeMember(getName());
            } catch (DatabaseException e) {
                LOGGER.warn(String.format("The deletion of node %s on remote nodes failed due to: %s. To finish deletion a " + "removal of the node from any of remote nodes (%s) is required.", this, e.getMessage(), helpers));
            }
        }
        onCloseOrDelete();
    });
}
Also used : DurableConfigurationStore(org.apache.qpid.server.store.DurableConfigurationStore) InetSocketAddress(java.net.InetSocketAddress) ReplicationGroupAdmin(com.sleepycat.je.rep.util.ReplicationGroupAdmin) DatabaseException(com.sleepycat.je.DatabaseException)

Aggregations

ReplicationGroupAdmin (com.sleepycat.je.rep.util.ReplicationGroupAdmin)2 InetSocketAddress (java.net.InetSocketAddress)2 DatabaseException (com.sleepycat.je.DatabaseException)1 ReplicationConfig (com.sleepycat.je.rep.ReplicationConfig)1 HashSet (java.util.HashSet)1 DurableConfigurationStore (org.apache.qpid.server.store.DurableConfigurationStore)1