/** * Recreate throwable from exception protoBuf which received from remote or local node. * if no match constructor found, the base Throwable (Exception or Error) is created as a substitution * * @param exceptionWrapper the exception protoBuf * @return Throwable deserialized from protoBuf */ public static Throwable getThrowable(UserBitShared.ExceptionWrapper exceptionWrapper) { if (exceptionWrapper == null) { return null; } String className = exceptionWrapper.getExceptionClass(); if (StringUtils.isBlank(className) || exceptionWrapper.getStackTraceCount() < 1) { return null; } Throwable inner = getThrowable(exceptionWrapper.getCause()); try { Throwable throwable = getInstance(className, exceptionWrapper.getMessage(), inner); int size = exceptionWrapper.getStackTraceCount(); StackTraceElement[] stackTrace = new StackTraceElement[size]; for (int i = 0; i < size; ++i) { UserBitShared.StackTraceElementWrapper w = exceptionWrapper.getStackTrace(i); stackTrace[i] = new StackTraceElement(w.getClassName(), w.getMethodName(), w.getFileName(), w.getLineNumber()); } throwable.setStackTrace(stackTrace); return throwable; } catch (Throwable t) { return null; } }
/** * Recreate throwable from exception protoBuf which received from remote or local node. * if no match constructor found, the base Throwable (Exception or Error) is created as a substitution * * @param exceptionWrapper the exception protoBuf * @return Throwable deserialized from protoBuf */ public static Throwable getThrowable(UserBitShared.ExceptionWrapper exceptionWrapper) { if (exceptionWrapper == null) { return null; } String className = exceptionWrapper.getExceptionClass(); if (StringUtils.isBlank(className) || exceptionWrapper.getStackTraceCount() < 1) { return null; } Throwable inner = getThrowable(exceptionWrapper.getCause()); try { Throwable throwable = getInstance(className, exceptionWrapper.getMessage(), inner); int size = exceptionWrapper.getStackTraceCount(); StackTraceElement[] stackTrace = new StackTraceElement[size]; for (int i = 0; i < size; ++i) { UserBitShared.StackTraceElementWrapper w = exceptionWrapper.getStackTrace(i); stackTrace[i] = new StackTraceElement(w.getClassName(), w.getMethodName(), w.getFileName(), w.getLineNumber()); } throwable.setStackTrace(stackTrace); return throwable; } catch (Throwable t) { return null; } }
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserBitShared.ExceptionWrapper message) throws java.io.IOException { if(message.hasExceptionClass()) output.writeString(1, message.getExceptionClass(), false); if(message.hasMessage()) output.writeString(2, message.getMessage(), false); for(org.apache.drill.exec.proto.UserBitShared.StackTraceElementWrapper stackTrace : message.getStackTraceList()) output.writeObject(3, stackTrace, org.apache.drill.exec.proto.SchemaUserBitShared.StackTraceElementWrapper.WRITE, true); if(message.hasCause()) output.writeObject(4, message.getCause(), org.apache.drill.exec.proto.SchemaUserBitShared.ExceptionWrapper.WRITE, false); } public boolean isInitialized(org.apache.drill.exec.proto.UserBitShared.ExceptionWrapper message)
/** * <code>optional string exception_class = 1;</code> */ public Builder clearExceptionClass() { bitField0_ = (bitField0_ & ~0x00000001); exceptionClass_ = getDefaultInstance().getExceptionClass(); onChanged(); return this; } /**
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserBitShared.ExceptionWrapper message) throws java.io.IOException { if(message.hasExceptionClass()) output.writeString(1, message.getExceptionClass(), false); if(message.hasMessage()) output.writeString(2, message.getMessage(), false); for(org.apache.drill.exec.proto.UserBitShared.StackTraceElementWrapper stackTrace : message.getStackTraceList()) output.writeObject(3, stackTrace, org.apache.drill.exec.proto.SchemaUserBitShared.StackTraceElementWrapper.WRITE, true); if(message.hasCause()) output.writeObject(4, message.getCause(), org.apache.drill.exec.proto.SchemaUserBitShared.ExceptionWrapper.WRITE, false); } public boolean isInitialized(org.apache.drill.exec.proto.UserBitShared.ExceptionWrapper message)
/** * <code>optional string exception_class = 1;</code> */ public Builder clearExceptionClass() { bitField0_ = (bitField0_ & ~0x00000001); exceptionClass_ = getDefaultInstance().getExceptionClass(); onChanged(); return this; } /**