Skip to content

Commit

Permalink
Added code changes for treemap data (#208)
Browse files Browse the repository at this point in the history
* Added code changes for treemap data

* Remove unused import

* Reverted to original hibenate connection parameters
  • Loading branch information
rishitha-ravi authored Nov 11, 2024
1 parent 3377bdd commit 4a24c64
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class MapAggregationStatsResponse {
private Map<String, List<Map<String, Object>>> countPerDay;
private Map<String, List<Map<String, Object>>> groupObservedOn;
private List<Map<String, Object>> groupTraits;
private Map<String, Long> groupTaxon;

public Map<String, Long> getTotalCounts() {
return totalCounts;
Expand Down Expand Up @@ -69,4 +70,12 @@ public void setGroupUniqueSpecies(Map<String, Long> groupUniqueSpecies) {
this.groupUniqueSpecies = groupUniqueSpecies;
}

public Map<String, Long> getGroupTaxon() {
return groupTaxon;
}

public void setGroupTaxon(Map<String, Long> taxonAgg) {
this.groupTaxon = taxonAgg;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ public MapAggregationStatsResponse mapAggregateStats(String index, String type,

Map<String, AggregationResponse> mapAggStatsResponse = new HashMap<String, AggregationResponse>();

int totalLatch = 6;
int totalLatch = 7;

// latch count down
CountDownLatch latch = new CountDownLatch(totalLatch);
Expand All @@ -614,6 +614,9 @@ public MapAggregationStatsResponse mapAggregateStats(String index, String type,
getAggregateLatch(index, type, "group_by_traits", geoAggregationField, mapSearchQuery, mapAggStatsResponse,
latch, null, geoShapeFilterField);

getAggregateLatch(index, type, "group_by_taxon", geoAggregationField, mapSearchQuery, mapAggStatsResponse,
latch, null, geoShapeFilterField);

// for top Uploaders

if (user != null && !user.isEmpty()) {
Expand Down Expand Up @@ -715,6 +718,8 @@ public MapAggregationStatsResponse mapAggregateStats(String index, String type,

aggregationStatsResponse.setGroupObservedOn(groupByMonth);

Map<String, Long> taxonAgg = getAggregationValue(mapAggStatsResponse.get("group_by_taxon"));
aggregationStatsResponse.setGroupTaxon(taxonAgg);
Map<String, Long> traitsAgg = getAggregationValue(mapAggStatsResponse.get("group_by_traits"));
int traitsIndex = 0;
List<Map<String, Object>> groupByTraits = new ArrayList<>();
Expand Down

0 comments on commit 4a24c64

Please sign in to comment.