@VisibleForTesting
  boolean populateEmptyIndexes(Set<Index> indexes,
      HashMap<String, Exception> exceptionsMap) {
    boolean throwException = false;
    if (getDataStore() != null && indexes.size() > 0) {
      Set localBuckets = getDataStore().getAllLocalBuckets();
      for (final Object localBucket : localBuckets) {
        Map.Entry entry = (Map.Entry) localBucket;
        Region bucket = (Region) entry.getValue();

        if (bucket == null) {
          continue;
        }
        IndexManager bucketIndexManager = IndexUtils.getIndexManager(cache, bucket, true);
        if (bucketIndexManager == null) {
          cache.getCancelCriterion().checkCancelInProgress();
        }
        Set<Index> bucketIndexes = getBucketIndexesForPRIndexes(bucket, indexes);
        try {
          bucketIndexManager.populateIndexes(bucketIndexes);
        } catch (MultiIndexCreationException ex) {
          exceptionsMap.putAll(ex.getExceptionsMap());
          throwException = true;
        }
      }
    }
    return throwException;
  }
Creates the actual index on this partitioned regions.

@param remotelyOriginated true if the index is created because of a remote index creation call
@param indexType the type of index created.
@param indexName the name for the index to be created
@param indexedExpression expression for index creation.
@param fromClause the from clause for index creation
@param imports class to be imported for fromClause.

@return Index an index created on this region.
@throws ForceReattemptException indicating the operation failed to create a remote index
@throws IndexCreationException if the index is not created properly
@throws IndexNameConflictException if an index exists with this name on this region
@throws IndexExistsException if and index already exists with the same properties as the one
        created
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java