hbase-8529: checkOpen is missing from multi, mutate, get and multiGet etc.

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1552787 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
jeffreyz 2013-12-20 19:21:53 +00:00
parent f9cb3d74c8
commit 4acb881d78
1 changed files with 17 additions and 1 deletions

View File

@ -2806,6 +2806,7 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
final GetRequest request) throws ServiceException { final GetRequest request) throws ServiceException {
long before = EnvironmentEdgeManager.currentTimeMillis(); long before = EnvironmentEdgeManager.currentTimeMillis();
try { try {
checkOpen();
requestCount.increment(); requestCount.increment();
HRegion region = getRegion(request.getRegion()); HRegion region = getRegion(request.getRegion());
@ -2872,6 +2873,7 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
// Clear scanner so we are not holding on to reference across call. // Clear scanner so we are not holding on to reference across call.
if (controller != null) controller.setCellScanner(null); if (controller != null) controller.setCellScanner(null);
try { try {
checkOpen();
requestCount.increment(); requestCount.increment();
HRegion region = getRegion(request.getRegion()); HRegion region = getRegion(request.getRegion());
MutateResponse.Builder builder = MutateResponse.newBuilder(); MutateResponse.Builder builder = MutateResponse.newBuilder();
@ -3242,6 +3244,7 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
public BulkLoadHFileResponse bulkLoadHFile(final RpcController controller, public BulkLoadHFileResponse bulkLoadHFile(final RpcController controller,
final BulkLoadHFileRequest request) throws ServiceException { final BulkLoadHFileRequest request) throws ServiceException {
try { try {
checkOpen();
requestCount.increment(); requestCount.increment();
HRegion region = getRegion(request.getRegion()); HRegion region = getRegion(request.getRegion());
List<Pair<byte[], String>> familyPaths = new ArrayList<Pair<byte[], String>>(); List<Pair<byte[], String>> familyPaths = new ArrayList<Pair<byte[], String>>();
@ -3272,6 +3275,7 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
public CoprocessorServiceResponse execService(final RpcController controller, public CoprocessorServiceResponse execService(final RpcController controller,
final CoprocessorServiceRequest request) throws ServiceException { final CoprocessorServiceRequest request) throws ServiceException {
try { try {
checkOpen();
requestCount.increment(); requestCount.increment();
HRegion region = getRegion(request.getRegion()); HRegion region = getRegion(request.getRegion());
// ignore the passed in controller (from the serialized call) // ignore the passed in controller (from the serialized call)
@ -3303,6 +3307,11 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
@Override @Override
public MultiResponse multi(final RpcController rpcc, final MultiRequest request) public MultiResponse multi(final RpcController rpcc, final MultiRequest request)
throws ServiceException { throws ServiceException {
try {
checkOpen();
} catch (IOException ie) {
throw new ServiceException(ie);
}
// rpc controller is how we bring in data via the back door; it is unprotobuf'ed data. // rpc controller is how we bring in data via the back door; it is unprotobuf'ed data.
// It is also the conduit via which we pass back data. // It is also the conduit via which we pass back data.
@ -3469,6 +3478,7 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
public GetStoreFileResponse getStoreFile(final RpcController controller, public GetStoreFileResponse getStoreFile(final RpcController controller,
final GetStoreFileRequest request) throws ServiceException { final GetStoreFileRequest request) throws ServiceException {
try { try {
checkOpen();
HRegion region = getRegion(request.getRegion()); HRegion region = getRegion(request.getRegion());
requestCount.increment(); requestCount.increment();
Set<byte[]> columnFamilies; Set<byte[]> columnFamilies;
@ -3982,6 +3992,7 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
public RollWALWriterResponse rollWALWriter(final RpcController controller, public RollWALWriterResponse rollWALWriter(final RpcController controller,
final RollWALWriterRequest request) throws ServiceException { final RollWALWriterRequest request) throws ServiceException {
try { try {
checkOpen();
requestCount.increment(); requestCount.increment();
HLog wal = this.getWAL(); HLog wal = this.getWAL();
byte[][] regionsToFlush = wal.rollWriter(true); byte[][] regionsToFlush = wal.rollWriter(true);
@ -4023,6 +4034,11 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
@Override @Override
public GetServerInfoResponse getServerInfo(final RpcController controller, public GetServerInfoResponse getServerInfo(final RpcController controller,
final GetServerInfoRequest request) throws ServiceException { final GetServerInfoRequest request) throws ServiceException {
try {
checkOpen();
} catch (IOException ie) {
throw new ServiceException(ie);
}
ServerName serverName = getServerName(); ServerName serverName = getServerName();
requestCount.increment(); requestCount.increment();
return ResponseConverter.buildGetServerInfoResponse(serverName, rsInfo.getInfoPort()); return ResponseConverter.buildGetServerInfoResponse(serverName, rsInfo.getInfoPort());