use of com.amazonaws.services.kinesis.model.CreateStreamRequest in project hazelcast by hazelcast.
the class KinesisTestHelper method createStream.
public void createStream(int shardCount) {
if (streamExists()) {
throw new IllegalStateException("Stream already exists");
}
callSafely(() -> {
CreateStreamRequest request = new CreateStreamRequest();
request.setShardCount(shardCount);
request.setStreamName(stream);
return kinesis.createStream(request);
}, "stream creation");
waitForStreamToActivate();
}
use of com.amazonaws.services.kinesis.model.CreateStreamRequest in project apex-malhar by apache.
the class KinesisOperatorTestBase method beforeTest.
@Before
public void beforeTest() {
CreateStreamRequest streamRequest = null;
createClient();
for (int i = 0; i < 100; ++i) {
try {
streamName = streamNamePrefix + i;
streamRequest = new CreateStreamRequest();
streamRequest.setStreamName(streamName);
streamRequest.setShardCount(shardCount);
client.createStream(streamRequest);
logger.info("created stream {}.", streamName);
Thread.sleep(30000);
break;
} catch (ResourceInUseException riue) {
logger.warn("Resource is in use.", riue.getMessage());
} catch (Exception e) {
logger.error("Got exception.", e);
throw new RuntimeException(e);
}
}
}
Aggregations