Package com.google.protobuf

Examples of com.google.protobuf.ServiceException


      getAuthenticationToken(serverController, request, callback);
      try {
        serverController.checkFailed();
        return callback.get();
      } catch (IOException ioe) {
        throw new ServiceException(ioe);
      }
    }
View Full Code Here


      whoAmI(serverController, request, callback);
      try {
        serverController.checkFailed();
        return callback.get();
      } catch (IOException ioe) {
        throw new ServiceException(ioe);
      }
    }
View Full Code Here

      long sid = 12345L;
      try {
        Mockito.when(stub.scan((RpcController)Mockito.any(),
            (ClientProtos.ScanRequest)Mockito.any())).
          thenReturn(ClientProtos.ScanResponse.newBuilder().setScannerId(sid).build()).
          thenThrow(new ServiceException(new RegionServerStoppedException("From Mockito"))).
          thenReturn(ClientProtos.ScanResponse.newBuilder().setScannerId(sid).
            setMoreResults(false).build());
      } catch (ServiceException e) {
        throw new IOException(e);
      }
View Full Code Here

      long sid = 12345L;
      try {
        Mockito.when(stub.scan((RpcController)Mockito.any(),
            (ClientProtos.ScanRequest)Mockito.any())).
          thenReturn(ClientProtos.ScanResponse.newBuilder().setScannerId(sid).build()).
          thenThrow(new ServiceException(new RegionServerStoppedException("From Mockito"))).
          thenReturn(ClientProtos.ScanResponse.newBuilder().setScannerId(sid).
            setMoreResults(false).build());
      } catch (ServiceException e) {
        throw new IOException(e);
      }
View Full Code Here

      // Mock up my stub so an exists call -- which turns into a get -- throws an exception
      this.stub = Mockito.mock(ClientService.BlockingInterface.class);
      try {
        Mockito.when(stub.get((RpcController)Mockito.any(),
            (ClientProtos.GetRequest)Mockito.any())).
          thenThrow(new ServiceException(new RegionServerStoppedException("From Mockito")));
      } catch (ServiceException e) {
        throw new IOException(e);
      }
    }
View Full Code Here

    }
    if (t instanceof RemoteException) {
      t = ((RemoteException)t).unwrapRemoteException();
    }
    if (t instanceof ServiceException) {
      ServiceException se = (ServiceException)t;
      Throwable cause = se.getCause();
      if (cause != null && cause instanceof DoNotRetryIOException) {
        throw (DoNotRetryIOException)cause;
      }
      // Don't let ServiceException out; its rpc specific.
      t = cause;
View Full Code Here

        ClientProtos.Result pbr = ProtobufUtil.toResult(r);
        builder.setResult(pbr);
      }
      return builder.build();
    } catch (IOException ie) {
      throw new ServiceException(ie);
    } finally {
      metricsRegionServer.updateGet(EnvironmentEdgeManager.currentTimeMillis() - before);
    }
  }
View Full Code Here

      if (processed != null) builder.setProcessed(processed.booleanValue());
      addResult(builder, r, controller);
      return builder.build();
    } catch (IOException ie) {
      checkFileSystem();
      throw new ServiceException(ie);
    }
  }
View Full Code Here

          scanners.remove(scannerName);
        }
        throw convertThrowableToIOE(cleanup(t));
      }
    } catch (IOException ie) {
      throw new ServiceException(ie);
    }
  }
View Full Code Here

      }
      BulkLoadHFileResponse.Builder builder = BulkLoadHFileResponse.newBuilder();
      builder.setLoaded(loaded);
      return builder.build();
    } catch (IOException ie) {
      throw new ServiceException(ie);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.protobuf.ServiceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.