@SuppressWarnings("unchecked") @Override public Throwable deSerialize() { SerializedException cause = getCause(); SerializedExceptionProtoOrBuilder p = viaProto ? proto : builder; Class<?> realClass = null; try { realClass = Class.forName(p.getClassName()); } catch (ClassNotFoundException e) { throw new YarnRuntimeException(e); } Class classType = null; if (YarnException.class.isAssignableFrom(realClass)) { classType = YarnException.class; } else if (IOException.class.isAssignableFrom(realClass)) { classType = IOException.class; } else if (RuntimeException.class.isAssignableFrom(realClass)) { classType = RuntimeException.class; } else { classType = Exception.class; } return instantiateException(realClass.asSubclass(classType), getMessage(), cause == null ? null : cause.deSerialize()); }
@SuppressWarnings("unchecked") @Override public Throwable deSerialize() { SerializedException cause = getCause(); SerializedExceptionProtoOrBuilder p = viaProto ? proto : builder; Class<?> realClass = null; try { realClass = Class.forName(p.getClassName()); } catch (ClassNotFoundException e) { throw new YarnRuntimeException(e); } Class classType = null; if (YarnException.class.isAssignableFrom(realClass)) { classType = YarnException.class; } else if (IOException.class.isAssignableFrom(realClass)) { classType = IOException.class; } else if (RuntimeException.class.isAssignableFrom(realClass)) { classType = RuntimeException.class; } else { classType = Throwable.class; } return instantiateException(realClass.asSubclass(classType), getMessage(), cause == null ? null : cause.deSerialize()); }
@Override public SerializedException getCause() { SerializedExceptionProtoOrBuilder p = viaProto ? proto : builder; if (p.hasCause()) { return new SerializedExceptionPBImpl(p.getCause()); } else { return null; } }
@Override public String getMessage() { SerializedExceptionProtoOrBuilder p = viaProto ? proto : builder; return p.getMessage(); }
@Override public String getRemoteTrace() { SerializedExceptionProtoOrBuilder p = viaProto ? proto : builder; return p.getTrace(); }