Example #1
0
 public Cursor(TSessionHandle m_Session, TCLIService.Client m_Client,
               TProtocolVersion version = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V7)
 {
     this.m_Session = m_Session;
     this.m_Client  = m_Client;
     m_Version      = version;
 }
Example #2
0
        public void Read(TProtocol iprot)
        {
            bool   isset_sessionHandle = false;
            bool   isset_infoType      = false;
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.Struct)
                    {
                        SessionHandle = new TSessionHandle();
                        SessionHandle.Read(iprot);
                        isset_sessionHandle = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.I32)
                    {
                        InfoType       = (TGetInfoType)iprot.ReadI32();
                        isset_infoType = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_sessionHandle)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_infoType)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
Example #3
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         Close();
         m_Client    = null;
         m_Transport = null;
         m_Session   = null;
     }
 }
Example #4
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         CloseOperation();
         m_LastSchema = null;
         m_Client     = null;
         m_Session    = null;
     }
 }
Example #5
0
 public void Open()
 {
     if (m_Transport != null && !m_Transport.IsOpen)
     {
         m_Transport.Open();
     }
     if (m_Session == null)
     {
         m_Session = GetSession();
     }
 }
Example #6
0
 public TGetFunctionsReq(TSessionHandle sessionHandle, string functionName) : this()
 {
     this.SessionHandle = sessionHandle;
     this.FunctionName  = functionName;
 }
Example #7
0
 public TGetDelegationTokenReq(TSessionHandle sessionHandle, string owner, string renewer) : this()
 {
     this.SessionHandle = sessionHandle;
     this.Owner         = owner;
     this.Renewer       = renewer;
 }
Example #8
0
 public TCloseSessionReq(TSessionHandle sessionHandle) : this()
 {
     this.SessionHandle = sessionHandle;
 }
Example #9
0
 public TGetSchemasReq(TSessionHandle sessionHandle) : this()
 {
     this.SessionHandle = sessionHandle;
 }
Example #10
0
        public void Read(TProtocol iprot)
        {
            bool   isset_sessionHandle = false;
            bool   isset_statement     = false;
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.Struct)
                    {
                        SessionHandle = new TSessionHandle();
                        SessionHandle.Read(iprot);
                        isset_sessionHandle = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        Statement       = iprot.ReadString();
                        isset_statement = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Map)
                    {
                        {
                            ConfOverlay = new Dictionary <string, string>();
                            TMap _map81 = iprot.ReadMapBegin();
                            for (int _i82 = 0; _i82 < _map81.Count; ++_i82)
                            {
                                string _key83;
                                string _val84;
                                _key83 = iprot.ReadString();
                                _val84 = iprot.ReadString();
                                ConfOverlay[_key83] = _val84;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.Bool)
                    {
                        RunAsync = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_sessionHandle)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_statement)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
Example #11
0
 public TGetInfoReq(TSessionHandle sessionHandle, TGetInfoType infoType) : this()
 {
     this.SessionHandle = sessionHandle;
     this.InfoType      = infoType;
 }
Example #12
0
        public void Read(TProtocol iprot)
        {
            bool   isset_sessionHandle = false;
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.Struct)
                    {
                        SessionHandle = new TSessionHandle();
                        SessionHandle.Read(iprot);
                        isset_sessionHandle = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        CatalogName = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.String)
                    {
                        SchemaName = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.String)
                    {
                        TableName = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 5:
                    if (field.Type == TType.List)
                    {
                        {
                            TableTypes = new List <string>();
                            TList _list86 = iprot.ReadListBegin();
                            for (int _i87 = 0; _i87 < _list86.Count; ++_i87)
                            {
                                string _elem88 = null;
                                _elem88 = iprot.ReadString();
                                TableTypes.Add(_elem88);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_sessionHandle)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
Example #13
0
 public TGetTablesReq(TSessionHandle sessionHandle) : this()
 {
     this.SessionHandle = sessionHandle;
 }
Example #14
0
 public TGetColumnsReq(TSessionHandle sessionHandle) : this()
 {
     this.SessionHandle = sessionHandle;
 }
 public TRenewDelegationTokenReq(TSessionHandle sessionHandle, string delegationToken) : this()
 {
     this.SessionHandle   = sessionHandle;
     this.DelegationToken = delegationToken;
 }
Example #16
0
        public void Read(TProtocol iprot)
        {
            bool   isset_sessionHandle = false;
            bool   isset_functionName  = false;
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.Struct)
                    {
                        SessionHandle = new TSessionHandle();
                        SessionHandle.Read(iprot);
                        isset_sessionHandle = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        CatalogName = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.String)
                    {
                        SchemaName = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.String)
                    {
                        FunctionName       = iprot.ReadString();
                        isset_functionName = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_sessionHandle)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_functionName)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
Example #17
0
 public TExecuteStatementReq(TSessionHandle sessionHandle, string statement) : this()
 {
     this.SessionHandle = sessionHandle;
     this.Statement     = statement;
 }
Example #18
0
 public TGetCatalogsReq(TSessionHandle sessionHandle) : this()
 {
     this.SessionHandle = sessionHandle;
 }
Example #19
0
 public TGetTypeInfoReq(TSessionHandle sessionHandle) : this()
 {
     this.SessionHandle = sessionHandle;
 }
Example #20
0
        public void Read(TProtocol iprot)
        {
            bool   isset_status = false;
            bool   isset_serverProtocolVersion = false;
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.Struct)
                    {
                        Status = new TStatus();
                        Status.Read(iprot);
                        isset_status = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.I32)
                    {
                        ServerProtocolVersion       = (TProtocolVersion)iprot.ReadI32();
                        isset_serverProtocolVersion = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Struct)
                    {
                        SessionHandle = new TSessionHandle();
                        SessionHandle.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.Map)
                    {
                        {
                            Configuration = new Dictionary <string, string>();
                            TMap _map76 = iprot.ReadMapBegin();
                            for (int _i77 = 0; _i77 < _map76.Count; ++_i77)
                            {
                                string _key78;
                                string _val79;
                                _key78 = iprot.ReadString();
                                _val79 = iprot.ReadString();
                                Configuration[_key78] = _val79;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_status)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_serverProtocolVersion)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }