From 8b20e57fd740ccdd9da9a4f5ace324ba9d628b63 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Fri, 9 Aug 2013 09:17:01 +0200 Subject: [PATCH] Update to Elasticsearch 0.90.3 Closes #31. --- README.md | 6 +++--- pom.xml | 2 +- .../elasticsearch/cloud/aws/network/Ec2NameResolver.java | 4 ++-- .../cloud/aws/node/Ec2CustomNodeAttributes.java | 4 ++-- .../discovery/ec2/AwsEc2UnicastHostsProvider.java | 3 ++- .../java/org/elasticsearch/discovery/ec2/Ec2Discovery.java | 3 ++- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c88c9ff8c38..c7390b26f31 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ In order to install the plugin, simply run: `bin/plugin -install elasticsearch/e ----------------------------------------------- | AWS Cloud Plugin | ElasticSearch | ----------------------------------------------- - | 1.13.0-SNAPSHOT (master) | 0.90 -> master | + | 1.13.0-SNAPSHOT (master) | 0.90.3 -> master | ----------------------------------------------- - | 1.12.0 | 0.90 -> master | + | 1.12.0 | 0.90 -> 0.90.2 | ----------------------------------------------- - | 1.11.0 | 0.90 -> master | + | 1.11.0 | 0.90 -> 0.90.2 | ----------------------------------------------- | 1.10.0 | 0.19 | ----------------------------------------------- diff --git a/pom.xml b/pom.xml index f22b1af8f73..84738ed9405 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ - 0.90.1 + 0.90.3 diff --git a/src/main/java/org/elasticsearch/cloud/aws/network/Ec2NameResolver.java b/src/main/java/org/elasticsearch/cloud/aws/network/Ec2NameResolver.java index 7a1c18df9c5..28e061bee0e 100755 --- a/src/main/java/org/elasticsearch/cloud/aws/network/Ec2NameResolver.java +++ b/src/main/java/org/elasticsearch/cloud/aws/network/Ec2NameResolver.java @@ -19,10 +19,10 @@ package org.elasticsearch.cloud.aws.network; +import org.apache.lucene.util.IOUtils; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.cloud.aws.AwsEc2Service; import org.elasticsearch.common.component.AbstractComponent; -import org.elasticsearch.common.io.Closeables; import org.elasticsearch.common.network.NetworkService.CustomNameResolver; import org.elasticsearch.common.settings.Settings; @@ -117,7 +117,7 @@ public class Ec2NameResolver extends AbstractComponent implements CustomNameReso } return null; } finally { - Closeables.closeQuietly(in); + IOUtils.closeWhileHandlingException(in); } } diff --git a/src/main/java/org/elasticsearch/cloud/aws/node/Ec2CustomNodeAttributes.java b/src/main/java/org/elasticsearch/cloud/aws/node/Ec2CustomNodeAttributes.java index a780159932e..dbc66ce593b 100644 --- a/src/main/java/org/elasticsearch/cloud/aws/node/Ec2CustomNodeAttributes.java +++ b/src/main/java/org/elasticsearch/cloud/aws/node/Ec2CustomNodeAttributes.java @@ -19,12 +19,12 @@ package org.elasticsearch.cloud.aws.node; +import org.apache.lucene.util.IOUtils; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.cloud.aws.AwsEc2Service; import org.elasticsearch.cluster.node.DiscoveryNodeService; import org.elasticsearch.common.collect.Maps; import org.elasticsearch.common.component.AbstractComponent; -import org.elasticsearch.common.io.Closeables; import org.elasticsearch.common.settings.Settings; import java.io.BufferedReader; @@ -69,7 +69,7 @@ public class Ec2CustomNodeAttributes extends AbstractComponent implements Discov } catch (IOException e) { logger.debug("failed to get metadata for [placement/availability-zone]: " + ExceptionsHelper.detailedMessage(e)); } finally { - Closeables.closeQuietly(in); + IOUtils.closeWhileHandlingException(in); } return ec2Attributes; diff --git a/src/main/java/org/elasticsearch/discovery/ec2/AwsEc2UnicastHostsProvider.java b/src/main/java/org/elasticsearch/discovery/ec2/AwsEc2UnicastHostsProvider.java index bfac13c3a21..abca15afd8e 100644 --- a/src/main/java/org/elasticsearch/discovery/ec2/AwsEc2UnicastHostsProvider.java +++ b/src/main/java/org/elasticsearch/discovery/ec2/AwsEc2UnicastHostsProvider.java @@ -21,6 +21,7 @@ package org.elasticsearch.discovery.ec2; import com.amazonaws.services.ec2.AmazonEC2; import com.amazonaws.services.ec2.model.*; +import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.ImmutableMap; @@ -179,7 +180,7 @@ public class AwsEc2UnicastHostsProvider extends AbstractComponent implements Uni // we only limit to 1 addresses, makes no sense to ping 100 ports for (int i = 0; (i < addresses.length && i < UnicastZenPing.LIMIT_PORTS_COUNT); i++) { logger.trace("adding {}, address {}, transport_address {}", instance.getInstanceId(), address, addresses[i]); - discoNodes.add(new DiscoveryNode("#cloud-" + instance.getInstanceId() + "-" + i, addresses[i])); + discoNodes.add(new DiscoveryNode("#cloud-" + instance.getInstanceId() + "-" + i, addresses[i], Version.CURRENT)); } } catch (Exception e) { logger.warn("failed ot add {}, address {}", e, instance.getInstanceId(), address); diff --git a/src/main/java/org/elasticsearch/discovery/ec2/Ec2Discovery.java b/src/main/java/org/elasticsearch/discovery/ec2/Ec2Discovery.java index 3d600459b1b..4f65e0a5c7c 100755 --- a/src/main/java/org/elasticsearch/discovery/ec2/Ec2Discovery.java +++ b/src/main/java/org/elasticsearch/discovery/ec2/Ec2Discovery.java @@ -19,6 +19,7 @@ package org.elasticsearch.discovery.ec2; +import org.elasticsearch.Version; import org.elasticsearch.cloud.aws.AwsEc2Service; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterService; @@ -43,7 +44,7 @@ public class Ec2Discovery extends ZenDiscovery { public Ec2Discovery(Settings settings, ClusterName clusterName, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, NodeSettingsService nodeSettingsService, ZenPingService pingService, DiscoveryNodeService discoveryNodeService, AwsEc2Service ec2Service) { - super(settings, clusterName, threadPool, transportService, clusterService, nodeSettingsService, discoveryNodeService, pingService); + super(settings, clusterName, threadPool, transportService, clusterService, nodeSettingsService, discoveryNodeService, pingService, Version.CURRENT); if (settings.getAsBoolean("cloud.enabled", true)) { ImmutableList zenPings = pingService.zenPings(); UnicastZenPing unicastZenPing = null;