@Override
  protected boolean operateOnPartitionedRegion(ClusterDistributionManager dm, PartitionedRegion pr,
      long startTime)
      throws CacheException, QueryException, ForceReattemptException, InterruptedException {
    // TODO Auto-generated method stub

    ReplyException replyEx = null;
    boolean result = true;
    int bucketIndexRemoved = 0; // invalid
    int numIndexesRemoved = 0;

    logger.info("Will remove the indexes on this pr : {}", pr);
    try {
      if (removeSingleIndex) {
        bucketIndexRemoved = pr.removeIndex(indexName);
      } else {
        bucketIndexRemoved = pr.removeIndexes(true); // remotely orignated
      }
      numIndexesRemoved = pr.getDataStore().getAllLocalBuckets().size();
    } catch (Exception ex) {
      result = false;
      replyEx = new ReplyException(ex);
    }

    // send back the reply.
    sendReply(getSender(), getProcessorId(), dm, replyEx, result, bucketIndexRemoved,
        numIndexesRemoved);

    return false;
  }
This method is responsible to remove index on the given partitioned region.

@param dm Distribution maanger for the system
@param pr Partitioned region to remove indexes on.

@throws CacheException indicates a cache level error
@throws ForceReattemptException if the peer is no longer available
@throws InterruptedException if the thread is interrupted in the operation for example during
        shutdown.
geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveIndexesMessage.java