public MessagePool(Config config, Stats stats) { this.config = config; this.stats = stats; config.registerForUpdates(configListener); }
public MessagePool(Config config, Stats stats) { this.config = config; this.stats = stats; config.registerForUpdates(this); }
/** * Must be called before command objects are created. */ public static void initConfig(Config config) { config.registerForUpdates(new Observer() { /* * Called at the time of registration and whenever the config file changes. */ @Override public void update(Observable obs, Object arg) { Config config = (Config) arg; commandTracing = config.getBoolean("tracing.command"); maxCommandSize = config.getInt("raft.command_max_size"); } }); }
/** * Must be called before message objects can be created. */ public static void initConfig(Config config) { config.registerForUpdates(new Observer() { /* * Called at the time of registration and whenever the config file changes. */ @Override public void update(Observable obs, Object arg) { Config config = (Config) arg; maxCommandSize = config.getInt("raft.command_max_size"); messageTracing = config.getBoolean("tracing.raft_messages"); System.out.println("********** "+messageTracing); heartbeatTracing = config.getBoolean("tracing.raft_heartbeats"); batching = config.getBoolean("gondola.batching"); } }); }
/** * Must be called before logger objects are created. */ public static void initConfig(Config config) { config.registerForUpdates(config1 -> { stackTraceSuppression = config1.getBoolean("gondola.stack_trace_suppression"); } ); }
public ShardManager(Gondola gondola, RoutingFilter filter, Config config, ShardManagerClient shardManagerClient) { this.gondola = gondola; this.filter = filter; this.config = config; this.shardManagerClient = shardManagerClient; this.config.registerForUpdates(config1 -> tracing = config1.getBoolean("tracing.router")); }
/** * Must be called before command objects are created. */ public static void initConfig(Config config) { config.registerForUpdates(config1 -> { commandTracing = config1.getBoolean("gondola.tracing.command"); maxCommandSize = config1.getInt("raft.command_max_size"); }); }
/** * 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; }
private void loadConfig() { gondola.getConfig().registerForUpdates(config -> tracing = config.getBoolean("tracing.router")); }
public SocketNetwork(Gondola gondola, String hostId) throws SocketException { this.gondola = gondola; this.hostId = hostId; gondola.getConfig().registerForUpdates(this); InetSocketAddress address = gondola.getConfig().getAddressForHost(hostId); if (!isLocalAddress(address.getAddress())) { throw new IllegalStateException(address.getHostName() + " is not a local address"); } // Check whether another process is already using this address if (isActive(getAddress())) { throw new IllegalStateException(String.format("Another process is actively listening to %s", getAddress())); } }
public SocketChannel(Gondola gondola, int memberId, int toMemberId) { this.gondola = gondola; this.memberId = memberId; this.peerId = toMemberId; gondola.getConfig().registerForUpdates(this); logger.info("[{}-{}] Creating connection to {}", gondola.getHostId(), memberId, toMemberId); inetSocketAddress = gondola.getConfig().getAddressForMember(peerId); reconnect(); }
public SocketNetwork(Gondola gondola, String hostId) throws SocketException { this.gondola = gondola; this.hostId = hostId; gondola.getConfig().registerForUpdates(config -> { networkTracing = config.getBoolean("gondola.tracing.network"); connTimeout = config.getInt("network.socket.connect_timeout"); }); InetSocketAddress address = gondola.getConfig().getAddressForHost(hostId); if (!isLocalAddress(address.getAddress())) { throw new IllegalStateException(address.getHostName() + " is not a local address"); } // Check whether another process is already using this address if (isActive(getAddress())) { throw new IllegalStateException(String.format("Another process is actively listening to %s", getAddress())); } }
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(); }
/** * Must be called before peer objects are created. */ public static void initConfig(Config config) { config.registerForUpdates(config1 -> { storageTracing = config1.getBoolean("gondola.tracing.storage"); networkTracing = config1.getBoolean("gondola.tracing.network"); heartbeatPeriod = config1.getInt("raft.heartbeat_period"); socketInactivityTimeout = config1.getInt("network.channel_inactivity_timeout"); } ); }
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(); }
public ZookeeperShardManagerClient(String serviceName, String clientName, String connectString, Config config) { client = ZookeeperUtils.getCuratorFrameworkInstance(connectString); this.serviceName = serviceName; this.config = config; this.clientName = clientName; ensurePath(serviceName, client); watchZookeeperStats(); config.registerForUpdates(config1 -> tracing = config.getBoolean("tracing.router")); ready = true; }
/** * Must be called before message objects can be created. */ public static void initConfig(Config config) { config.registerForUpdates(config1 -> { maxCommandSize = config1.getInt("raft.command_max_size"); messageTracing = config1.getBoolean("gondola.tracing.raft_messages"); heartbeatTracing = config1.getBoolean("gondola.tracing.raft_heartbeats"); batching = config1.getBoolean("gondola.batching"); }); }
public ZookeeperShardManagerServer(String serviceName, String connectString, Gondola gondola, ShardManager shardmanager) { this.serviceName = serviceName; this.gondola = gondola; this.delegate = shardmanager; config = gondola.getConfig(); config.registerForUpdates(config -> tracing = config.getBoolean("tracing.router")); client = ZookeeperUtils.getCuratorFrameworkInstance(connectString); Watcher watcher = new Watcher(); watcher.start(); threads.add(watcher); initNode(gondola.getHostId()); ready = true; }
SaveQueue(Gondola gondola, CoreMember cmember) throws GondolaException { this.gondola = gondola; this.cmember = cmember; gondola.getConfig().registerForUpdates(configListener); storage = gondola.getStorage(); stats = gondola.getStats(); numWorkers = gondola.getConfig().getInt("storage.save_queue_workers"); String address = storage.getAddress(cmember.memberId); if (address != null && !address.equals(gondola.getNetwork().getAddress()) && gondola.getNetwork().isActive(address)) { throw new IllegalStateException(String.format("[%s-%s] Process %s at address %s is currently using storage", gondola.getHostId(), cmember.memberId, gondola.getProcessId(), address)); } storage.setAddress(cmember.memberId, gondola.getNetwork().getAddress()); storage.setPid(cmember.memberId, gondola.getProcessId()); initSavedIndex(); }
SaveQueue(Gondola gondola, CoreMember cmember) throws Exception { this.gondola = gondola; this.cmember = cmember; gondola.getConfig().registerForUpdates(this); storage = gondola.getStorage(); stats = gondola.getStats(); numWorkers = gondola.getConfig().getInt("storage.save_queue_workers"); String address = storage.getAddress(cmember.memberId); if (address != null && gondola.getNetwork().isActive(address)) { throw new IllegalStateException(String.format("[%s-%s] Process %s at address %s is currently using storage", gondola.getHostId(), cmember.memberId, gondola.getProcessId(), address)); } storage.setAddress(cmember.memberId, gondola.getNetwork().getAddress()); storage.setPid(cmember.memberId, gondola.getProcessId()); initSavedIndex(); }