Apache9 commented on code in PR #6141: URL: https://github.com/apache/hbase/pull/6141#discussion_r1713845499
########## hbase-server/src/main/java/org/apache/hadoop/hbase/io/RangeStoreFileReader.java: ########## @@ -0,0 +1,278 @@ +/* + * 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.hadoop.hbase.io; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.ExtendedCell; +import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.PrivateCellUtil; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.io.hfile.CacheConfig; +import org.apache.hadoop.hbase.io.hfile.HFileInfo; +import org.apache.hadoop.hbase.io.hfile.HFileScanner; +import org.apache.hadoop.hbase.io.hfile.ReaderContext; +import org.apache.hadoop.hbase.regionserver.StoreFileInfo; +import org.apache.hadoop.hbase.regionserver.StoreFileReader; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.yetus.audience.InterfaceAudience; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.Optional; +import java.util.function.IntConsumer; + [email protected] +public class RangeStoreFileReader extends StoreFileReader { + + private static final Logger LOG = LoggerFactory.getLogger(RangeStoreFileReader.class); + + protected final byte[] startKey; + protected final byte[] endKey; + private final ExtendedCell startCell; + private final ExtendedCell endCell; + private Optional<ExtendedCell> firstKey = Optional.empty(); + + private boolean firstKeySeeked = false; + + public RangeStoreFileReader(final ReaderContext context, final HFileInfo fileInfo, + final CacheConfig cacheConf, final byte[] startKey, final byte[] endKey, StoreFileInfo storeFileInfo, + final Configuration conf) throws IOException { + super(context, fileInfo, cacheConf, storeFileInfo, conf); + this.startKey = startKey; + this.endKey = endKey; + this.startCell = new KeyValue.KeyOnlyKeyValue(this.startKey, 0, this.startKey.length); Review Comment: At least you need to deal with startKey == null or endKey == null for the first range and last range? -- 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]
