Skip to content

Commit

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

elasticsearch:
hosts:
- stg-es201.phonepe.nb6
cluster: stg-es67xx
- localhost
cluster: foxtrot
tableNamePrefix: foxtrot
getQueryTimeout: 10000
connectionType: HTTP
Expand All @@ -18,10 +18,10 @@ elasticsearch:
hbase:
secure : false
tableName: foxtrot
hbaseZookeeperQuorum: stg-hdp201.phonepe.nb6:2181
hbaseZookeeperQuorum: localhost:2181
hbaseZookeeperClientPort: 2181
seggregatedTablePrefix: foxtrot-
hbaseZookeeperZnodeParent: /hbase-unsecure
hbaseZookeeperZnodeParent: /hbase-test

cluster:
name: foxtrot
Expand All @@ -48,6 +48,7 @@ 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,7 +17,6 @@
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 @@ -49,9 +48,7 @@ public ClusterRerouteManager(
this.mapper = mapper;
}

//TODO This needs fixing to correspond to changed response from java high level client

/*public void reallocate() {
public void reallocate() {
Map<String, NodeInfo> nodeIdVsNodeInfoMap = new HashMap<>();
BiMap<String, String> nodeNameVsNodeId = HashBiMap.create();
this.createNodeInfoMap(nodeIdVsNodeInfoMap);
Expand Down Expand Up @@ -109,10 +106,9 @@ private boolean reallocateShard(ShardId shardId, String fromNode, String toNode)
private void createNodeInfoMap(Map<String, NodeInfo> nodeIdVsNodeInfoMap) {
nodeIdVsNodeInfoMap.clear();
val request = new Request("GET", "/_stats");
Response response = connection.getClient()
val response = connection.getClient()
.getLowLevelClient()
.performRequest(request);
val indicesStatsResponse = mapper.readValue(EntityUtils.toString(response.getEntity()),
IndicesStatsResponse.class);
Arrays.stream(indicesStatsResponse.getShards())
Expand Down Expand Up @@ -183,6 +179,6 @@ private Deque<String> getVacantNodeId(
}
}
return vacantNodeIds;
}*/
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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<String, Integer> tableColumnCount;

}

0 comments on commit 97d9e1c

Please sign in to comment.