@Override public String getScaleDownGroupName() { return getScaleDownPolicy() != null ? getScaleDownPolicy().getGroupName() : null; }
@Override public boolean isSharedStore() { return backupPolicy.isSharedStore(); }
private synchronized boolean activateSharedStoreBackup(String journalDirectory, String bindingsDirectory, String largeMessagesDirectory, String pagingDirectory) throws Exception { Configuration configuration = server.getConfiguration().copy(); ActiveMQServer backup = server.createBackupServer(configuration); try { int portOffset = haPolicy.getBackupPortOffset() * (backupServers.size() + 1); String name = "colocated_backup_" + backupServers.size() + 1; //make sure we don't restart as we are colocated haPolicy.getBackupPolicy().setRestartBackup(false); //set the backup policy backup.setHAPolicy(haPolicy.getBackupPolicy()); updateSharedStoreConfiguration(configuration, name, portOffset, haPolicy.getExcludedConnectors(), journalDirectory, bindingsDirectory, largeMessagesDirectory, pagingDirectory, haPolicy.getBackupPolicy().getScaleDownPolicy() == null); backupServers.put(configuration.getName(), backup); backup.start(); } catch (Exception e) { backup.stop(); ActiveMQServerLogger.LOGGER.activateSharedStoreSlaveFailed(e); return false; } ActiveMQServerLogger.LOGGER.activatingSharedStoreSlave(); return true; }
String name = "colocated_backup_" + backupServers.size() + 1; haPolicy.getBackupPolicy().setRestartBackup(false); updateReplicatedConfiguration(configuration, name, portOffset, haPolicy.getExcludedConnectors(), haPolicy.getBackupPolicy().getScaleDownPolicy() == null); backup.addActivationParam(ActivationParams.REPLICATION_ENDPOINT, member); backupServers.put(configuration.getName(), backup);
public synchronized boolean activateBackup(int backupSize, String journalDirectory, String bindingsDirectory, String largeMessagesDirectory, String pagingDirectory, SimpleString nodeID) throws Exception { if (backupServers.size() >= haPolicy.getMaxBackups() || backupSize != backupServers.size()) { return false; } if (haPolicy.getBackupPolicy().isSharedStore()) { return activateSharedStoreBackup(journalDirectory, bindingsDirectory, largeMessagesDirectory, pagingDirectory); } else { return activateReplicatedBackup(nodeID); } }