1919
2020import static org .apache .hadoop .hbase .HConstants .HREGION_LOGDIR_NAME ;
2121
22+ import com .google .errorprone .annotations .RestrictedApi ;
2223import java .io .IOException ;
2324import java .util .List ;
2425import org .apache .hadoop .conf .Configuration ;
@@ -142,6 +143,12 @@ public void update(UpdateMasterRegion action) throws IOException {
142143 flusherAndCompactor .onUpdate ();
143144 }
144145
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/.*" )
145152 public Result get (Get get ) throws IOException {
146153 return region .get (get );
147154 }
@@ -154,14 +161,20 @@ public RegionScanner getRegionScanner(Scan scan) throws IOException {
154161 return region .getScanner (scan );
155162 }
156163
164+ @ RestrictedApi (explanation = "Should only be called in tests" , link = "" ,
165+ allowedOnPath = ".*/src/test/.*" )
157166 public FlushResult flush (boolean force ) throws IOException {
158167 return region .flush (force );
159168 }
160169
170+ @ RestrictedApi (explanation = "Should only be called in tests" , link = "" ,
171+ allowedOnPath = ".*/src/test/.*" )
161172 public void requestRollAll () {
162173 walRoller .requestRollAll ();
163174 }
164175
176+ @ RestrictedApi (explanation = "Should only be called in tests" , link = "" ,
177+ allowedOnPath = ".*/src/test/.*" )
165178 public void waitUntilWalRollFinished () throws InterruptedException {
166179 walRoller .waitUntilWalRollFinished ();
167180 }
0 commit comments