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 ); } }
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 .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 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); }
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()); } }
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()); } }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, returnCode_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, getMessageBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeMessage(3, stackTrace_); } getUnknownFields().writeTo(output); }
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 void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, returnCode_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, getMessageBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeMessage(3, stackTrace_); } getUnknownFields().writeTo(output); }