From b28461dd0efe6118604e94bffbb9a5b709667eab Mon Sep 17 00:00:00 2001 From: kimchy Date: Thu, 24 Mar 2011 01:12:36 +0200 Subject: [PATCH] compress cluster state when publishing it --- .../discovery/zen/publish/PublishClusterStateAction.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/publish/PublishClusterStateAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/publish/PublishClusterStateAction.java index a2d12873279..629b7e0ef89 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/publish/PublishClusterStateAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/publish/PublishClusterStateAction.java @@ -48,12 +48,17 @@ public class PublishClusterStateAction extends AbstractComponent { private final NewClusterStateListener listener; + private final boolean compesss; + public PublishClusterStateAction(Settings settings, TransportService transportService, DiscoveryNodesProvider nodesProvider, NewClusterStateListener listener) { super(settings); this.transportService = transportService; this.nodesProvider = nodesProvider; this.listener = listener; + + this.compesss = componentSettings.getAsBoolean("compress", true); + transportService.registerHandler(PublishClusterStateRequestHandler.ACTION, new PublishClusterStateRequestHandler()); } @@ -70,7 +75,7 @@ public class PublishClusterStateAction extends AbstractComponent { } transportService.sendRequest(node, PublishClusterStateRequestHandler.ACTION, new PublishClusterStateRequest(clusterState), - TransportRequestOptions.options().withHighType(), + TransportRequestOptions.options().withHighType().withCompress(compesss), new VoidTransportResponseHandler(ThreadPool.Names.SAME) { @Override public void handleException(TransportException exp) {