Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split-shard kinesis Sense data #898

Open
pims opened this issue May 25, 2015 · 0 comments
Open

Split-shard kinesis Sense data #898

pims opened this issue May 25, 2015 · 0 comments

Comments

@pims
Copy link
Contributor

pims commented May 25, 2015

Example from http://awsdocs.s3.amazonaws.com/kinesis/latest/kinesis-dg.pdf

SplitShardRequest splitShardRequest = new SplitShardRequest();
splitShardRequest.setStreamName(myStreamName);
splitShardRequest.setShardToSplit(shard.getShardId());

/*
Determine the hash key value which is half-way between the lowest and highest values in the shard.This
is the starting hash key value for the child shard that will contain the upper half of the hash keys from the
parent shard. Specify this value in the setNewStartingHashKey() method.You need specify only this
value; the Amazon Kinesis service automatically distributes the hash keys below this value to the other
child shard that is created by the split.The last step is to call the splitShard() method on the Amazon
Kinesis service client.
*/
BigInteger startingHashKey = new BigInteger(shard.getHashKeyRange().getStarting
HashKey());
BigInteger endingHashKey = new BigInteger(shard.getHashKeyRange().getEnding
HashKey());
String newStartingHashKey = startingHashKey.add(endingHashKey).divide(new Bi
gInteger("2")).toString();
splitShardRequest.setNewStartingHashKey(newStartingHashKey);
client.splitShard(splitShardRequest);
@pims pims self-assigned this May 25, 2015
@pims pims removed their assignment Aug 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant