private AsyncSingleAction(Request request, ActionListener<Response> listener) {
      this.listener = listener;

      ClusterState clusterState = clusterService.state();
      nodes = clusterState.nodes();
      ClusterBlockException blockException = checkGlobalBlock(clusterState);
      if (blockException != null) {
        throw blockException;
      }

      String concreteSingleIndex;
      if (resolveIndex(request)) {
        concreteSingleIndex =
            clusterState.metaData().concreteSingleIndex(request.index(), request.indicesOptions());
      } else {
        concreteSingleIndex = request.index();
      }
      this.internalRequest = new InternalRequest(request, concreteSingleIndex);

      blockException = checkRequestBlock(clusterState, internalRequest);
      if (blockException != null) {
        throw blockException;
      }
      this.shardsIt = shards(clusterState, internalRequest);
    }
    protected AsyncBroadcastAction(Request request, ActionListener<Response> listener) {
      this.request = request;
      this.listener = listener;

      clusterState = clusterService.state();

      ClusterBlockException blockException = checkGlobalBlock(clusterState, request);
      if (blockException != null) {
        throw blockException;
      }
      // update to concrete indices
      String[] concreteIndices =
          clusterState.metaData().concreteIndices(request.indicesOptions(), request.indices());
      blockException = checkRequestBlock(clusterState, request, concreteIndices);
      if (blockException != null) {
        throw blockException;
      }

      nodes = clusterState.nodes();
      logger.trace("resolving shards based on cluster state version [{}]", clusterState.version());
      shardsIts = shards(clusterState, request, concreteIndices);
      expectedOps = shardsIts.size();

      shardsResponses = new AtomicReferenceArray<Object>(expectedOps);
    }
 public IndicesOptions indicesOptions() {
   return indicesLevelRequest.indicesOptions();
 }
 @Override
 public IndicesOptions indicesOptions() {
   return request.indicesOptions();
 }