@Test public void testGetLease() throws Exception { proposer.openCell(TESTCELL, new ArrayList(), false, 0); Thread.sleep(100); FleaseProposerCell cell = proposer.cells.get(TESTCELL); assertEquals(TESTCELL,cell.getMessageSent().getCellId()); assertEquals(cfg.getIdentity(),cell.getMessageSent().getLeaseHolder()); assertTrue(cell.getMessageSent().getLeaseTimeout() > TimeSync.getGlobalTime()); }
public void openCell( ASCIIString cellId, List<InetSocketAddress> acceptors, boolean requestMasterEpoch, int viewId) throws FleaseException { FleaseProposerCell cell = cells.get(cellId); if (cell == null) { cell = new FleaseProposerCell(cellId, acceptors, config.getSenderId()); cell.setCellState(State.IDLE); cell.setRequestMasteEpoch(requestMasterEpoch); cell.setViewId(viewId); cells.put(cellId, cell); cell.addAction(ActionName.PROPOSER_CELL_OPENED); if (Logging.isDebug()) { Logging.logMessage(Logging.LEVEL_WARN, Category.flease, this, "P created new cellId %s", cellId); } acquireLease(cell); } else { throw new FleaseException("cell already opened"); } }
FleaseProposer { public void openCell( ASCIIString cellId, List<InetSocketAddress> acceptors, boolean requestMasterEpoch, int viewId) throws FleaseException { FleaseProposerCell cell = cells.get(cellId); if (cell == null) { cell = new FleaseProposerCell(cellId, acceptors, config.getSenderId()); cell.setCellState(State.IDLE); cell.setRequestMasteEpoch(requestMasterEpoch); cell.setViewId(viewId); cells.put(cellId, cell); cell.addAction(ActionName.PROPOSER_CELL_OPENED); if (Logging.isDebug()) { Logging.logMessage(Logging.LEVEL_WARN, Category.flease, this, "P created new cellId %s", cellId); } acquireLease(cell); } else { throw new FleaseException("cell already opened"); } } }
FleaseProposer { public void openCell( ASCIIString cellId, List<InetSocketAddress> acceptors, boolean requestMasterEpoch, int viewId) throws FleaseException { FleaseProposerCell cell = cells.get(cellId); if (cell == null) { cell = new FleaseProposerCell(cellId, acceptors, config.getSenderId()); cell.setCellState(State.IDLE); cell.setRequestMasteEpoch(requestMasterEpoch); cell.setViewId(viewId); cells.put(cellId, cell); cell.addAction(ActionName.PROPOSER_CELL_OPENED); if (Logging.isDebug()) { Logging.logMessage(Logging.LEVEL_WARN, Category.flease, this, "P created new cellId %s", cellId); } acquireLease(cell); } else { throw new FleaseException("cell already opened"); } } FleaseProposer(
            FleaseConfig config,
            FleaseAcceptor localAcceptor,
            FleaseCommunicationInterface comm,
            FleaseStatusListener leaseListener,
            LearnEventListener evListener,
            FleaseLocalQueueInterface localQueue,
            MasterEpochHandlerInterface meHandler); }
FleaseProposer { public void openCell( ASCIIString cellId, List<InetSocketAddress> acceptors, boolean requestMasterEpoch, int viewId) throws FleaseException { FleaseProposerCell cell = cells.get(cellId); if (cell == null) { cell = new FleaseProposerCell(cellId, acceptors, config.getSenderId()); cell.setCellState(State.IDLE); cell.setRequestMasteEpoch(requestMasterEpoch); cell.setViewId(viewId); cells.put(cellId, cell); cell.addAction(ActionName.PROPOSER_CELL_OPENED); if (Logging.isDebug()) { Logging.logMessage(Logging.LEVEL_WARN, Category.flease, this, "P created new cellId %s", cellId); } acquireLease(cell); } else { throw new FleaseException("cell already opened"); } } FleaseProposer(
            FleaseConfig config,
            FleaseAcceptor localAcceptor,
            FleaseCommunicationInterface comm,
            FleaseStatusListener leaseListener,
            LearnEventListener evListener,
            FleaseLocalQueueInterface localQueue,
            MasterEpochHandlerInterface meHandler); void setViewChangeListener(FleaseViewChangeListenerInterface listener); void setViewId(ASCIIString cellId, int viewId); Flease updatePrevLeaseForCell(ASCIIString cellId, Flease lease); ProposalNumber getCurrentBallotNo(ASCIIString cellId); void openCell(
            ASCIIString cellId,
            List<InetSocketAddress> acceptors,
            boolean requestMasterEpoch,
            int viewId); void closeCell(ASCIIString cellId); void renewLease(ASCIIString cellId); void handoverLease(ASCIIString cellId, ASCIIString newOwner); void processMessage(FleaseMessage msg); void startAccept(FleaseProposerCell cell); void learn(FleaseProposerCell cell); long globalToLocalTime(long globalTime); void cancel(FleaseProposerCell cell, Throwable reason, long retryAfter_ms); }
FleaseProposer { public void openCell( ASCIIString cellId, List<InetSocketAddress> acceptors, boolean requestMasterEpoch, int viewId) throws FleaseException { FleaseProposerCell cell = cells.get(cellId); if (cell == null) { cell = new FleaseProposerCell(cellId, acceptors, config.getSenderId()); cell.setCellState(State.IDLE); cell.setRequestMasteEpoch(requestMasterEpoch); cell.setViewId(viewId); cells.put(cellId, cell); cell.addAction(ActionName.PROPOSER_CELL_OPENED); if (Logging.isDebug()) { Logging.logMessage(Logging.LEVEL_WARN, Category.flease, this, "P created new cellId %s", cellId); } acquireLease(cell); } else { throw new FleaseException("cell already opened"); } } FleaseProposer(
            FleaseConfig config,
            FleaseAcceptor localAcceptor,
            FleaseCommunicationInterface comm,
            FleaseStatusListener leaseListener,
            LearnEventListener evListener,
            FleaseLocalQueueInterface localQueue,
            MasterEpochHandlerInterface meHandler); void setViewChangeListener(FleaseViewChangeListenerInterface listener); void setViewId(ASCIIString cellId, int viewId); Flease updatePrevLeaseForCell(ASCIIString cellId, Flease lease); ProposalNumber getCurrentBallotNo(ASCIIString cellId); void openCell(
            ASCIIString cellId,
            List<InetSocketAddress> acceptors,
            boolean requestMasterEpoch,
            int viewId); void closeCell(ASCIIString cellId); void renewLease(ASCIIString cellId); void handoverLease(ASCIIString cellId, ASCIIString newOwner); void processMessage(FleaseMessage msg); void startAccept(FleaseProposerCell cell); void learn(FleaseProposerCell cell); long globalToLocalTime(long globalTime); void cancel(FleaseProposerCell cell, Throwable reason, long retryAfter_ms);  }