Search in sources :

Example 1 with HashRange

use of com.hazelcast.jet.kinesis.impl.source.HashRange in project hazelcast by hazelcast.

the class AbstractKinesisTest method splitShard.

protected void splitShard(Shard shard) {
    HashRange range = HashRange.range(shard.getHashKeyRange());
    BigInteger middle = range.getMinInclusive().add(range.getMaxExclusive()).divide(BigInteger.valueOf(2));
    SplitShardRequest request = new SplitShardRequest();
    request.setStreamName(STREAM);
    request.setShardToSplit(shard.getShardId());
    request.setNewStartingHashKey(middle.toString());
    System.out.println("Splitting " + shard.getShardId());
    kinesis.splitShard(request);
}
Also used : HashRange(com.hazelcast.jet.kinesis.impl.source.HashRange) BigInteger(java.math.BigInteger) SplitShardRequest(com.amazonaws.services.kinesis.model.SplitShardRequest)

Aggregations

SplitShardRequest (com.amazonaws.services.kinesis.model.SplitShardRequest)1 HashRange (com.hazelcast.jet.kinesis.impl.source.HashRange)1 BigInteger (java.math.BigInteger)1