1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase.regionserver;
20
21 import java.util.Collection;
22 import java.util.Comparator;
23 import java.util.Iterator;
24 import java.util.NavigableSet;
25 import java.util.SortedSet;
26 import java.util.concurrent.ConcurrentNavigableMap;
27 import java.util.concurrent.ConcurrentSkipListMap;
28
29 import org.apache.hadoop.hbase.Cell;
30 import org.apache.hadoop.hbase.KeyValue;
31 import org.apache.hadoop.hbase.classification.InterfaceAudience;
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 @InterfaceAudience.Private
48 public class CellSkipListSet implements NavigableSet<Cell> {
49 private final ConcurrentNavigableMap<Cell, Cell> delegatee;
50
51 CellSkipListSet(final KeyValue.KVComparator c) {
52 this.delegatee = new ConcurrentSkipListMap<Cell, Cell>(c);
53 }
54
55 CellSkipListSet(final ConcurrentNavigableMap<Cell, Cell> m) {
56 this.delegatee = m;
57 }
58
59 public Cell ceiling(Cell e) {
60 throw new UnsupportedOperationException("Not implemented");
61 }
62
63 public Iterator<Cell> descendingIterator() {
64 return this.delegatee.descendingMap().values().iterator();
65 }
66
67 public NavigableSet<Cell> descendingSet() {
68 throw new UnsupportedOperationException("Not implemented");
69 }
70
71 public Cell floor(Cell e) {
72 throw new UnsupportedOperationException("Not implemented");
73 }
74
75 public SortedSet<Cell> headSet(final Cell toElement) {
76 return headSet(toElement, false);
77 }
78
79 public NavigableSet<Cell> headSet(final Cell toElement,
80 boolean inclusive) {
81 return new CellSkipListSet(this.delegatee.headMap(toElement, inclusive));
82 }
83
84 public Cell higher(Cell e) {
85 throw new UnsupportedOperationException("Not implemented");
86 }
87
88 public Iterator<Cell> iterator() {
89 return this.delegatee.values().iterator();
90 }
91
92 public Cell lower(Cell e) {
93 throw new UnsupportedOperationException("Not implemented");
94 }
95
96 public Cell pollFirst() {
97 throw new UnsupportedOperationException("Not implemented");
98 }
99
100 public Cell pollLast() {
101 throw new UnsupportedOperationException("Not implemented");
102 }
103
104 public SortedSet<Cell> subSet(Cell fromElement, Cell toElement) {
105 throw new UnsupportedOperationException("Not implemented");
106 }
107
108 public NavigableSet<Cell> subSet(Cell fromElement,
109 boolean fromInclusive, Cell toElement, boolean toInclusive) {
110 throw new UnsupportedOperationException("Not implemented");
111 }
112
113 public SortedSet<Cell> tailSet(Cell fromElement) {
114 return tailSet(fromElement, true);
115 }
116
117 public NavigableSet<Cell> tailSet(Cell fromElement, boolean inclusive) {
118 return new CellSkipListSet(this.delegatee.tailMap(fromElement, inclusive));
119 }
120
121 public Comparator<? super Cell> comparator() {
122 throw new UnsupportedOperationException("Not implemented");
123 }
124
125 public Cell first() {
126 return this.delegatee.get(this.delegatee.firstKey());
127 }
128
129 public Cell last() {
130 return this.delegatee.get(this.delegatee.lastKey());
131 }
132
133 public boolean add(Cell e) {
134 return this.delegatee.put(e, e) == null;
135 }
136
137 public boolean addAll(Collection<? extends Cell> c) {
138 throw new UnsupportedOperationException("Not implemented");
139 }
140
141 public void clear() {
142 this.delegatee.clear();
143 }
144
145 public boolean contains(Object o) {
146
147 return this.delegatee.containsKey(o);
148 }
149
150 public boolean containsAll(Collection<?> c) {
151 throw new UnsupportedOperationException("Not implemented");
152 }
153
154 public boolean isEmpty() {
155 return this.delegatee.isEmpty();
156 }
157
158 public boolean remove(Object o) {
159 return this.delegatee.remove(o) != null;
160 }
161
162 public boolean removeAll(Collection<?> c) {
163 throw new UnsupportedOperationException("Not implemented");
164 }
165
166 public boolean retainAll(Collection<?> c) {
167 throw new UnsupportedOperationException("Not implemented");
168 }
169
170 public Cell get(Cell kv) {
171 return this.delegatee.get(kv);
172 }
173
174 public int size() {
175 return this.delegatee.size();
176 }
177
178 public Object[] toArray() {
179 throw new UnsupportedOperationException("Not implemented");
180 }
181
182 public <T> T[] toArray(T[] a) {
183 throw new UnsupportedOperationException("Not implemented");
184 }
185 }