Invalidates futures registered with indexes {@code >= entryIndex}. Note that {@code entryIndex} is inclusive.
{@link LeaderDemotedException} is set a result to futures.
506088
public void invalidateFuturesFrom(long entryIndex) {
        int count = 0;
        Iterator<Entry<Long, SimpleCompletableFuture>> iterator = futures.entrySet().iterator();
        while (iterator.hasNext()) {
            Entry<Long, SimpleCompletableFuture> entry = iterator.next();
            long index = entry.getKey();
            if (index >= entryIndex) {
                entry.getValue().setResult(new LeaderDemotedException(localMember, state.leader()));
                iterator.remove();
                count++;
            }
        }

        if (count > 0) {
            logger.warning("Invalidated " + count + " futures from log index: " + entryIndex);
        }
    }
498696
public synchronized void finalReap() {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "finalReap : Remote Async Results = " + ivAllRemoteAsyncResults.size());

        // Re-write the finalReap to use the LinkedHashSet, iterating thru the list removing
        // all the entries no matter if they have timed out or not.  Cancel alarm if set.    d623593
        if (ivFuture != null) {
            ivIsCanceled = true;
            ivFuture.cancel(false);
            ivFuture = null;
        }

        for (Iterator<RemoteAsyncResultImpl> iterator = ivAllRemoteAsyncResults.iterator(); iterator.hasNext();) {
            RemoteAsyncResultImpl asyncResult = iterator.next();
            releaseResources(asyncResult); // d690014.3
            iterator.remove();
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "finalReap : Remote Async Results = " + ivAllRemoteAsyncResults.size());
    }
415185
public final DSLMappingEntry valid_entry() throws RecognitionException {
		DSLMappingEntry mappingEntry = null;


		DSLMappingEntry ent =null;

		try {
			// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:30:5: (ent= entry )
			// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:30:7: ent= entry
			{
			pushFollow(FOLLOW_entry_in_valid_entry96);
			ent=entry();
			state._fsp--;

			mappingEntry = ent; 
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return mappingEntry;
	}
1042186
public void removeAt(int index) {
        synchronized (mLock) {
            if (mOriginalValues != null) {
                mOriginalValues.remove(index);
            } else {
                mObjects.remove(index);
            }
        }
        if (mNotifyOnChange) notifyDataSetChanged();
    }
327409
protected boolean updateTermAndLeader(long term, MemberId leader) {
    // If the request indicates a term that is greater than the current term or no leader has been
    // set for the current term, update leader and term.
    if (term > raft.getTerm() || (term == raft.getTerm() && raft.getLeader() == null && leader != null)) {
      raft.setTerm(term);
      raft.setLeader(leader);

      // Reset the current cluster configuration to the last committed configuration when a leader change occurs.
      raft.getCluster().reset();
      return true;
    }
    return false;
  }
1255348
public void write(final AbstractIndex index)
		throws IOException
	{

		StringBuilder cmd;

		while (index.size() > 0) {

			System.out.println("Transmit Index [" + index + "]");

			cmd = index.remove();

			if(index instanceof ArticleIndex){
				articleIdxWriter.write(cmd.toString());
			}else if(index instanceof ChronoIndex){
				chronoIdxWriter.write(cmd.toString());
			}else if(index instanceof RevisionIndex){
				revisionIdxWriter.write(cmd.toString());
			}

		}

		if(index instanceof ArticleIndex){
			articleIdxWriter.flush();
		}else if(index instanceof ChronoIndex){
			chronoIdxWriter.flush();
		}else if(index instanceof RevisionIndex){
			revisionIdxWriter.flush();
		}
	}
356465
public void setLastApplied(long index) {
    // Query callbacks for this session are added to the indexQueries map to be executed once the required index
    // for the query is reached. For each increment of the index, trigger query callbacks that are dependent
    // on the specific index.
    for (long i = lastApplied + 1; i <= index; i++) {
      lastApplied = i;
      List<Runnable> queries = this.indexQueries.remove(lastApplied);
      if (queries != null) {
        for (Runnable query : queries) {
          query.run();
        }
      }
    }
  }
570571
@SuppressWarnings("unchecked")
  private void applyIndex(long index) {
    // Apply entries prior to this entry.
    if (reader.hasNext() && reader.getNextIndex() == index) {
      // Read the entry from the log. If the entry is non-null then apply it, otherwise
      // simply update the last applied index and return a null result.
      Indexed<RaftLogEntry> entry = reader.next();
      try {
        if (entry.index() != index) {
          throw new IllegalStateException("inconsistent index applying entry " + index + ": " + entry);
        }
        CompletableFuture future = futures.remove(index);
        apply(entry).whenComplete((r, e) -> {
          raft.setLastApplied(index);
          if (future != null) {
            if (e == null) {
              future.complete(r);
            } else {
              future.completeExceptionally(e);
            }
          }
        });
      } catch (Exception e) {
        logger.error("Failed to apply {}: {}", entry, e);
      }
    } else {
      CompletableFuture future = futures.remove(index);
      if (future != null) {
        logger.error("Cannot apply index " + index);
        future.completeExceptionally(new IndexOutOfBoundsException("Cannot apply index " + index));
      }
    }
  }
717463
private void commitEntries() {
    raft.checkThread();

    // Sort the list of replicas, order by the last index that was replicated
    // to the replica. This will allow us to determine the median index
    // for all known replicated entries across all cluster members.
    List<RaftMemberContext> members = raft.getCluster().getActiveMemberStates((m1, m2) ->
        Long.compare(m2.getMatchIndex() != 0 ? m2.getMatchIndex() : 0L, m1.getMatchIndex() != 0 ? m1.getMatchIndex() : 0L));

    // If the active members list is empty (a configuration change occurred between an append request/response)
    // ensure all commit futures are completed and cleared.
    if (members.isEmpty()) {
      long commitIndex = raft.getLogWriter().getLastIndex();
      long previousCommitIndex = raft.setCommitIndex(commitIndex);
      if (commitIndex > previousCommitIndex) {
        log.trace("Committed entries up to {}", commitIndex);
        completeCommits(previousCommitIndex, commitIndex);
      }
      return;
    }

    // Calculate the current commit index as the median matchIndex.
    long commitIndex = members.get(getQuorumIndex()).getMatchIndex();

    // If the commit index has increased then update the commit index. Note that in order to ensure
    // the leader completeness property holds, we verify that the commit index is greater than or equal to
    // the index of the leader's no-op entry. Update the commit index and trigger commit futures.
    long previousCommitIndex = raft.getCommitIndex();
    if (commitIndex > 0 && commitIndex > previousCommitIndex && (leaderIndex > 0 && commitIndex >= leaderIndex)) {
      log.trace("Committed entries up to {}", commitIndex);
      raft.setCommitIndex(commitIndex);
      completeCommits(previousCommitIndex, commitIndex);
    }
  }
780542
public void invalidate(InternalIndex index) {
        String[] components = index.getComponents();
        if (components == null) {
            cache.remove(index.getName());
            return;
        }

        for (String component : components) {
            TypeConverter converter = cache.get(component);
            if (converter instanceof UnresolvedConverter) {
                cache.remove(component);
            }
        }
    }
1360222
public boolean removeBusHalt(int index) {
		try {
			final BusItineraryHalt removedBushalt;
			if (index < this.validHalts.size()) {
				removedBushalt = this.validHalts.remove(index);
			} else {
				final int idx = index - this.validHalts.size();
				removedBushalt = this.invalidHalts.remove(idx);
			}
			removedBushalt.setContainer(null);
			removedBushalt.setRoadSegmentIndex(-1);
			removedBushalt.setPositionOnSegment(Float.NaN);
			removedBushalt.setEventFirable(true);
			removedBushalt.checkPrimitiveValidity();
			fireShapeChanged(new BusChangeEvent(this,
					BusChangeEventType.ITINERARY_HALT_REMOVED,
					removedBushalt,
					removedBushalt.indexInParent(),
					"shape", //$NON-NLS-1$
					null,
					null));
			checkPrimitiveValidity();
			return true;
		} catch (Throwable exception) {
			//
		}
		return false;
	}
848303
public AddressSelector reset(Address leader, Collection<Address> servers) {
    if (changed(leader, servers)) {
      this.leader = leader;
      this.servers = servers;
      this.selections = strategy.selectConnections(leader, new ArrayList<>(servers));
      this.selectionsIterator = null;
    }
    return this;
  }
668042
protected CompletableFuture<QueryResponse> applyQuery(Indexed<QueryEntry> entry) {
    // In the case of the leader, the state machine is always up to date, so no queries will be queued and all query
    // indexes will be the last applied index.
    CompletableFuture<QueryResponse> future = new CompletableFuture<>();
    raft.getServiceManager().<OperationResult>apply(entry).whenComplete((result, error) -> {
      completeOperation(result, QueryResponse.builder(), error, future);
    });
    return future;
  }
439087
void invalidate() {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "invalidate");
        }

        _sessionInvalidated = true;

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "invalidate");
        }

    }
1028092
@SuppressWarnings("unchecked")
	protected void fireEntryRemoved(K key, V value) {
		if (this.listeners != null) {
			for (final DMapListener<? super K, ? super V> listener : this.listeners.getListeners(DMapListener.class)) {
				listener.entryRemoved(key, value);
			}
		}
	}
1014305
public MenuItemTransitionBuilder invalidateOptionOnStopTransition(@NonNull Activity activity, boolean invalidate) {
        mActivity = activity;
        mInvalidateOptionOnStopAnimation = invalidate;
        return self();
    }
676186
public void invalidate(P principal) {

        final Set<ImmutablePair<P, String>> keys = cache.asMap().keySet().stream()
                .filter(cacheKey -> cacheKey.getLeft().equals(principal))
                .collect(Collectors.toSet());
        cache.invalidateAll(keys);
    }