Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.CompareOperator;
import org.apache.hadoop.hbase.CoprocessorEnvironment;
import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.HBaseInterfaceAudience;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.NamespaceDescriptor;
Expand Down Expand Up @@ -99,9 +100,9 @@ public class ReadOnlyController implements MasterCoprocessor, RegionCoprocessor,

private volatile boolean globalReadOnlyEnabled;

private void internalReadOnlyGuard() throws IOException {
private void internalReadOnlyGuard() throws DoNotRetryIOException {
if (this.globalReadOnlyEnabled) {
throw new IOException("Operation not allowed in Read-Only Mode");
throw new DoNotRetryIOException("Operation not allowed in Read-Only Mode");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.mockito.Mockito.mock;

import java.io.IOException;
import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.coprocessor.ObserverContext;
Expand Down Expand Up @@ -62,7 +63,7 @@ public void tearDown() throws Exception {

}

@Test(expected = IOException.class)
@Test(expected = DoNotRetryIOException.class)
public void testPrePrepareBulkLoadReadOnlyException() throws IOException {
readOnlyController.onConfigurationChange(readOnlyConf);
readOnlyController.prePrepareBulkLoad(ctx);
Expand All @@ -73,7 +74,7 @@ public void testPrePrepareBulkLoadNoException() throws IOException {
readOnlyController.prePrepareBulkLoad(ctx);
}

@Test(expected = IOException.class)
@Test(expected = DoNotRetryIOException.class)
public void testPreCleanupBulkLoadReadOnlyException() throws IOException {
readOnlyController.onConfigurationChange(readOnlyConf);
readOnlyController.preCleanupBulkLoad(ctx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.mockito.Mockito.mock;

import java.io.IOException;
import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.coprocessor.ObserverContext;
Expand All @@ -47,7 +48,7 @@ public class TestReadOnlyControllerEndpointObserver {
ReadOnlyController readOnlyController;
HBaseConfiguration readOnlyConf;

// Region Server Coprocessor mocking variables
// Region Server Coprocessor mocking variables.
ObserverContext<? extends RegionCoprocessorEnvironment> ctx;
Service service;
String methodName;
Expand All @@ -73,7 +74,7 @@ public void tearDown() throws Exception {

}

@Test(expected = IOException.class)
@Test(expected = DoNotRetryIOException.class)
public void testPreEndpointInvocationReadOnlyException() throws IOException {
readOnlyController.onConfigurationChange(readOnlyConf);
readOnlyController.preEndpointInvocation(ctx, service, methodName, request);
Expand Down
Loading