Sets the maximum compaction index for minor compaction.

@param index The maximum compaction index for minor compaction.
@return The log compactor.
439409
public Compactor minorIndex(long index) {
    this.minorIndex = Math.max(this.minorIndex, index);
    Segment segment = segments.segment(minorIndex);
    if (segment != null) {
      compactIndex = segment.firstIndex();
    }
    return this;
  }
1336031
private void recordIndex(int index) {
        stateLock.writeLock().lock();
        try {
            int insertionPoint = -Arrays.binarySearch(effectiveIndex, index) - 1;
            System.arraycopy(effectiveIndex, insertionPoint, effectiveIndex, insertionPoint + 1, effectiveIndex.length - insertionPoint - 1);
            effectiveIndex[insertionPoint] = index;
        } finally {
            stateLock.writeLock().unlock();
        }
    }
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));
      }
    }
  }
432983
public ComparatorChain<E> setComparator(final int index, final Comparator<E> comparator) throws IndexOutOfBoundsException {
		return setComparator(index, comparator, false);
	}
1167497
public Log commit(long index) {
    assertIsOpen();
    if (index > 0) {
      assertValidIndex(index);
      segments.commitIndex(index);
      if (storage.flushOnCommit()) {
        segments.currentSegment().flush();
      }
    }
    return this;
  }
719826
public boolean setMaxRegister(final long registerIndex, final long value) {
        final long bitIndex = registerIndex * registerWidth;
        final int firstWordIndex = (int)(bitIndex >>> LOG2_BITS_PER_WORD)/*aka (bitIndex / BITS_PER_WORD)*/;
        final int secondWordIndex = (int)((bitIndex + registerWidth - 1) >>> LOG2_BITS_PER_WORD)/*see above*/;
        final int bitRemainder = (int)(bitIndex & BITS_PER_WORD_MASK)/*aka (bitIndex % BITS_PER_WORD)*/;

        // NOTE:  matches getRegister()
        final long registerValue;
        final long words[] = this.words/*for convenience/performance*/;
        if(firstWordIndex == secondWordIndex)
            registerValue = ((words[firstWordIndex] >>> bitRemainder) & registerMask);
        else /*register spans words*/
            registerValue = (words[firstWordIndex] >>> bitRemainder)/*no need to mask since at top of word*/
                          | (words[secondWordIndex] << (BITS_PER_WORD - bitRemainder)) & registerMask;

        // determine which is the larger and update as necessary
        if(value > registerValue) {
            // NOTE:  matches setRegister()
            if(firstWordIndex == secondWordIndex) {
                // clear then set
                words[firstWordIndex] &= ~(registerMask << bitRemainder);
                words[firstWordIndex] |= (value << bitRemainder);
            } else {/*register spans words*/
                // clear then set each partial word
                words[firstWordIndex] &= (1L << bitRemainder) - 1;
                words[firstWordIndex] |= (value << bitRemainder);

                words[secondWordIndex] &= ~(registerMask >>> (BITS_PER_WORD - bitRemainder));
                words[secondWordIndex] |= (value >>> (BITS_PER_WORD - bitRemainder));
            }
        } /* else -- the register value is greater (or equal) so nothing needs to be done */

        return (value >= registerValue);
    }
772242
private void compactLogs(long compactIndex) {
    raft.getThreadContext().execute(() -> {
      logger.debug("Compacting logs up to index {}", compactIndex);
      try {
        raft.getLog().compact(compactIndex);
      } catch (Exception e) {
        logger.error("An exception occurred during log compaction: {}", e);
      } finally {
        this.compactFuture.complete(null);
        this.compactFuture = null;
        // Immediately attempt to take new snapshots since compaction is already run after a time interval.
        takeSnapshots(false, false);
      }
    });
  }
1032610
public void fastSet(int index) {
        assert index >= 0 && index < numBits;
        int wordNum = index >> 6;      // div 64
        int bit = index & 0x3f;     // mod 64
        long bitmask = 1L << bit;
        bits[wordNum] |= bitmask;
    }
221525
public Object opt(int index) {
        if (index < 0 || index >= values.size()) {
            return null;
        }
        return values.get(index);
    }
942672
public GeometryIndex getParent(GeometryIndex index) {
		GeometryIndex parent = new GeometryIndex(index);
		GeometryIndex deepestParent = null;
		GeometryIndex p = parent;
		while (p.hasChild()) {
			deepestParent = p;
			p = p.getChild();
		}
		if (deepestParent != null) {
			deepestParent.setChild(null);
		}
		return parent;
	}
955226
@Override
    public T set(int index, T element) {
        if (displacement != null) {
            return super.set(index - displacement, element);
        }
        return super.set(index, element);
    }
555192
public long setCommitIndex(long commitIndex) {
    this.commitIndex = Math.max(this.commitIndex, commitIndex);
    writer.commit(this.commitIndex);
    return this.commitIndex;
  }
115776
public ByteBuffer get4x3(int index, ByteBuffer buffer) {
        MemUtil.INSTANCE.put4x3(this, index, buffer);
        return buffer;
    }
168756
public double set(long index, double value) {
        compact();
        int i = findIndexMatching(index);
        if(i < 0) {
            add(index, value);
            compacted = false;
            return 0;
        } else {
            double old = vals[i];
            vals[i] = value;
            return old;
        }
    }
424993
public LocationIndexTree setMaxRegionSearch(int numTiles) {
        if (numTiles < 1)
            throw new IllegalArgumentException("Region of location index must be at least 1 but was " + numTiles);

        // see #232
        if (numTiles % 2 == 1)
            numTiles++;

        this.maxRegionSearch = numTiles;
        return this;
    }
492770
public ByteBuffer get(final int index) {
		if (!validState) {
			throw new InvalidStateException();
		}
		if (log.isDebugEnabled()) {
			log.debug("get(" + index + ")");
		}
		try {
			if (useMmap) {
				final MappedByteBuffer mbb = getMmapForIndex(index);
				if (mbb != null) {
					return mbb;
				}
				// Fallback to RAF
			}
			final ByteBuffer buf = bufstack.pop();
			fileChannel.position(index * blockSize).read(buf);
			buf.rewind();
			return buf;
		} catch (Exception e) {
			log.error("Exception in get(" + index + ")", e);
		}
		return null;
	}
1060474
public Object opt(int index) {

        return ((index < 0) || (index >= length())) ? null : m_myArrayList.get(index);
    }