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 org.apache.hadoop.hbase.classification.InterfaceAudience;
22 import org.apache.hadoop.fs.FileSystem;
23 import org.apache.hadoop.hbase.HRegionInfo;
24 import org.apache.hadoop.hbase.catalog.CatalogTracker;
25 import org.apache.hadoop.hbase.executor.ExecutorService;
26 import org.apache.hadoop.hbase.ipc.PriorityFunction;
27 import org.apache.hadoop.hbase.ipc.RpcServerInterface;
28 import org.apache.hadoop.hbase.master.TableLockManager;
29 import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode;
30 import org.apache.hadoop.hbase.regionserver.wal.HLog;
31 import org.apache.zookeeper.KeeperException;
32
33 import com.google.protobuf.Service;
34
35 import java.io.IOException;
36 import java.util.Map;
37 import java.util.concurrent.ConcurrentMap;
38
39
40
41
42 @InterfaceAudience.Private
43 public interface RegionServerServices
44 extends OnlineRegions, FavoredNodesForRegion, PriorityFunction {
45
46
47
48 boolean isStopping();
49
50
51
52 HLog getWAL(HRegionInfo regionInfo) throws IOException;
53
54
55
56
57 CompactionRequestor getCompactionRequester();
58
59
60
61
62 FlushRequester getFlushRequester();
63
64
65
66
67 RegionServerAccounting getRegionServerAccounting();
68
69
70
71
72 TableLockManager getTableLockManager();
73
74
75
76
77 class PostOpenDeployContext {
78 private final HRegion region;
79 private final long masterSystemTime;
80
81 @InterfaceAudience.Private
82 public PostOpenDeployContext(HRegion region, long masterSystemTime) {
83 this.region = region;
84 this.masterSystemTime = masterSystemTime;
85 }
86 public HRegion getRegion() {
87 return region;
88 }
89 public long getMasterSystemTime() {
90 return masterSystemTime;
91 }
92 }
93
94
95
96
97
98
99
100
101
102
103 void postOpenDeployTasks(final PostOpenDeployContext context, final CatalogTracker ct)
104 throws KeeperException, IOException;
105
106
107
108
109
110
111
112
113
114
115
116 @Deprecated
117 void postOpenDeployTasks(final HRegion r, final CatalogTracker ct)
118 throws KeeperException, IOException;
119
120 class RegionStateTransitionContext {
121 private final TransitionCode code;
122 private final long openSeqNum;
123 private final long masterSystemTime;
124 private final HRegionInfo[] hris;
125
126 @InterfaceAudience.Private
127 public RegionStateTransitionContext(TransitionCode code, long openSeqNum, long masterSystemTime,
128 HRegionInfo... hris) {
129 this.code = code;
130 this.openSeqNum = openSeqNum;
131 this.masterSystemTime = masterSystemTime;
132 this.hris = hris;
133 }
134 public TransitionCode getCode() {
135 return code;
136 }
137 public long getOpenSeqNum() {
138 return openSeqNum;
139 }
140 public long getMasterSystemTime() {
141 return masterSystemTime;
142 }
143 public HRegionInfo[] getHris() {
144 return hris;
145 }
146 }
147
148
149
150
151 boolean reportRegionStateTransition(final RegionStateTransitionContext context);
152
153
154
155
156 @Deprecated
157 boolean reportRegionStateTransition(TransitionCode code, HRegionInfo... hris);
158
159
160
161
162 @Deprecated
163 boolean reportRegionStateTransition(TransitionCode code, long openSeqNum, HRegionInfo... hris);
164
165
166
167
168 RpcServerInterface getRpcServer();
169
170
171
172
173
174 ConcurrentMap<byte[], Boolean> getRegionsInTransitionInRS();
175
176
177
178
179 FileSystem getFileSystem();
180
181
182
183
184 Leases getLeases();
185
186
187
188
189 ExecutorService getExecutorService();
190
191
192
193
194 CatalogTracker getCatalogTracker();
195
196
197
198
199 Map<String, HRegion> getRecoveringRegions();
200
201
202
203
204
205 public ServerNonceManager getNonceManager();
206
207
208
209
210
211
212
213 boolean registerService(Service service);
214
215
216
217
218 HeapMemoryManager getHeapMemoryManager();
219
220
221
222
223
224
225
226 double getCompactionPressure();
227 }