HBASE-26921 Rewrite the counting cells part in TestMultiVersions (#4316)
[hbase.git] / hbase-server / src / main / java / org / apache / hadoop / hbase / regionserver / InternalScan.java
blob1c76a347f584c8b6d3c8eab62488941ee45d56b4
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.IOException;
23 import org.apache.hadoop.hbase.HBaseInterfaceAudience;
24 import org.apache.yetus.audience.InterfaceAudience;
25 import org.apache.hadoop.hbase.client.Get;
26 import org.apache.hadoop.hbase.client.Scan;
28 /**
29 * Special scanner, currently used for increment operations to
30 * allow additional server-side arguments for Scan operations.
31 * <p>
32 * Rather than adding new options/parameters to the public Scan API, this new
33 * class has been created.
34 * <p>
35 * Supports adding an option to only read from the MemStore with
36 * {@link #checkOnlyMemStore()} or to only read from StoreFiles with
37 * {@link #checkOnlyStoreFiles()}.
39 @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
40 public class InternalScan extends Scan {
41 private boolean memOnly = false;
42 private boolean filesOnly = false;
44 /**
45 * @param get get to model scan after
47 public InternalScan(Get get) {
48 super(get);
51 /**
52 * @param scan - original scan object
53 * @throws IOException
55 public InternalScan(Scan scan)
56 throws IOException
58 super(scan);
61 /**
62 * StoreFiles will not be scanned. Only MemStore will be scanned.
64 public void checkOnlyMemStore() {
65 memOnly = true;
66 filesOnly = false;
69 /**
70 * MemStore will not be scanned. Only StoreFiles will be scanned.
72 public void checkOnlyStoreFiles() {
73 memOnly = false;
74 filesOnly = true;
77 /**
78 * Returns true if only the MemStore should be checked. False if not.
79 * @return true to only check MemStore
81 public boolean isCheckOnlyMemStore() {
82 return (memOnly);
85 /**
86 * Returns true if only StoreFiles should be checked. False if not.
87 * @return true if only check StoreFiles
89 public boolean isCheckOnlyStoreFiles() {
90 return (filesOnly);