AddDataNode() public method

public AddDataNode ( int dataNodeIndex, int replica ) : void
dataNodeIndex int
replica int
return void
示例#1
0
        /// <exception cref="System.SqlSyntaxErrorException" />
        public override void Process(CobarHint hint, string hintName, string sql)
        {
            Pair <int, int> pair = null;

            if (CurrentChar(hint, sql) == '[')
            {
                for (;;)
                {
                    NextChar(hint, sql);
                    pair = ParseDataNode(hint, sql);
                    hint.AddDataNode(pair.Key, pair.Value);
                    switch (CurrentChar(hint, sql))
                    {
                    case ',':
                    {
                        continue;
                    }

                    case ']':
                    {
                        NextChar(hint, sql);
                        return;
                    }

                    default:
                    {
                        throw new SqlSyntaxErrorException("err for dataNodeId: " + sql);
                    }
                    }
                }
            }
            pair = ParseDataNode(hint, sql);
            hint.AddDataNode(pair.Key, pair.Value);
        }
        /// <exception cref="System.SqlSyntaxErrorException" />
        public override void Process(CobarHint hint, string hintName, string sql)
        {
            Pair<int, int> pair = null;
            if (CurrentChar(hint, sql) == '[')
            {
                for (;;)
                {
                    NextChar(hint, sql);
                    pair = ParseDataNode(hint, sql);
                    hint.AddDataNode(pair.Key, pair.Value);
                    switch (CurrentChar(hint, sql))
                    {
                        case ',':
                        {
                            continue;
                        }

                        case ']':
                        {
                            NextChar(hint, sql);
                            return;
                        }

                        default:
                        {
                            throw new SqlSyntaxErrorException("err for dataNodeId: " + sql);
                        }
                    }
                }
            }
            pair = ParseDataNode(hint, sql);
            hint.AddDataNode(pair.Key, pair.Value);
        }