@Override
    public void initializeIndex(boolean loadEntries) throws IMQException {
      initEntriesUpdated = 0;
      try {
        // Asif: Since an index initialization can happen multiple times
        // for a given region, due to clear operation, we are using harcoded
        // scope ID of 1 , as otherwise if obtained from ExecutionContext
        // object, it will get incremented on very index initialization
        initContext.newScope(1);
        for (int i = 0; i < iteratorSize; i++) {
          CompiledIteratorDef iterDef = (CompiledIteratorDef) indexInitIterators.get(i);
          RuntimeIterator rIter = null;
          if (!hasInitOccurredOnce) {
            iterDef.computeDependencies(initContext);
            rIter = iterDef.getRuntimeIterator(initContext);
            initContext.addToIndependentRuntimeItrMapForIndexCreation(iterDef);
          }
          if (rIter == null) {
            rIter = iterDef.getRuntimeIterator(initContext);
          }
          initContext.bindIterator(rIter);
        }
        hasInitOccurredOnce = true;
        if (indexResultSetType == null) {
          indexResultSetType = createIndexResultSetType();
        }
        if (loadEntries) {
          doNestedIterationsForIndexInit(0, initContext.getCurrentIterators());
        }
      } catch (IMQException imqe) {
        throw imqe;
      } catch (Exception e) {
        throw new IMQException(e);
      } finally {
        initContext.popScope();
      }
    }
This function is used for creating Index data at the start
geode-core/src/main/java/org/apache/geode/cache/query/internal/index/HashIndex.java