/*
 * 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;


public final class SchemaCoordinationProtos
{

    public static final class DrillbitEndpoint
    {
        public static final org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.MessageSchema WRITE =
            new org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.MessageSchema();
        public static final org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.BuilderSchema MERGE =
            new org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.BuilderSchema();
        
        public static class MessageSchema implements io.protostuff.Schema<org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint>
        {
            public void writeTo(io.protostuff.Output output, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint message) throws java.io.IOException
            {
                if(message.hasAddress())
                    output.writeString(1, message.getAddress(), false);
                if(message.hasUserPort())
                    output.writeInt32(2, message.getUserPort(), false);
                if(message.hasControlPort())
                    output.writeInt32(3, message.getControlPort(), false);
                if(message.hasDataPort())
                    output.writeInt32(4, message.getDataPort(), false);
                if(message.hasRoles())
                    output.writeObject(5, message.getRoles(), org.apache.drill.exec.proto.SchemaCoordinationProtos.Roles.WRITE, false);

                if(message.hasVersion())
                    output.writeString(6, message.getVersion(), false);
                if(message.hasState())
                    output.writeEnum(7, message.getState().getNumber(), false);
                if(message.hasHttpPort())
                    output.writeInt32(8, message.getHttpPort(), false);
            }
            public boolean isInitialized(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint message)
            {
                return message.isInitialized();
            }
            public java.lang.String getFieldName(int number)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.getFieldName(number);
            }
            public int getFieldNumber(java.lang.String name)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.getFieldNumber(name);
            }
            public java.lang.Class<org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint> typeClass()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.class;
            }
            public java.lang.String messageName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.class.getSimpleName();
            }
            public java.lang.String messageFullName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.class.getName();
            }
            //unused
            public void mergeFrom(io.protostuff.Input input, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint message) throws java.io.IOException {}
            public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint newMessage() { return null; }
        }
        public static class BuilderSchema implements io.protostuff.Schema<org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder>
        {
            public void mergeFrom(io.protostuff.Input input, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder builder) throws java.io.IOException
            {
                for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
                {
                    switch(number)
                    {
                        case 0:
                            return;
                        case 1:
                            builder.setAddress(input.readString());
                            break;
                        case 2:
                            builder.setUserPort(input.readInt32());
                            break;
                        case 3:
                            builder.setControlPort(input.readInt32());
                            break;
                        case 4:
                            builder.setDataPort(input.readInt32());
                            break;
                        case 5:
                            builder.setRoles(input.mergeObject(org.apache.drill.exec.proto.CoordinationProtos.Roles.newBuilder(), org.apache.drill.exec.proto.SchemaCoordinationProtos.Roles.MERGE));

                            break;
                        case 6:
                            builder.setVersion(input.readString());
                            break;
                        case 7:
                            builder.setState(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.State.valueOf(input.readEnum()));
                            break;
                        case 8:
                            builder.setHttpPort(input.readInt32());
                            break;
                        default:
                            input.handleUnknownField(number, this);
                    }
                }
            }
            public boolean isInitialized(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder builder)
            {
                return builder.isInitialized();
            }
            public org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder newMessage()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.newBuilder();
            }
            public java.lang.String getFieldName(int number)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.getFieldName(number);
            }
            public int getFieldNumber(java.lang.String name)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.getFieldNumber(name);
            }
            public java.lang.Class<org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder> typeClass()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder.class;
            }
            public java.lang.String messageName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.class.getSimpleName();
            }
            public java.lang.String messageFullName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.class.getName();
            }
            //unused
            public void writeTo(io.protostuff.Output output, org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.Builder builder) throws java.io.IOException {}
        }
        public static java.lang.String getFieldName(int number)
        {
            switch(number)
            {
                case 1: return "address";
                case 2: return "userPort";
                case 3: return "controlPort";
                case 4: return "dataPort";
                case 5: return "roles";
                case 6: return "version";
                case 7: return "state";
                case 8: return "httpPort";
                default: return null;
            }
        }
        public static int getFieldNumber(java.lang.String name)
        {
            java.lang.Integer number = fieldMap.get(name);
            return number == null ? 0 : number.intValue();
        }
        private static final java.util.HashMap<java.lang.String,java.lang.Integer> fieldMap = new java.util.HashMap<java.lang.String,java.lang.Integer>();
        static
        {
            fieldMap.put("address", 1);
            fieldMap.put("userPort", 2);
            fieldMap.put("controlPort", 3);
            fieldMap.put("dataPort", 4);
            fieldMap.put("roles", 5);
            fieldMap.put("version", 6);
            fieldMap.put("state", 7);
            fieldMap.put("httpPort", 8);
        }
    }

    public static final class DrillServiceInstance
    {
        public static final org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillServiceInstance.MessageSchema WRITE =
            new org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillServiceInstance.MessageSchema();
        public static final org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillServiceInstance.BuilderSchema MERGE =
            new org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillServiceInstance.BuilderSchema();
        
        public static class MessageSchema implements io.protostuff.Schema<org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance>
        {
            public void writeTo(io.protostuff.Output output, org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance message) throws java.io.IOException
            {
                if(message.hasId())
                    output.writeString(1, message.getId(), false);
                if(message.hasRegistrationTimeUTC())
                    output.writeInt64(2, message.getRegistrationTimeUTC(), false);
                if(message.hasEndpoint())
                    output.writeObject(3, message.getEndpoint(), org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.WRITE, false);

            }
            public boolean isInitialized(org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance message)
            {
                return message.isInitialized();
            }
            public java.lang.String getFieldName(int number)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillServiceInstance.getFieldName(number);
            }
            public int getFieldNumber(java.lang.String name)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillServiceInstance.getFieldNumber(name);
            }
            public java.lang.Class<org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance> typeClass()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.class;
            }
            public java.lang.String messageName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.class.getSimpleName();
            }
            public java.lang.String messageFullName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.class.getName();
            }
            //unused
            public void mergeFrom(io.protostuff.Input input, org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance message) throws java.io.IOException {}
            public org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance newMessage() { return null; }
        }
        public static class BuilderSchema implements io.protostuff.Schema<org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.Builder>
        {
            public void mergeFrom(io.protostuff.Input input, org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.Builder builder) throws java.io.IOException
            {
                for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
                {
                    switch(number)
                    {
                        case 0:
                            return;
                        case 1:
                            builder.setId(input.readString());
                            break;
                        case 2:
                            builder.setRegistrationTimeUTC(input.readInt64());
                            break;
                        case 3:
                            builder.setEndpoint(input.mergeObject(org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.newBuilder(), org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillbitEndpoint.MERGE));

                            break;
                        default:
                            input.handleUnknownField(number, this);
                    }
                }
            }
            public boolean isInitialized(org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.Builder builder)
            {
                return builder.isInitialized();
            }
            public org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.Builder newMessage()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.newBuilder();
            }
            public java.lang.String getFieldName(int number)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillServiceInstance.getFieldName(number);
            }
            public int getFieldNumber(java.lang.String name)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.DrillServiceInstance.getFieldNumber(name);
            }
            public java.lang.Class<org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.Builder> typeClass()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.Builder.class;
            }
            public java.lang.String messageName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.class.getSimpleName();
            }
            public java.lang.String messageFullName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.class.getName();
            }
            //unused
            public void writeTo(io.protostuff.Output output, org.apache.drill.exec.proto.CoordinationProtos.DrillServiceInstance.Builder builder) throws java.io.IOException {}
        }
        public static java.lang.String getFieldName(int number)
        {
            switch(number)
            {
                case 1: return "id";
                case 2: return "registrationTimeUTC";
                case 3: return "endpoint";
                default: return null;
            }
        }
        public static int getFieldNumber(java.lang.String name)
        {
            java.lang.Integer number = fieldMap.get(name);
            return number == null ? 0 : number.intValue();
        }
        private static final java.util.HashMap<java.lang.String,java.lang.Integer> fieldMap = new java.util.HashMap<java.lang.String,java.lang.Integer>();
        static
        {
            fieldMap.put("id", 1);
            fieldMap.put("registrationTimeUTC", 2);
            fieldMap.put("endpoint", 3);
        }
    }

    public static final class Roles
    {
        public static final org.apache.drill.exec.proto.SchemaCoordinationProtos.Roles.MessageSchema WRITE =
            new org.apache.drill.exec.proto.SchemaCoordinationProtos.Roles.MessageSchema();
        public static final org.apache.drill.exec.proto.SchemaCoordinationProtos.Roles.BuilderSchema MERGE =
            new org.apache.drill.exec.proto.SchemaCoordinationProtos.Roles.BuilderSchema();
        
        public static class MessageSchema implements io.protostuff.Schema<org.apache.drill.exec.proto.CoordinationProtos.Roles>
        {
            public void writeTo(io.protostuff.Output output, org.apache.drill.exec.proto.CoordinationProtos.Roles message) throws java.io.IOException
            {
                if(message.hasSqlQuery())
                    output.writeBool(1, message.getSqlQuery(), false);
                if(message.hasLogicalPlan())
                    output.writeBool(2, message.getLogicalPlan(), false);
                if(message.hasPhysicalPlan())
                    output.writeBool(3, message.getPhysicalPlan(), false);
                if(message.hasJavaExecutor())
                    output.writeBool(4, message.getJavaExecutor(), false);
                if(message.hasDistributedCache())
                    output.writeBool(5, message.getDistributedCache(), false);
            }
            public boolean isInitialized(org.apache.drill.exec.proto.CoordinationProtos.Roles message)
            {
                return message.isInitialized();
            }
            public java.lang.String getFieldName(int number)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.Roles.getFieldName(number);
            }
            public int getFieldNumber(java.lang.String name)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.Roles.getFieldNumber(name);
            }
            public java.lang.Class<org.apache.drill.exec.proto.CoordinationProtos.Roles> typeClass()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.Roles.class;
            }
            public java.lang.String messageName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.Roles.class.getSimpleName();
            }
            public java.lang.String messageFullName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.Roles.class.getName();
            }
            //unused
            public void mergeFrom(io.protostuff.Input input, org.apache.drill.exec.proto.CoordinationProtos.Roles message) throws java.io.IOException {}
            public org.apache.drill.exec.proto.CoordinationProtos.Roles newMessage() { return null; }
        }
        public static class BuilderSchema implements io.protostuff.Schema<org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder>
        {
            public void mergeFrom(io.protostuff.Input input, org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder builder) throws java.io.IOException
            {
                for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
                {
                    switch(number)
                    {
                        case 0:
                            return;
                        case 1:
                            builder.setSqlQuery(input.readBool());
                            break;
                        case 2:
                            builder.setLogicalPlan(input.readBool());
                            break;
                        case 3:
                            builder.setPhysicalPlan(input.readBool());
                            break;
                        case 4:
                            builder.setJavaExecutor(input.readBool());
                            break;
                        case 5:
                            builder.setDistributedCache(input.readBool());
                            break;
                        default:
                            input.handleUnknownField(number, this);
                    }
                }
            }
            public boolean isInitialized(org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder builder)
            {
                return builder.isInitialized();
            }
            public org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder newMessage()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.Roles.newBuilder();
            }
            public java.lang.String getFieldName(int number)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.Roles.getFieldName(number);
            }
            public int getFieldNumber(java.lang.String name)
            {
                return org.apache.drill.exec.proto.SchemaCoordinationProtos.Roles.getFieldNumber(name);
            }
            public java.lang.Class<org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder> typeClass()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder.class;
            }
            public java.lang.String messageName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.Roles.class.getSimpleName();
            }
            public java.lang.String messageFullName()
            {
                return org.apache.drill.exec.proto.CoordinationProtos.Roles.class.getName();
            }
            //unused
            public void writeTo(io.protostuff.Output output, org.apache.drill.exec.proto.CoordinationProtos.Roles.Builder builder) throws java.io.IOException {}
        }
        public static java.lang.String getFieldName(int number)
        {
            switch(number)
            {
                case 1: return "sqlQuery";
                case 2: return "logicalPlan";
                case 3: return "physicalPlan";
                case 4: return "javaExecutor";
                case 5: return "distributedCache";
                default: return null;
            }
        }
        public static int getFieldNumber(java.lang.String name)
        {
            java.lang.Integer number = fieldMap.get(name);
            return number == null ? 0 : number.intValue();
        }
        private static final java.util.HashMap<java.lang.String,java.lang.Integer> fieldMap = new java.util.HashMap<java.lang.String,java.lang.Integer>();
        static
        {
            fieldMap.put("sqlQuery", 1);
            fieldMap.put("logicalPlan", 2);
            fieldMap.put("physicalPlan", 3);
            fieldMap.put("javaExecutor", 4);
            fieldMap.put("distributedCache", 5);
        }
    }

}
