public void removeFromBucketIndexes(Region r, Index index) {
    synchronized (bucketIndexes) {
      List<Index> indexes = bucketIndexes.get(r);
      if (indexes != null) {
        indexes.remove(index);
        if (indexes.isEmpty()) {
          bucketIndexes.remove(r);
        }
      }
      if (index == arbitraryBucketIndex) {
        resetArbitraryBucketIndex(retrieveArbitraryBucketIndex());
      }
    }
  }
Adds an index on a bucket to the list of already indexed buckets in the partitioned region.

@param index bucket index to be added to the list.
geode-core/src/main/java/org/apache/geode/cache/query/internal/index/PartitionedIndex.java