Search in sources :

Example 6 with FlushResult

use of org.apache.hadoop.hbase.regionserver.HRegion.FlushResult in project hbase by apache.

the class MiniHBaseCluster method executeFlush.

private void executeFlush(HRegion region) throws IOException {
    if (!RegionReplicaUtil.isDefaultReplica(region.getRegionInfo())) {
        return;
    }
    // retry 5 times if we can not flush
    for (int i = 0; i < 5; i++) {
        FlushResult result = region.flush(true);
        if (result.getResult() != FlushResult.Result.CANNOT_FLUSH) {
            return;
        }
        Threads.sleep(1000);
    }
}
Also used : FlushResult(org.apache.hadoop.hbase.regionserver.HRegion.FlushResult)

Aggregations

FlushResult (org.apache.hadoop.hbase.regionserver.HRegion.FlushResult)6 IOException (java.io.IOException)2 DroppedSnapshotException (org.apache.hadoop.hbase.DroppedSnapshotException)2 Get (org.apache.hadoop.hbase.client.Get)2 Put (org.apache.hadoop.hbase.client.Put)2 Test (org.junit.Test)2 Map (java.util.Map)1 MutableBoolean (org.apache.commons.lang3.mutable.MutableBoolean)1 Connection (org.apache.hadoop.hbase.client.Connection)1 Result (org.apache.hadoop.hbase.client.Result)1 Table (org.apache.hadoop.hbase.client.Table)1 HRegion (org.apache.hadoop.hbase.regionserver.HRegion)1 PrepareFlushResult (org.apache.hadoop.hbase.regionserver.HRegion.PrepareFlushResult)1 RemoteException (org.apache.hadoop.ipc.RemoteException)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1