Ejemplo n.º 1
0
        public QueryResult Parse(Select select, Hubble.Core.Data.DBProvider dbProvider,
                                 Service.ConnectionInformation connInfo)
        {
            BigTable bigTable = dbProvider.BigTableCfg;

            //if (!string.IsNullOrEmpty(tc.ConnectString))
            //{
            //    throw new ParseException("Free version does not provider distributable BigTable. You should use HubblePro for it");
            //}

            if (bigTable.Tablets.Count <= 0)
            {
                throw new ParseException("The Bigtable must have at least one table in table collection");
            }

            List <Select> unionSelect = new List <Select>();

            foreach (TabletInfo tf in bigTable.Tablets)
            {
                string tableName = tf.TableName;
                Select sel       = select.Clone();
                sel.SelectFroms[0].Name  = tableName;
                sel.SelectFroms[0].Alias = tableName;

                unionSelect.Add(sel);
            }

            string      unionSelectTableName;
            string      tableTicksReturn = null;
            QueryResult datacacheQuery   = null;

            List <QueryResult> unionQueryResult = _SFQLParse.UnionSelectDistribute(connInfo, unionSelect,
                                                                                   out unionSelectTableName, out tableTicksReturn, out datacacheQuery);

            if (datacacheQuery != null)
            {
                return(datacacheQuery);
            }

            return(SFQLParse.ExcuteUnionSelect(unionSelectTableName, tableTicksReturn,
                                               unionQueryResult, connInfo));
        }
Ejemplo n.º 2
0
        public BigTable Clone()
        {
            BigTable bigTable = new BigTable();

            bigTable.TimeStamp = this.TimeStamp;

            bigTable.ExecuteTimeout = this.ExecuteTimeout;

            bigTable.KeepDataIntegrity = this.KeepDataIntegrity;

            foreach (TabletInfo tabletInfo in Tablets)
            {
                bigTable.Tablets.Add(tabletInfo.Clone());
            }

            foreach (ServerInfo serverInfo in ServerList)
            {
                bigTable.ServerList.Add(serverInfo.Clone());
            }

            return(bigTable);
        }