public static ReplicatedEnvironment createDetachedEnv(File envHome, ReplicationConfig repConfig, EnvironmentConfig envConfig) throws DatabaseException { return new ReplicatedEnvironment(envHome, repConfig, envConfig, null, QuorumPolicy.SIMPLE_MAJORITY, false, null); }
public static ReplicatedEnvironment createInternalEnvHandle(File envHome, ReplicationConfig repConfig, EnvironmentConfig envConfig) throws DatabaseException { return new ReplicatedEnvironment(envHome, repConfig, envConfig, null, null, false, null); }
public ReplicatedEnvironment makeEnvironment() { return new ReplicatedEnvironment(getEnvironmentHome(), cloneRepConfig(), cloneConfig()); }
_environment.set(new ReplicatedEnvironment(environmentPathFile, replicationConfig, envConfig)); restore.execute(ile, config); LOGGER.warn("Network restore complete."); _environment.set(new ReplicatedEnvironment(environmentPathFile, replicationConfig, envConfig));
@Override public Environment open(File envHome, EnvironmentConfig envConfig, Map<String, String> repParams) { final String host = "localhost"; final FreePortLocator locator = new FreePortLocator (host, START_PORT, START_PORT + PORT_RANGE); final int port = locator.next(); final String hostPort = host + ':' + port; final ReplicationConfig repConfig = new ReplicationConfig ("DbCacheSizeGroup", "DbCacheSizeNode", hostPort); repConfig.setHelperHosts(hostPort); for (Map.Entry<String, String> entry : repParams.entrySet()) { repConfig.setConfigParam(entry.getKey(), entry.getValue()); } return new ReplicatedEnvironment(envHome, repConfig, envConfig); } }
private Environment createEnvironment(final EnvironmentConfig config) throws Exception { final Environment env; if (_ha) { final ReplicationConfig repConfig = (ReplicationConfig) ReplicationConfig.DEFAULT .setNodeHostPort(_nodeHost) .setGroupName(_groupName) .setNodeName(_nodeName) .setDesignatedPrimary(true) .setElectableGroupSizeOverride(1); env = new ReplicatedEnvironment(new File(_storePath), repConfig, config); } else { env = new Environment(new File(_storePath), config); } return env; }
ReplicatedEnvironment repEnv = null; try { repEnv = new ReplicatedEnvironment(new File(envHome), repConfig, envConfig,
envConfig.setCacheMode(cacheMode); ReplicatedEnvironment repEnv = new ReplicatedEnvironment(envHome, repConfig, envConfig); RepNode repNode = RepInternal.getNonNullRepImpl(repEnv).getRepNode();
/** * Modify the log files in the environment directory to add a modicum of * replication required metadata. */ public void convert() { Durability durability = new Durability(Durability.SyncPolicy.WRITE_NO_SYNC, Durability.SyncPolicy.WRITE_NO_SYNC, Durability.ReplicaAckPolicy.SIMPLE_MAJORITY); EnvironmentConfig envConfig = new EnvironmentConfig(); envConfig.setAllowCreate(true); envConfig.setTransactional(true); envConfig.setDurability(durability); ReplicationConfig repConfig = new ReplicationConfig(groupName, nodeName, nodeHostPort); repConfig.setHelperHosts(repConfig.getNodeHostPort()); RepInternal.setAllowConvert(repConfig, true); ReplicatedEnvironment repEnv = new ReplicatedEnvironment(envHome, repConfig, envConfig); repEnv.close(); } }
new ReplicatedEnvironment(envHome, repConfig, envConfig);