shubhamvishu commented on code in PR #12930: URL: https://github.com/apache/lucene/pull/12930#discussion_r1462857551
########## dev-docs/codec-version-bump-howto.md: ########## @@ -0,0 +1,74 @@ +<!-- +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. +--> + +# Lucene Codec Version Bump How-To Manual + +Changing the name of the codec in Lucene is required for maintaining backward compatibility and ensuring a smooth transition for users. +Through explicit versioning, we isolate changes to the codec, and prevent unintended interactions between different codec +versions. Changes to the codec format version serves as a signal that a change in the format or structure of the index has occurred. + +This manual provides a step-by-step guide through the process of "bumping" the version of the Lucene Codec. + +### Fork and modify files +* Creating a new Codec: + * Create a new package for your new codec of version XXX: `org.apache.lucene.codecs.luceneXXX`. + * Copy the previous codec in, updating all references to the old version number. + * Set the new codec, as the `defaultCodec` in [Codec.java](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/codecs/Codec.java). + * Update all references from the old codec version to the new one. +* Fork Components: + * Fork the required codec components, ensure the new codec is using those components. + * Fork subclasses impacted by the codec changes and update version numbers accordingly. +* ForUtil (if modified): + * Move the unmodified `gen_ForUtil.py` to the latest `backward_codecs` package. Move the modified `gen_ForUtil.py` to the newly forked codec package. + * Change the [generateForUtil.json](https://github.com/apache/lucene/blob/main/lucene/core/src/generated/checksums/generateForUtil.json) to use the newest `luceneXXX` package. Create a [generateForUtilXXX.json](https://github.com/apache/lucene/tree/main/lucene/backward-codecs/src/generated/checksums) for the `gen_ForUtil.py` moved to `backwards_codecs`. + * In [forUtil.gradle](https://github.com/apache/lucene/blob/main/gradle/generation/forUtil.gradle), change the genDir to the latest + codec. Create a new task to `generateForUtil` for the `ForUtil` in `backwards_codecs`. + * Generate the `ForUtil`'s by running the command : `./gradlew generateForUtil`. + +### Move original files to backwards_codecs +* Deprecate previous Codec: + * Create a new package for the previous codec of version XXX: `org.apache.lucene.backward_codecs.luceneXXX.LuceneXXXCodec`. Review Comment: Are we creating a new package or you mean a new class eg: `LuceneXXXCodec` with old codec as specified 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