mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 14:26:27 +00:00
parent
9cc331b12d
commit
4a1cbd2f63
4
pom.xml
4
pom.xml
@ -6,7 +6,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.elasticsearch</groupId>
|
<groupId>org.elasticsearch</groupId>
|
||||||
<artifactId>elasticsearch-cloud-aws</artifactId>
|
<artifactId>elasticsearch-cloud-aws</artifactId>
|
||||||
<version>1.17.0-SNAPSHOT</version>
|
<version>2.0.0.RC1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<description>AWS Cloud plugin for ElasticSearch</description>
|
<description>AWS Cloud plugin for ElasticSearch</description>
|
||||||
<inceptionYear>2009</inceptionYear>
|
<inceptionYear>2009</inceptionYear>
|
||||||
@ -31,7 +31,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<elasticsearch.version>0.90.10</elasticsearch.version>
|
<elasticsearch.version>1.0.0.RC1-SNAPSHOT</elasticsearch.version>
|
||||||
<lucene.version>4.6.0</lucene.version>
|
<lucene.version>4.6.0</lucene.version>
|
||||||
<tests.output>onerror</tests.output>
|
<tests.output>onerror</tests.output>
|
||||||
<tests.jvms>1</tests.jvms>
|
<tests.jvms>1</tests.jvms>
|
||||||
|
@ -25,8 +25,8 @@ import com.amazonaws.auth.*;
|
|||||||
import com.amazonaws.internal.StaticCredentialsProvider;
|
import com.amazonaws.internal.StaticCredentialsProvider;
|
||||||
import com.amazonaws.services.ec2.AmazonEC2;
|
import com.amazonaws.services.ec2.AmazonEC2;
|
||||||
import com.amazonaws.services.ec2.AmazonEC2Client;
|
import com.amazonaws.services.ec2.AmazonEC2Client;
|
||||||
import org.elasticsearch.ElasticSearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.ElasticSearchIllegalArgumentException;
|
import org.elasticsearch.ElasticsearchIllegalArgumentException;
|
||||||
import org.elasticsearch.cloud.aws.network.Ec2NameResolver;
|
import org.elasticsearch.cloud.aws.network.Ec2NameResolver;
|
||||||
import org.elasticsearch.cloud.aws.node.Ec2CustomNodeAttributes;
|
import org.elasticsearch.cloud.aws.node.Ec2CustomNodeAttributes;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNodeService;
|
import org.elasticsearch.cluster.node.DiscoveryNodeService;
|
||||||
@ -66,7 +66,7 @@ public class AwsEc2Service extends AbstractLifecycleComponent<AwsEc2Service> {
|
|||||||
} else if ("https".equals(protocol)) {
|
} else if ("https".equals(protocol)) {
|
||||||
clientConfiguration.setProtocol(Protocol.HTTPS);
|
clientConfiguration.setProtocol(Protocol.HTTPS);
|
||||||
} else {
|
} else {
|
||||||
throw new ElasticSearchIllegalArgumentException("No protocol supported [" + protocol + "], can either be [http] or [https]");
|
throw new ElasticsearchIllegalArgumentException("No protocol supported [" + protocol + "], can either be [http] or [https]");
|
||||||
}
|
}
|
||||||
String account = componentSettings.get("access_key", settings.get("cloud.account"));
|
String account = componentSettings.get("access_key", settings.get("cloud.account"));
|
||||||
String key = componentSettings.get("secret_key", settings.get("cloud.key"));
|
String key = componentSettings.get("secret_key", settings.get("cloud.key"));
|
||||||
@ -78,7 +78,7 @@ public class AwsEc2Service extends AbstractLifecycleComponent<AwsEc2Service> {
|
|||||||
try {
|
try {
|
||||||
proxyPort = Integer.parseInt(portString, 10);
|
proxyPort = Integer.parseInt(portString, 10);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
throw new ElasticSearchIllegalArgumentException("The configured proxy port value [" + portString + "] is invalid", ex);
|
throw new ElasticsearchIllegalArgumentException("The configured proxy port value [" + portString + "] is invalid", ex);
|
||||||
}
|
}
|
||||||
clientConfiguration.withProxyHost(proxyHost).setProxyPort(proxyPort);
|
clientConfiguration.withProxyHost(proxyHost).setProxyPort(proxyPort);
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ public class AwsEc2Service extends AbstractLifecycleComponent<AwsEc2Service> {
|
|||||||
} else if (region.equals("sa-east") || region.equals("sa-east-1")) {
|
} else if (region.equals("sa-east") || region.equals("sa-east-1")) {
|
||||||
endpoint = "ec2.sa-east-1.amazonaws.com";
|
endpoint = "ec2.sa-east-1.amazonaws.com";
|
||||||
} else {
|
} else {
|
||||||
throw new ElasticSearchIllegalArgumentException("No automatic endpoint could be derived from region [" + region + "]");
|
throw new ElasticsearchIllegalArgumentException("No automatic endpoint could be derived from region [" + region + "]");
|
||||||
}
|
}
|
||||||
if (endpoint != null) {
|
if (endpoint != null) {
|
||||||
logger.debug("using ec2 region [{}], with endpoint [{}]", region, endpoint);
|
logger.debug("using ec2 region [{}], with endpoint [{}]", region, endpoint);
|
||||||
@ -136,15 +136,15 @@ public class AwsEc2Service extends AbstractLifecycleComponent<AwsEc2Service> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doStart() throws ElasticSearchException {
|
protected void doStart() throws ElasticsearchException {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doStop() throws ElasticSearchException {
|
protected void doStop() throws ElasticsearchException {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doClose() throws ElasticSearchException {
|
protected void doClose() throws ElasticsearchException {
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
client.shutdown();
|
client.shutdown();
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,8 @@ import com.amazonaws.auth.*;
|
|||||||
import com.amazonaws.internal.StaticCredentialsProvider;
|
import com.amazonaws.internal.StaticCredentialsProvider;
|
||||||
import com.amazonaws.services.s3.AmazonS3;
|
import com.amazonaws.services.s3.AmazonS3;
|
||||||
import com.amazonaws.services.s3.AmazonS3Client;
|
import com.amazonaws.services.s3.AmazonS3Client;
|
||||||
import org.elasticsearch.ElasticSearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.ElasticSearchIllegalArgumentException;
|
import org.elasticsearch.ElasticsearchIllegalArgumentException;
|
||||||
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
@ -58,7 +58,7 @@ public class AwsS3Service extends AbstractLifecycleComponent<AwsS3Service> {
|
|||||||
} else if ("https".equals(protocol)) {
|
} else if ("https".equals(protocol)) {
|
||||||
clientConfiguration.setProtocol(Protocol.HTTPS);
|
clientConfiguration.setProtocol(Protocol.HTTPS);
|
||||||
} else {
|
} else {
|
||||||
throw new ElasticSearchIllegalArgumentException("No protocol supported [" + protocol + "], can either be [http] or [https]");
|
throw new ElasticsearchIllegalArgumentException("No protocol supported [" + protocol + "], can either be [http] or [https]");
|
||||||
}
|
}
|
||||||
String account = componentSettings.get("access_key", settings.get("cloud.account"));
|
String account = componentSettings.get("access_key", settings.get("cloud.account"));
|
||||||
String key = componentSettings.get("secret_key", settings.get("cloud.key"));
|
String key = componentSettings.get("secret_key", settings.get("cloud.key"));
|
||||||
@ -70,7 +70,7 @@ public class AwsS3Service extends AbstractLifecycleComponent<AwsS3Service> {
|
|||||||
try {
|
try {
|
||||||
proxyPort = Integer.parseInt(portString, 10);
|
proxyPort = Integer.parseInt(portString, 10);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
throw new ElasticSearchIllegalArgumentException("The configured proxy port value [" + portString + "] is invalid", ex);
|
throw new ElasticsearchIllegalArgumentException("The configured proxy port value [" + portString + "] is invalid", ex);
|
||||||
}
|
}
|
||||||
clientConfiguration.withProxyHost(proxyHost).setProxyPort(proxyPort);
|
clientConfiguration.withProxyHost(proxyHost).setProxyPort(proxyPort);
|
||||||
}
|
}
|
||||||
@ -126,7 +126,7 @@ public class AwsS3Service extends AbstractLifecycleComponent<AwsS3Service> {
|
|||||||
} else if ("sa-east-1".equals(region)) {
|
} else if ("sa-east-1".equals(region)) {
|
||||||
endpoint = "s3-sa-east-1.amazonaws.com";
|
endpoint = "s3-sa-east-1.amazonaws.com";
|
||||||
} else {
|
} else {
|
||||||
throw new ElasticSearchIllegalArgumentException("No automatic endpoint could be derived from region [" + region + "]");
|
throw new ElasticsearchIllegalArgumentException("No automatic endpoint could be derived from region [" + region + "]");
|
||||||
}
|
}
|
||||||
if (endpoint != null) {
|
if (endpoint != null) {
|
||||||
logger.debug("using s3 region [{}], with endpoint [{}]", region, endpoint);
|
logger.debug("using s3 region [{}], with endpoint [{}]", region, endpoint);
|
||||||
@ -138,15 +138,15 @@ public class AwsS3Service extends AbstractLifecycleComponent<AwsS3Service> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doStart() throws ElasticSearchException {
|
protected void doStart() throws ElasticsearchException {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doStop() throws ElasticSearchException {
|
protected void doStop() throws ElasticsearchException {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doClose() throws ElasticSearchException {
|
protected void doClose() throws ElasticsearchException {
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
client.shutdown();
|
client.shutdown();
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
package org.elasticsearch.gateway.s3;
|
package org.elasticsearch.gateway.s3;
|
||||||
|
|
||||||
import org.elasticsearch.ElasticSearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.ElasticSearchIllegalArgumentException;
|
import org.elasticsearch.ElasticsearchIllegalArgumentException;
|
||||||
import org.elasticsearch.cloud.aws.AwsS3Service;
|
import org.elasticsearch.cloud.aws.AwsS3Service;
|
||||||
import org.elasticsearch.cloud.aws.blobstore.S3BlobStore;
|
import org.elasticsearch.cloud.aws.blobstore.S3BlobStore;
|
||||||
import org.elasticsearch.cluster.ClusterName;
|
import org.elasticsearch.cluster.ClusterName;
|
||||||
@ -53,7 +53,7 @@ public class S3Gateway extends BlobStoreGateway {
|
|||||||
|
|
||||||
String bucket = componentSettings.get("bucket");
|
String bucket = componentSettings.get("bucket");
|
||||||
if (bucket == null) {
|
if (bucket == null) {
|
||||||
throw new ElasticSearchIllegalArgumentException("No bucket defined for s3 gateway");
|
throw new ElasticsearchIllegalArgumentException("No bucket defined for s3 gateway");
|
||||||
}
|
}
|
||||||
|
|
||||||
String region = componentSettings.get("region");
|
String region = componentSettings.get("region");
|
||||||
@ -98,7 +98,7 @@ public class S3Gateway extends BlobStoreGateway {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doClose() throws ElasticSearchException {
|
protected void doClose() throws ElasticsearchException {
|
||||||
super.doClose();
|
super.doClose();
|
||||||
concurrentStreamPool.shutdown();
|
concurrentStreamPool.shutdown();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user