aboutsummaryrefslogtreecommitdiff
path: root/protocol/src/main/java/org/apache/drill/exec/proto/beans
diff options
context:
space:
mode:
Diffstat (limited to 'protocol/src/main/java/org/apache/drill/exec/proto/beans')
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnSearchability.java55
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnUpdatability.java51
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/CreatePreparedStatementReq.java163
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/CreatePreparedStatementResp.java211
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/GetCatalogsResp.java2
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/GetColumnsResp.java2
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/GetSchemasResp.java2
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/GetTablesResp.java2
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/PreparedStatement.java199
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/PreparedStatementHandle.java164
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryType.java4
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/RequestStatus.java8
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/ResultColumnMetadata.java559
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/RpcType.java4
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/RunQuery.java24
-rw-r--r--protocol/src/main/java/org/apache/drill/exec/proto/beans/ServerPreparedStatementState.java163
16 files changed, 1605 insertions, 8 deletions
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnSearchability.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnSearchability.java
new file mode 100644
index 000000000..826a89625
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnSearchability.java
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by http://code.google.com/p/protostuff/ ... DO NOT EDIT!
+// Generated from protobuf
+
+package org.apache.drill.exec.proto.beans;
+
+public enum ColumnSearchability implements com.dyuproject.protostuff.EnumLite<ColumnSearchability>
+{
+ UNKNOWN_SEARCHABILITY(0),
+ NONE(1),
+ CHAR(2),
+ NUMBER(3),
+ ALL(4);
+
+ public final int number;
+
+ private ColumnSearchability (int number)
+ {
+ this.number = number;
+ }
+
+ public int getNumber()
+ {
+ return number;
+ }
+
+ public static ColumnSearchability valueOf(int number)
+ {
+ switch(number)
+ {
+ case 0: return UNKNOWN_SEARCHABILITY;
+ case 1: return NONE;
+ case 2: return CHAR;
+ case 3: return NUMBER;
+ case 4: return ALL;
+ default: return null;
+ }
+ }
+}
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnUpdatability.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnUpdatability.java
new file mode 100644
index 000000000..09adb4fe9
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnUpdatability.java
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by http://code.google.com/p/protostuff/ ... DO NOT EDIT!
+// Generated from protobuf
+
+package org.apache.drill.exec.proto.beans;
+
+public enum ColumnUpdatability implements com.dyuproject.protostuff.EnumLite<ColumnUpdatability>
+{
+ UNKNOWN_UPDATABILITY(0),
+ READ_ONLY(1),
+ WRITABLE(2);
+
+ public final int number;
+
+ private ColumnUpdatability (int number)
+ {
+ this.number = number;
+ }
+
+ public int getNumber()
+ {
+ return number;
+ }
+
+ public static ColumnUpdatability valueOf(int number)
+ {
+ switch(number)
+ {
+ case 0: return UNKNOWN_UPDATABILITY;
+ case 1: return READ_ONLY;
+ case 2: return WRITABLE;
+ default: return null;
+ }
+ }
+}
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/CreatePreparedStatementReq.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/CreatePreparedStatementReq.java
new file mode 100644
index 000000000..dc86da5a4
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/CreatePreparedStatementReq.java
@@ -0,0 +1,163 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by http://code.google.com/p/protostuff/ ... DO NOT EDIT!
+// Generated from protobuf
+
+package org.apache.drill.exec.proto.beans;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import com.dyuproject.protostuff.GraphIOUtil;
+import com.dyuproject.protostuff.Input;
+import com.dyuproject.protostuff.Message;
+import com.dyuproject.protostuff.Output;
+import com.dyuproject.protostuff.Schema;
+
+public final class CreatePreparedStatementReq implements Externalizable, Message<CreatePreparedStatementReq>, Schema<CreatePreparedStatementReq>
+{
+
+ public static Schema<CreatePreparedStatementReq> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static CreatePreparedStatementReq getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final CreatePreparedStatementReq DEFAULT_INSTANCE = new CreatePreparedStatementReq();
+
+
+ private String sqlQuery;
+
+ public CreatePreparedStatementReq()
+ {
+
+ }
+
+ // getters and setters
+
+ // sqlQuery
+
+ public String getSqlQuery()
+ {
+ return sqlQuery;
+ }
+
+ public CreatePreparedStatementReq setSqlQuery(String sqlQuery)
+ {
+ this.sqlQuery = sqlQuery;
+ return this;
+ }
+
+ // java serialization
+
+ public void readExternal(ObjectInput in) throws IOException
+ {
+ GraphIOUtil.mergeDelimitedFrom(in, this, this);
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ GraphIOUtil.writeDelimitedTo(out, this, this);
+ }
+
+ // message method
+
+ public Schema<CreatePreparedStatementReq> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public CreatePreparedStatementReq newMessage()
+ {
+ return new CreatePreparedStatementReq();
+ }
+
+ public Class<CreatePreparedStatementReq> typeClass()
+ {
+ return CreatePreparedStatementReq.class;
+ }
+
+ public String messageName()
+ {
+ return CreatePreparedStatementReq.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return CreatePreparedStatementReq.class.getName();
+ }
+
+ public boolean isInitialized(CreatePreparedStatementReq message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, CreatePreparedStatementReq message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ message.sqlQuery = input.readString();
+ break;
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, CreatePreparedStatementReq message) throws IOException
+ {
+ if(message.sqlQuery != null)
+ output.writeString(1, message.sqlQuery, false);
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "sqlQuery";
+ default: return null;
+ }
+ }
+
+ public int getFieldNumber(String name)
+ {
+ final Integer number = __fieldMap.get(name);
+ return number == null ? 0 : number.intValue();
+ }
+
+ private static final java.util.HashMap<String,Integer> __fieldMap = new java.util.HashMap<String,Integer>();
+ static
+ {
+ __fieldMap.put("sqlQuery", 1);
+ }
+
+}
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/CreatePreparedStatementResp.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/CreatePreparedStatementResp.java
new file mode 100644
index 000000000..afa3ea81e
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/CreatePreparedStatementResp.java
@@ -0,0 +1,211 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by http://code.google.com/p/protostuff/ ... DO NOT EDIT!
+// Generated from protobuf
+
+package org.apache.drill.exec.proto.beans;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import com.dyuproject.protostuff.GraphIOUtil;
+import com.dyuproject.protostuff.Input;
+import com.dyuproject.protostuff.Message;
+import com.dyuproject.protostuff.Output;
+import com.dyuproject.protostuff.Schema;
+
+public final class CreatePreparedStatementResp implements Externalizable, Message<CreatePreparedStatementResp>, Schema<CreatePreparedStatementResp>
+{
+
+ public static Schema<CreatePreparedStatementResp> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static CreatePreparedStatementResp getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final CreatePreparedStatementResp DEFAULT_INSTANCE = new CreatePreparedStatementResp();
+
+
+ private RequestStatus status;
+ private PreparedStatement preparedStatement;
+ private DrillPBError error;
+
+ public CreatePreparedStatementResp()
+ {
+
+ }
+
+ // getters and setters
+
+ // status
+
+ public RequestStatus getStatus()
+ {
+ return status == null ? RequestStatus.UNKNOWN_STATUS : status;
+ }
+
+ public CreatePreparedStatementResp setStatus(RequestStatus status)
+ {
+ this.status = status;
+ return this;
+ }
+
+ // preparedStatement
+
+ public PreparedStatement getPreparedStatement()
+ {
+ return preparedStatement;
+ }
+
+ public CreatePreparedStatementResp setPreparedStatement(PreparedStatement preparedStatement)
+ {
+ this.preparedStatement = preparedStatement;
+ return this;
+ }
+
+ // error
+
+ public DrillPBError getError()
+ {
+ return error;
+ }
+
+ public CreatePreparedStatementResp setError(DrillPBError error)
+ {
+ this.error = error;
+ return this;
+ }
+
+ // java serialization
+
+ public void readExternal(ObjectInput in) throws IOException
+ {
+ GraphIOUtil.mergeDelimitedFrom(in, this, this);
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ GraphIOUtil.writeDelimitedTo(out, this, this);
+ }
+
+ // message method
+
+ public Schema<CreatePreparedStatementResp> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public CreatePreparedStatementResp newMessage()
+ {
+ return new CreatePreparedStatementResp();
+ }
+
+ public Class<CreatePreparedStatementResp> typeClass()
+ {
+ return CreatePreparedStatementResp.class;
+ }
+
+ public String messageName()
+ {
+ return CreatePreparedStatementResp.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return CreatePreparedStatementResp.class.getName();
+ }
+
+ public boolean isInitialized(CreatePreparedStatementResp message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, CreatePreparedStatementResp message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ message.status = RequestStatus.valueOf(input.readEnum());
+ break;
+ case 2:
+ message.preparedStatement = input.mergeObject(message.preparedStatement, PreparedStatement.getSchema());
+ break;
+
+ case 3:
+ message.error = input.mergeObject(message.error, DrillPBError.getSchema());
+ break;
+
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, CreatePreparedStatementResp message) throws IOException
+ {
+ if(message.status != null)
+ output.writeEnum(1, message.status.number, false);
+
+ if(message.preparedStatement != null)
+ output.writeObject(2, message.preparedStatement, PreparedStatement.getSchema(), false);
+
+
+ if(message.error != null)
+ output.writeObject(3, message.error, DrillPBError.getSchema(), false);
+
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "status";
+ case 2: return "preparedStatement";
+ case 3: return "error";
+ default: return null;
+ }
+ }
+
+ public int getFieldNumber(String name)
+ {
+ final Integer number = __fieldMap.get(name);
+ return number == null ? 0 : number.intValue();
+ }
+
+ private static final java.util.HashMap<String,Integer> __fieldMap = new java.util.HashMap<String,Integer>();
+ static
+ {
+ __fieldMap.put("status", 1);
+ __fieldMap.put("preparedStatement", 2);
+ __fieldMap.put("error", 3);
+ }
+
+}
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetCatalogsResp.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetCatalogsResp.java
index d71062ddc..d6b94758b 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetCatalogsResp.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetCatalogsResp.java
@@ -64,7 +64,7 @@ public final class GetCatalogsResp implements Externalizable, Message<GetCatalog
public RequestStatus getStatus()
{
- return status == null ? RequestStatus.UNKNOWN : status;
+ return status == null ? RequestStatus.UNKNOWN_STATUS : status;
}
public GetCatalogsResp setStatus(RequestStatus status)
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetColumnsResp.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetColumnsResp.java
index dc22c85b6..f52771984 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetColumnsResp.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetColumnsResp.java
@@ -64,7 +64,7 @@ public final class GetColumnsResp implements Externalizable, Message<GetColumnsR
public RequestStatus getStatus()
{
- return status == null ? RequestStatus.UNKNOWN : status;
+ return status == null ? RequestStatus.UNKNOWN_STATUS : status;
}
public GetColumnsResp setStatus(RequestStatus status)
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetSchemasResp.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetSchemasResp.java
index 3dc5e84b0..f604abcbc 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetSchemasResp.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetSchemasResp.java
@@ -64,7 +64,7 @@ public final class GetSchemasResp implements Externalizable, Message<GetSchemasR
public RequestStatus getStatus()
{
- return status == null ? RequestStatus.UNKNOWN : status;
+ return status == null ? RequestStatus.UNKNOWN_STATUS : status;
}
public GetSchemasResp setStatus(RequestStatus status)
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetTablesResp.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetTablesResp.java
index c62ed3c8a..b06cf0c41 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetTablesResp.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetTablesResp.java
@@ -64,7 +64,7 @@ public final class GetTablesResp implements Externalizable, Message<GetTablesRes
public RequestStatus getStatus()
{
- return status == null ? RequestStatus.UNKNOWN : status;
+ return status == null ? RequestStatus.UNKNOWN_STATUS : status;
}
public GetTablesResp setStatus(RequestStatus status)
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/PreparedStatement.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/PreparedStatement.java
new file mode 100644
index 000000000..9ec4e8fe6
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/PreparedStatement.java
@@ -0,0 +1,199 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by http://code.google.com/p/protostuff/ ... DO NOT EDIT!
+// Generated from protobuf
+
+package org.apache.drill.exec.proto.beans;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.dyuproject.protostuff.GraphIOUtil;
+import com.dyuproject.protostuff.Input;
+import com.dyuproject.protostuff.Message;
+import com.dyuproject.protostuff.Output;
+import com.dyuproject.protostuff.Schema;
+
+public final class PreparedStatement implements Externalizable, Message<PreparedStatement>, Schema<PreparedStatement>
+{
+
+ public static Schema<PreparedStatement> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static PreparedStatement getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final PreparedStatement DEFAULT_INSTANCE = new PreparedStatement();
+
+
+ private List<ResultColumnMetadata> columns;
+ private PreparedStatementHandle serverHandle;
+
+ public PreparedStatement()
+ {
+
+ }
+
+ // getters and setters
+
+ // columns
+
+ public List<ResultColumnMetadata> getColumnsList()
+ {
+ return columns;
+ }
+
+ public PreparedStatement setColumnsList(List<ResultColumnMetadata> columns)
+ {
+ this.columns = columns;
+ return this;
+ }
+
+ // serverHandle
+
+ public PreparedStatementHandle getServerHandle()
+ {
+ return serverHandle;
+ }
+
+ public PreparedStatement setServerHandle(PreparedStatementHandle serverHandle)
+ {
+ this.serverHandle = serverHandle;
+ return this;
+ }
+
+ // java serialization
+
+ public void readExternal(ObjectInput in) throws IOException
+ {
+ GraphIOUtil.mergeDelimitedFrom(in, this, this);
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ GraphIOUtil.writeDelimitedTo(out, this, this);
+ }
+
+ // message method
+
+ public Schema<PreparedStatement> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public PreparedStatement newMessage()
+ {
+ return new PreparedStatement();
+ }
+
+ public Class<PreparedStatement> typeClass()
+ {
+ return PreparedStatement.class;
+ }
+
+ public String messageName()
+ {
+ return PreparedStatement.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return PreparedStatement.class.getName();
+ }
+
+ public boolean isInitialized(PreparedStatement message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, PreparedStatement message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ if(message.columns == null)
+ message.columns = new ArrayList<ResultColumnMetadata>();
+ message.columns.add(input.mergeObject(null, ResultColumnMetadata.getSchema()));
+ break;
+
+ case 2:
+ message.serverHandle = input.mergeObject(message.serverHandle, PreparedStatementHandle.getSchema());
+ break;
+
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, PreparedStatement message) throws IOException
+ {
+ if(message.columns != null)
+ {
+ for(ResultColumnMetadata columns : message.columns)
+ {
+ if(columns != null)
+ output.writeObject(1, columns, ResultColumnMetadata.getSchema(), true);
+ }
+ }
+
+
+ if(message.serverHandle != null)
+ output.writeObject(2, message.serverHandle, PreparedStatementHandle.getSchema(), false);
+
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "columns";
+ case 2: return "serverHandle";
+ default: return null;
+ }
+ }
+
+ public int getFieldNumber(String name)
+ {
+ final Integer number = __fieldMap.get(name);
+ return number == null ? 0 : number.intValue();
+ }
+
+ private static final java.util.HashMap<String,Integer> __fieldMap = new java.util.HashMap<String,Integer>();
+ static
+ {
+ __fieldMap.put("columns", 1);
+ __fieldMap.put("serverHandle", 2);
+ }
+
+}
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/PreparedStatementHandle.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/PreparedStatementHandle.java
new file mode 100644
index 000000000..c35c7cea8
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/PreparedStatementHandle.java
@@ -0,0 +1,164 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by http://code.google.com/p/protostuff/ ... DO NOT EDIT!
+// Generated from protobuf
+
+package org.apache.drill.exec.proto.beans;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import com.dyuproject.protostuff.ByteString;
+import com.dyuproject.protostuff.GraphIOUtil;
+import com.dyuproject.protostuff.Input;
+import com.dyuproject.protostuff.Message;
+import com.dyuproject.protostuff.Output;
+import com.dyuproject.protostuff.Schema;
+
+public final class PreparedStatementHandle implements Externalizable, Message<PreparedStatementHandle>, Schema<PreparedStatementHandle>
+{
+
+ public static Schema<PreparedStatementHandle> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static PreparedStatementHandle getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final PreparedStatementHandle DEFAULT_INSTANCE = new PreparedStatementHandle();
+
+
+ private ByteString serverInfo;
+
+ public PreparedStatementHandle()
+ {
+
+ }
+
+ // getters and setters
+
+ // serverInfo
+
+ public ByteString getServerInfo()
+ {
+ return serverInfo;
+ }
+
+ public PreparedStatementHandle setServerInfo(ByteString serverInfo)
+ {
+ this.serverInfo = serverInfo;
+ return this;
+ }
+
+ // java serialization
+
+ public void readExternal(ObjectInput in) throws IOException
+ {
+ GraphIOUtil.mergeDelimitedFrom(in, this, this);
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ GraphIOUtil.writeDelimitedTo(out, this, this);
+ }
+
+ // message method
+
+ public Schema<PreparedStatementHandle> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public PreparedStatementHandle newMessage()
+ {
+ return new PreparedStatementHandle();
+ }
+
+ public Class<PreparedStatementHandle> typeClass()
+ {
+ return PreparedStatementHandle.class;
+ }
+
+ public String messageName()
+ {
+ return PreparedStatementHandle.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return PreparedStatementHandle.class.getName();
+ }
+
+ public boolean isInitialized(PreparedStatementHandle message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, PreparedStatementHandle message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ message.serverInfo = input.readBytes();
+ break;
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, PreparedStatementHandle message) throws IOException
+ {
+ if(message.serverInfo != null)
+ output.writeBytes(1, message.serverInfo, false);
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "serverInfo";
+ default: return null;
+ }
+ }
+
+ public int getFieldNumber(String name)
+ {
+ final Integer number = __fieldMap.get(name);
+ return number == null ? 0 : number.intValue();
+ }
+
+ private static final java.util.HashMap<String,Integer> __fieldMap = new java.util.HashMap<String,Integer>();
+ static
+ {
+ __fieldMap.put("serverInfo", 1);
+ }
+
+}
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryType.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryType.java
index 71f98f37c..7a4320d48 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryType.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryType.java
@@ -25,7 +25,8 @@ public enum QueryType implements com.dyuproject.protostuff.EnumLite<QueryType>
SQL(1),
LOGICAL(2),
PHYSICAL(3),
- EXECUTION(4);
+ EXECUTION(4),
+ PREPARED_STATEMENT(5);
public final int number;
@@ -47,6 +48,7 @@ public enum QueryType implements com.dyuproject.protostuff.EnumLite<QueryType>
case 2: return LOGICAL;
case 3: return PHYSICAL;
case 4: return EXECUTION;
+ case 5: return PREPARED_STATEMENT;
default: return null;
}
}
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/RequestStatus.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/RequestStatus.java
index f526ab5d9..2e08a4a23 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/RequestStatus.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/RequestStatus.java
@@ -22,9 +22,10 @@ package org.apache.drill.exec.proto.beans;
public enum RequestStatus implements com.dyuproject.protostuff.EnumLite<RequestStatus>
{
- UNKNOWN(0),
+ UNKNOWN_STATUS(0),
OK(1),
- FAILED(2);
+ FAILED(2),
+ TIMEOUT(3);
public final int number;
@@ -42,9 +43,10 @@ public enum RequestStatus implements com.dyuproject.protostuff.EnumLite<RequestS
{
switch(number)
{
- case 0: return UNKNOWN;
+ case 0: return UNKNOWN_STATUS;
case 1: return OK;
case 2: return FAILED;
+ case 3: return TIMEOUT;
default: return null;
}
}
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/ResultColumnMetadata.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/ResultColumnMetadata.java
new file mode 100644
index 000000000..7af4ed525
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/ResultColumnMetadata.java
@@ -0,0 +1,559 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by http://code.google.com/p/protostuff/ ... DO NOT EDIT!
+// Generated from protobuf
+
+package org.apache.drill.exec.proto.beans;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import com.dyuproject.protostuff.GraphIOUtil;
+import com.dyuproject.protostuff.Input;
+import com.dyuproject.protostuff.Message;
+import com.dyuproject.protostuff.Output;
+import com.dyuproject.protostuff.Schema;
+
+public final class ResultColumnMetadata implements Externalizable, Message<ResultColumnMetadata>, Schema<ResultColumnMetadata>
+{
+
+ public static Schema<ResultColumnMetadata> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static ResultColumnMetadata getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final ResultColumnMetadata DEFAULT_INSTANCE = new ResultColumnMetadata();
+
+
+ private String catalogName;
+ private String schemaName;
+ private String tableName;
+ private String columnName;
+ private String label;
+ private String dataType;
+ private Boolean isNullable;
+ private int precision;
+ private int scale;
+ private Boolean signed;
+ private int displaySize;
+ private Boolean isAliased;
+ private ColumnSearchability searchability;
+ private ColumnUpdatability updatability;
+ private Boolean autoIncrement;
+ private Boolean caseSensitivity;
+ private Boolean sortable;
+ private String className;
+ private Boolean isCurrency;
+
+ public ResultColumnMetadata()
+ {
+
+ }
+
+ // getters and setters
+
+ // catalogName
+
+ public String getCatalogName()
+ {
+ return catalogName;
+ }
+
+ public ResultColumnMetadata setCatalogName(String catalogName)
+ {
+ this.catalogName = catalogName;
+ return this;
+ }
+
+ // schemaName
+
+ public String getSchemaName()
+ {
+ return schemaName;
+ }
+
+ public ResultColumnMetadata setSchemaName(String schemaName)
+ {
+ this.schemaName = schemaName;
+ return this;
+ }
+
+ // tableName
+
+ public String getTableName()
+ {
+ return tableName;
+ }
+
+ public ResultColumnMetadata setTableName(String tableName)
+ {
+ this.tableName = tableName;
+ return this;
+ }
+
+ // columnName
+
+ public String getColumnName()
+ {
+ return columnName;
+ }
+
+ public ResultColumnMetadata setColumnName(String columnName)
+ {
+ this.columnName = columnName;
+ return this;
+ }
+
+ // label
+
+ public String getLabel()
+ {
+ return label;
+ }
+
+ public ResultColumnMetadata setLabel(String label)
+ {
+ this.label = label;
+ return this;
+ }
+
+ // dataType
+
+ public String getDataType()
+ {
+ return dataType;
+ }
+
+ public ResultColumnMetadata setDataType(String dataType)
+ {
+ this.dataType = dataType;
+ return this;
+ }
+
+ // isNullable
+
+ public Boolean getIsNullable()
+ {
+ return isNullable;
+ }
+
+ public ResultColumnMetadata setIsNullable(Boolean isNullable)
+ {
+ this.isNullable = isNullable;
+ return this;
+ }
+
+ // precision
+
+ public int getPrecision()
+ {
+ return precision;
+ }
+
+ public ResultColumnMetadata setPrecision(int precision)
+ {
+ this.precision = precision;
+ return this;
+ }
+
+ // scale
+
+ public int getScale()
+ {
+ return scale;
+ }
+
+ public ResultColumnMetadata setScale(int scale)
+ {
+ this.scale = scale;
+ return this;
+ }
+
+ // signed
+
+ public Boolean getSigned()
+ {
+ return signed;
+ }
+
+ public ResultColumnMetadata setSigned(Boolean signed)
+ {
+ this.signed = signed;
+ return this;
+ }
+
+ // displaySize
+
+ public int getDisplaySize()
+ {
+ return displaySize;
+ }
+
+ public ResultColumnMetadata setDisplaySize(int displaySize)
+ {
+ this.displaySize = displaySize;
+ return this;
+ }
+
+ // isAliased
+
+ public Boolean getIsAliased()
+ {
+ return isAliased;
+ }
+
+ public ResultColumnMetadata setIsAliased(Boolean isAliased)
+ {
+ this.isAliased = isAliased;
+ return this;
+ }
+
+ // searchability
+
+ public ColumnSearchability getSearchability()
+ {
+ return searchability == null ? ColumnSearchability.UNKNOWN_SEARCHABILITY : searchability;
+ }
+
+ public ResultColumnMetadata setSearchability(ColumnSearchability searchability)
+ {
+ this.searchability = searchability;
+ return this;
+ }
+
+ // updatability
+
+ public ColumnUpdatability getUpdatability()
+ {
+ return updatability == null ? ColumnUpdatability.UNKNOWN_UPDATABILITY : updatability;
+ }
+
+ public ResultColumnMetadata setUpdatability(ColumnUpdatability updatability)
+ {
+ this.updatability = updatability;
+ return this;
+ }
+
+ // autoIncrement
+
+ public Boolean getAutoIncrement()
+ {
+ return autoIncrement;
+ }
+
+ public ResultColumnMetadata setAutoIncrement(Boolean autoIncrement)
+ {
+ this.autoIncrement = autoIncrement;
+ return this;
+ }
+
+ // caseSensitivity
+
+ public Boolean getCaseSensitivity()
+ {
+ return caseSensitivity;
+ }
+
+ public ResultColumnMetadata setCaseSensitivity(Boolean caseSensitivity)
+ {
+ this.caseSensitivity = caseSensitivity;
+ return this;
+ }
+
+ // sortable
+
+ public Boolean getSortable()
+ {
+ return sortable;
+ }
+
+ public ResultColumnMetadata setSortable(Boolean sortable)
+ {
+ this.sortable = sortable;
+ return this;
+ }
+
+ // className
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+ public ResultColumnMetadata setClassName(String className)
+ {
+ this.className = className;
+ return this;
+ }
+
+ // isCurrency
+
+ public Boolean getIsCurrency()
+ {
+ return isCurrency;
+ }
+
+ public ResultColumnMetadata setIsCurrency(Boolean isCurrency)
+ {
+ this.isCurrency = isCurrency;
+ return this;
+ }
+
+ // java serialization
+
+ public void readExternal(ObjectInput in) throws IOException
+ {
+ GraphIOUtil.mergeDelimitedFrom(in, this, this);
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ GraphIOUtil.writeDelimitedTo(out, this, this);
+ }
+
+ // message method
+
+ public Schema<ResultColumnMetadata> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public ResultColumnMetadata newMessage()
+ {
+ return new ResultColumnMetadata();
+ }
+
+ public Class<ResultColumnMetadata> typeClass()
+ {
+ return ResultColumnMetadata.class;
+ }
+
+ public String messageName()
+ {
+ return ResultColumnMetadata.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return ResultColumnMetadata.class.getName();
+ }
+
+ public boolean isInitialized(ResultColumnMetadata message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, ResultColumnMetadata message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ message.catalogName = input.readString();
+ break;
+ case 2:
+ message.schemaName = input.readString();
+ break;
+ case 3:
+ message.tableName = input.readString();
+ break;
+ case 4:
+ message.columnName = input.readString();
+ break;
+ case 5:
+ message.label = input.readString();
+ break;
+ case 6:
+ message.dataType = input.readString();
+ break;
+ case 7:
+ message.isNullable = input.readBool();
+ break;
+ case 8:
+ message.precision = input.readInt32();
+ break;
+ case 9:
+ message.scale = input.readInt32();
+ break;
+ case 10:
+ message.signed = input.readBool();
+ break;
+ case 11:
+ message.displaySize = input.readInt32();
+ break;
+ case 12:
+ message.isAliased = input.readBool();
+ break;
+ case 13:
+ message.searchability = ColumnSearchability.valueOf(input.readEnum());
+ break;
+ case 14:
+ message.updatability = ColumnUpdatability.valueOf(input.readEnum());
+ break;
+ case 15:
+ message.autoIncrement = input.readBool();
+ break;
+ case 16:
+ message.caseSensitivity = input.readBool();
+ break;
+ case 17:
+ message.sortable = input.readBool();
+ break;
+ case 18:
+ message.className = input.readString();
+ break;
+ case 20:
+ message.isCurrency = input.readBool();
+ break;
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, ResultColumnMetadata message) throws IOException
+ {
+ if(message.catalogName != null)
+ output.writeString(1, message.catalogName, false);
+
+ if(message.schemaName != null)
+ output.writeString(2, message.schemaName, false);
+
+ if(message.tableName != null)
+ output.writeString(3, message.tableName, false);
+
+ if(message.columnName != null)
+ output.writeString(4, message.columnName, false);
+
+ if(message.label != null)
+ output.writeString(5, message.label, false);
+
+ if(message.dataType != null)
+ output.writeString(6, message.dataType, false);
+
+ if(message.isNullable != null)
+ output.writeBool(7, message.isNullable, false);
+
+ if(message.precision != 0)
+ output.writeInt32(8, message.precision, false);
+
+ if(message.scale != 0)
+ output.writeInt32(9, message.scale, false);
+
+ if(message.signed != null)
+ output.writeBool(10, message.signed, false);
+
+ if(message.displaySize != 0)
+ output.writeInt32(11, message.displaySize, false);
+
+ if(message.isAliased != null)
+ output.writeBool(12, message.isAliased, false);
+
+ if(message.searchability != null)
+ output.writeEnum(13, message.searchability.number, false);
+
+ if(message.updatability != null)
+ output.writeEnum(14, message.updatability.number, false);
+
+ if(message.autoIncrement != null)
+ output.writeBool(15, message.autoIncrement, false);
+
+ if(message.caseSensitivity != null)
+ output.writeBool(16, message.caseSensitivity, false);
+
+ if(message.sortable != null)
+ output.writeBool(17, message.sortable, false);
+
+ if(message.className != null)
+ output.writeString(18, message.className, false);
+
+ if(message.isCurrency != null)
+ output.writeBool(20, message.isCurrency, false);
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "catalogName";
+ case 2: return "schemaName";
+ case 3: return "tableName";
+ case 4: return "columnName";
+ case 5: return "label";
+ case 6: return "dataType";
+ case 7: return "isNullable";
+ case 8: return "precision";
+ case 9: return "scale";
+ case 10: return "signed";
+ case 11: return "displaySize";
+ case 12: return "isAliased";
+ case 13: return "searchability";
+ case 14: return "updatability";
+ case 15: return "autoIncrement";
+ case 16: return "caseSensitivity";
+ case 17: return "sortable";
+ case 18: return "className";
+ case 20: return "isCurrency";
+ default: return null;
+ }
+ }
+
+ public int getFieldNumber(String name)
+ {
+ final Integer number = __fieldMap.get(name);
+ return number == null ? 0 : number.intValue();
+ }
+
+ private static final java.util.HashMap<String,Integer> __fieldMap = new java.util.HashMap<String,Integer>();
+ static
+ {
+ __fieldMap.put("catalogName", 1);
+ __fieldMap.put("schemaName", 2);
+ __fieldMap.put("tableName", 3);
+ __fieldMap.put("columnName", 4);
+ __fieldMap.put("label", 5);
+ __fieldMap.put("dataType", 6);
+ __fieldMap.put("isNullable", 7);
+ __fieldMap.put("precision", 8);
+ __fieldMap.put("scale", 9);
+ __fieldMap.put("signed", 10);
+ __fieldMap.put("displaySize", 11);
+ __fieldMap.put("isAliased", 12);
+ __fieldMap.put("searchability", 13);
+ __fieldMap.put("updatability", 14);
+ __fieldMap.put("autoIncrement", 15);
+ __fieldMap.put("caseSensitivity", 16);
+ __fieldMap.put("sortable", 17);
+ __fieldMap.put("className", 18);
+ __fieldMap.put("isCurrency", 20);
+ }
+
+}
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/RpcType.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/RpcType.java
index ff4f4bc8b..923a76a2d 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/RpcType.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/RpcType.java
@@ -34,6 +34,7 @@ public enum RpcType implements com.dyuproject.protostuff.EnumLite<RpcType>
GET_SCHEMAS(15),
GET_TABLES(16),
GET_COLUMNS(17),
+ CREATE_PREPARED_STATEMENT(22),
QUERY_DATA(6),
QUERY_HANDLE(7),
QUERY_PLAN_FRAGMENTS(13),
@@ -41,6 +42,7 @@ public enum RpcType implements com.dyuproject.protostuff.EnumLite<RpcType>
SCHEMAS(19),
TABLES(20),
COLUMNS(21),
+ PREPARED_STATEMENT(23),
REQ_META_FUNCTIONS(8),
RESP_FUNCTION_LIST(9),
QUERY_RESULT(10);
@@ -83,6 +85,8 @@ public enum RpcType implements com.dyuproject.protostuff.EnumLite<RpcType>
case 19: return SCHEMAS;
case 20: return TABLES;
case 21: return COLUMNS;
+ case 22: return CREATE_PREPARED_STATEMENT;
+ case 23: return PREPARED_STATEMENT;
default: return null;
}
}
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/RunQuery.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/RunQuery.java
index e6035d1cb..d338b4d91 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/RunQuery.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/RunQuery.java
@@ -53,6 +53,7 @@ public final class RunQuery implements Externalizable, Message<RunQuery>, Schema
private QueryType type;
private String plan;
private List<PlanFragment> fragments;
+ private PreparedStatementHandle preparedStatementHandle;
public RunQuery()
{
@@ -113,6 +114,19 @@ public final class RunQuery implements Externalizable, Message<RunQuery>, Schema
return this;
}
+ // preparedStatementHandle
+
+ public PreparedStatementHandle getPreparedStatementHandle()
+ {
+ return preparedStatementHandle;
+ }
+
+ public RunQuery setPreparedStatementHandle(PreparedStatementHandle preparedStatementHandle)
+ {
+ this.preparedStatementHandle = preparedStatementHandle;
+ return this;
+ }
+
// java serialization
public void readExternal(ObjectInput in) throws IOException
@@ -182,6 +196,10 @@ public final class RunQuery implements Externalizable, Message<RunQuery>, Schema
message.fragments.add(input.mergeObject(null, PlanFragment.getSchema()));
break;
+ case 5:
+ message.preparedStatementHandle = input.mergeObject(message.preparedStatementHandle, PreparedStatementHandle.getSchema());
+ break;
+
default:
input.handleUnknownField(number, this);
}
@@ -209,6 +227,10 @@ public final class RunQuery implements Externalizable, Message<RunQuery>, Schema
}
}
+
+ if(message.preparedStatementHandle != null)
+ output.writeObject(5, message.preparedStatementHandle, PreparedStatementHandle.getSchema(), false);
+
}
public String getFieldName(int number)
@@ -219,6 +241,7 @@ public final class RunQuery implements Externalizable, Message<RunQuery>, Schema
case 2: return "type";
case 3: return "plan";
case 4: return "fragments";
+ case 5: return "preparedStatementHandle";
default: return null;
}
}
@@ -236,6 +259,7 @@ public final class RunQuery implements Externalizable, Message<RunQuery>, Schema
__fieldMap.put("type", 2);
__fieldMap.put("plan", 3);
__fieldMap.put("fragments", 4);
+ __fieldMap.put("preparedStatementHandle", 5);
}
}
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/ServerPreparedStatementState.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/ServerPreparedStatementState.java
new file mode 100644
index 000000000..ad2118cfb
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/ServerPreparedStatementState.java
@@ -0,0 +1,163 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by http://code.google.com/p/protostuff/ ... DO NOT EDIT!
+// Generated from protobuf
+
+package org.apache.drill.exec.proto.beans;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import com.dyuproject.protostuff.GraphIOUtil;
+import com.dyuproject.protostuff.Input;
+import com.dyuproject.protostuff.Message;
+import com.dyuproject.protostuff.Output;
+import com.dyuproject.protostuff.Schema;
+
+public final class ServerPreparedStatementState implements Externalizable, Message<ServerPreparedStatementState>, Schema<ServerPreparedStatementState>
+{
+
+ public static Schema<ServerPreparedStatementState> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static ServerPreparedStatementState getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final ServerPreparedStatementState DEFAULT_INSTANCE = new ServerPreparedStatementState();
+
+
+ private String sqlQuery;
+
+ public ServerPreparedStatementState()
+ {
+
+ }
+
+ // getters and setters
+
+ // sqlQuery
+
+ public String getSqlQuery()
+ {
+ return sqlQuery;
+ }
+
+ public ServerPreparedStatementState setSqlQuery(String sqlQuery)
+ {
+ this.sqlQuery = sqlQuery;
+ return this;
+ }
+
+ // java serialization
+
+ public void readExternal(ObjectInput in) throws IOException
+ {
+ GraphIOUtil.mergeDelimitedFrom(in, this, this);
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ GraphIOUtil.writeDelimitedTo(out, this, this);
+ }
+
+ // message method
+
+ public Schema<ServerPreparedStatementState> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public ServerPreparedStatementState newMessage()
+ {
+ return new ServerPreparedStatementState();
+ }
+
+ public Class<ServerPreparedStatementState> typeClass()
+ {
+ return ServerPreparedStatementState.class;
+ }
+
+ public String messageName()
+ {
+ return ServerPreparedStatementState.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return ServerPreparedStatementState.class.getName();
+ }
+
+ public boolean isInitialized(ServerPreparedStatementState message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, ServerPreparedStatementState message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ message.sqlQuery = input.readString();
+ break;
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, ServerPreparedStatementState message) throws IOException
+ {
+ if(message.sqlQuery != null)
+ output.writeString(1, message.sqlQuery, false);
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "sqlQuery";
+ default: return null;
+ }
+ }
+
+ public int getFieldNumber(String name)
+ {
+ final Integer number = __fieldMap.get(name);
+ return number == null ? 0 : number.intValue();
+ }
+
+ private static final java.util.HashMap<String,Integer> __fieldMap = new java.util.HashMap<String,Integer>();
+ static
+ {
+ __fieldMap.put("sqlQuery", 1);
+ }
+
+}