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.regionserver;
20  
21  import java.io.IOException;
22  import java.util.SortedSet;
23  
24  import org.apache.hadoop.hbase.Cell;
25  import org.apache.hadoop.hbase.client.Scan;
26  import org.apache.hadoop.hbase.regionserver.KeyValueScanner;
27  
28  public class DelegatingKeyValueScanner implements KeyValueScanner {
29    protected KeyValueScanner delegate;
30  
31    public DelegatingKeyValueScanner(KeyValueScanner delegate) {
32      this.delegate = delegate;
33    }
34  
35    @Override
36    public Cell peek() {
37      return delegate.peek();
38    }
39  
40    @Override
41    public Cell next() throws IOException {
42      return delegate.next();
43    }
44  
45    @Override
46    public boolean seek(Cell key) throws IOException {
47      return delegate.seek(key);
48    }
49  
50    @Override
51    public boolean reseek(Cell key) throws IOException {
52      return delegate.reseek(key);
53    }
54  
55    @Override
56    public void close() {
57      delegate.close();
58    }
59  
60    @Override
61    public boolean shouldUseScanner(Scan scan, SortedSet<byte[]> columns, long oldestUnexpiredTS) {
62      return delegate.shouldUseScanner(scan, columns, oldestUnexpiredTS);
63    }
64  
65    @Override
66    public boolean requestSeek(Cell kv, boolean forward, boolean useBloom) throws IOException {
67      return delegate.requestSeek(kv, forward, useBloom);
68    }
69  
70    @Override
71    public long getSequenceID() {
72      return delegate.getSequenceID();
73    }
74  
75    @Override
76    public boolean realSeekDone() {
77      return delegate.realSeekDone();
78    }
79  
80    @Override
81    public void enforceSeek() throws IOException {
82      delegate.enforceSeek();
83    }
84  
85    @Override
86    public boolean isFileScanner() {
87      return delegate.isFileScanner();
88    }
89  
90    @Override
91    public boolean backwardSeek(Cell key) throws IOException {
92      return delegate.backwardSeek(key);
93    }
94  
95    @Override
96    public boolean seekToPreviousRow(Cell key) throws IOException {
97      return delegate.seekToPreviousRow(key);
98    }
99  
100   @Override
101   public boolean seekToLastRow() throws IOException {
102     return delegate.seekToLastRow();
103   }
104 
105   @Override
106   public Cell getNextIndexedKey() {
107     return delegate.getNextIndexedKey();
108   }
109 }