Class TransportBroadcastByNodeAction<Request extends BroadcastRequest<Request>,​Response extends BroadcastResponse,​ShardOperationResult extends Writeable>

    • Method Detail

      • readShardResult

        protected abstract ShardOperationResult readShardResult​(StreamInput in)
                                                         throws java.io.IOException
        Deserialize a shard-level result from an input stream
        Parameters:
        in - input stream
        Returns:
        a deserialized shard-level result
        Throws:
        java.io.IOException
      • newResponse

        protected abstract Response newResponse​(Request request,
                                                int totalShards,
                                                int successfulShards,
                                                int failedShards,
                                                java.util.List<ShardOperationResult> results,
                                                java.util.List<DefaultShardOperationFailedException> shardFailures,
                                                ClusterState clusterState)
        Creates a new response to the underlying request.
        Parameters:
        request - the underlying request
        totalShards - the total number of shards considered for execution of the operation
        successfulShards - the total number of shards for which execution of the operation was successful
        failedShards - the total number of shards for which execution of the operation failed
        results - the per-node aggregated shard-level results
        shardFailures - the exceptions corresponding to shard operation failures
        clusterState - the cluster state
        Returns:
        the response
      • readRequestFrom

        protected abstract Request readRequestFrom​(StreamInput in)
                                            throws java.io.IOException
        Deserialize a request from an input stream
        Parameters:
        in - input stream
        Returns:
        a de-serialized request
        Throws:
        java.io.IOException
      • shardOperation

        protected abstract ShardOperationResult shardOperation​(Request request,
                                                               ShardRouting shardRouting)
                                                        throws java.io.IOException
        Executes the shard-level operation. This method is called once per shard serially on the receiving node.
        Parameters:
        request - the node-level request
        shardRouting - the shard on which to execute the operation
        Returns:
        the result of the shard-level operation for the shard
        Throws:
        java.io.IOException
      • shards

        protected abstract ShardsIterator shards​(ClusterState clusterState,
                                                 Request request,
                                                 java.lang.String[] concreteIndices)
        Determines the shards on which this operation will be executed on. The operation is executed once per shard.
        Parameters:
        clusterState - the cluster state
        request - the underlying request
        concreteIndices - the concrete indices on which to execute the operation
        Returns:
        the shards on which to execute the operation
      • checkGlobalBlock

        protected abstract ClusterBlockException checkGlobalBlock​(ClusterState state,
                                                                  Request request)
        Executes a global block check before polling the cluster state.
        Parameters:
        state - the cluster state
        request - the underlying request
        Returns:
        a non-null exception if the operation is blocked
      • checkRequestBlock

        protected abstract ClusterBlockException checkRequestBlock​(ClusterState state,
                                                                   Request request,
                                                                   java.lang.String[] concreteIndices)
        Executes a global request-level check before polling the cluster state.
        Parameters:
        state - the cluster state
        request - the underlying request
        concreteIndices - the concrete indices on which to execute the operation
        Returns:
        a non-null exception if the operation if blocked