热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

com.amazonaws.services.kinesis.AmazonKinesisClient.setRegion()方法的使用及代码示例

本文整理了Java中com.amazonaws.services.kinesis.AmazonKinesisClient.setRegion()方法的一些代码示例,展示

本文整理了Java中com.amazonaws.services.kinesis.AmazonKinesisClient.setRegion()方法的一些代码示例,展示了AmazonKinesisClient.setRegion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AmazonKinesisClient.setRegion()方法的具体详情如下:
包路径:com.amazonaws.services.kinesis.AmazonKinesisClient
类名称:AmazonKinesisClient
方法名:setRegion

AmazonKinesisClient.setRegion介绍

暂无

代码示例

代码示例来源:origin: apache/storm

void initialize () {
kinesisClient = new AmazonKinesisClient(kinesisConnectionInfo.getCredentialsProvider(), kinesisConnectionInfo.getClientConfiguration());
kinesisClient.setRegion(Region.getRegion(kinesisConnectionInfo.getRegion()));
}

代码示例来源:origin: rakam-io/rakam

public S3BulkEventStore(Metastore metastore, AWSConfig config, FieldDependencyBuilder.FieldDependency fieldDependency) {
this.metastore = metastore;
this.cOnfig= config;
this.s3Client = new AmazonS3Client(config.getCredentials());
s3Client.setRegion(config.getAWSRegion());
if (config.getS3Endpoint() != null) {
s3Client.setEndpoint(config.getS3Endpoint());
}
kinesis = new AmazonKinesisClient(config.getCredentials());
kinesis.setRegion(config.getAWSRegion());
if (config.getKinesisEndpoint() != null) {
kinesis.setEndpoint(config.getKinesisEndpoint());
}
cloudWatchClient = new AmazonCloudWatchAsyncClient(config.getCredentials());
cloudWatchClient.setRegion(config.getAWSRegion());
this.cOnditionalMagicFieldsSize= fieldDependency.dependentFields.size();
}

代码示例来源:origin: org.rakam/rakam-aws-kinesis

@Inject
public AWSKinesisEventStore(AWSConfig config, FieldDependencyBuilder.FieldDependency dependency) {
this.kinesis = new AmazonKinesisClient(config.getCredentials());
kinesis.setRegion(config.getAWSRegion());
this.sourceFields = dependency.dependentFields.keySet();
this.cOnfig= config;
}

代码示例来源:origin: awslabs/amazon-kinesis-aggregators

@Override
public void initialise() throws Exception {
if (!this.online) {
if (this.region != null) {
this.dynamoClient.setRegion(this.region);
if (this.streamName != null) {
this.kinesisClient.setRegion(this.region);
}
}
initAggTable(this.labelAttribute, this.dateAttribute, this.readCapacity,
this.writeCapacity);
this.queryEngine = new DynamoQueryEngine(this.dynamoClient, this.tableName,
this.labelAttribute, this.dateAttribute);
this.Online= true;
}
}

代码示例来源:origin: awslabs/amazon-kinesis-scaling-utils

public StreamScaler(Region region) throws Exception {
pctFormat.setMaximumFractionDigits(1);
// use the default provider chain plus support for classpath
// properties
// files
ClientConfiguration cOnfig= new ClientConfiguration();
StringBuilder userAgent = new StringBuilder(ClientConfiguration.DEFAULT_USER_AGENT);
userAgent.append(" ");
userAgent.append(this.AWSApplication);
userAgent.append("/");
userAgent.append(this.version);
config.setUserAgent(userAgent.toString());
kinesisClient = new AmazonKinesisClient(new AWSCredentialsProviderChain(
new DefaultAWSCredentialsProviderChain(), new ClasspathPropertiesFileCredentialsProvider()), config);
kinesisClient.setRegion(region);
String kinesisEndpoint = System.getProperty("kinesisEndpoint");
if (kinesisEndpoint != null) {
kinesisClient.setEndpoint(kinesisEndpoint);
}
if (kinesisClient.getServiceName() == null) {
throw new Exception("Unable to reach Kinesis Service");
}
}

代码示例来源:origin: amazon-archives/kinesis-storm-spout

/**
* @return new instance of AmazonKinesisClient, with parameters supplied by whatever was passed
* to the KinesisHelper constructor.
*/
private AmazonKinesisClient makeNewKinesisClient() {
AmazonKinesisClient client = new AmazonKinesisClient(getKinesisCredsProvider(), getClientConfiguration());
LOG.info("Using " + getRegion().getName() + " region");
client.setRegion(getRegion());
return client;
}

代码示例来源:origin: apache/streams

@Override
public void prepare(Object configurationObject) {
// Connect to Kinesis
synchronized (this) {
// Create the credentials Object
AWSCredentials credentials = new BasicAWSCredentials(config.getKey(), config.getSecretKey());
ClientConfiguration clientCOnfig= new ClientConfiguration();
clientConfig.setProtocol(Protocol.valueOf(config.getProtocol().toString()));
this.client = new AmazonKinesisClient(credentials, clientConfig);
if (StringUtils.isNotEmpty(config.getRegion()))
this.client.setRegion(Region.getRegion(Regions.fromName(config.getRegion())));
}
streamNames = this.config.getStreams();
executor = Executors.newFixedThreadPool(streamNames.size());
}

代码示例来源:origin: apache/streams

@Override
public void prepare(Object configurationObject) {
// Connect to Kinesis
synchronized (this) {
// Create the credentials Object
AWSCredentials credentials = new BasicAWSCredentials(config.getKey(), config.getSecretKey());
ClientConfiguration clientCOnfig= new ClientConfiguration();
clientConfig.setProtocol(Protocol.valueOf(config.getProtocol().toString()));
this.client = new AmazonKinesisClient(credentials, clientConfig);
if (StringUtils.isNotEmpty(config.getRegion())) {
this.client.setRegion(Region.getRegion(Regions.fromName(config.getRegion())));
}
}
executor = Executors.newSingleThreadExecutor();
}

代码示例来源:origin: org.rakam/rakam-clickhouse

@Inject
public AWSKinesisClickhouseEventStore(AWSConfig config, ClickHouseConfig clickHouseConfig)
{
kinesis = new AmazonKinesisClient(config.getCredentials());
kinesis.setRegion(config.getAWSRegion());
if (config.getKinesisEndpoint() != null) {
kinesis.setEndpoint(config.getKinesisEndpoint());
}
this.cOnfig= config;
this.bulkClient = new ClickHouseEventStore(clickHouseConfig);
KinesisProducerConfiguration producerCOnfiguration= new KinesisProducerConfiguration()
.setRegion(config.getRegion())
.setCredentialsProvider(config.getCredentials());
// producer = new KinesisProducer(producerConfiguration);
}

代码示例来源:origin: awslabs/amazon-kinesis-aggregators

region = Region.getRegion(Regions.fromName(this.config
.getRegionName()));
kinesisClient.setRegion(region);
this.config.getKinesisCredentialsProvider());
if (region != null)
this.kinesisClient.setRegion(region);

代码示例来源:origin: awslabs/amazon-kinesis-scaling-utils

public StreamMonitor(AutoscalingConfiguration config) throws Exception {
this.cOnfig= config;
Region setRegion = Region.getRegion(Regions.fromName(this.config.getRegion()));
this.scaler = new StreamScaler(setRegion);
this.cloudWatchClient = new AmazonCloudWatchClient(new DefaultAWSCredentialsProviderChain());
this.cloudWatchClient.setRegion(setRegion);
this.kinesisClient = new AmazonKinesisClient(new DefaultAWSCredentialsProviderChain());
this.kinesisClient.setRegion(setRegion);
this.snsClient = new AmazonSNSClient(new DefaultAWSCredentialsProviderChain());
this.snsClient.setRegion(setRegion);
}

推荐阅读
author-avatar
良良8003
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有