public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, timestamp_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(2, returnCode_.getNumber()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, getMessageBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, stackTrace_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public static ResultCode valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( "EnumValueDescriptor is not for this type."); } return VALUES[desc.getIndex()]; }
public static SQLException makeSQLException(ResultCode code, String ...args) { if (SQLSTATES.containsKey(code)) { return new SQLException( ErrorMessages.getMessage(code, args), SQLSTATES.get(code), code.getNumber()); } else { // If there is no SQLState corresponding to error code, // It will make SQLState '42000' (Syntax Error Or Access Rule Violation). return new SQLException( code.name(), "42000", code.getNumber()); } }
org.apache.tajo.error.Errors.ResultCode value = org.apache.tajo.error.Errors.ResultCode.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(2, rawValue);
org.apache.tajo.error.Errors.ResultCode value = org.apache.tajo.error.Errors.ResultCode.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(1, rawValue);
org.apache.tajo.error.Errors.ResultCode value = org.apache.tajo.error.Errors.ResultCode.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(2, rawValue);
org.apache.tajo.error.Errors.ResultCode value = org.apache.tajo.error.Errors.ResultCode.valueOf(rawValue); if (value == null) { unknownFields.mergeVarintField(1, rawValue);
public static DefaultTajoException toTajoExceptionCommon(ReturnState state) { if (state.getReturnCode() == Errors.ResultCode.INTERNAL_ERROR) { return new TajoInternalError(state); } else if (EXCEPTIONS.containsKey(state.getReturnCode())) { Object exception; try { Class clazz = EXCEPTIONS.get(state.getReturnCode()); Constructor c = clazz.getConstructor(ReturnState.class); exception = c.newInstance(new Object[]{state}); } catch (Throwable t) { throw new TajoInternalError(t); } if (exception instanceof TajoException) { return (TajoException) exception; } else if (exception instanceof TajoRuntimeException) { return ((TajoRuntimeException) exception); } else { return ((TajoError) exception); } } else { throw new TajoInternalError( "Cannot restore the exception for [" + state.getReturnCode().name() +"] '" + state.getMessage() +"'"); } }
public static DefaultTajoException toTajoExceptionCommon(ReturnState state) { if (state.getReturnCode() == Errors.ResultCode.INTERNAL_ERROR) { return new TajoInternalError(state); } else if (EXCEPTIONS.containsKey(state.getReturnCode())) { Object exception; try { Class clazz = EXCEPTIONS.get(state.getReturnCode()); Constructor c = clazz.getConstructor(ReturnState.class); exception = c.newInstance(new Object[]{state}); } catch (Throwable t) { throw new TajoInternalError(t); } if (exception instanceof TajoException) { return (TajoException) exception; } else if (exception instanceof TajoRuntimeException) { return ((TajoRuntimeException) exception); } else { return ((TajoError) exception); } } else { throw new TajoInternalError( "Cannot restore the exception for [" + state.getReturnCode().name() +"] '" + state.getMessage() +"'"); } }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(1, timestamp_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(2, returnCode_.getNumber()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, getMessageBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, stackTrace_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, returnCode_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, getMessageBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, stackTrace_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, returnCode_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, getMessageBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, stackTrace_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public static String getMessage(ResultCode code, String...args) { if (!MESSAGES.containsKey(code)) { throw new TajoInternalError("no error message for " + code); } else { Pair<String, Integer> messageFormat = MESSAGES.get(code); if (messageFormat.getSecond() == args.length) { // if arguments are matched if (args.length == 0) { // no argument return MESSAGES.get(code).getFirst(); } else { return String.format(MESSAGES.get(code).getFirst(), args); } } else { throw new TajoInternalError( "Error message arguments are invalid: code=" + code.name() + ", args=" + concat(args) + ". Please report this bug to https://issues.apache.org/jira/browse/TAJO."); } } } }
public static String getMessage(ResultCode code, String...args) { if (!MESSAGES.containsKey(code)) { throw new TajoInternalError("no error message for " + code); } else { Pair<String, Integer> messageFormat = MESSAGES.get(code); if (messageFormat.getSecond() == args.length) { // if arguments are matched if (args.length == 0) { // no argument return MESSAGES.get(code).getFirst(); } else { return String.format(MESSAGES.get(code).getFirst(), args); } } else { throw new TajoInternalError( "Error message arguments are invalid: code=" + code.name() + ", args=" + concat(args) + ". Please report this bug to https://issues.apache.org/jira/browse/TAJO."); } } } }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt64(1, timestamp_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeEnum(2, returnCode_.getNumber()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, getMessageBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeMessage(4, stackTrace_); } getUnknownFields().writeTo(output); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt64(1, timestamp_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeEnum(2, returnCode_.getNumber()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, getMessageBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeMessage(4, stackTrace_); } getUnknownFields().writeTo(output); }
private static SQLException toSQLException(ResultCode code, String message) throws SQLException { if (SQLSTATES.containsKey(code)) { return new SQLException( message, SQLSTATES.get(code), code.getNumber() ); } else { // If there is no SQLState corresponding to error code, // It will make SQLState '42000' (Syntax Error Or Access Rule Violation). return new SQLException( message, "42000", ResultCode.SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION_VALUE ); } }
private static SQLException toSQLException(ResultCode code, String message) throws SQLException { if (SQLSTATES.containsKey(code)) { return new SQLException( message, SQLSTATES.get(code), code.getNumber() ); } else { // If there is no SQLState corresponding to error code, // It will make SQLState '42000' (Syntax Error Or Access Rule Violation). return new SQLException( message, "42000", ResultCode.SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION_VALUE ); } }
private Schema waitOnResult() throws SQLException { try { QueryStatus status = TajoClientUtil.waitCompletion(tajoClient, queryId); if (status.getState() != TajoProtos.QueryState.QUERY_SUCCEEDED) { throw new SQLException(status.getErrorMessage(), SQLExceptionUtil.toSQLState(ResultCode.INTERNAL_ERROR), ResultCode.INTERNAL_ERROR.getNumber()); } ClientProtos.GetQueryResultResponse response = tajoClient.getResultResponse(queryId); TableDesc tableDesc = new TableDesc(response.getTableDesc()); return tableDesc.getLogicalSchema(); } catch (TajoException e) { throw SQLExceptionUtil.toSQLException(e); } } }
public static SQLException makeSQLException(ResultCode code, String ...args) { if (SQLSTATES.containsKey(code)) { return new SQLException( ErrorMessages.getMessage(code, args), SQLSTATES.get(code), code.getNumber()); } else { // If there is no SQLState corresponding to error code, // It will make SQLState '42000' (Syntax Error Or Access Rule Violation). return new SQLException( code.name(), "42000", code.getNumber()); } }