RepInternal.createInternalEnvHandle(envHome, conf.createReplicationConfig(), conf.createEnvConfig()); final NameIdPair pair = RepInternal.getNonNullRepImpl(ret) .getNameIdPair(); if (conf.getNodeType().hasTransientId() && !pair.hasNullId()) {
/** * Returns the accumulated statistics for this node. The method * encapsulates the statistics associated with its two principal components * the FeederManager and the Replica. */ public ReplicatedEnvironmentStats getStats(StatsConfig config) { return RepInternal.makeReplicatedEnvironmentStats(repImpl, config); }
return RepInternal.makeReplicationConfig (repProperties, validateParams);
RepInternal.createInternalEnvHandle(envDir, repConfig, envConfig); this.repImpl = RepInternal.getRepImpl(restoreEnv);
public static int getNodeId(ReplicatedEnvironment rep) { return getNonNullRepImpl(rep).getNodeId(); }
public long getLastKnownReplicationTransactionId() { if (_state.get() == State.OPEN) { try { VLSNRange range = RepInternal.getRepImpl(getEnvironment()).getVLSNIndex().getRange(); VLSN lastTxnEnd = range.getLastTxnEnd(); return lastTxnEnd.getSequence(); } catch (RuntimeException e) { throw handleDatabaseException("Exception on getting last known replication transaction id", e); } } else { return -1L; } }
repConfig.setHelperHosts(hostName); final ReplicatedEnvironment rep = RepInternal.createDetachedEnv(envHome, repConfig, envConfig); try { ReplicatedEnvironment.State state = rep.getState(); final RepImpl envImpl = RepInternal.getNonNullRepImpl(rep); final VLSNIndex vlsnIndex = envImpl.getVLSNIndex(); if (forward) { RepImpl repImpl = RepInternal.getNonNullRepImpl(rep); VLSNRange range = repImpl.getVLSNIndex().getRange(); if (forward) {
RepInternal.getRepGroupImpl(group);
private ReplicatedEnvironment recover() { ReplicationConfig repConfig = new ReplicationConfig(); repConfig.setNodeName(nodeName); repConfig.setGroupName(groupName); repConfig.setNodeHostPort(nodeHost); EnvironmentConfig envConfig = new EnvironmentConfig(); envConfig.setTransactional(true); return RepInternal.createDetachedEnv(envHome, repConfig, envConfig); }
/** * 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(); } }
RepInternal.getAllowConvert(((ReplicationConfig) repConfigProxy));
SubscriptionThread(ReplicatedEnvironment env, VLSN reqVLSN, SubscriptionConfig config, SubscriptionStat stats, Logger logger) { super(RepInternal.getNonNullRepImpl(env), "Subscription Main"); setUncaughtExceptionHandler(new SubscriptionThreadExceptionHandler()); this.reqVLSN = reqVLSN; this.config = config; this.stats = stats; this.logger = logger; protocol = null; namedChannel = null; /* init subscription input and output queue */ inputQueue = new ArrayBlockingQueue<>(config.getInputMessageQueueSize()); outputQueue = new ArrayBlockingQueue<>(config.getOutputMessageQueueSize()); status = SubscriptionStatus.INIT; storedException = null; exceptionHandlingTestHook = null; }
final RepGroupImpl group = RepInternal.getRepGroupImpl(repGroup);
repConfig.setRepNetConfig(ac.getRepNetConfig()); repEnv = RepInternal.createInternalEnvHandle(envHome, repConfig, envConfig); try { ai = new ArbiterImpl( envHome, RepInternal.getNonNullRepImpl(repEnv)); ai.runArbiter(); } catch (Throwable t) {
@Override public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException { if (actionName == null) { throw new IllegalArgumentException("ActionName can't be null."); } try { if (actionName.equals(OP_DUMP_REPSTATS)) { return ((ReplicatedEnvironment) env). getRepStats(getStatsConfig(params)).toString(); } else if (actionName.equals(OP_GET_REP_TIPS)) { return ((ReplicatedEnvironment) env).getRepStats (getStatsConfig(new Object[] {false, true})).getTips(); } else if (actionName.equals(OP_DUMP_STATE)) { return RepInternal.getNonNullRepImpl ((ReplicatedEnvironment) env).dumpState(); } } catch (DatabaseException e) { throw new MBeanException(new RuntimeException(e.getMessage())); } return super.invoke(actionName, params, signature); }
private void run() { ReplicatedEnvironment repEnv = recover(); if (showVLSN) { RepInternal.getNonNullRepImpl(repEnv).getVLSNIndex().dumpDb(true); } if (doCheckpoint) { repEnv.checkpoint(new CheckpointConfig().setForce(true)); } repEnv.close(); }
/** * Shutdown a subscription completely, keep the thread object to keep the * state. */ public void shutdown() { if (subscriptionThread != null && subscriptionThread.isAlive()) { subscriptionThread.shutdown(); } if (dummyRepEnv != null) { final NodeType nodeType = configuration.getNodeType(); if (nodeType.hasTransientId() && !dummyRepEnv.isClosed()) { RepInternal.getNonNullRepImpl(dummyRepEnv) .getNameIdPair() .revertToNull(); } dummyRepEnv.close(); logger.fine("Closed env " + dummyRepEnv.getNodeName() + "(forget transient id? " + nodeType.hasTransientId() + ")"); } }
ReplicatedEnvironment repEnv = new ReplicatedEnvironment(envHome, repConfig, envConfig); RepNode repNode = RepInternal.getNonNullRepImpl(repEnv).getRepNode();
RepInternal.getNonNullRepImpl(dummyRepEnv), "Timeout in initialization, shut down " + "subscription.");