improve exception message
This commit is contained in:
parent
db87594bca
commit
76c660ba93
|
@ -73,7 +73,7 @@ public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIn
|
||||||
protected void doExecute(CloseIndexRequest request, ActionListener<CloseIndexResponse> listener) {
|
protected void doExecute(CloseIndexRequest request, ActionListener<CloseIndexResponse> listener) {
|
||||||
destructiveOperations.failDestructive(request.indices());
|
destructiveOperations.failDestructive(request.indices());
|
||||||
if (closeIndexEnabled == false) {
|
if (closeIndexEnabled == false) {
|
||||||
throw new IllegalStateException("closing indices is disabled - set [" + SETTING_CLUSTER_INDICES_CLOSE_ENABLE + ": true] to enable it. NOTE: closed indices consume a significant amount of diskspace");
|
throw new IllegalStateException("closing indices is disabled - set [" + SETTING_CLUSTER_INDICES_CLOSE_ENABLE + ": true] to enable it. NOTE: closed indices still consume a significant amount of diskspace");
|
||||||
}
|
}
|
||||||
super.doExecute(request, listener);
|
super.doExecute(request, listener);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcke
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
import static org.hamcrest.Matchers.notNullValue;
|
import static org.hamcrest.Matchers.notNullValue;
|
||||||
|
|
||||||
@ClusterScope(scope= Scope.TEST, numDataNodes =2)
|
@ClusterScope(scope=Scope.TEST, numDataNodes=2)
|
||||||
public class CloseIndexDisableCloseAllIT extends ESIntegTestCase {
|
public class CloseIndexDisableCloseAllIT extends ESIntegTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -100,7 +100,7 @@ public class CloseIndexDisableCloseAllIT extends ESIntegTestCase {
|
||||||
client.admin().indices().prepareClose("test_no_close").execute().actionGet();
|
client.admin().indices().prepareClose("test_no_close").execute().actionGet();
|
||||||
fail("exception expected");
|
fail("exception expected");
|
||||||
} catch (IllegalStateException ex) {
|
} catch (IllegalStateException ex) {
|
||||||
assertEquals(ex.getMessage(), "closing indices is disabled - set [cluster.indices.close.enable: true] to enable it. NOTE: closed indices consume a significant amount of diskspace");
|
assertEquals(ex.getMessage(), "closing indices is disabled - set [cluster.indices.close.enable: true] to enable it. NOTE: closed indices still consume a significant amount of diskspace");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue