Package org.apache.hadoop.ipc

Examples of org.apache.hadoop.ipc.RemoteException


            whatIsLeftToRead + " bytes");
          IOUtils.skipFully(in, whatIsLeftToRead);
        }
        if (responseHeader.hasException()) {
          ExceptionResponse exceptionResponse = responseHeader.getException();
          RemoteException re = createRemoteException(exceptionResponse);
          if (isFatalConnectionException(exceptionResponse)) {
            markClosed(re);
          } else {
            if (call != null) call.setException(re);
          }
View Full Code Here


  /** Convert a Json map to a RemoteException. */
  public static RemoteException toRemoteException(final Map<?, ?> json) {
    final Map<?, ?> m = (Map<?, ?>)json.get(RemoteException.class.getSimpleName());
    final String message = (String)m.get("message");
    final String javaClassName = (String)m.get("javaClassName");
    return new RemoteException(javaClassName, message);
  }
View Full Code Here

            + ", message=" + conn.getResponseMessage());
      } else if (m.get(RemoteException.class.getSimpleName()) == null) {
        return m;
      }

      final RemoteException re = JsonUtil.toRemoteException(m);
      throw unwrapException? toIOException(re): re;
    }
    return null;
  }
View Full Code Here

    final IOException ioe = (IOException)e;
    if (!(ioe instanceof RemoteException)) {
      return ioe;
    }

    final RemoteException re = (RemoteException)ioe;
    return re.unwrapRemoteException(AccessControlException.class,
        InvalidToken.class,
        AuthenticationException.class,
        AuthorizationException.class,
        FileAlreadyExistsException.class,
        FileNotFoundException.class,
View Full Code Here

      if (num_calls > num_calls_allowed) {
        throw new IOException("addBlock called more times than "
                              + RETRY_CONFIG
                              + " allows.");
      } else {
          throw new RemoteException(NotReplicatedYetException.class.getName(),
                                    ADD_BLOCK_EXCEPTION);
      }
    }
View Full Code Here

    while (res == null && cur != null) {
      if (cur instanceof EntityGroupMovedException) {
        res = (EntityGroupMovedException) cur;
      } else {
        if (cur instanceof RemoteException) {
          RemoteException re = (RemoteException) cur;
          Exception e = re
              .unwrapRemoteException(EntityGroupMovedException.class);
          if (e == null) {
            e = re.unwrapRemoteException();
          }
          // unwrapRemoteException can return the exception given as a parameter
          // when it cannot
          // unwrap it. In this case, there is no need to look further
          // noinspection ObjectEquality
View Full Code Here

        Message value = builder.build();

        return value;
      } else if (status == Status.ERROR) {
        RpcException exceptionResponse = RpcException.parseDelimitedFrom(in);
        RemoteException remoteException = new RemoteException(
            exceptionResponse.getExceptionName(),
            exceptionResponse.getStackTrace());
        throw remoteException.unwrapRemoteException();
      } else if (status == Status.FATAL) {
        RpcException exceptionResponse = RpcException.parseDelimitedFrom(in);
        // Close the connection
        LOG.error("Fatal Exception.", exceptionResponse);
        RemoteException remoteException = new RemoteException(
            exceptionResponse.getExceptionName(),
            exceptionResponse.getStackTrace());
        throw remoteException.unwrapRemoteException();
      } else {
        throw new IOException("What happened?");
      }
    } catch (Exception e) {
      if (e instanceof RemoteException) {
View Full Code Here

      if (cur instanceof RegionMovedException || cur instanceof RegionOpeningException
          || cur instanceof RegionTooBusyException) {
        return cur;
      }
      if (cur instanceof RemoteException) {
        RemoteException re = (RemoteException) cur;
        cur = re.unwrapRemoteException(
            RegionOpeningException.class, RegionMovedException.class,
            RegionTooBusyException.class);
        if (cur == null) {
          cur = re.unwrapRemoteException();
        }
        // unwrapRemoteException can return the exception given as a parameter when it cannot
        //  unwrap it. In this case, there is no need to look further
        // noinspection ObjectEquality
        if (cur == re) {
View Full Code Here

        Call call = calls.remove(id);

        boolean isError = in.readBoolean();     // read if error
        if (isError) {
          call.setException(new RemoteException( WritableUtils.readString(in),
              WritableUtils.readString(in)));
        } else {
          Writable value = ReflectionUtils.newInstance(valueClass, conf);
          value.readFields(in);                 // read value
          call.setValue(value);
View Full Code Here

          if (call != null) {
            call.setValue(value);
          }
        } else if (state == Status.ERROR.state) {
          if (call != null) {
            call.setException(new RemoteException(WritableUtils.readString(in), WritableUtils
                .readString(in)));
          }
        } else if (state == Status.FATAL.state) {
          RemoteException exception = new RemoteException(WritableUtils.readString(in),
              WritableUtils.readString(in));
          // the call will be removed from call map, we must set Exception here to notify
          // the thread waited on the call
          if (call != null) {
            call.setException(exception);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.ipc.RemoteException

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.