/** * Creates a new StreamSource. * * @param config Configuration to determine which stream to put records to and get {@link * AWSCredentialsProvider} * @param inputFile File containing record data to emit on each line * @param loopOverStreamSource Loop over the stream source to continually put records */ public StreamSource( KinesisConnectorConfiguration config, String inputFile, boolean loopOverStreamSource) { this.config = config; this.inputFile = inputFile; this.loopOverInputFile = loopOverStreamSource; this.objectMapper = new ObjectMapper(); kinesisClient = new AmazonKinesisClient(config.AWS_CREDENTIALS_PROVIDER); kinesisClient.setRegion(RegionUtils.getRegion(config.REGION_NAME)); if (config.KINESIS_ENDPOINT != null) { kinesisClient.setEndpoint(config.KINESIS_ENDPOINT); } KinesisUtils.createInputStream(config); }
/** * Create the AmazonKinesisClient with the given credentials * * @param accessKey AWS accessKeyId * @param secretKey AWS secretAccessKey * @throws Exception */ public void createKinesisClient(String accessKey, String secretKey, String endPoint) throws Exception { if (client == null) { try { client = new AmazonKinesisClient(new BasicAWSCredentials(accessKey, secretKey)); if (endPoint != null) { client.setEndpoint(endPoint); } } catch (Exception e) { throw new AmazonClientException("Unable to load credentials", e); } } }
public S3ManifestEmitter(KinesisConnectorConfiguration configuration) { super(configuration); manifestStream = configuration.KINESIS_OUTPUT_STREAM; kinesisClient = new AmazonKinesisClient(configuration.AWS_CREDENTIALS_PROVIDER); kinesisClient.setEndpoint(configuration.KINESIS_ENDPOINT); }