You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/12/19 14:54:44 UTC

[GitHub] [lucene] rmuir commented on a diff in pull request #12019: Clean up vector backward-codecs

rmuir commented on code in PR #12019:
URL: https://github.com/apache/lucene/pull/12019#discussion_r1052301297


##########
lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene94/Lucene94RWCodec.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * 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.lucene94;
+
+import org.apache.lucene.codecs.KnnVectorsFormat;
+import org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat;
+
+/** Implements the Lucene 9.4 index format for backwards compat testing */
+public class Lucene94RWCodec extends Lucene94Codec {

Review Comment:
   That's correct, it isn't two variants, it is just that we don't want to provide users ability to "write" new indexes with an ancient codec, only be able to read them. It would be bad (and some kind of error/misconfiguration/bug) if users could do that (e.g. set an ancient codec via Codec.setDefault and create new segments with an ancient format). 
   
   At the same time, we want our tests to be able to "write" in the old format for testing purposes, so we know we can read all the corner cases. the `.zip`ped up indexes stored in the test suite are very basic, so we wouldn't have good testing with these alone.
   
   So that's why you see these RWCodec variants, with the write support etc factored out into test-only code



-- 
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-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org