HBASE-26286: Add support for specifying store file tracker when restoring or cloning...
[hbase.git] / hbase-server / src / main / java / org / apache / hadoop / hbase / regionserver / InternalScanner.java
blobfe527581b6e55c11d66137c9f6c692968bb92d94
1 /**
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 package org.apache.hadoop.hbase.regionserver;
21 import java.io.Closeable;
22 import java.io.IOException;
23 import java.util.List;
25 import org.apache.hadoop.hbase.Cell;
26 import org.apache.hadoop.hbase.HBaseInterfaceAudience;
27 import org.apache.yetus.audience.InterfaceAudience;
28 import org.apache.yetus.audience.InterfaceStability;
30 /**
31 * Internal scanners differ from client-side scanners in that they operate on
32 * HStoreKeys and byte[] instead of RowResults. This is because they are
33 * actually close to how the data is physically stored, and therefore it is more
34 * convenient to interact with them that way. It is also much easier to merge
35 * the results across SortedMaps than RowResults.
37 * <p>Additionally, we need to be able to determine if the scanner is doing
38 * wildcard column matches (when only a column family is specified or if a
39 * column regex is specified) or if multiple members of the same column family
40 * were specified. If so, we need to ignore the timestamp to ensure that we get
41 * all the family members, as they may have been last updated at different
42 * times.
44 @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
45 @InterfaceStability.Evolving
46 public interface InternalScanner extends Closeable {
47 /**
48 * Grab the next row's worth of values.
49 * @param result return output array
50 * @return true if more rows exist after this one, false if scanner is done
51 * @throws IOException e
53 default boolean next(List<Cell> result) throws IOException {
54 return next(result, NoLimitScannerContext.getInstance());
57 /**
58 * Grab the next row's worth of values.
59 * @param result return output array
60 * @param scannerContext
61 * @return true if more rows exist after this one, false if scanner is done
62 * @throws IOException e
64 boolean next(List<Cell> result, ScannerContext scannerContext) throws IOException;
66 /**
67 * Closes the scanner and releases any resources it has allocated
68 * @throws IOException
70 @Override
71 void close() throws IOException;