Skip to content

Commit

Permalink
Commented cluster re route job
Browse files Browse the repository at this point in the history
  • Loading branch information
nitishgoyal13 committed Feb 2, 2022
1 parent 97d9e1c commit 882c4d6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 32 deletions.
9 changes: 4 additions & 5 deletions config/local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ server:

elasticsearch:
hosts:
- localhost
cluster: foxtrot
- stg-es201.phonepe.nb6
cluster: stg-es67xx
tableNamePrefix: foxtrot
getQueryTimeout: 10000
connectionType: HTTP
Expand All @@ -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
Expand All @@ -48,7 +48,6 @@ cardinality:
elasticsearchTuningConfig:
precisionThreshold: 500
aggregationSize: 10000
scrollSize: 100
scrollTimeInSeconds: 120
documentsLimitAllowed: 10000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String, NodeInfo> nodeIdVsNodeInfoMap = new HashMap<>();
BiMap<String, String> nodeNameVsNodeId = HashBiMap.create();
this.createNodeInfoMap(nodeIdVsNodeInfoMap);
Expand Down Expand Up @@ -106,9 +109,10 @@ private boolean reallocateShard(ShardId shardId, String fromNode, String toNode)
private void createNodeInfoMap(Map<String, NodeInfo> 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())
Expand Down Expand Up @@ -179,6 +183,6 @@ private Deque<String> getVacantNodeId(
}
}
return vacantNodeIds;
}
}*/

}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

0 comments on commit 882c4d6

Please sign in to comment.