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


Java AmazonCloudSearchDomainClient类代码示例

本文整理汇总了Java中com.amazonaws.services.cloudsearchdomain.AmazonCloudSearchDomainClient的典型用法代码示例。如果您正苦于以下问题:Java AmazonCloudSearchDomainClient类的具体用法?Java AmazonCloudSearchDomainClient怎么用?Java AmazonCloudSearchDomainClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AmazonCloudSearchDomainClient类属于com.amazonaws.services.cloudsearchdomain包,在下文中一共展示了AmazonCloudSearchDomainClient类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CloudSearchIndexer

import com.amazonaws.services.cloudsearchdomain.AmazonCloudSearchDomainClient; //导入依赖的package包/类
public CloudSearchIndexer(AWSCredentialsProvider creds, String index) {
    // Find the Cloud Search Domain endpoint
    AmazonCloudSearchClient cloudsearch = new AmazonCloudSearchClient(creds);
    for (DomainStatus domain : cloudsearch.describeDomains().getDomainStatusList()) {
        Logger.Info(domain.getDomainName());
        if (domain.getDomainName().equals(index))
            searchClient = new AmazonCloudSearchDomainClient(creds)
                .withEndpoint(domain.getDocService().getEndpoint());
    }
    if (searchClient == null) {
        Logger.Info("Could not find Cloud Search index %s, aborting.", index);
        throw new IllegalArgumentException("Unrecognized index.");
    }
}
 
开发者ID:jhy,项目名称:RekognitionS3Batch,代码行数:15,代码来源:CloudSearchIndexer.java

示例2: initialize

import com.amazonaws.services.cloudsearchdomain.AmazonCloudSearchDomainClient; //导入依赖的package包/类
@PostConstruct
public void initialize() {
  domain = new AmazonCloudSearchDomainClient(new AWSCredentials() {
    @Override
    public String getAWSAccessKeyId() {
      return accessKey;
    }

    @Override
    public String getAWSSecretKey() {
      return secretKey;
    }
  });
  domain.setEndpoint(documentEndPoint);
}
 
开发者ID:smah3sh,项目名称:mcs,代码行数:16,代码来源:CloudSearchService.java

示例3: open

import com.amazonaws.services.cloudsearchdomain.AmazonCloudSearchDomainClient; //导入依赖的package包/类
@Override
public void open(JobConf job, String name) throws IOException {
  LOG.debug("CloudSearchIndexWriter.open() name={} ", name);

  maxDocsInBatch = job.getInt(CloudSearchConstants.MAX_DOCS_BATCH, -1);

  buffer = new StringBuffer(MAX_SIZE_BATCH_BYTES).append('[');

  dumpBatchFilesToTemp = job.getBoolean(CloudSearchConstants.BATCH_DUMP,
      false);

  if (dumpBatchFilesToTemp) {
    // only dumping to local file
    // no more config required
    return;
  }

  String endpoint = job.get(CloudSearchConstants.ENDPOINT);

  if (StringUtils.isBlank(endpoint)) {
    throw new RuntimeException("endpoint not set for CloudSearch");
  }

  AmazonCloudSearchClient cl = new AmazonCloudSearchClient();
  if (StringUtils.isNotBlank(regionName)) {
    cl.setRegion(RegionUtils.getRegion(regionName));
  }

  String domainName = null;

  // retrieve the domain name
  DescribeDomainsResult domains = cl
      .describeDomains(new DescribeDomainsRequest());

  Iterator<DomainStatus> dsiter = domains.getDomainStatusList().iterator();
  while (dsiter.hasNext()) {
    DomainStatus ds = dsiter.next();
    if (ds.getDocService().getEndpoint().equals(endpoint)) {
      domainName = ds.getDomainName();
      break;
    }
  }

  // check domain name
  if (StringUtils.isBlank(domainName)) {
    throw new RuntimeException(
        "No domain name found for CloudSearch endpoint");
  }

  DescribeIndexFieldsResult indexDescription = cl.describeIndexFields(
      new DescribeIndexFieldsRequest().withDomainName(domainName));
  for (IndexFieldStatus ifs : indexDescription.getIndexFields()) {
    String indexname = ifs.getOptions().getIndexFieldName();
    String indextype = ifs.getOptions().getIndexFieldType();
    LOG.info("CloudSearch index name {} of type {}", indexname, indextype);
    csfields.put(indexname, indextype);
  }

  client = new AmazonCloudSearchDomainClient();
  client.setEndpoint(endpoint);

}
 
开发者ID:jorcox,项目名称:GeoCrawler,代码行数:63,代码来源:CloudSearchIndexWriter.java

示例4: createDomain

import com.amazonaws.services.cloudsearchdomain.AmazonCloudSearchDomainClient; //导入依赖的package包/类
protected AmazonCloudSearchDomain createDomain() {
    return new AmazonCloudSearchDomainClient();
}
 
开发者ID:coding4people,项目名称:mosquito-report-api,代码行数:4,代码来源:Indexer.java

示例5: getClient

import com.amazonaws.services.cloudsearchdomain.AmazonCloudSearchDomainClient; //导入依赖的package包/类
private AmazonCloudSearchDomainClient getClient(Localization localization) {
    AmazonCloudSearchDomainClient client = new AmazonCloudSearchDomainClient(awsCredentials);
    client.setEndpoint(getServiceUrl(localization));
    return client;
}
 
开发者ID:sdl,项目名称:dxa-modules,代码行数:6,代码来源:AwsCloudSearchProvider.java

示例6: build

import com.amazonaws.services.cloudsearchdomain.AmazonCloudSearchDomainClient; //导入依赖的package包/类
public static AmazonCloudSearchDomain build(final String endpoint) {
    final AmazonCloudSearchDomain amazonCloudSearchDomain = new AmazonCloudSearchDomainClient();
    amazonCloudSearchDomain.setEndpoint(endpoint);
    return amazonCloudSearchDomain;
}
 
开发者ID:travel-cloud,项目名称:Cheddar,代码行数:6,代码来源:AmazonCloudSearchDomainClientBuilder.java

示例7: prepare

import com.amazonaws.services.cloudsearchdomain.AmazonCloudSearchDomainClient; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void prepare(Map conf, TopologyContext context,
        OutputCollector collector) {
    super.prepare(conf, context, collector);
    _collector = collector;

    this.eventCounter = context.registerMetric("CloudSearchIndexer",
            new MultiCountMetric(), 10);

    maxTimeBuffered = ConfUtils.getInt(conf,
            CloudSearchConstants.MAX_TIME_BUFFERED, 10);

    maxDocsInBatch = ConfUtils.getInt(conf,
            CloudSearchConstants.MAX_DOCS_BATCH, -1);

    buffer = new StringBuffer(MAX_SIZE_BATCH_BYTES).append('[');

    dumpBatchFilesToTemp = ConfUtils.getBoolean(conf,
            "cloudsearch.batch.dump", false);

    if (dumpBatchFilesToTemp) {
        // only dumping to local file
        // no more config required
        return;
    }

    String endpoint = ConfUtils.getString(conf, "cloudsearch.endpoint");

    if (StringUtils.isBlank(endpoint)) {
        String message = "Missing CloudSearch endpoint";
        LOG.error(message);
        throw new RuntimeException(message);
    }

    String regionName = ConfUtils.getString(conf,
            CloudSearchConstants.REGION);

    AmazonCloudSearchClient cl = new AmazonCloudSearchClient();
    if (StringUtils.isNotBlank(regionName)) {
        cl.setRegion(RegionUtils.getRegion(regionName));
    }

    String domainName = null;

    // retrieve the domain name
    DescribeDomainsResult domains = cl
            .describeDomains(new DescribeDomainsRequest());

    Iterator<DomainStatus> dsiter = domains.getDomainStatusList()
            .iterator();
    while (dsiter.hasNext()) {
        DomainStatus ds = dsiter.next();
        if (ds.getDocService().getEndpoint().equals(endpoint)) {
            domainName = ds.getDomainName();
            break;
        }
    }
    // check domain name
    if (StringUtils.isBlank(domainName)) {
        throw new RuntimeException(
                "No domain name found for CloudSearch endpoint");
    }

    DescribeIndexFieldsResult indexDescription = cl
            .describeIndexFields(new DescribeIndexFieldsRequest()
                    .withDomainName(domainName));
    for (IndexFieldStatus ifs : indexDescription.getIndexFields()) {
        String indexname = ifs.getOptions().getIndexFieldName();
        String indextype = ifs.getOptions().getIndexFieldType();
        LOG.info("CloudSearch index name {} of type {}", indexname,
                indextype);
        csfields.put(indexname, indextype);
    }

    client = new AmazonCloudSearchDomainClient();
    client.setEndpoint(endpoint);
}
 
开发者ID:DigitalPebble,项目名称:storm-crawler,代码行数:79,代码来源:CloudSearchIndexerBolt.java


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