You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ve...@apache.org on 2016/08/07 19:51:11 UTC
[2/5] drill git commit: DRILL-4728: Add support for new metadata
fetch APIs
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/CatalogMetadata.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/CatalogMetadata.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/CatalogMetadata.java
new file mode 100644
index 0000000..30af128
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/CatalogMetadata.java
@@ -0,0 +1,207 @@
+/**
+ * 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 CatalogMetadata implements Externalizable, Message<CatalogMetadata>, Schema<CatalogMetadata>
+{
+
+ public static Schema<CatalogMetadata> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static CatalogMetadata getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final CatalogMetadata DEFAULT_INSTANCE = new CatalogMetadata();
+
+
+ private String catalogName;
+ private String description;
+ private String connect;
+
+ public CatalogMetadata()
+ {
+
+ }
+
+ // getters and setters
+
+ // catalogName
+
+ public String getCatalogName()
+ {
+ return catalogName;
+ }
+
+ public CatalogMetadata setCatalogName(String catalogName)
+ {
+ this.catalogName = catalogName;
+ return this;
+ }
+
+ // description
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public CatalogMetadata setDescription(String description)
+ {
+ this.description = description;
+ return this;
+ }
+
+ // connect
+
+ public String getConnect()
+ {
+ return connect;
+ }
+
+ public CatalogMetadata setConnect(String connect)
+ {
+ this.connect = connect;
+ 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<CatalogMetadata> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public CatalogMetadata newMessage()
+ {
+ return new CatalogMetadata();
+ }
+
+ public Class<CatalogMetadata> typeClass()
+ {
+ return CatalogMetadata.class;
+ }
+
+ public String messageName()
+ {
+ return CatalogMetadata.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return CatalogMetadata.class.getName();
+ }
+
+ public boolean isInitialized(CatalogMetadata message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, CatalogMetadata 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.description = input.readString();
+ break;
+ case 3:
+ message.connect = input.readString();
+ break;
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, CatalogMetadata message) throws IOException
+ {
+ if(message.catalogName != null)
+ output.writeString(1, message.catalogName, false);
+
+ if(message.description != null)
+ output.writeString(2, message.description, false);
+
+ if(message.connect != null)
+ output.writeString(3, message.connect, false);
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "catalogName";
+ case 2: return "description";
+ case 3: return "connect";
+ 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("description", 2);
+ __fieldMap.put("connect", 3);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnMetadata.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnMetadata.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnMetadata.java
new file mode 100644
index 0000000..a5e7e5d
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/ColumnMetadata.java
@@ -0,0 +1,493 @@
+/**
+ * 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 ColumnMetadata implements Externalizable, Message<ColumnMetadata>, Schema<ColumnMetadata>
+{
+
+ public static Schema<ColumnMetadata> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static ColumnMetadata getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final ColumnMetadata DEFAULT_INSTANCE = new ColumnMetadata();
+
+
+ private String catalogName;
+ private String schemaName;
+ private String tableName;
+ private String columnName;
+ private int ordinalPosition;
+ private String defaultValue;
+ private Boolean isNullable;
+ private String dataType;
+ private int charMaxLength;
+ private int charOctetLength;
+ private int numericPrecision;
+ private int numericPrecisionRadix;
+ private int numericScale;
+ private int dateTimePrecision;
+ private String intervalType;
+ private int intervalPrecision;
+
+ public ColumnMetadata()
+ {
+
+ }
+
+ // getters and setters
+
+ // catalogName
+
+ public String getCatalogName()
+ {
+ return catalogName;
+ }
+
+ public ColumnMetadata setCatalogName(String catalogName)
+ {
+ this.catalogName = catalogName;
+ return this;
+ }
+
+ // schemaName
+
+ public String getSchemaName()
+ {
+ return schemaName;
+ }
+
+ public ColumnMetadata setSchemaName(String schemaName)
+ {
+ this.schemaName = schemaName;
+ return this;
+ }
+
+ // tableName
+
+ public String getTableName()
+ {
+ return tableName;
+ }
+
+ public ColumnMetadata setTableName(String tableName)
+ {
+ this.tableName = tableName;
+ return this;
+ }
+
+ // columnName
+
+ public String getColumnName()
+ {
+ return columnName;
+ }
+
+ public ColumnMetadata setColumnName(String columnName)
+ {
+ this.columnName = columnName;
+ return this;
+ }
+
+ // ordinalPosition
+
+ public int getOrdinalPosition()
+ {
+ return ordinalPosition;
+ }
+
+ public ColumnMetadata setOrdinalPosition(int ordinalPosition)
+ {
+ this.ordinalPosition = ordinalPosition;
+ return this;
+ }
+
+ // defaultValue
+
+ public String getDefaultValue()
+ {
+ return defaultValue;
+ }
+
+ public ColumnMetadata setDefaultValue(String defaultValue)
+ {
+ this.defaultValue = defaultValue;
+ return this;
+ }
+
+ // isNullable
+
+ public Boolean getIsNullable()
+ {
+ return isNullable;
+ }
+
+ public ColumnMetadata setIsNullable(Boolean isNullable)
+ {
+ this.isNullable = isNullable;
+ return this;
+ }
+
+ // dataType
+
+ public String getDataType()
+ {
+ return dataType;
+ }
+
+ public ColumnMetadata setDataType(String dataType)
+ {
+ this.dataType = dataType;
+ return this;
+ }
+
+ // charMaxLength
+
+ public int getCharMaxLength()
+ {
+ return charMaxLength;
+ }
+
+ public ColumnMetadata setCharMaxLength(int charMaxLength)
+ {
+ this.charMaxLength = charMaxLength;
+ return this;
+ }
+
+ // charOctetLength
+
+ public int getCharOctetLength()
+ {
+ return charOctetLength;
+ }
+
+ public ColumnMetadata setCharOctetLength(int charOctetLength)
+ {
+ this.charOctetLength = charOctetLength;
+ return this;
+ }
+
+ // numericPrecision
+
+ public int getNumericPrecision()
+ {
+ return numericPrecision;
+ }
+
+ public ColumnMetadata setNumericPrecision(int numericPrecision)
+ {
+ this.numericPrecision = numericPrecision;
+ return this;
+ }
+
+ // numericPrecisionRadix
+
+ public int getNumericPrecisionRadix()
+ {
+ return numericPrecisionRadix;
+ }
+
+ public ColumnMetadata setNumericPrecisionRadix(int numericPrecisionRadix)
+ {
+ this.numericPrecisionRadix = numericPrecisionRadix;
+ return this;
+ }
+
+ // numericScale
+
+ public int getNumericScale()
+ {
+ return numericScale;
+ }
+
+ public ColumnMetadata setNumericScale(int numericScale)
+ {
+ this.numericScale = numericScale;
+ return this;
+ }
+
+ // dateTimePrecision
+
+ public int getDateTimePrecision()
+ {
+ return dateTimePrecision;
+ }
+
+ public ColumnMetadata setDateTimePrecision(int dateTimePrecision)
+ {
+ this.dateTimePrecision = dateTimePrecision;
+ return this;
+ }
+
+ // intervalType
+
+ public String getIntervalType()
+ {
+ return intervalType;
+ }
+
+ public ColumnMetadata setIntervalType(String intervalType)
+ {
+ this.intervalType = intervalType;
+ return this;
+ }
+
+ // intervalPrecision
+
+ public int getIntervalPrecision()
+ {
+ return intervalPrecision;
+ }
+
+ public ColumnMetadata setIntervalPrecision(int intervalPrecision)
+ {
+ this.intervalPrecision = intervalPrecision;
+ 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<ColumnMetadata> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public ColumnMetadata newMessage()
+ {
+ return new ColumnMetadata();
+ }
+
+ public Class<ColumnMetadata> typeClass()
+ {
+ return ColumnMetadata.class;
+ }
+
+ public String messageName()
+ {
+ return ColumnMetadata.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return ColumnMetadata.class.getName();
+ }
+
+ public boolean isInitialized(ColumnMetadata message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, ColumnMetadata 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.ordinalPosition = input.readInt32();
+ break;
+ case 6:
+ message.defaultValue = input.readString();
+ break;
+ case 7:
+ message.isNullable = input.readBool();
+ break;
+ case 8:
+ message.dataType = input.readString();
+ break;
+ case 9:
+ message.charMaxLength = input.readInt32();
+ break;
+ case 10:
+ message.charOctetLength = input.readInt32();
+ break;
+ case 11:
+ message.numericPrecision = input.readInt32();
+ break;
+ case 12:
+ message.numericPrecisionRadix = input.readInt32();
+ break;
+ case 13:
+ message.numericScale = input.readInt32();
+ break;
+ case 14:
+ message.dateTimePrecision = input.readInt32();
+ break;
+ case 15:
+ message.intervalType = input.readString();
+ break;
+ case 16:
+ message.intervalPrecision = input.readInt32();
+ break;
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, ColumnMetadata 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.ordinalPosition != 0)
+ output.writeInt32(5, message.ordinalPosition, false);
+
+ if(message.defaultValue != null)
+ output.writeString(6, message.defaultValue, false);
+
+ if(message.isNullable != null)
+ output.writeBool(7, message.isNullable, false);
+
+ if(message.dataType != null)
+ output.writeString(8, message.dataType, false);
+
+ if(message.charMaxLength != 0)
+ output.writeInt32(9, message.charMaxLength, false);
+
+ if(message.charOctetLength != 0)
+ output.writeInt32(10, message.charOctetLength, false);
+
+ if(message.numericPrecision != 0)
+ output.writeInt32(11, message.numericPrecision, false);
+
+ if(message.numericPrecisionRadix != 0)
+ output.writeInt32(12, message.numericPrecisionRadix, false);
+
+ if(message.numericScale != 0)
+ output.writeInt32(13, message.numericScale, false);
+
+ if(message.dateTimePrecision != 0)
+ output.writeInt32(14, message.dateTimePrecision, false);
+
+ if(message.intervalType != null)
+ output.writeString(15, message.intervalType, false);
+
+ if(message.intervalPrecision != 0)
+ output.writeInt32(16, message.intervalPrecision, 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 "ordinalPosition";
+ case 6: return "defaultValue";
+ case 7: return "isNullable";
+ case 8: return "dataType";
+ case 9: return "charMaxLength";
+ case 10: return "charOctetLength";
+ case 11: return "numericPrecision";
+ case 12: return "numericPrecisionRadix";
+ case 13: return "numericScale";
+ case 14: return "dateTimePrecision";
+ case 15: return "intervalType";
+ case 16: return "intervalPrecision";
+ 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("ordinalPosition", 5);
+ __fieldMap.put("defaultValue", 6);
+ __fieldMap.put("isNullable", 7);
+ __fieldMap.put("dataType", 8);
+ __fieldMap.put("charMaxLength", 9);
+ __fieldMap.put("charOctetLength", 10);
+ __fieldMap.put("numericPrecision", 11);
+ __fieldMap.put("numericPrecisionRadix", 12);
+ __fieldMap.put("numericScale", 13);
+ __fieldMap.put("dateTimePrecision", 14);
+ __fieldMap.put("intervalType", 15);
+ __fieldMap.put("intervalPrecision", 16);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetCatalogsReq.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetCatalogsReq.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetCatalogsReq.java
new file mode 100644
index 0000000..064cfbd
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetCatalogsReq.java
@@ -0,0 +1,165 @@
+/**
+ * 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 GetCatalogsReq implements Externalizable, Message<GetCatalogsReq>, Schema<GetCatalogsReq>
+{
+
+ public static Schema<GetCatalogsReq> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static GetCatalogsReq getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final GetCatalogsReq DEFAULT_INSTANCE = new GetCatalogsReq();
+
+
+ private LikeFilter catalogNameFilter;
+
+ public GetCatalogsReq()
+ {
+
+ }
+
+ // getters and setters
+
+ // catalogNameFilter
+
+ public LikeFilter getCatalogNameFilter()
+ {
+ return catalogNameFilter;
+ }
+
+ public GetCatalogsReq setCatalogNameFilter(LikeFilter catalogNameFilter)
+ {
+ this.catalogNameFilter = catalogNameFilter;
+ 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<GetCatalogsReq> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public GetCatalogsReq newMessage()
+ {
+ return new GetCatalogsReq();
+ }
+
+ public Class<GetCatalogsReq> typeClass()
+ {
+ return GetCatalogsReq.class;
+ }
+
+ public String messageName()
+ {
+ return GetCatalogsReq.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return GetCatalogsReq.class.getName();
+ }
+
+ public boolean isInitialized(GetCatalogsReq message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, GetCatalogsReq message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ message.catalogNameFilter = input.mergeObject(message.catalogNameFilter, LikeFilter.getSchema());
+ break;
+
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, GetCatalogsReq message) throws IOException
+ {
+ if(message.catalogNameFilter != null)
+ output.writeObject(1, message.catalogNameFilter, LikeFilter.getSchema(), false);
+
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "catalogNameFilter";
+ 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("catalogNameFilter", 1);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetCatalogsResp.java
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..d71062d
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetCatalogsResp.java
@@ -0,0 +1,221 @@
+/**
+ * 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 GetCatalogsResp implements Externalizable, Message<GetCatalogsResp>, Schema<GetCatalogsResp>
+{
+
+ public static Schema<GetCatalogsResp> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static GetCatalogsResp getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final GetCatalogsResp DEFAULT_INSTANCE = new GetCatalogsResp();
+
+
+ private RequestStatus status;
+ private List<CatalogMetadata> catalogs;
+ private DrillPBError error;
+
+ public GetCatalogsResp()
+ {
+
+ }
+
+ // getters and setters
+
+ // status
+
+ public RequestStatus getStatus()
+ {
+ return status == null ? RequestStatus.UNKNOWN : status;
+ }
+
+ public GetCatalogsResp setStatus(RequestStatus status)
+ {
+ this.status = status;
+ return this;
+ }
+
+ // catalogs
+
+ public List<CatalogMetadata> getCatalogsList()
+ {
+ return catalogs;
+ }
+
+ public GetCatalogsResp setCatalogsList(List<CatalogMetadata> catalogs)
+ {
+ this.catalogs = catalogs;
+ return this;
+ }
+
+ // error
+
+ public DrillPBError getError()
+ {
+ return error;
+ }
+
+ public GetCatalogsResp 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<GetCatalogsResp> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public GetCatalogsResp newMessage()
+ {
+ return new GetCatalogsResp();
+ }
+
+ public Class<GetCatalogsResp> typeClass()
+ {
+ return GetCatalogsResp.class;
+ }
+
+ public String messageName()
+ {
+ return GetCatalogsResp.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return GetCatalogsResp.class.getName();
+ }
+
+ public boolean isInitialized(GetCatalogsResp message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, GetCatalogsResp 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:
+ if(message.catalogs == null)
+ message.catalogs = new ArrayList<CatalogMetadata>();
+ message.catalogs.add(input.mergeObject(null, CatalogMetadata.getSchema()));
+ break;
+
+ case 3:
+ message.error = input.mergeObject(message.error, DrillPBError.getSchema());
+ break;
+
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, GetCatalogsResp message) throws IOException
+ {
+ if(message.status != null)
+ output.writeEnum(1, message.status.number, false);
+
+ if(message.catalogs != null)
+ {
+ for(CatalogMetadata catalogs : message.catalogs)
+ {
+ if(catalogs != null)
+ output.writeObject(2, catalogs, CatalogMetadata.getSchema(), true);
+ }
+ }
+
+
+ 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 "catalogs";
+ 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("catalogs", 2);
+ __fieldMap.put("error", 3);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetColumnsReq.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetColumnsReq.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetColumnsReq.java
new file mode 100644
index 0000000..4ace257
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetColumnsReq.java
@@ -0,0 +1,237 @@
+/**
+ * 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 GetColumnsReq implements Externalizable, Message<GetColumnsReq>, Schema<GetColumnsReq>
+{
+
+ public static Schema<GetColumnsReq> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static GetColumnsReq getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final GetColumnsReq DEFAULT_INSTANCE = new GetColumnsReq();
+
+
+ private LikeFilter catalogNameFilter;
+ private LikeFilter schameNameFilter;
+ private LikeFilter tableNameFilter;
+ private LikeFilter columnNameFilter;
+
+ public GetColumnsReq()
+ {
+
+ }
+
+ // getters and setters
+
+ // catalogNameFilter
+
+ public LikeFilter getCatalogNameFilter()
+ {
+ return catalogNameFilter;
+ }
+
+ public GetColumnsReq setCatalogNameFilter(LikeFilter catalogNameFilter)
+ {
+ this.catalogNameFilter = catalogNameFilter;
+ return this;
+ }
+
+ // schameNameFilter
+
+ public LikeFilter getSchameNameFilter()
+ {
+ return schameNameFilter;
+ }
+
+ public GetColumnsReq setSchameNameFilter(LikeFilter schameNameFilter)
+ {
+ this.schameNameFilter = schameNameFilter;
+ return this;
+ }
+
+ // tableNameFilter
+
+ public LikeFilter getTableNameFilter()
+ {
+ return tableNameFilter;
+ }
+
+ public GetColumnsReq setTableNameFilter(LikeFilter tableNameFilter)
+ {
+ this.tableNameFilter = tableNameFilter;
+ return this;
+ }
+
+ // columnNameFilter
+
+ public LikeFilter getColumnNameFilter()
+ {
+ return columnNameFilter;
+ }
+
+ public GetColumnsReq setColumnNameFilter(LikeFilter columnNameFilter)
+ {
+ this.columnNameFilter = columnNameFilter;
+ 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<GetColumnsReq> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public GetColumnsReq newMessage()
+ {
+ return new GetColumnsReq();
+ }
+
+ public Class<GetColumnsReq> typeClass()
+ {
+ return GetColumnsReq.class;
+ }
+
+ public String messageName()
+ {
+ return GetColumnsReq.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return GetColumnsReq.class.getName();
+ }
+
+ public boolean isInitialized(GetColumnsReq message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, GetColumnsReq message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ message.catalogNameFilter = input.mergeObject(message.catalogNameFilter, LikeFilter.getSchema());
+ break;
+
+ case 2:
+ message.schameNameFilter = input.mergeObject(message.schameNameFilter, LikeFilter.getSchema());
+ break;
+
+ case 3:
+ message.tableNameFilter = input.mergeObject(message.tableNameFilter, LikeFilter.getSchema());
+ break;
+
+ case 4:
+ message.columnNameFilter = input.mergeObject(message.columnNameFilter, LikeFilter.getSchema());
+ break;
+
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, GetColumnsReq message) throws IOException
+ {
+ if(message.catalogNameFilter != null)
+ output.writeObject(1, message.catalogNameFilter, LikeFilter.getSchema(), false);
+
+
+ if(message.schameNameFilter != null)
+ output.writeObject(2, message.schameNameFilter, LikeFilter.getSchema(), false);
+
+
+ if(message.tableNameFilter != null)
+ output.writeObject(3, message.tableNameFilter, LikeFilter.getSchema(), false);
+
+
+ if(message.columnNameFilter != null)
+ output.writeObject(4, message.columnNameFilter, LikeFilter.getSchema(), false);
+
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "catalogNameFilter";
+ case 2: return "schameNameFilter";
+ case 3: return "tableNameFilter";
+ case 4: return "columnNameFilter";
+ 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("catalogNameFilter", 1);
+ __fieldMap.put("schameNameFilter", 2);
+ __fieldMap.put("tableNameFilter", 3);
+ __fieldMap.put("columnNameFilter", 4);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetColumnsResp.java
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..dc22c85
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetColumnsResp.java
@@ -0,0 +1,221 @@
+/**
+ * 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 GetColumnsResp implements Externalizable, Message<GetColumnsResp>, Schema<GetColumnsResp>
+{
+
+ public static Schema<GetColumnsResp> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static GetColumnsResp getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final GetColumnsResp DEFAULT_INSTANCE = new GetColumnsResp();
+
+
+ private RequestStatus status;
+ private List<ColumnMetadata> columns;
+ private DrillPBError error;
+
+ public GetColumnsResp()
+ {
+
+ }
+
+ // getters and setters
+
+ // status
+
+ public RequestStatus getStatus()
+ {
+ return status == null ? RequestStatus.UNKNOWN : status;
+ }
+
+ public GetColumnsResp setStatus(RequestStatus status)
+ {
+ this.status = status;
+ return this;
+ }
+
+ // columns
+
+ public List<ColumnMetadata> getColumnsList()
+ {
+ return columns;
+ }
+
+ public GetColumnsResp setColumnsList(List<ColumnMetadata> columns)
+ {
+ this.columns = columns;
+ return this;
+ }
+
+ // error
+
+ public DrillPBError getError()
+ {
+ return error;
+ }
+
+ public GetColumnsResp 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<GetColumnsResp> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public GetColumnsResp newMessage()
+ {
+ return new GetColumnsResp();
+ }
+
+ public Class<GetColumnsResp> typeClass()
+ {
+ return GetColumnsResp.class;
+ }
+
+ public String messageName()
+ {
+ return GetColumnsResp.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return GetColumnsResp.class.getName();
+ }
+
+ public boolean isInitialized(GetColumnsResp message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, GetColumnsResp 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:
+ if(message.columns == null)
+ message.columns = new ArrayList<ColumnMetadata>();
+ message.columns.add(input.mergeObject(null, ColumnMetadata.getSchema()));
+ break;
+
+ case 3:
+ message.error = input.mergeObject(message.error, DrillPBError.getSchema());
+ break;
+
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, GetColumnsResp message) throws IOException
+ {
+ if(message.status != null)
+ output.writeEnum(1, message.status.number, false);
+
+ if(message.columns != null)
+ {
+ for(ColumnMetadata columns : message.columns)
+ {
+ if(columns != null)
+ output.writeObject(2, columns, ColumnMetadata.getSchema(), true);
+ }
+ }
+
+
+ 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 "columns";
+ 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("columns", 2);
+ __fieldMap.put("error", 3);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetSchemasReq.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetSchemasReq.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetSchemasReq.java
new file mode 100644
index 0000000..742b195
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetSchemasReq.java
@@ -0,0 +1,189 @@
+/**
+ * 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 GetSchemasReq implements Externalizable, Message<GetSchemasReq>, Schema<GetSchemasReq>
+{
+
+ public static Schema<GetSchemasReq> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static GetSchemasReq getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final GetSchemasReq DEFAULT_INSTANCE = new GetSchemasReq();
+
+
+ private LikeFilter catalogNameFilter;
+ private LikeFilter schameNameFilter;
+
+ public GetSchemasReq()
+ {
+
+ }
+
+ // getters and setters
+
+ // catalogNameFilter
+
+ public LikeFilter getCatalogNameFilter()
+ {
+ return catalogNameFilter;
+ }
+
+ public GetSchemasReq setCatalogNameFilter(LikeFilter catalogNameFilter)
+ {
+ this.catalogNameFilter = catalogNameFilter;
+ return this;
+ }
+
+ // schameNameFilter
+
+ public LikeFilter getSchameNameFilter()
+ {
+ return schameNameFilter;
+ }
+
+ public GetSchemasReq setSchameNameFilter(LikeFilter schameNameFilter)
+ {
+ this.schameNameFilter = schameNameFilter;
+ 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<GetSchemasReq> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public GetSchemasReq newMessage()
+ {
+ return new GetSchemasReq();
+ }
+
+ public Class<GetSchemasReq> typeClass()
+ {
+ return GetSchemasReq.class;
+ }
+
+ public String messageName()
+ {
+ return GetSchemasReq.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return GetSchemasReq.class.getName();
+ }
+
+ public boolean isInitialized(GetSchemasReq message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, GetSchemasReq message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ message.catalogNameFilter = input.mergeObject(message.catalogNameFilter, LikeFilter.getSchema());
+ break;
+
+ case 2:
+ message.schameNameFilter = input.mergeObject(message.schameNameFilter, LikeFilter.getSchema());
+ break;
+
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, GetSchemasReq message) throws IOException
+ {
+ if(message.catalogNameFilter != null)
+ output.writeObject(1, message.catalogNameFilter, LikeFilter.getSchema(), false);
+
+
+ if(message.schameNameFilter != null)
+ output.writeObject(2, message.schameNameFilter, LikeFilter.getSchema(), false);
+
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "catalogNameFilter";
+ case 2: return "schameNameFilter";
+ 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("catalogNameFilter", 1);
+ __fieldMap.put("schameNameFilter", 2);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetSchemasResp.java
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..3dc5e84
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetSchemasResp.java
@@ -0,0 +1,221 @@
+/**
+ * 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 GetSchemasResp implements Externalizable, Message<GetSchemasResp>, Schema<GetSchemasResp>
+{
+
+ public static Schema<GetSchemasResp> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static GetSchemasResp getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final GetSchemasResp DEFAULT_INSTANCE = new GetSchemasResp();
+
+
+ private RequestStatus status;
+ private List<SchemaMetadata> schemas;
+ private DrillPBError error;
+
+ public GetSchemasResp()
+ {
+
+ }
+
+ // getters and setters
+
+ // status
+
+ public RequestStatus getStatus()
+ {
+ return status == null ? RequestStatus.UNKNOWN : status;
+ }
+
+ public GetSchemasResp setStatus(RequestStatus status)
+ {
+ this.status = status;
+ return this;
+ }
+
+ // schemas
+
+ public List<SchemaMetadata> getSchemasList()
+ {
+ return schemas;
+ }
+
+ public GetSchemasResp setSchemasList(List<SchemaMetadata> schemas)
+ {
+ this.schemas = schemas;
+ return this;
+ }
+
+ // error
+
+ public DrillPBError getError()
+ {
+ return error;
+ }
+
+ public GetSchemasResp 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<GetSchemasResp> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public GetSchemasResp newMessage()
+ {
+ return new GetSchemasResp();
+ }
+
+ public Class<GetSchemasResp> typeClass()
+ {
+ return GetSchemasResp.class;
+ }
+
+ public String messageName()
+ {
+ return GetSchemasResp.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return GetSchemasResp.class.getName();
+ }
+
+ public boolean isInitialized(GetSchemasResp message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, GetSchemasResp 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:
+ if(message.schemas == null)
+ message.schemas = new ArrayList<SchemaMetadata>();
+ message.schemas.add(input.mergeObject(null, SchemaMetadata.getSchema()));
+ break;
+
+ case 3:
+ message.error = input.mergeObject(message.error, DrillPBError.getSchema());
+ break;
+
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, GetSchemasResp message) throws IOException
+ {
+ if(message.status != null)
+ output.writeEnum(1, message.status.number, false);
+
+ if(message.schemas != null)
+ {
+ for(SchemaMetadata schemas : message.schemas)
+ {
+ if(schemas != null)
+ output.writeObject(2, schemas, SchemaMetadata.getSchema(), true);
+ }
+ }
+
+
+ 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 "schemas";
+ 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("schemas", 2);
+ __fieldMap.put("error", 3);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetTablesReq.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetTablesReq.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetTablesReq.java
new file mode 100644
index 0000000..ce9da61
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetTablesReq.java
@@ -0,0 +1,213 @@
+/**
+ * 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 GetTablesReq implements Externalizable, Message<GetTablesReq>, Schema<GetTablesReq>
+{
+
+ public static Schema<GetTablesReq> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static GetTablesReq getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final GetTablesReq DEFAULT_INSTANCE = new GetTablesReq();
+
+
+ private LikeFilter catalogNameFilter;
+ private LikeFilter schameNameFilter;
+ private LikeFilter tableNameFilter;
+
+ public GetTablesReq()
+ {
+
+ }
+
+ // getters and setters
+
+ // catalogNameFilter
+
+ public LikeFilter getCatalogNameFilter()
+ {
+ return catalogNameFilter;
+ }
+
+ public GetTablesReq setCatalogNameFilter(LikeFilter catalogNameFilter)
+ {
+ this.catalogNameFilter = catalogNameFilter;
+ return this;
+ }
+
+ // schameNameFilter
+
+ public LikeFilter getSchameNameFilter()
+ {
+ return schameNameFilter;
+ }
+
+ public GetTablesReq setSchameNameFilter(LikeFilter schameNameFilter)
+ {
+ this.schameNameFilter = schameNameFilter;
+ return this;
+ }
+
+ // tableNameFilter
+
+ public LikeFilter getTableNameFilter()
+ {
+ return tableNameFilter;
+ }
+
+ public GetTablesReq setTableNameFilter(LikeFilter tableNameFilter)
+ {
+ this.tableNameFilter = tableNameFilter;
+ 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<GetTablesReq> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public GetTablesReq newMessage()
+ {
+ return new GetTablesReq();
+ }
+
+ public Class<GetTablesReq> typeClass()
+ {
+ return GetTablesReq.class;
+ }
+
+ public String messageName()
+ {
+ return GetTablesReq.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return GetTablesReq.class.getName();
+ }
+
+ public boolean isInitialized(GetTablesReq message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, GetTablesReq message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ message.catalogNameFilter = input.mergeObject(message.catalogNameFilter, LikeFilter.getSchema());
+ break;
+
+ case 2:
+ message.schameNameFilter = input.mergeObject(message.schameNameFilter, LikeFilter.getSchema());
+ break;
+
+ case 3:
+ message.tableNameFilter = input.mergeObject(message.tableNameFilter, LikeFilter.getSchema());
+ break;
+
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, GetTablesReq message) throws IOException
+ {
+ if(message.catalogNameFilter != null)
+ output.writeObject(1, message.catalogNameFilter, LikeFilter.getSchema(), false);
+
+
+ if(message.schameNameFilter != null)
+ output.writeObject(2, message.schameNameFilter, LikeFilter.getSchema(), false);
+
+
+ if(message.tableNameFilter != null)
+ output.writeObject(3, message.tableNameFilter, LikeFilter.getSchema(), false);
+
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "catalogNameFilter";
+ case 2: return "schameNameFilter";
+ case 3: return "tableNameFilter";
+ 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("catalogNameFilter", 1);
+ __fieldMap.put("schameNameFilter", 2);
+ __fieldMap.put("tableNameFilter", 3);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetTablesResp.java
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..c62ed3c
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/GetTablesResp.java
@@ -0,0 +1,221 @@
+/**
+ * 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 GetTablesResp implements Externalizable, Message<GetTablesResp>, Schema<GetTablesResp>
+{
+
+ public static Schema<GetTablesResp> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static GetTablesResp getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final GetTablesResp DEFAULT_INSTANCE = new GetTablesResp();
+
+
+ private RequestStatus status;
+ private List<TableMetadata> tables;
+ private DrillPBError error;
+
+ public GetTablesResp()
+ {
+
+ }
+
+ // getters and setters
+
+ // status
+
+ public RequestStatus getStatus()
+ {
+ return status == null ? RequestStatus.UNKNOWN : status;
+ }
+
+ public GetTablesResp setStatus(RequestStatus status)
+ {
+ this.status = status;
+ return this;
+ }
+
+ // tables
+
+ public List<TableMetadata> getTablesList()
+ {
+ return tables;
+ }
+
+ public GetTablesResp setTablesList(List<TableMetadata> tables)
+ {
+ this.tables = tables;
+ return this;
+ }
+
+ // error
+
+ public DrillPBError getError()
+ {
+ return error;
+ }
+
+ public GetTablesResp 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<GetTablesResp> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public GetTablesResp newMessage()
+ {
+ return new GetTablesResp();
+ }
+
+ public Class<GetTablesResp> typeClass()
+ {
+ return GetTablesResp.class;
+ }
+
+ public String messageName()
+ {
+ return GetTablesResp.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return GetTablesResp.class.getName();
+ }
+
+ public boolean isInitialized(GetTablesResp message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, GetTablesResp 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:
+ if(message.tables == null)
+ message.tables = new ArrayList<TableMetadata>();
+ message.tables.add(input.mergeObject(null, TableMetadata.getSchema()));
+ break;
+
+ case 3:
+ message.error = input.mergeObject(message.error, DrillPBError.getSchema());
+ break;
+
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, GetTablesResp message) throws IOException
+ {
+ if(message.status != null)
+ output.writeEnum(1, message.status.number, false);
+
+ if(message.tables != null)
+ {
+ for(TableMetadata tables : message.tables)
+ {
+ if(tables != null)
+ output.writeObject(2, tables, TableMetadata.getSchema(), true);
+ }
+ }
+
+
+ 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 "tables";
+ 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("tables", 2);
+ __fieldMap.put("error", 3);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/LikeFilter.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/LikeFilter.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/LikeFilter.java
new file mode 100644
index 0000000..88d0716
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/LikeFilter.java
@@ -0,0 +1,185 @@
+/**
+ * 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 LikeFilter implements Externalizable, Message<LikeFilter>, Schema<LikeFilter>
+{
+
+ public static Schema<LikeFilter> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static LikeFilter getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final LikeFilter DEFAULT_INSTANCE = new LikeFilter();
+
+
+ private String regex;
+ private String escape;
+
+ public LikeFilter()
+ {
+
+ }
+
+ // getters and setters
+
+ // regex
+
+ public String getRegex()
+ {
+ return regex;
+ }
+
+ public LikeFilter setRegex(String regex)
+ {
+ this.regex = regex;
+ return this;
+ }
+
+ // escape
+
+ public String getEscape()
+ {
+ return escape;
+ }
+
+ public LikeFilter setEscape(String escape)
+ {
+ this.escape = escape;
+ 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<LikeFilter> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public LikeFilter newMessage()
+ {
+ return new LikeFilter();
+ }
+
+ public Class<LikeFilter> typeClass()
+ {
+ return LikeFilter.class;
+ }
+
+ public String messageName()
+ {
+ return LikeFilter.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return LikeFilter.class.getName();
+ }
+
+ public boolean isInitialized(LikeFilter message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, LikeFilter message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ message.regex = input.readString();
+ break;
+ case 2:
+ message.escape = input.readString();
+ break;
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, LikeFilter message) throws IOException
+ {
+ if(message.regex != null)
+ output.writeString(1, message.regex, false);
+
+ if(message.escape != null)
+ output.writeString(2, message.escape, false);
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "regex";
+ case 2: return "escape";
+ 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("regex", 1);
+ __fieldMap.put("escape", 2);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/RequestStatus.java
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..f526ab5
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/RequestStatus.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 RequestStatus implements com.dyuproject.protostuff.EnumLite<RequestStatus>
+{
+ UNKNOWN(0),
+ OK(1),
+ FAILED(2);
+
+ public final int number;
+
+ private RequestStatus (int number)
+ {
+ this.number = number;
+ }
+
+ public int getNumber()
+ {
+ return number;
+ }
+
+ public static RequestStatus valueOf(int number)
+ {
+ switch(number)
+ {
+ case 0: return UNKNOWN;
+ case 1: return OK;
+ case 2: return FAILED;
+ default: return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/RpcType.java
----------------------------------------------------------------------
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 5800183..ff4f4bc 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
@@ -30,9 +30,17 @@ public enum RpcType implements com.dyuproject.protostuff.EnumLite<RpcType>
REQUEST_RESULTS(5),
RESUME_PAUSED_QUERY(11),
GET_QUERY_PLAN_FRAGMENTS(12),
+ GET_CATALOGS(14),
+ GET_SCHEMAS(15),
+ GET_TABLES(16),
+ GET_COLUMNS(17),
QUERY_DATA(6),
QUERY_HANDLE(7),
QUERY_PLAN_FRAGMENTS(13),
+ CATALOGS(18),
+ SCHEMAS(19),
+ TABLES(20),
+ COLUMNS(21),
REQ_META_FUNCTIONS(8),
RESP_FUNCTION_LIST(9),
QUERY_RESULT(10);
@@ -67,6 +75,14 @@ public enum RpcType implements com.dyuproject.protostuff.EnumLite<RpcType>
case 11: return RESUME_PAUSED_QUERY;
case 12: return GET_QUERY_PLAN_FRAGMENTS;
case 13: return QUERY_PLAN_FRAGMENTS;
+ case 14: return GET_CATALOGS;
+ case 15: return GET_SCHEMAS;
+ case 16: return GET_TABLES;
+ case 17: return GET_COLUMNS;
+ case 18: return CATALOGS;
+ case 19: return SCHEMAS;
+ case 20: return TABLES;
+ case 21: return COLUMNS;
default: return null;
}
}
http://git-wip-us.apache.org/repos/asf/drill/blob/ef6e522c/protocol/src/main/java/org/apache/drill/exec/proto/beans/SchemaMetadata.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/SchemaMetadata.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/SchemaMetadata.java
new file mode 100644
index 0000000..29f6e67
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/SchemaMetadata.java
@@ -0,0 +1,251 @@
+/**
+ * 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 SchemaMetadata implements Externalizable, Message<SchemaMetadata>, Schema<SchemaMetadata>
+{
+
+ public static Schema<SchemaMetadata> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static SchemaMetadata getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final SchemaMetadata DEFAULT_INSTANCE = new SchemaMetadata();
+
+
+ private String catalogName;
+ private String schemaName;
+ private String owner;
+ private String type;
+ private String mutable;
+
+ public SchemaMetadata()
+ {
+
+ }
+
+ // getters and setters
+
+ // catalogName
+
+ public String getCatalogName()
+ {
+ return catalogName;
+ }
+
+ public SchemaMetadata setCatalogName(String catalogName)
+ {
+ this.catalogName = catalogName;
+ return this;
+ }
+
+ // schemaName
+
+ public String getSchemaName()
+ {
+ return schemaName;
+ }
+
+ public SchemaMetadata setSchemaName(String schemaName)
+ {
+ this.schemaName = schemaName;
+ return this;
+ }
+
+ // owner
+
+ public String getOwner()
+ {
+ return owner;
+ }
+
+ public SchemaMetadata setOwner(String owner)
+ {
+ this.owner = owner;
+ return this;
+ }
+
+ // type
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public SchemaMetadata setType(String type)
+ {
+ this.type = type;
+ return this;
+ }
+
+ // mutable
+
+ public String getMutable()
+ {
+ return mutable;
+ }
+
+ public SchemaMetadata setMutable(String mutable)
+ {
+ this.mutable = mutable;
+ 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<SchemaMetadata> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public SchemaMetadata newMessage()
+ {
+ return new SchemaMetadata();
+ }
+
+ public Class<SchemaMetadata> typeClass()
+ {
+ return SchemaMetadata.class;
+ }
+
+ public String messageName()
+ {
+ return SchemaMetadata.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return SchemaMetadata.class.getName();
+ }
+
+ public boolean isInitialized(SchemaMetadata message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, SchemaMetadata 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.owner = input.readString();
+ break;
+ case 4:
+ message.type = input.readString();
+ break;
+ case 5:
+ message.mutable = input.readString();
+ break;
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, SchemaMetadata 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.owner != null)
+ output.writeString(3, message.owner, false);
+
+ if(message.type != null)
+ output.writeString(4, message.type, false);
+
+ if(message.mutable != null)
+ output.writeString(5, message.mutable, false);
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "catalogName";
+ case 2: return "schemaName";
+ case 3: return "owner";
+ case 4: return "type";
+ case 5: return "mutable";
+ 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("owner", 3);
+ __fieldMap.put("type", 4);
+ __fieldMap.put("mutable", 5);
+ }
+
+}