From 882c4d6a59daf41b80c1505e11ea1286188f834a Mon Sep 17 00:00:00 2001 From: Nitish Goyal Date: Wed, 2 Feb 2022 09:25:40 +0530 Subject: [PATCH] Commented cluster re route job --- config/local.yml | 9 ++++----- .../core/reroute/ClusterRerouteManager.java | 10 +++++++--- .../server/resources/ESClusterResource.java | 5 +---- .../response/FoxtrotIndicesStatsResponse.java | 20 ------------------- 4 files changed, 12 insertions(+), 32 deletions(-) delete mode 100644 foxtrot-server/src/main/java/com/flipkart/foxtrot/server/utils/response/FoxtrotIndicesStatsResponse.java diff --git a/config/local.yml b/config/local.yml index 46df5b1a1..20283fd7d 100755 --- a/config/local.yml +++ b/config/local.yml @@ -8,8 +8,8 @@ server: elasticsearch: hosts: - - localhost - cluster: foxtrot + - stg-es201.phonepe.nb6 + cluster: stg-es67xx tableNamePrefix: foxtrot getQueryTimeout: 10000 connectionType: HTTP @@ -18,10 +18,10 @@ elasticsearch: hbase: secure : false tableName: foxtrot - hbaseZookeeperQuorum: localhost:2181 + hbaseZookeeperQuorum: stg-hdp201.phonepe.nb6:2181 hbaseZookeeperClientPort: 2181 seggregatedTablePrefix: foxtrot- - hbaseZookeeperZnodeParent: /hbase-test + hbaseZookeeperZnodeParent: /hbase-unsecure cluster: name: foxtrot @@ -48,7 +48,6 @@ cardinality: elasticsearchTuningConfig: precisionThreshold: 500 aggregationSize: 10000 - scrollSize: 100 scrollTimeInSeconds: 120 documentsLimitAllowed: 10000 diff --git a/foxtrot-core/src/main/java/com/flipkart/foxtrot/core/reroute/ClusterRerouteManager.java b/foxtrot-core/src/main/java/com/flipkart/foxtrot/core/reroute/ClusterRerouteManager.java index cdb6b9dbb..2506918ab 100644 --- a/foxtrot-core/src/main/java/com/flipkart/foxtrot/core/reroute/ClusterRerouteManager.java +++ b/foxtrot-core/src/main/java/com/flipkart/foxtrot/core/reroute/ClusterRerouteManager.java @@ -17,6 +17,7 @@ import org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteResponse; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.client.Request; +import org.elasticsearch.client.Response; import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand; import org.elasticsearch.index.shard.ShardId; import org.joda.time.DateTime; @@ -48,7 +49,9 @@ public ClusterRerouteManager( this.mapper = mapper; } - public void reallocate() { + //TODO This needs fixing to correspond to changed response from java high level client + + /*public void reallocate() { Map nodeIdVsNodeInfoMap = new HashMap<>(); BiMap nodeNameVsNodeId = HashBiMap.create(); this.createNodeInfoMap(nodeIdVsNodeInfoMap); @@ -106,9 +109,10 @@ private boolean reallocateShard(ShardId shardId, String fromNode, String toNode) private void createNodeInfoMap(Map nodeIdVsNodeInfoMap) { nodeIdVsNodeInfoMap.clear(); val request = new Request("GET", "/_stats"); - val response = connection.getClient() + Response response = connection.getClient() .getLowLevelClient() .performRequest(request); + val indicesStatsResponse = mapper.readValue(EntityUtils.toString(response.getEntity()), IndicesStatsResponse.class); Arrays.stream(indicesStatsResponse.getShards()) @@ -179,6 +183,6 @@ private Deque getVacantNodeId( } } return vacantNodeIds; - } + }*/ } diff --git a/foxtrot-server/src/main/java/com/flipkart/foxtrot/server/resources/ESClusterResource.java b/foxtrot-server/src/main/java/com/flipkart/foxtrot/server/resources/ESClusterResource.java index 935bdbb73..2a0423af7 100644 --- a/foxtrot-server/src/main/java/com/flipkart/foxtrot/server/resources/ESClusterResource.java +++ b/foxtrot-server/src/main/java/com/flipkart/foxtrot/server/resources/ESClusterResource.java @@ -2,16 +2,13 @@ import com.flipkart.foxtrot.core.reroute.ClusterRerouteManager; import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import ru.vyarus.dropwizard.guice.module.installer.order.Order; - import javax.inject.Inject; import javax.inject.Singleton; import javax.ws.rs.Consumes; -import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import ru.vyarus.dropwizard.guice.module.installer.order.Order; /*** Created by mudit.g on Sep, 2019 diff --git a/foxtrot-server/src/main/java/com/flipkart/foxtrot/server/utils/response/FoxtrotIndicesStatsResponse.java b/foxtrot-server/src/main/java/com/flipkart/foxtrot/server/utils/response/FoxtrotIndicesStatsResponse.java deleted file mode 100644 index 78a0468d7..000000000 --- a/foxtrot-server/src/main/java/com/flipkart/foxtrot/server/utils/response/FoxtrotIndicesStatsResponse.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.flipkart.foxtrot.server.utils.response; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; - -import java.util.Map; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class FoxtrotIndicesStatsResponse { - - private IndicesStatsResponse indicesStatsResponse; - private Map tableColumnCount; - -}