Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
Signed-off-by: Sarthak Aggarwal <[email protected]>
  • Loading branch information
sarthakaggarwal97 committed Jul 5, 2024
1 parent 3e94f68 commit a1c8f14
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public List<MetricAggregatorInfo> generateMetricAggregatorInfos(MapperService ma
* @param dimensionId dimension id
* @return dimension value
*/
public abstract long getDimensionValue(int docId, int dimensionId) throws IOException;
public abstract Long getDimensionValue(int docId, int dimensionId) throws IOException;

/**
* Sorts and aggregates the star-tree document in the segment, and returns a star-tree document iterator for all the
Expand Down Expand Up @@ -522,10 +522,10 @@ private Map<Long, StarTreeBuilderUtils.TreeNode> constructNonStarNodes(int start
throws IOException {
Map<Long, StarTreeBuilderUtils.TreeNode> nodes = new HashMap<>();
int nodeStartDocId = startDocId;
long nodeDimensionValue = getDimensionValue(startDocId, dimensionId);
Long nodeDimensionValue = getDimensionValue(startDocId, dimensionId);
for (int i = startDocId + 1; i < endDocId; i++) {
long dimensionValue = getDimensionValue(i, dimensionId);
if (dimensionValue != nodeDimensionValue) {
Long dimensionValue = getDimensionValue(i, dimensionId);
if (!dimensionValue.equals(nodeDimensionValue)) {
StarTreeBuilderUtils.TreeNode child = getNewNode();
child.dimensionId = dimensionId;
child.dimensionValue = nodeDimensionValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ public List<StarTreeDocument> getStarTreeDocuments() {
return starTreeDocuments;
}

// TODO: should this be just long?
@Override
public long getDimensionValue(int docId, int dimensionId) throws IOException {
public Long getDimensionValue(int docId, int dimensionId) throws IOException {
return starTreeDocuments.get(docId).dimensions[dimensionId];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public List<StarTreeDocument> getStarTreeDocuments() {
}

@Override
public long getDimensionValue(int docId, int dimensionId) throws IOException {
return 0;
public Long getDimensionValue(int docId, int dimensionId) throws IOException {
return 0L;
}

@Override
Expand Down

0 comments on commit a1c8f14

Please sign in to comment.