public IndexData getIndex(IndexType indexType, String[] definitions,
      CompiledValue indexedExpression, ExecutionContext context)
      throws TypeMismatchException, NameResolutionException {
    IndexData indxData = null;
    int qItrSize = definitions.length;
    Iterator it = indexes.values().iterator();
    StringBuilder sb = new StringBuilder();
    indexedExpression.generateCanonicalizedExpression(sb, context);
    String indexExprStr = sb.toString();
    while (it.hasNext()) {
      int[] mapping = new int[qItrSize];
      Object ind = it.next();
      // Check if the returned value is instance of Index (this means
      // the index is not in create phase, its created successfully).
      if (!(ind instanceof Index)) {
        continue;
      }
      Index index = (Index) ind;
      if (!((IndexProtocol) ind).isMatchingWithIndexExpression(indexedExpression, indexExprStr,
          context) || index.getType() != indexType) {
        continue;
      }

      int matchLevel = getMatchLevel(definitions,
          ((IndexProtocol) index).getCanonicalizedIteratorDefinitions(), mapping);

      if (matchLevel == 0) {
        indxData = new IndexData((IndexProtocol) index, 0/* Exact Match */, mapping);
        break;
      }

    }
    return indxData;
  }
Get the Index with the specified indexType, fromClause, indexedExpression TODO: Asif :Check if
synchronization is needed while obtaining Array of Indexes as similar to what we have used
during index updates. This function will get the exact index , if available, else will return
null

@param indexType the type of index
@param definitions the String array containing the required defintions of the fromClause of the
       index
@param indexedExpression the indexedExpression for the index
@param context ExecutionContext
@return the sole index of the region with these parameters, or null if there isn't one
geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java