View Javadoc

1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package org.apache.hadoop.hbase.codec.prefixtree.scanner;
20  
21  import org.apache.hadoop.classification.InterfaceAudience;
22  
23  /**
24   * An indicator of the state of the scanner after an operation such as nextCell() or
25   * positionAt(..). For example:
26   * <ul>
27   * <li>In a DataBlockScanner, the AFTER_LAST position indicates to the parent StoreFileScanner that
28   * it should load the next block.</li>
29   * <li>In a StoreFileScanner, the AFTER_LAST position indicates that the file has been exhausted.
30   * </li>
31   * <li>In a RegionScanner, the AFTER_LAST position indicates that the scanner should move to the
32   * next region.</li>
33   * </ul>
34   */
35  @InterfaceAudience.Private
36  public enum CellScannerPosition {
37  
38    /**
39     * getCurrentCell() will NOT return a valid cell. Calling nextCell() will advance to the first
40     * cell.
41     */
42    BEFORE_FIRST,
43  
44    /**
45     * getCurrentCell() will return a valid cell, but it is not the cell requested by positionAt(..),
46     * rather it is the nearest cell before the requested cell.
47     */
48    BEFORE,
49  
50    /**
51     * getCurrentCell() will return a valid cell, and it is exactly the cell that was requested by
52     * positionAt(..).
53     */
54    AT,
55  
56    /**
57     * getCurrentCell() will return a valid cell, but it is not the cell requested by positionAt(..),
58     * rather it is the nearest cell after the requested cell.
59     */
60    AFTER,
61  
62    /**
63     * getCurrentCell() will NOT return a valid cell. Calling nextCell() will have no effect.
64     */
65    AFTER_LAST
66  
67  }