jpountz commented on code in PR #11793: URL: https://github.com/apache/lucene/pull/11793#discussion_r975074845
########## lucene/core/src/java/org/apache/lucene/index/PointValues.java: ########## @@ -467,4 +467,90 @@ public final long estimateDocCount(IntersectVisitor visitor) { /** Returns the total number of documents that have indexed at least one point. */ public abstract int getDocCount(); + + public static PointValues empty( + int numDimensions, int numIndexDimensions, int bytesPerDimension) { + return new PointValues() { + @Override + public PointTree getPointTree() { + return new PointTree() { + @Override + public PointTree clone() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean moveToChild() { + return false; + } + + @Override + public boolean moveToSibling() { + return false; + } + + @Override + public boolean moveToParent() { + return false; + } + + @Override + public byte[] getMinPackedValue() { + return new byte[0]; Review Comment: The contract is to return `null` if `size` is 0. ########## lucene/core/src/java/org/apache/lucene/index/PointValues.java: ########## @@ -467,4 +467,90 @@ public final long estimateDocCount(IntersectVisitor visitor) { /** Returns the total number of documents that have indexed at least one point. */ public abstract int getDocCount(); + + public static PointValues empty( + int numDimensions, int numIndexDimensions, int bytesPerDimension) { + return new PointValues() { + @Override + public PointTree getPointTree() { + return new PointTree() { + @Override + public PointTree clone() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean moveToChild() { + return false; + } + + @Override + public boolean moveToSibling() { + return false; + } + + @Override + public boolean moveToParent() { + return false; + } + + @Override + public byte[] getMinPackedValue() { + return new byte[0]; + } + + @Override + public byte[] getMaxPackedValue() { + return new byte[0]; Review Comment: and likewise here ########## lucene/core/src/java/org/apache/lucene/index/PointValues.java: ########## @@ -467,4 +467,90 @@ public final long estimateDocCount(IntersectVisitor visitor) { /** Returns the total number of documents that have indexed at least one point. */ public abstract int getDocCount(); + + public static PointValues empty( Review Comment: Add javadocs? ########## lucene/core/src/java/org/apache/lucene/index/PointValues.java: ########## @@ -467,4 +467,90 @@ public final long estimateDocCount(IntersectVisitor visitor) { /** Returns the total number of documents that have indexed at least one point. */ public abstract int getDocCount(); + + public static PointValues empty( + int numDimensions, int numIndexDimensions, int bytesPerDimension) { + return new PointValues() { + @Override + public PointTree getPointTree() { + return new PointTree() { + @Override + public PointTree clone() { + throw new UnsupportedOperationException(); Review Comment: Should we `return this` here to make this implementation well behaved? ########## lucene/core/src/java/org/apache/lucene/index/PointValues.java: ########## @@ -467,4 +467,90 @@ public final long estimateDocCount(IntersectVisitor visitor) { /** Returns the total number of documents that have indexed at least one point. */ public abstract int getDocCount(); + + public static PointValues empty( + int numDimensions, int numIndexDimensions, int bytesPerDimension) { + return new PointValues() { + @Override + public PointTree getPointTree() { + return new PointTree() { + @Override + public PointTree clone() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean moveToChild() { + return false; + } + + @Override + public boolean moveToSibling() { + return false; + } + + @Override + public boolean moveToParent() { + return false; + } + + @Override + public byte[] getMinPackedValue() { + return new byte[0]; + } + + @Override + public byte[] getMaxPackedValue() { + return new byte[0]; + } + + @Override + public long size() { + return 0; + } + + @Override + public void visitDocIDs(IntersectVisitor visitor) {} + + @Override + public void visitDocValues(IntersectVisitor visitor) {} + }; + } + + @Override + public byte[] getMinPackedValue() { + return null; + } + + @Override + public byte[] getMaxPackedValue() { + return null; + } + + @Override + public int getNumDimensions() { + return 0; Review Comment: return `numDimensions` here? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org