/** * Protected Methods. * * @param shardId the shard id * @return the boolean */ protected boolean isLeaderInShard(String shardId) { return gondola.getShard(shardId).getLocalMember().isLeader(); }
public InetSocketAddress getAddress() { return gondola.getConfig().getAddressForMember(getMemberId()); } }
CommitQueue(Gondola gondola, CoreMember cmember) throws Exception { this.gondola = gondola; this.cmember = cmember; this.storage = gondola.getStorage(); this.pool = gondola.getMessagePool(); this.savedIndex = null;//savedIndex; this.matchIndices = null;//matchIndices; gondola.getConfig().registerForUpdates(this); stats = gondola.getStats(); }
/** * Instantiates a new Lock manager. * * @param gondola The Gondola instance. */ public LockManager(Gondola gondola) { gondola.getConfig().registerForUpdates(config1 -> tracing = config1.getBoolean("tracing.router")); this.gondola = gondola; }
public String getSiteId() { return gondola.getConfig().getSiteIdForHost(gondola.getHostId()); }
public RoutingService(Gondola gondola, String shardId) { this.gondola = gondola; shard = gondola.getShard(shardId); hostId = gondola.getHostId(); this.shardId = shardId; memberId = shard.getLocalMember().getMemberId(); commitTimer = GondolaApplication.MyMetricsServletContextListener.METRIC_REGISTRY.timer("LogWriter"); }
/** * Reads config values from a HOCON file. The observers are notified whenever the config file changes. */ public Config(File file) { this.file = file; process(getMergedConf(file)); watcher = new Watcher(file); watcher.start(); }
@Override public void update(Observable obs, Object arg) { Config config = (Config) arg; commandTracing = config.getBoolean("tracing.command"); maxCommandSize = config.getInt("raft.command_max_size"); } });
/** * Is leader boolean. * * @return the boolean */ public boolean isLeader() { return shard.getLocalMember().isLeader(); }
public MessagePool(Config config, Stats stats) { this.config = config; this.stats = stats; config.registerForUpdates(this); }
/** * Called at the time of registration and whenever the config file changes. */ public void update(Observable obs, Object arg) { Config config = (Config) arg; commandTracing = config.getBoolean("tracing.command"); storageTracing = config.getBoolean("tracing.storage"); }
/** * Equivalent to getCommittedCommand(index, -1); * * @param index must be > 0. * @return the non-null Command at index. */ public Command getCommittedCommand(int index) throws Exception { return getCommittedCommand(index, -1); }
public float getRps() { long now = clock.now(); int v = value; float result = (v - lastValue) * 1000.0f / (now - lastTs); lastTs = now; lastValue = v; return result; } }
/** * Returns this command object back to the pool. */ public void release() { cluster.checkinCommand(this); } }
CommitQueue(Gondola gondola, CoreMember cmember) throws GondolaException { this.gondola = gondola; this.cmember = cmember; this.storage = gondola.getStorage(); this.pool = gondola.getMessagePool(); this.savedIndex = null; //savedIndex; this.matchIndices = null; //matchIndices; gondola.getConfig().registerForUpdates(configListener); stats = gondola.getStats(); }
private void loadConfig() { gondola.getConfig().registerForUpdates(config -> tracing = config.getBoolean("tracing.router")); }
public InetSocketAddress getAddress() { return gondola.getConfig().getAddressForMember(getMemberId()); }
@Override public void update(Observable obs, Object arg) { Config config = (Config) arg; storageTracing = config.getBoolean("tracing.storage"); networkTracing = config.getBoolean("tracing.network"); heartbeatPeriod = config.getInt("raft.heartbeat_period"); socketInactivityTimeout = config.getInt("network.channel_inactivity_timeout"); } });
@Override public void update(Observable obs, Object arg) { Config config = (Config) arg; networkTracing = config.getBoolean("tracing.network"); connTimeout = config.getInt("network_socket.connect_timeout"); }