Skip to content

Commit

Permalink
Delegate more instances to PointRangeQuery
Browse files Browse the repository at this point in the history
Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
  • Loading branch information
harshavamsi committed Jul 19, 2024
1 parent 949b3b4 commit 89b6589
Showing 1 changed file with 10 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import org.opensearch.search.sort.SortOrder;

import java.io.IOException;
import java.util.Arrays;
import java.util.Objects;
import java.util.function.BiFunction;
import java.util.function.Predicate;

Expand Down Expand Up @@ -554,26 +552,6 @@ public boolean isCacheable(LeafReaderContext ctx) {
};
}

public String getField() {
return field;
}

public int getNumDims() {
return numDims;
}

public int getBytesPerDim() {
return bytesPerDim;
}

public byte[] getLowerPoint() {
return lowerPoint.clone();
}

public byte[] getUpperPoint() {
return upperPoint.clone();
}

@Override
public final int hashCode() {
return pointRangeQuery.hashCode();
Expand All @@ -584,16 +562,18 @@ public final boolean equals(Object o) {
return pointRangeQuery.equals(o);
}

private boolean equalsTo(ApproximatePointRangeQuery other) {
return Objects.equals(field, other.getField())
&& numDims == other.getNumDims()
&& bytesPerDim == other.getBytesPerDim()
&& Arrays.equals(lowerPoint, other.getLowerPoint())
&& Arrays.equals(upperPoint, other.getUpperPoint());
}

@Override
public final String toString(String field) {
return pointRangeQuery.toString(field);
}

/**
* Returns a string of a single value in a human-readable format for debugging. This is used by
* {@link #toString()}.
*
* @param dimension dimension of the particular value
* @param value single value, never null
* @return human readable value for debugging
*/
protected abstract String toString(int dimension, byte[] value);
}

0 comments on commit 89b6589

Please sign in to comment.