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(); }
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(); }
public CoreMember(Gondola gondola, Cluster cluster, int memberId, List<Integer> peerIds, boolean isPrimary) throws Exception { this.gondola = gondola; this.cluster = cluster; this.memberId = memberId; this.isPrimary = isPrimary; gondola.getConfig().registerForUpdates(this); acquireFileLock(); clock = gondola.getClock(); pool = gondola.getMessagePool(); storage = gondola.getStorage(); incomingQueue = new ArrayBlockingQueue<>(incomingQueueSize); saveQueue = new SaveQueue(gondola, this); commitQueue = new CommitQueue(gondola, this); for (int id : peerIds) { Peer peer = new Peer(gondola, this, id); peers.add(peer); peerMap.put(peer.peerId, peer); } // Initialize some convenience variables for use when calculating the commit index majority = (peers.size() + 1) / 2 + 1; matchIndices = new int[peers.size()]; reset(); }
public void run() { MessageHandler handler = new MyMessageHandler(); MessagePool pool = gondola.getMessagePool(); Message message = pool.checkout(); Message nextMessage = pool.checkout();
public CoreMember(Gondola gondola, Shard shard, int memberId, List<Integer> peerIds, boolean isPrimary) throws GondolaException { this.gondola = gondola; this.shard = shard; this.memberId = memberId; this.peerIds = peerIds; this.isPrimary = isPrimary; gondola.getConfig().registerForUpdates(configListener); // Acquire file lock to prevent another process running with the same member id try { fileLock(true); } catch (IOException e) { throw new GondolaException(e); } clock = gondola.getClock(); pool = gondola.getMessagePool(); storage = gondola.getStorage(); incomingQueue = new ArrayBlockingQueue<>(incomingQueueSize); saveQueue = new SaveQueue(gondola, this); commitQueue = new CommitQueue(gondola, this); gondola.getNetwork().register(memberId, channel -> acceptSlaveConnection(channel)); peerIds.forEach(id -> peers.put(id, new Peer(gondola, this, id))); // Initialize some convenience variables for use when calculating the commit index majority = (peers.size() + 1) / 2 + 1; matchIndices = new int[peers.size()]; reset(); }
MessagePool pool = gondola.getMessagePool(); Rid rid = new Rid(); Rid savedRid = new Rid();
MessagePool pool = gondola.getMessagePool(); Rid rid = new Rid(); Rid savedRid = new Rid();
public void run() { MessageHandler handler = new MyMessageHandler(); MessagePool pool = gondola.getMessagePool(); Message message = pool.checkout(); Message nextMessage = pool.checkout();