예제 #1
0
        public override void UnionFromClientHandler(UnionMessageReader request, UnionResponseWriter response)
        {
            idDict.Clear();
            List <List <List <long> > > classify = Classify(request.cellidsB, null);

            for (int i = 0; i < Global.ServerCount; i++)
            {
                UnionMessageWriter msg = new UnionMessageWriter(request.cellidsA, classify[i]);
                Global.CloudStorage.UnionFromProxyToDatabaseServer(i, msg);
            }
            sem.WaitOne();
            for (int i = 0; i < Global.ServerCount; i++)
            {
                response.cellids.AddRange(idDict[i]);
            }
        }
예제 #2
0
파일: Table.cs 프로젝트: zoukaifa/TriSQL
        /// <summary>
        /// union distinct 假设重复是由两表合并引起的
        /// </summary>
        /// <param name="anotherTable"></param>
        /// <returns>this</returns>
        public Table union_distinct(Table anotherTable)
        {
            for (int i = 0; i < columnNames.Count; i++)
            {
                if (!columnNames[i].Equals(anotherTable.columnNames[i]))
                {
                    throw new Exception("两表无并相容性");
                }
            }
            if (anotherTable.cellIds.Count == 0)
            {
                throw new Exception("anotherTable不能为空");
            }
            UnionMessageWriter  msg  = new UnionMessageWriter(this.cellIds, anotherTable.cellIds);
            List <List <long> > temp = Global.CloudStorage.UnionFromClientToDatabaseProxy(0, msg).cellids;

            this.cellIds.AddRange(temp);
            return(this);
        }