19
19
20
20
import static org .apache .hadoop .hbase .HConstants .HREGION_LOGDIR_NAME ;
21
21
22
+ import com .google .errorprone .annotations .RestrictedApi ;
22
23
import java .io .IOException ;
23
24
import java .util .List ;
24
25
import org .apache .hadoop .conf .Configuration ;
@@ -142,6 +143,12 @@ public void update(UpdateMasterRegion action) throws IOException {
142
143
flusherAndCompactor .onUpdate ();
143
144
}
144
145
146
+ /**
147
+ * The design for master region is to only load all the data to memory at once when starting, so
148
+ * typically you should not use the get method to get a single row of data at runtime.
149
+ */
150
+ @ RestrictedApi (explanation = "Should only be called in tests" , link = "" ,
151
+ allowedOnPath = ".*/src/test/.*" )
145
152
public Result get (Get get ) throws IOException {
146
153
return region .get (get );
147
154
}
@@ -154,14 +161,20 @@ public RegionScanner getRegionScanner(Scan scan) throws IOException {
154
161
return region .getScanner (scan );
155
162
}
156
163
164
+ @ RestrictedApi (explanation = "Should only be called in tests" , link = "" ,
165
+ allowedOnPath = ".*/src/test/.*" )
157
166
public FlushResult flush (boolean force ) throws IOException {
158
167
return region .flush (force );
159
168
}
160
169
170
+ @ RestrictedApi (explanation = "Should only be called in tests" , link = "" ,
171
+ allowedOnPath = ".*/src/test/.*" )
161
172
public void requestRollAll () {
162
173
walRoller .requestRollAll ();
163
174
}
164
175
176
+ @ RestrictedApi (explanation = "Should only be called in tests" , link = "" ,
177
+ allowedOnPath = ".*/src/test/.*" )
165
178
public void waitUntilWalRollFinished () throws InterruptedException {
166
179
walRoller .waitUntilWalRollFinished ();
167
180
}
0 commit comments