diff --git a/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java b/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java index 0c5e71a..0e6dbe5 100644 --- a/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java +++ b/elx-api/src/main/java/org/xbib/elx/api/AdminClient.java @@ -1,6 +1,5 @@ package org.xbib.elx.api; -import java.io.IOException; import java.util.List; import java.util.Map; @@ -9,7 +8,7 @@ import java.util.Map; */ public interface AdminClient extends BasicClient { - Map getMapping(IndexDefinition indexDefinition) throws IOException; + Map getMapping(IndexDefinition indexDefinition); void checkMapping(IndexDefinition indexDefinition); @@ -25,9 +24,8 @@ public interface AdminClient extends BasicClient { * @param indexDefinition the index definition * @param level the replica level * @return this - * @throws IOException if replica setting could not be updated */ - AdminClient updateReplicaLevel(IndexDefinition indexDefinition, int level) throws IOException; + AdminClient updateReplicaLevel(IndexDefinition indexDefinition, int level); /** * Get replica level. @@ -92,7 +90,6 @@ public interface AdminClient extends BasicClient { * @param indexDefinition the index definition * @param timestampfieldname the timestamp field name * @return millis UTC millis of the most recent document - * @throws IOException if most rcent document can not be found */ - Long mostRecentDocument(IndexDefinition indexDefinition, String timestampfieldname) throws IOException; + Long mostRecentDocument(IndexDefinition indexDefinition, String timestampfieldname); } diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java index f271fc1..203fdb2 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java @@ -117,7 +117,7 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements } @Override - public AdminClient updateReplicaLevel(IndexDefinition indexDefinition, int level) throws IOException { + public AdminClient updateReplicaLevel(IndexDefinition indexDefinition, int level) { if (isIndexDefinitionDisabled(indexDefinition)) { return null; } @@ -415,16 +415,14 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements } @Override - public void updateIndexSetting(String index, String key, Object value, long timeout, TimeUnit timeUnit) throws IOException { - if (index == null) { - throw new IOException("no index name given"); - } + public void updateIndexSetting(String index, String key, Object value, long timeout, TimeUnit timeUnit) { ensureClientIsPresent(); Settings.Builder updateSettingsBuilder = Settings.builder(); updateSettingsBuilder.put(key, value.toString()); UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest(index) .settings(updateSettingsBuilder).timeout(toTimeValue(timeout, timeUnit)); client.execute(UpdateSettingsAction.INSTANCE, updateSettingsRequest).actionGet(); + waitForCluster("GREEN", 300L, TimeUnit.SECONDS); } @Override diff --git a/gradle.properties b/gradle.properties index fed8911..d58c194 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ group = org.xbib name = elx -version = 2.2.1.42 +version = 2.2.1.43 gradle.wrapper.version = 6.6.1 xbib-metrics.version = 2.1.0