本文整理汇总了Java中com.amazonaws.services.kinesis.AmazonKinesisClientBuilder类的典型用法代码示例。如果您正苦于以下问题:Java AmazonKinesisClientBuilder类的具体用法?Java AmazonKinesisClientBuilder怎么用?Java AmazonKinesisClientBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AmazonKinesisClientBuilder类属于com.amazonaws.services.kinesis包,在下文中一共展示了AmazonKinesisClientBuilder类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
/**
* Loads the test-specific Log4J configuration and resets the environment.
*/
public void setUp(String propertiesName, String streamName) throws Exception
{
URL config = ClassLoader.getSystemResource(propertiesName);
assertNotNull("missing configuration: " + propertiesName, config);
LogManager.resetConfiguration();
PropertyConfigurator.configure(config);
localLogger = Logger.getLogger(getClass());
localClient = AmazonKinesisClientBuilder.defaultClient();
deleteStreamIfExists(streamName);
}
示例2: build
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
public com.amazonaws.services.kinesis.AmazonKinesis build(AmazonKinesis kinesisProperties) {
com.amazonaws.services.kinesis.AmazonKinesisClientBuilder clientBuilder = com.amazonaws.services.kinesis.AmazonKinesisClientBuilder.standard();
clientBuilder.setRegion(kinesisProperties.getRegion());
clientBuilder.setCredentials(new AWSCredentialsProvider() {
@Override
public AWSCredentials getCredentials() {
return new BasicAWSCredentials(kinesisProperties.getKey(), kinesisProperties.getSecret());
}
@Override
public void refresh() {
}
});
clientBuilder.setClientConfiguration(new ClientConfiguration());
return clientBuilder.build();
}
示例3: createKinesisClient
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
/**
* Creates an AmazonKinesis client.
* @param configProps configuration properties containing the access key, secret key, and region
* @return a new AmazonKinesis client
*/
public static AmazonKinesis createKinesisClient(Properties configProps) {
// set a Flink-specific user agent
ClientConfiguration awsClientConfig = new ClientConfigurationFactory().getConfig()
.withUserAgentPrefix(String.format(USER_AGENT_FORMAT,
EnvironmentInformation.getVersion(),
EnvironmentInformation.getRevisionInformation().commitId));
// utilize automatic refreshment of credentials by directly passing the AWSCredentialsProvider
AmazonKinesisClientBuilder builder = AmazonKinesisClientBuilder.standard()
.withCredentials(AWSUtil.getCredentialsProvider(configProps))
.withClientConfiguration(awsClientConfig)
.withRegion(Regions.fromName(configProps.getProperty(AWSConfigConstants.AWS_REGION)));
if (configProps.containsKey(AWSConfigConstants.AWS_ENDPOINT)) {
// Set signingRegion as null, to facilitate mocking Kinesis for local tests
builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(
configProps.getProperty(AWSConfigConstants.AWS_ENDPOINT),
null));
}
return builder.build();
}
示例4: create
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
@Override
public AmazonKinesis create(KinesisSourceConnectorConfig config) {
AmazonKinesisClientBuilder builder = AmazonKinesisClient.builder()
.withCredentials(config.awsCredentialsProvider())
.withRegion(config.kinesisRegion);
return builder.build();
}
示例5: getKinesisClient
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
@Override
public AmazonKinesis getKinesisClient() {
AmazonKinesisClientBuilder clientBuilder =
AmazonKinesisClientBuilder.standard().withCredentials(getCredentialsProvider());
if (serviceEndpoint == null) {
clientBuilder.withRegion(region);
} else {
clientBuilder.withEndpointConfiguration(
new AwsClientBuilder.EndpointConfiguration(serviceEndpoint, region.getName()));
}
return clientBuilder.build();
}
示例6: getKinesisClient
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
private static AmazonKinesis getKinesisClient(ClientConfiguration awsClientConfig, KinesisConfigBean conf) throws StageException {
AmazonKinesisClientBuilder builder = AmazonKinesisClientBuilder
.standard()
.withClientConfiguration(checkNotNull(awsClientConfig))
.withCredentials(AWSUtil.getCredentialsProvider(conf.awsConfig));
if (AWSRegions.OTHER == conf.region) {
builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(conf.endpoint, null));
} else {
builder.withRegion(conf.region.getLabel());
}
return builder.build();
}
示例7: beforeClass
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
@BeforeClass
public void beforeClass() {
String awsRegion = "us-east-1";
String awsAccessKeyId = "<access key id>";
String awsSecretAccessKey = "<secret access key>";
BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(awsAccessKeyId, awsSecretAccessKey);
client = AmazonKinesisClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(basicAWSCredentials))
.withRegion(awsRegion)
.build();
}
示例8: createKinesisClient
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
public static AmazonKinesisClient createKinesisClient() {
BasicCredentialsProvider credentials = BasicCredentialsProvider.standard();
AmazonKinesisClient client = !credentials.isValid() ? null : (AmazonKinesisClient)
AmazonKinesisClientBuilder.standard()
.withCredentials(credentials)
.withRegion("eu-west-1").build();
return client;
}
示例9: WatermarkTracker
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
public WatermarkTracker(String region, String streamName) {
this.streamName = streamName;
this.kinesisClient = AmazonKinesisClientBuilder.standard().withRegion(region).build();
}
示例10: createClient
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
/**
* Factory method called by smoketest
*/
public static AmazonKinesis createClient()
{
return AmazonKinesisClientBuilder.defaultClient();
}
示例11: setClientBuilder
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
public void setClientBuilder(AmazonKinesisClientBuilder clientBuilder) {
this.clientBuilder = clientBuilder;
}