void startJoin() { logger.log(Level.FINEST, "Starting Join."); joinInProgress = true; final MembersUpdateCall membersUpdate = new MembersUpdateCall(lsMembers, node.getClusterImpl().getClusterTime()); if (setJoins != null && setJoins.size() > 0) { for (MemberInfo memberJoined : setJoins) { membersUpdate.addMemberInfo(memberJoined); } } membersUpdate.setNode(node); membersUpdate.call(); node.executorManager.executeNow(new JoinRunnable(membersUpdate)); }
public void invalidateScheduledActionsFor(Address endpoint, Set<Integer> threadIds) { if (!node.joined() || !node.isActive()) return; if (setScheduledActions.size() > 0) { Iterator<ScheduledAction> it = setScheduledActions.iterator(); while (it.hasNext()) { ScheduledAction sa = it.next(); Request request = sa.getRequest(); if (endpoint.equals(request.caller) && threadIds.contains(request.lockThreadId)) { sa.setValid(false); it.remove(); } } } }
public void checkScheduledActions() { if (!node.joined() || !node.isActive()) return; if (setScheduledActions.size() > 0) { Iterator<ScheduledAction> it = setScheduledActions.iterator(); while (it.hasNext()) { ScheduledAction sa = it.next(); if (sa.expired() && sa.isValid()) { sa.onExpire(); it.remove(); } else if (!sa.isValid()) { it.remove(); } } } }
public boolean shouldTryMerge() { return !joinInProgress && setJoins.size() == 0; }