uschindler commented on code in PR #15186: URL: https://github.com/apache/lucene/pull/15186#discussion_r2366207607
########## lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/util/GroupVIntUtil.java: ########## @@ -0,0 +1,135 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.lucene.backward_codecs.util; Review Comment: maybe move this class next to store package (to not open another package). ########## lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/store/DataOutputUtil.java: ########## @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.lucene.backward_codecs.store; + +import java.io.IOException; +import org.apache.lucene.backward_codecs.util.GroupVIntUtil; +import org.apache.lucene.store.DataOutput; + +/** + * Utility methods for DataOutput operations that are only used by backward codecs. + * + * @lucene.internal + */ +public final class DataOutputUtil { + + private DataOutputUtil() {} // no instance + + /** + * Encode integers using group-varint. It uses {@link DataOutput#writeVInt VInt} to encode tail + * values that are not enough for a group. we need a long[] because this is what postings are + * using, all longs are actually required to be integers. + * + * @param values the values to write + * @param limit the number of values to write. + * @lucene.experimental + */ + public static void writeGroupVInts(DataOutput out, long[] values, int limit) throws IOException { Review Comment: Move that to `GroupVIntUtil`. ########## lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseDirectoryTestCase.java: ########## @@ -1480,38 +1480,6 @@ public void testDataTypes() throws IOException { } } - @Deprecated - public void testGroupVIntOverflow() throws IOException { Review Comment: yes, move this test to TestGroupVIntUtil. In addition as the code here does no longer access any internals of a specific directory implementation (there is no implementations anymore), so just test the overflow on the standard test directory impl used by tests! In short: Move test to test class above an instead of `getDirectory(createTempDir("testGroupVIntOverflow"))` use `LuceneTestCase#newDirectory()`. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
