Container for the parameters to the SplitShard operation.

This operation splits a shard into two new shards in the stream, to increase the stream's capacity to ingest and transport data. SplitShard is called when there is a need to increase the overall capacity of stream because of an expected increase in the volume of data records being ingested.

SplitShard can also be used when a given shard appears to be approaching its maximum utilization, for example, when the set of producers sending data into the specific shard are suddenly sending more than previously anticipated. You can also call the SplitShard operation to increase stream capacity, so that more Amazon Kinesis applications can simultaneously read data from the stream for real-time processing.

The SplitShard operation requires that you specify the shard to be split and the new hash key, which is the position in the shard where the shard gets split in two. In many cases, the new hash key might simply be the average of the beginning and ending hash key, but it can be any hash key value in the range being mapped into the shard. For more information about splitting shards, see the Amazon Kinesis Developer Guide .

You can use the DescribeStream operation to determine the shard ID and hash key values for the ShardToSplit and NewStartingHashKey parameters that are specified in the SplitShard request.

SplitShard is an asynchronous operation. Upon receiving a SplitShard request, Amazon Kinesis immediately returns a response and sets the stream status to UPDATING. After the operation is completed, Amazon Kinesis sets the stream status to ACTIVE. Read and write operations continue to work while the stream is in the UPDATING state.

You can use DescribeStream to check the status of the stream, which is returned in StreamStatus . If the stream is in the ACTIVE state, you can call SplitShard . If a stream is in CREATING or UPDATING or DELETING states, then Amazon Kinesis returns a ResourceInUseException .

If the specified stream does not exist, Amazon Kinesis returns a ResourceNotFoundException . If you try to create more shards than are authorized for your account, you receive a LimitExceededException .

Note: The default limit for an AWS account is two shards per stream. If you need to create a stream with more than two shards, contact AWS Support to increase the limit on your account.

If you try to operate on too many streams in parallel using CreateStream, DeleteStream, MergeShards or SplitShard, you will receive a LimitExceededException .

SplitShard has limit of 5 transactions per second per account.

Inheritance: AmazonKinesisRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Kinesis.Model.SplitShardRequest();

            if (cmdletContext.NewStartingHashKey != null)
            {
                request.NewStartingHashKey = cmdletContext.NewStartingHashKey;
            }
            if (cmdletContext.ShardToSplit != null)
            {
                request.ShardToSplit = cmdletContext.ShardToSplit;
            }
            if (cmdletContext.StreamName != null)
            {
                request.StreamName = cmdletContext.StreamName;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
        /// <summary>
        /// <para>This operation splits a shard into two new shards in the stream, to increase the stream's capacity to ingest and transport data.
        /// <c>SplitShard</c> is called when there is a need to increase the overall capacity of stream because of an expected increase in the volume of
        /// data records being ingested. </para> <para> <c>SplitShard</c> can also be used when a given shard appears to be approaching its maximum
        /// utilization, for example, when the set of producers sending data into the specific shard are suddenly sending more than previously
        /// anticipated. You can also call the <c>SplitShard</c> operation to increase stream capacity, so that more Amazon Kinesis applications can
        /// simultaneously read data from the stream for real-time processing. </para> <para>The <c>SplitShard</c> operation requires that you specify
        /// the shard to be split and the new hash key, which is the position in the shard where the shard gets split in two. In many cases, the new
        /// hash key might simply be the average of the beginning and ending hash key, but it can be any hash key value in the range being mapped into
        /// the shard. For more information about splitting shards, see the <a href="http://docs.aws.amazon.com/kinesis/latest/dev/">Amazon Kinesis
        /// Developer Guide</a> .
        /// </para> <para>You can use the DescribeStream operation to determine the shard ID and hash key values for the <c>ShardToSplit</c>
        /// and <c>NewStartingHashKey</c> parameters that are specified in the <c>SplitShard</c> request.</para> <para> <c>SplitShard</c> is an
        /// asynchronous operation. Upon receiving a <c>SplitShard</c> request, Amazon Kinesis immediately returns a response and sets the stream status
        /// to UPDATING. After the operation is completed, Amazon Kinesis sets the stream status to ACTIVE. Read and write operations continue to work
        /// while the stream is in the UPDATING state. </para> <para>You can use <c>DescribeStream</c> to check the status of the stream, which is
        /// returned in <c>StreamStatus</c> .
        /// If the stream is in the ACTIVE state, you can call <c>SplitShard</c> .
        /// If a stream is in CREATING or UPDATING or DELETING states, then Amazon Kinesis returns a <c>ResourceInUseException</c> .</para>
        /// <para>If the specified stream does not exist, Amazon Kinesis returns a <c>ResourceNotFoundException</c> .
        /// If you try to create more shards than are authorized for your account, you receive a <c>LimitExceededException</c> .
        /// </para> <para> <b>Note:</b> The default limit for an AWS account is two shards per stream. If you need to create a stream with more than two
        /// shards, contact AWS Support to increase the limit on your account.</para> <para>If you try to operate on too many streams in parallel using
        /// CreateStream, DeleteStream, MergeShards or SplitShard, you will receive a <c>LimitExceededException</c> . </para> <para> <c>SplitShard</c>
        /// has limit of 5 transactions per second per account.</para>
        /// </summary>
        /// 
        /// <param name="splitShardRequest">Container for the necessary parameters to execute the SplitShard 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" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<SplitShardResponse> SplitShardAsync(SplitShardRequest splitShardRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SplitShardRequestMarshaller();
            var unmarshaller = SplitShardResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, SplitShardRequest, SplitShardResponse>(splitShardRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
		internal SplitShardResponse SplitShard(SplitShardRequest request)
        {
            var task = SplitShardAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the SplitShard operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SplitShard 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<SplitShardResponse> SplitShardAsync(SplitShardRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SplitShardRequestMarshaller();
            var unmarshaller = SplitShardResponseUnmarshaller.Instance;

            return InvokeAsync<SplitShardRequest,SplitShardResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal SplitShardResponse SplitShard(SplitShardRequest request)
        {
            var marshaller = new SplitShardRequestMarshaller();
            var unmarshaller = SplitShardResponseUnmarshaller.Instance;

            return Invoke<SplitShardRequest,SplitShardResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the SplitShard operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SplitShard operation on AmazonKinesisClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">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>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSplitShard
        ///         operation.</returns>
        public IAsyncResult BeginSplitShard(SplitShardRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new SplitShardRequestMarshaller();
            var unmarshaller = SplitShardResponseUnmarshaller.Instance;

            return BeginInvoke<SplitShardRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// <para>This operation splits a shard into two new shards in the stream, to increase the stream's capacity to ingest and transport data.
        /// <c>SplitShard</c> is called when there is a need to increase the overall capacity of stream because of an expected increase in the volume of
        /// data records being ingested. </para> <para> <c>SplitShard</c> can also be used when a given shard appears to be approaching its maximum
        /// utilization, for example, when the set of producers sending data into the specific shard are suddenly sending more than previously
        /// anticipated. You can also call the <c>SplitShard</c> operation to increase stream capacity, so that more Amazon Kinesis applications can
        /// simultaneously read data from the stream for real-time processing. </para> <para>The <c>SplitShard</c> operation requires that you specify
        /// the shard to be split and the new hash key, which is the position in the shard where the shard gets split in two. In many cases, the new
        /// hash key might simply be the average of the beginning and ending hash key, but it can be any hash key value in the range being mapped into
        /// the shard. For more information about splitting shards, see the <a href="http://docs.aws.amazon.com/kinesis/latest/dev/">Amazon Kinesis
        /// Developer Guide</a> .
        /// </para> <para>You can use the DescribeStream operation to determine the shard ID and hash key values for the <c>ShardToSplit</c>
        /// and <c>NewStartingHashKey</c> parameters that are specified in the <c>SplitShard</c> request.</para> <para> <c>SplitShard</c> is an
        /// asynchronous operation. Upon receiving a <c>SplitShard</c> request, Amazon Kinesis immediately returns a response and sets the stream status
        /// to UPDATING. After the operation is completed, Amazon Kinesis sets the stream status to ACTIVE. Read and write operations continue to work
        /// while the stream is in the UPDATING state. </para> <para>You can use <c>DescribeStream</c> to check the status of the stream, which is
        /// returned in <c>StreamStatus</c> .
        /// If the stream is in the ACTIVE state, you can call <c>SplitShard</c> .
        /// If a stream is in CREATING or UPDATING or DELETING states, then Amazon Kinesis returns a <c>ResourceInUseException</c> .</para>
        /// <para>If the specified stream does not exist, Amazon Kinesis returns a <c>ResourceNotFoundException</c> .
        /// If you try to create more shards than are authorized for your account, you receive a <c>LimitExceededException</c> .
        /// </para> <para> <b>Note:</b> The default limit for an AWS account is 10 shards per stream. If you need to create a stream with more than 10
        /// shards, <a href="http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html">contact AWS Support</a> to increase the limit on
        /// your account.</para> <para>If you try to operate on too many streams in parallel using CreateStream, DeleteStream, MergeShards or
        /// SplitShard, you will receive a <c>LimitExceededException</c> . </para> <para> <c>SplitShard</c> has limit of 5 transactions per second per
        /// account.</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SplitShard 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 SplitShardResponse SplitShard(SplitShardRequest request)
        {
            var task = SplitShardAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
 private Amazon.Kinesis.Model.SplitShardResponse CallAWSServiceOperation(IAmazonKinesis client, Amazon.Kinesis.Model.SplitShardRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Kinesis", "SplitShard");
     try
     {
         #if DESKTOP
         return(client.SplitShard(request));
         #elif CORECLR
         return(client.SplitShardAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
Example #9
0
 /// <summary>
 /// Initiates the asynchronous execution of the SplitShard operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the SplitShard 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 SplitShardAsync(SplitShardRequest request, AmazonServiceCallback<SplitShardRequest, SplitShardResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new SplitShardRequestMarshaller();
     var unmarshaller = SplitShardResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<SplitShardRequest,SplitShardResponse> responseObject 
                     = new AmazonServiceResult<SplitShardRequest,SplitShardResponse>((SplitShardRequest)req, (SplitShardResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<SplitShardRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
 IAsyncResult invokeSplitShard(SplitShardRequest splitShardRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new SplitShardRequestMarshaller().Marshall(splitShardRequest);
     var unmarshaller = SplitShardResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 /// <summary>
 /// Initiates the asynchronous execution of the SplitShard operation.
 /// <seealso cref="Amazon.Kinesis.IAmazonKinesis.SplitShard"/>
 /// </summary>
 /// 
 /// <param name="splitShardRequest">Container for the necessary parameters to execute the SplitShard operation on AmazonKinesis.</param>
 /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
 /// <param name="state">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 IAsyncResult BeginSplitShard(SplitShardRequest splitShardRequest, AsyncCallback callback, object state)
 {
     return invokeSplitShard(splitShardRequest, callback, state, false);
 }
 /// <summary>
 /// <para>This operation splits a shard into two new shards in the stream, to increase the stream's capacity to ingest and transport data.
 /// <c>SplitShard</c> is called when there is a need to increase the overall capacity of stream because of an expected increase in the volume of
 /// data records being ingested. </para> <para> <c>SplitShard</c> can also be used when a given shard appears to be approaching its maximum
 /// utilization, for example, when the set of producers sending data into the specific shard are suddenly sending more than previously
 /// anticipated. You can also call the <c>SplitShard</c> operation to increase stream capacity, so that more Amazon Kinesis applications can
 /// simultaneously read data from the stream for real-time processing. </para> <para>The <c>SplitShard</c> operation requires that you specify
 /// the shard to be split and the new hash key, which is the position in the shard where the shard gets split in two. In many cases, the new
 /// hash key might simply be the average of the beginning and ending hash key, but it can be any hash key value in the range being mapped into
 /// the shard. For more information about splitting shards, see the <a href="http://docs.aws.amazon.com/kinesis/latest/dev/" >Amazon Kinesis
 /// Developer Guide</a> .
 /// </para> <para>You can use the DescribeStream operation to determine the shard ID and hash key values for the <c>ShardToSplit</c>
 /// and <c>NewStartingHashKey</c> parameters that are specified in the <c>SplitShard</c> request.</para> <para> <c>SplitShard</c> is an
 /// asynchronous operation. Upon receiving a <c>SplitShard</c> request, Amazon Kinesis immediately returns a response and sets the stream status
 /// to UPDATING. After the operation is completed, Amazon Kinesis sets the stream status to ACTIVE. Read and write operations continue to work
 /// while the stream is in the UPDATING state. </para> <para>You can use <c>DescribeStream</c> to check the status of the stream, which is
 /// returned in <c>StreamStatus</c> .
 /// If the stream is in the ACTIVE state, you can call <c>SplitShard</c> .
 /// If a stream is in CREATING or UPDATING or DELETING states, then Amazon Kinesis returns a <c>ResourceInUseException</c> .</para>
 /// <para>If the specified stream does not exist, Amazon Kinesis returns a <c>ResourceNotFoundException</c> .
 /// If you try to create more shards than are authorized for your account, you receive a <c>LimitExceededException</c> .
 /// </para> <para> <b>Note:</b> The default limit for an AWS account is 10 shards per stream. If you need to create a stream with more than 10
 /// shards, <a href="http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html" >contact AWS Support</a> to increase the limit on
 /// your account.</para> <para>If you try to operate on too many streams in parallel using CreateStream, DeleteStream, MergeShards or
 /// SplitShard, you will receive a <c>LimitExceededException</c> . </para> <para> <c>SplitShard</c> has limit of 5 transactions per second per
 /// account.</para>
 /// </summary>
 /// 
 /// <param name="splitShardRequest">Container for the necessary parameters to execute the SplitShard service method on AmazonKinesis.</param>
 /// 
 /// <exception cref="LimitExceededException"/>
 /// <exception cref="ResourceInUseException"/>
 /// <exception cref="InvalidArgumentException"/>
 /// <exception cref="ResourceNotFoundException"/>
 public SplitShardResponse SplitShard(SplitShardRequest splitShardRequest)
 {
     IAsyncResult asyncResult = invokeSplitShard(splitShardRequest, null, null, true);
     return EndSplitShard(asyncResult);
 }