Пример #1
0
        internal MergeShardsResponse MergeShards(MergeShardsRequest request)
        {
            var marshaller   = new MergeShardsRequestMarshaller();
            var unmarshaller = MergeShardsResponseUnmarshaller.Instance;

            return(Invoke <MergeShardsRequest, MergeShardsResponse>(request, marshaller, unmarshaller));
        }
Пример #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the MergeShards operation.
        /// <seealso cref="Amazon.Kinesis.IAmazonKinesis.MergeShards"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the MergeShards operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task <MergeShardsResponse> MergeShardsAsync(MergeShardsRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new MergeShardsRequestMarshaller();
            var unmarshaller = MergeShardsResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, MergeShardsRequest, MergeShardsResponse>(request, marshaller, unmarshaller, signer, cancellationToken));
        }
Пример #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the MergeShards operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the MergeShards operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task <MergeShardsResponse> MergeShardsAsync(MergeShardsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new MergeShardsRequestMarshaller();
            var unmarshaller = MergeShardsResponseUnmarshaller.Instance;

            return(InvokeAsync <MergeShardsRequest, MergeShardsResponse>(request, marshaller,
                                                                         unmarshaller, cancellationToken));
        }
Пример #4
0
        /// <summary>
        /// <para>This operation merges two adjacent shards in a stream and combines them into a single shard to reduce the stream's capacity to ingest
        /// and transport data. Two shards are considered adjacent if the union of the hash key ranges for the two shards form a contiguous set with no
        /// gaps. For example, if you have two shards, one with a hash key range of 276...381 and the other with a hash key range of 382...454, then you
        /// could merge these two shards into a single shard that would have a hash key range of 276...454. After the merge, the single child shard
        /// receives data for all hash key values covered by the two parent shards.</para> <para> <c>MergeShards</c> is called when there is a need to
        /// reduce the overall capacity of a stream because of excess capacity that is not being used. The operation requires that you specify the shard
        /// to be merged and the adjacent shard for a given stream. For more information about merging shards, see the <a href="http://docs.aws.amazon.com/kinesis/latest/dev/">Amazon Kinesis Developer Guide</a> .</para> <para>If the stream is in the ACTIVE
        /// state, you can call <c>MergeShards</c> . If a stream is in CREATING or UPDATING or DELETING states, then Amazon Kinesis returns a
        /// <c>ResourceInUseException</c> .
        /// If the specified stream does not exist, Amazon Kinesis returns a <c>ResourceNotFoundException</c> . </para> <para>You can use
        /// the DescribeStream operation to check the state of the stream, which is returned in <c>StreamStatus</c> .</para> <para> <c>MergeShards</c>
        /// is an asynchronous operation. Upon receiving a <c>MergeShards</c> request, Amazon Kinesis immediately returns a response and sets the
        /// <c>StreamStatus</c> to UPDATING. After the operation is completed, Amazon Kinesis sets the <c>StreamStatus</c> to ACTIVE. Read and write
        /// operations continue to work while the stream is in the UPDATING state. </para> <para>You use the DescribeStream operation to determine the
        /// shard IDs that are specified in the <c>MergeShards</c> request. </para> <para>If you try to operate on too many streams in parallel using
        /// CreateStream, DeleteStream, <c>MergeShards</c> or SplitShard, you will receive a <c>LimitExceededException</c> . </para> <para>
        /// <c>MergeShards</c> has limit of 5 transactions per second per account.</para>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the MergeShards service method on AmazonKinesis.</param>
        ///
        /// <exception cref="T:Amazon.Kinesis.Model.LimitExceededException" />
        /// <exception cref="T:Amazon.Kinesis.Model.ResourceInUseException" />
        /// <exception cref="T:Amazon.Kinesis.Model.InvalidArgumentException" />
        /// <exception cref="T:Amazon.Kinesis.Model.ResourceNotFoundException" />
        public MergeShardsResponse MergeShards(MergeShardsRequest request)
        {
            var task = MergeShardsAsync(request);

            try
            {
                return(task.Result);
            }
            catch (AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return(null);
            }
        }
Пример #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the MergeShards operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the MergeShards operation on AmazonKinesisClient.</param>
        /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
        /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        public void MergeShardsAsync(MergeShardsRequest request, AmazonServiceCallback <MergeShardsRequest, MergeShardsResponse> callback, AsyncOptions options = null)
        {
            options = options == null?new AsyncOptions():options;
            var marshaller   = new MergeShardsRequestMarshaller();
            var unmarshaller = MergeShardsResponseUnmarshaller.Instance;
            Action <AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;

            if (callback != null)
            {
                callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
                    AmazonServiceResult <MergeShardsRequest, MergeShardsResponse> responseObject
                        = new AmazonServiceResult <MergeShardsRequest, MergeShardsResponse>((MergeShardsRequest)req, (MergeShardsResponse)res, ex, ao.State);
                    callback(responseObject);
                }
            }
            ;
            BeginInvoke <MergeShardsRequest>(request, marshaller, unmarshaller, options, callbackHelper);
        }
Пример #6
0
 public Task <KinesisResponse> MergeShardsAsync(MergeShardsRequest request)
 {
     return(SendAsync <KinesisResponse>("MergeShards", request));
 }
Пример #7
0
 public Task <KinesisResponse> MergeShardsAsync(MergeShardsRequest request)
 => SendAsync <KinesisResponse>("MergeShards", request);