当前位置: 首页>>代码示例>>Java>>正文


Java AmazonKinesisClientBuilder类代码示例

本文整理汇总了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);
}
 
开发者ID:kdgregory,项目名称:log4j-aws-appenders,代码行数:18,代码来源:KinesisAppenderIntegrationTest.java

示例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();
        }
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:19,代码来源:EventPublisherAmazonKinesis.java

示例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();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:27,代码来源:AWSUtil.java

示例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();
}
 
开发者ID:jcustenborder,项目名称:kafka-connect-kinesis,代码行数:8,代码来源:KinesisClientFactoryImpl.java

示例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();
}
 
开发者ID:apache,项目名称:beam,代码行数:13,代码来源:KinesisIO.java

示例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();
  }
 
开发者ID:streamsets,项目名称:datacollector,代码行数:16,代码来源:KinesisUtil.java

示例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();
}
 
开发者ID:jivesoftware,项目名称:miru,代码行数:13,代码来源:HttpKinesisLogAppenderTest.java

示例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;
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:9,代码来源:KinesisUtils.java

示例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();
}
 
开发者ID:awslabs,项目名称:flink-stream-processing-refarch,代码行数:5,代码来源:WatermarkTracker.java

示例10: createClient

import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
/**
 *  Factory method called by smoketest
 */
public static AmazonKinesis createClient()
{
    return AmazonKinesisClientBuilder.defaultClient();
}
 
开发者ID:kdgregory,项目名称:log4j-aws-appenders,代码行数:8,代码来源:KinesisAppenderIntegrationTest.java

示例11: setClientBuilder

import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; //导入依赖的package包/类
public void setClientBuilder(AmazonKinesisClientBuilder clientBuilder) {
    this.clientBuilder = clientBuilder;
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:4,代码来源:EventPublisherAmazonKinesis.java


注:本文中的com.amazonaws.services.kinesis.AmazonKinesisClientBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。