dsmiley commented on a change in pull request #633: LUCENE-8753 UniformSplit PostingsFormat URL: https://github.com/apache/lucene-solr/pull/633#discussion_r289675937
########## File path: lucene/codecs/src/java/org/apache/lucene/codecs/lucene50/DeltaBaseTermStateSerializer.java ########## @@ -0,0 +1,206 @@ +/* + * 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.codecs.lucene50; + +import java.io.IOException; + +import org.apache.lucene.codecs.BlockTermState; +import org.apache.lucene.index.FieldInfo; +import org.apache.lucene.index.IndexOptions; +import org.apache.lucene.index.TermState; +import org.apache.lucene.store.DataInput; +import org.apache.lucene.store.DataOutput; +import org.apache.lucene.codecs.lucene50.Lucene50PostingsFormat.IntBlockTermState; +import org.apache.lucene.util.Accountable; +import org.apache.lucene.util.RamUsageEstimator; + +import static org.apache.lucene.codecs.lucene50.Lucene50PostingsFormat.BLOCK_SIZE; + +/** + * {@link TermState} serializer which encodes each file pointer as a delta relative + * to a base file pointer. It differs from {@link Lucene50PostingsWriter#encodeTerm} + * which encodes each file pointer as a delta relative to the previous file pointer. + * <p> + * It automatically sets the base file pointer to the first valid file pointer for + * doc start FP, pos start FP, pay start FP. These base file pointers have to + * be {@link #resetBaseStartFP() reset} by the caller before starting to write + * a new block. + * <p> + * It belongs to the lucene50 package because it accesses the package private Review comment: @rmuir Any thoughts on this? Is it fine where it is, in the lucene50 package? It is not strictly tied to UniformSplit although U.S. uses it; so I suppose it's fine here. Or perhaps IntBlockTermState could be made completely public, marked as lucene.internal of course, and moved to codecs package? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
