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