From 7762b8b46bb9efa4bb3a8b2c53d031aa5a5d6c3a Mon Sep 17 00:00:00 2001 From: winkyao Date: Mon, 17 Jul 2017 11:13:25 +0800 Subject: [PATCH 01/26] expression: handle int builtinUnaryOpSig overflow --- executor/executor_test.go | 4 ++++ expression/builtin_op.go | 21 ++++++++++++++++++++- expression/constant_fold.go | 6 ++++++ expression/scalar_function.go | 12 +++++++++--- 4 files changed, 39 insertions(+), 4 deletions(-) diff --git a/executor/executor_test.go b/executor/executor_test.go index e38f59a38f77f..7784b0b3a60b0 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -1034,6 +1034,10 @@ func (s *testSuite) TestBuiltin(c *C) { result = tk.MustQuery("select cast(a as signed) from t") result.Check(testkit.Rows("130000")) + // fixed issue #3762 + result = tk.MustQuery("select -9223372036854775809;") + result.Check(testkit.Rows("-9223372036854775809")) + // test unhex and hex result = tk.MustQuery("select unhex('4D7953514C')") result.Check(testkit.Rows("MySQL")) diff --git a/expression/builtin_op.go b/expression/builtin_op.go index c0973fa0431f5..e1e2b81d66d2e 100644 --- a/expression/builtin_op.go +++ b/expression/builtin_op.go @@ -14,9 +14,14 @@ package expression import ( + "math" + + "fmt" + "github.com/juju/errors" "github.com/pingcap/tidb/context" "github.com/pingcap/tidb/parser/opcode" + "github.com/pingcap/tidb/util/hack" "github.com/pingcap/tidb/util/types" ) @@ -353,7 +358,21 @@ func (b *builtinUnaryOpSig) eval(row []types.Datum) (d types.Datum, err error) { case types.KindInt64: d.SetInt64(-aDatum.GetInt64()) case types.KindUint64: - d.SetInt64(-int64(aDatum.GetUint64())) + // consider overflow, MySQL will convert it to Decimal when overflow occurred + uval := aDatum.GetUint64() + minInt64 := math.MinInt64 + absMinInt64 := uint64(-minInt64) // 9223372036854775808 + if uval > absMinInt64 { + // -uval will overflow + dval := new(types.MyDecimal) + sval := fmt.Sprintf("-%v", uval) + dval.FromString(hack.Slice(sval)) + d.SetMysqlDecimal(dval) + types.DefaultTypeForValue(dval, b.tp) + // err = types.ErrOverflow.GenByArgs("BIGINT", fmt.Sprintf("-%v", uval)) + } else { + d.SetInt64(-int64(uval)) + } case types.KindFloat64: d.SetFloat64(-aDatum.GetFloat64()) case types.KindFloat32: diff --git a/expression/constant_fold.go b/expression/constant_fold.go index cbc13084ef2a2..371ce6e0fd720 100644 --- a/expression/constant_fold.go +++ b/expression/constant_fold.go @@ -15,6 +15,7 @@ package expression import ( "github.com/ngaut/log" + "github.com/pingcap/tidb/mysql" ) // FoldConstant does constant folding optimization on an expression. @@ -40,6 +41,11 @@ func FoldConstant(expr Expression) Expression { log.Warnf("There may exist an error during constant folding. The function name is %s, args are %s", scalarFunc.FuncName, args) return expr } + + // TODO: retType maybe changed after function executed + if builtinRetTp := scalarFunc.Function.getRetTp(); builtinRetTp.Tp != mysql.TypeUnspecified { + scalarFunc.RetType = builtinRetTp + } return &Constant{ Value: value, RetType: scalarFunc.RetType, diff --git a/expression/scalar_function.go b/expression/scalar_function.go index 95869cfa1960c..d11c12f799dd2 100644 --- a/expression/scalar_function.go +++ b/expression/scalar_function.go @@ -23,6 +23,7 @@ import ( "github.com/pingcap/tidb/model" "github.com/pingcap/tidb/mysql" "github.com/pingcap/tidb/sessionctx/variable" + "github.com/pingcap/tidb/terror" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/types" ) @@ -172,10 +173,15 @@ func (sf *ScalarFunction) Eval(row []types.Datum) (d types.Datum, err error) { case types.ClassInt: var intRes int64 intRes, isNull, err = sf.EvalInt(row, sc) - if mysql.HasUnsignedFlag(tp.Flag) { - res = uint64(intRes) + if err != nil && terror.ErrorEqual(err, types.ErrOverflow) && !sc.InUpdateOrDeleteStmt { + // TODO: overflow convert it to decimal + } else { - res = intRes + if mysql.HasUnsignedFlag(tp.Flag) { + res = uint64(intRes) + } else { + res = intRes + } } case types.ClassReal: res, isNull, err = sf.EvalReal(row, sc) From f87e0afcc0e4420829f4b7412c16d86142789c2c Mon Sep 17 00:00:00 2001 From: winkyao Date: Mon, 17 Jul 2017 17:49:27 +0800 Subject: [PATCH 02/26] expression: fix #3762, signed integer overflow handle in minus unary scalar function --- executor/executor_test.go | 2 ++ expression/builtin_op.go | 9 +----- expression/constant_fold.go | 5 ---- expression/scalar_function.go | 53 +++++++++++++++++++++++++++++------ 4 files changed, 47 insertions(+), 22 deletions(-) diff --git a/executor/executor_test.go b/executor/executor_test.go index 7784b0b3a60b0..45644db6d40c9 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -1037,6 +1037,8 @@ func (s *testSuite) TestBuiltin(c *C) { // fixed issue #3762 result = tk.MustQuery("select -9223372036854775809;") result.Check(testkit.Rows("-9223372036854775809")) + result = tk.MustQuery("select -9223372036854775808;") + result.Check(testkit.Rows("-9223372036854775808")) // test unhex and hex result = tk.MustQuery("select unhex('4D7953514C')") diff --git a/expression/builtin_op.go b/expression/builtin_op.go index e1e2b81d66d2e..1368cae61c041 100644 --- a/expression/builtin_op.go +++ b/expression/builtin_op.go @@ -21,7 +21,6 @@ import ( "github.com/juju/errors" "github.com/pingcap/tidb/context" "github.com/pingcap/tidb/parser/opcode" - "github.com/pingcap/tidb/util/hack" "github.com/pingcap/tidb/util/types" ) @@ -358,18 +357,12 @@ func (b *builtinUnaryOpSig) eval(row []types.Datum) (d types.Datum, err error) { case types.KindInt64: d.SetInt64(-aDatum.GetInt64()) case types.KindUint64: - // consider overflow, MySQL will convert it to Decimal when overflow occurred uval := aDatum.GetUint64() minInt64 := math.MinInt64 absMinInt64 := uint64(-minInt64) // 9223372036854775808 if uval > absMinInt64 { // -uval will overflow - dval := new(types.MyDecimal) - sval := fmt.Sprintf("-%v", uval) - dval.FromString(hack.Slice(sval)) - d.SetMysqlDecimal(dval) - types.DefaultTypeForValue(dval, b.tp) - // err = types.ErrOverflow.GenByArgs("BIGINT", fmt.Sprintf("-%v", uval)) + err = types.ErrOverflow.GenByArgs("BIGINT", fmt.Sprintf("-%v", uval)) } else { d.SetInt64(-int64(uval)) } diff --git a/expression/constant_fold.go b/expression/constant_fold.go index 371ce6e0fd720..a1fbcf0315290 100644 --- a/expression/constant_fold.go +++ b/expression/constant_fold.go @@ -15,7 +15,6 @@ package expression import ( "github.com/ngaut/log" - "github.com/pingcap/tidb/mysql" ) // FoldConstant does constant folding optimization on an expression. @@ -42,10 +41,6 @@ func FoldConstant(expr Expression) Expression { return expr } - // TODO: retType maybe changed after function executed - if builtinRetTp := scalarFunc.Function.getRetTp(); builtinRetTp.Tp != mysql.TypeUnspecified { - scalarFunc.RetType = builtinRetTp - } return &Constant{ Value: value, RetType: scalarFunc.RetType, diff --git a/expression/scalar_function.go b/expression/scalar_function.go index d11c12f799dd2..31c0e52ed769e 100644 --- a/expression/scalar_function.go +++ b/expression/scalar_function.go @@ -158,12 +158,39 @@ func (sf *ScalarFunction) Decorrelate(schema *Schema) Expression { return sf } +func (sf *ScalarFunction) convertArgsToDecimal(sc *variable.StatementContext) error { + ft := types.NewFieldType(mysql.TypeNewDecimal) + for _, arg := range sf.GetArgs() { + if constArg, ok := arg.(*Constant); ok { + val, err := constArg.Value.ConvertTo(sc, ft) + if err != nil { + return err + } + constArg.Value = val + } + } + + return nil +} + // Eval implements Expression interface. func (sf *ScalarFunction) Eval(row []types.Datum) (d types.Datum, err error) { + sc := sf.GetCtx().GetSessionVars().StmtCtx if !TurnOnNewExprEval { - return sf.Function.eval(row) + d, err = sf.Function.eval(row) + // TODO: fix #3762, maybe better way + if err != nil && terror.ErrorEqual(err, types.ErrOverflow) && sf.GetTypeClass() == types.ClassInt && + sf.FuncName.L == ast.UnaryMinus && !sc.InUpdateOrDeleteStmt { + err = sf.convertArgsToDecimal(sc) + if err != nil { + return d, errors.Trace(err) + } + d, err = sf.Function.eval(row) + // change return type + types.DefaultTypeForValue(d, sf.RetType) + } + return } - sc := sf.GetCtx().GetSessionVars().StmtCtx var ( res interface{} isNull bool @@ -173,15 +200,11 @@ func (sf *ScalarFunction) Eval(row []types.Datum) (d types.Datum, err error) { case types.ClassInt: var intRes int64 intRes, isNull, err = sf.EvalInt(row, sc) - if err != nil && terror.ErrorEqual(err, types.ErrOverflow) && !sc.InUpdateOrDeleteStmt { - // TODO: overflow convert it to decimal + if mysql.HasUnsignedFlag(tp.Flag) { + res = uint64(intRes) } else { - if mysql.HasUnsignedFlag(tp.Flag) { - res = uint64(intRes) - } else { - res = intRes - } + res = intRes } case types.ClassReal: res, isNull, err = sf.EvalReal(row, sc) @@ -197,6 +220,18 @@ func (sf *ScalarFunction) Eval(row []types.Datum) (d types.Datum, err error) { res, isNull, err = sf.EvalString(row, sc) } } + + if err != nil && terror.ErrorEqual(err, types.ErrOverflow) && + sf.FuncName.L == ast.UnaryMinus && !sc.InUpdateOrDeleteStmt { + // TODO: fix #3762, overflow convert it to decimal + err = sf.convertArgsToDecimal(sc) + if err != nil { + return d, errors.Trace(err) + } + res, isNull, err = sf.EvalDecimal(row, sc) + types.DefaultTypeForValue(res, sf.RetType) + } + if isNull || err != nil { d.SetValue(nil) return d, errors.Trace(err) From 465dd1b678c7ae41a116e3c07c3061c097ca1c56 Mon Sep 17 00:00:00 2001 From: winkyao Date: Mon, 17 Jul 2017 17:52:39 +0800 Subject: [PATCH 03/26] expression: fix #3762, add builtin_op_test.go, some builtin test cases --- expression/builtin_op_test.go | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 expression/builtin_op_test.go diff --git a/expression/builtin_op_test.go b/expression/builtin_op_test.go new file mode 100644 index 0000000000000..16fe744a79876 --- /dev/null +++ b/expression/builtin_op_test.go @@ -0,0 +1,54 @@ +// Copyright 2015 PingCAP, Inc. +// +// Licensed 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, +// See the License for the specific language governing permissions and +// limitations under the License. + +package expression + +import ( + . "github.com/pingcap/check" + "github.com/pingcap/tidb/ast" + "github.com/pingcap/tidb/mysql" + "github.com/pingcap/tidb/util/testleak" +) + +func (s *testEvaluatorSuite) TestUnary(c *C) { + defer testleak.AfterTest(c)() + cases := []struct { + args interface{} + expected interface{} + expectedType byte + overflow bool + getErr bool + }{ + {uint64(9223372036854775809), "-9223372036854775809", mysql.TypeNewDecimal, true, false}, + {uint64(9223372036854775810), "-9223372036854775810", mysql.TypeNewDecimal, true, false}, + {uint64(9223372036854775808), "-9223372036854775808", mysql.TypeLonglong, false, false}, + } + + for _, t := range cases { + f, err := newFunctionForTest(s.ctx, ast.UnaryMinus, primitiveValsToConstants([]interface{}{t.args})...) + + c.Assert(err, IsNil) + d, err := f.Eval(nil) + if t.getErr { + c.Assert(err, NotNil) + } else { + c.Assert(err, IsNil) + if !t.overflow { + c.Assert(d.GetString(), Equals, t.expected) + } else { + c.Assert(d.GetMysqlDecimal().String(), Equals, t.expected) + c.Assert(f.GetType().Tp, Equals, t.expectedType) + } + } + } +} From 17f1e5f0dec5497e017b476123adb4848c802e18 Mon Sep 17 00:00:00 2001 From: winkyao Date: Mon, 17 Jul 2017 18:03:25 +0800 Subject: [PATCH 04/26] *: tiny cleanup --- expression/builtin_op.go | 3 +-- expression/builtin_op_test.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/expression/builtin_op.go b/expression/builtin_op.go index 1368cae61c041..862d4080ec33b 100644 --- a/expression/builtin_op.go +++ b/expression/builtin_op.go @@ -14,9 +14,8 @@ package expression import ( - "math" - "fmt" + "math" "github.com/juju/errors" "github.com/pingcap/tidb/context" diff --git a/expression/builtin_op_test.go b/expression/builtin_op_test.go index 16fe744a79876..e0cff685d33b8 100644 --- a/expression/builtin_op_test.go +++ b/expression/builtin_op_test.go @@ -1,4 +1,4 @@ -// Copyright 2015 PingCAP, Inc. +// Copyright 2017 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 5589c9e9fffae56d290f05762a7fdc202e8795ae Mon Sep 17 00:00:00 2001 From: winkyao Date: Mon, 17 Jul 2017 18:06:48 +0800 Subject: [PATCH 05/26] expression: fix #3691, builtin CAST func compatibilities, partially solved --- executor/executor_test.go | 39 +++++++++++++++ expression/builtin_cast.go | 85 +++++++++++++++++++++++++++------ expression/builtin_cast_test.go | 39 +++++++++++++++ expression/builtin_op.go | 1 + parser/parser.y | 1 + util/types/convert.go | 1 + util/types/errors.go | 30 ++++++++---- 7 files changed, 173 insertions(+), 23 deletions(-) diff --git a/executor/executor_test.go b/executor/executor_test.go index 94ddde88abfd6..e0c69991ee0a4 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -999,6 +999,44 @@ func (s *testSuite) TestBuiltin(c *C) { result.Check(testkit.Rows("3 2")) result = tk.MustQuery("select cast(-1 as unsigned)") result.Check(testkit.Rows("18446744073709551615")) + result = tk.MustQuery("select cast(1 as signed int)") + result.Check(testkit.Rows("1")) + result = tk.MustQuery("select cast('18446744073709551616' as unsigned);") + result.Check(testkit.Rows("18446744073709551615")) + result = tk.MustQuery("select cast('18446744073709551615' as signed);") + result.Check(testkit.Rows("-1")) + result = tk.MustQuery("select cast('18446744073709551614' as signed);") + result.Check(testkit.Rows("-2")) + result = tk.MustQuery("select cast(18446744073709551615 as unsigned);") + result.Check(testkit.Rows("18446744073709551615")) + result = tk.MustQuery("select cast(18446744073709551616 as unsigned);") + result.Check(testkit.Rows("18446744073709551615")) + result = tk.MustQuery("select cast(18446744073709551616 as signed);") + result.Check(testkit.Rows("9223372036854775807")) + result = tk.MustQuery("select cast(18446744073709551617 as signed);") + result.Check(testkit.Rows("9223372036854775807")) + result = tk.MustQuery("select cast(18446744073709551615 as signed);") + result.Check(testkit.Rows("-1")) + result = tk.MustQuery("select cast(18446744073709551614 as signed);") + result.Check(testkit.Rows("-2")) + result = tk.MustQuery("select cast(-18446744073709551616 as signed);") + result.Check(testkit.Rows("-9223372036854775808")) + result = tk.MustQuery("select cast(18446744073709551614.9 as unsigned);") // Round up + result.Check(testkit.Rows("18446744073709551615")) + result = tk.MustQuery("select cast(18446744073709551614.4 as unsigned);") // Round down + result.Check(testkit.Rows("18446744073709551614")) + + // TODO: not pass yet + result = tk.MustQuery("select cast(-9223372036854775809 as signed);") + result.Check(testkit.Rows("-9223372036854775808")) + result = tk.MustQuery("select cast(-9223372036854775809 as unsigned);") + result.Check(testkit.Rows("0")) + result = tk.MustQuery("select cast(-9223372036854775808 as unsigned);") + result.Check(testkit.Rows("9223372036854775808")) + result = tk.MustQuery("select cast('-9223372036854775809' as unsigned);") + result.Check(testkit.Rows("9223372036854775808")) + result = tk.MustQuery("select cast('-2' as unsigned);") + result.Check(testkit.Rows("18446744073709551614")) // fixed issue #3471 tk.MustExec("drop table if exists t") @@ -1984,3 +2022,4 @@ func (s *testSuite) TestFuncREPEAT(c *C) { r = tk.MustQuery("SELECT REPEAT(a, 16777217), REPEAT(b, 16777217), REPEAT(c, 16777217), REPEAT(d, 16777217), REPEAT(e, 16777217), REPEAT(f, 16777217) FROM table_string;") r.Check(testkit.Rows(" ")) } +`` \ No newline at end of file diff --git a/expression/builtin_cast.go b/expression/builtin_cast.go index 134c9befb1a99..cee84d4869bb7 100644 --- a/expression/builtin_cast.go +++ b/expression/builtin_cast.go @@ -23,12 +23,16 @@ package expression import ( "strconv" + "strings" + + "math" "github.com/juju/errors" "github.com/pingcap/tidb/ast" "github.com/pingcap/tidb/context" "github.com/pingcap/tidb/model" "github.com/pingcap/tidb/mysql" + "github.com/pingcap/tidb/terror" "github.com/pingcap/tidb/util/charset" "github.com/pingcap/tidb/util/types" ) @@ -542,22 +546,28 @@ func (b *builtinCastDecimalAsIntSig) evalInt(row []types.Datum) (res int64, isNu if isNull || err != nil { return res, isNull, errors.Trace(err) } + + // despite of unsigned or signed, Round is need + var to types.MyDecimal + val.Round(&to, 0, types.ModeHalfEven) + if mysql.HasUnsignedFlag(b.tp.Flag) { - var ( - floatVal float64 - uintRes uint64 - ) - floatVal, err = val.ToFloat64() - if err != nil { - return res, false, errors.Trace(err) - } - uintRes, err = types.ConvertFloatToUint(sc, floatVal, types.UnsignedUpperBound[mysql.TypeLonglong], mysql.TypeDouble) - res = int64(uintRes) + var ures uint64 + ures, err = to.ToUint() + res = int64(ures) } else { - var to types.MyDecimal - val.Round(&to, 0, types.ModeHalfEven) res, err = to.ToInt() } + + // see https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-strict + // said "For statements such as SELECT that do not change data, invalid values + // generate a warning in strict mode, not an error." + // and and https://dev.mysql.com/doc/refman/5.7/en/out-of-range-and-overflow.html + if terror.ErrorEqual(err, types.ErrOverflow) { + err = nil + sc.AppendWarning(types.ErrTruncatedWrongVal.GenByArgs("DECIMAL", val)) + } + return res, false, errors.Trace(err) } @@ -645,13 +655,60 @@ func (b *builtinCastStringAsIntSig) evalInt(row []types.Datum) (res int64, isNul if isNull || err != nil { return res, isNull, errors.Trace(err) } + + val = strings.TrimSpace(val) + isNegative := false + if len(val) > 1 && val[0] == '-' { // negative number + isNegative = true + } if mysql.HasUnsignedFlag(b.tp.Flag) { var ures uint64 - ures, err = types.StrToUint(sc, val) - res = int64(ures) + if isNegative { + res, err = types.StrToInt(sc, val) + } else { + ures, err = types.StrToUint(sc, val) + res = int64(ures) + } } else { res, err = types.StrToInt(sc, val) } + + // see https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-strict + // said "For statements such as SELECT that do not change data, invalid values + // generate a warning in strict mode, not an error." + // and and https://dev.mysql.com/doc/refman/5.7/en/out-of-range-and-overflow.html + if terror.ErrorEqual(err, types.ErrOverflow) { + err = nil + if mysql.HasUnsignedFlag(b.tp.Flag) { + if isNegative { + var ures uint64 + res = math.MinInt64 + ures = uint64(-res) + res = int64(ures) + } else { + var ures uint64 + ures = math.MaxUint64 + res = int64(ures) + } + sc.AppendWarning(types.ErrTruncatedWrongVal.GenByArgs("INTEGER", val)) + } else { + // signed overflow will be handled in two case: + // 1. the number is overflow uint64, so it will truncate to math.MaxUint64 + // and convert to it's negative complement + // 2. the number is overflow int64, but is a valid uint64 range, just convert to + // it's negative complement + var ures uint64 + ures, err1 := types.StrToUint(sc, val) + if terror.ErrorEqual(err1, types.ErrOverflow) { + ures = math.MaxUint64 + sc.AppendWarning(types.ErrTruncatedWrongVal.GenByArgs("INTEGER", val)) + } else { + sc.AppendWarning(types.ErrCastSignedOverflow) + } + res = int64(ures) + } + } + return res, false, errors.Trace(err) } diff --git a/expression/builtin_cast_test.go b/expression/builtin_cast_test.go index c574d55c40691..255ae65bd6f2f 100644 --- a/expression/builtin_cast_test.go +++ b/expression/builtin_cast_test.go @@ -21,6 +21,7 @@ import ( . "github.com/pingcap/check" "github.com/pingcap/tidb/mysql" + "github.com/pingcap/tidb/terror" "github.com/pingcap/tidb/util/charset" "github.com/pingcap/tidb/util/testleak" "github.com/pingcap/tidb/util/types" @@ -74,6 +75,44 @@ func (s *testEvaluatorSuite) TestCast(c *C) { c.Assert(err, IsNil) c.Assert(len(res.GetString()), Equals, 5) c.Assert(res.GetString(), Equals, string([]byte{'a', 0x00, 0x00, 0x00, 0x00})) + + // cast('18446744073709551616' as unsigned); + tp1 := types.NewFieldType(mysql.TypeLonglong) + tp1.Flag |= mysql.UnsignedFlag + tp1.Flen = mysql.MaxIntWidth + tp1.Charset = charset.CharsetBin + tp1.Collate = charset.CollationBin + tp1.Flag |= mysql.BinaryFlag + f = NewCastFunc(tp1, &Constant{Value: types.NewDatum("18446744073709551616"), RetType: types.NewFieldType(mysql.TypeString)}, ctx) + res, err = f.Eval(nil) + c.Assert(err, IsNil) + c.Assert(res.GetUint64() == math.MaxUint64, IsTrue) + + warnings := sc.GetWarnings() + lastWarn := warnings[len(warnings)-1] + c.Assert(terror.ErrorEqual(types.ErrTruncatedWrongVal, lastWarn), IsTrue) + + // cast('18446744073709551616' as signed); + mask := ^mysql.UnsignedFlag + tp1.Flag &= uint(mask) + f = NewCastFunc(tp1, &Constant{Value: types.NewDatum("18446744073709551616"), RetType: types.NewFieldType(mysql.TypeString)}, ctx) + res, err = f.Eval(nil) + c.Assert(err, IsNil) + c.Check(res.GetInt64(), Equals, int64(-1)) + + warnings = sc.GetWarnings() + lastWarn = warnings[len(warnings)-1] + c.Assert(terror.ErrorEqual(types.ErrTruncatedWrongVal, lastWarn), IsTrue) + + // cast('18446744073709551614' as signed); + f = NewCastFunc(tp1, &Constant{Value: types.NewDatum("18446744073709551614"), RetType: types.NewFieldType(mysql.TypeString)}, ctx) + res, err = f.Eval(nil) + c.Assert(err, IsNil) + c.Check(res.GetInt64(), Equals, int64(-2)) + + warnings = sc.GetWarnings() + lastWarn = warnings[len(warnings)-1] + c.Assert(terror.ErrorEqual(types.ErrCastSignedOverflow, lastWarn), IsTrue) } var ( diff --git a/expression/builtin_op.go b/expression/builtin_op.go index c0973fa0431f5..0c70041d8d678 100644 --- a/expression/builtin_op.go +++ b/expression/builtin_op.go @@ -353,6 +353,7 @@ func (b *builtinUnaryOpSig) eval(row []types.Datum) (d types.Datum, err error) { case types.KindInt64: d.SetInt64(-aDatum.GetInt64()) case types.KindUint64: + // TODO: aDatum.GetUint64() may overflow, MySQL convert it to decimal if overflow d.SetInt64(-int64(aDatum.GetUint64())) case types.KindFloat64: d.SetFloat64(-aDatum.GetFloat64()) diff --git a/parser/parser.y b/parser/parser.y index 113d53136952b..ee7ebf12438cf 100644 --- a/parser/parser.y +++ b/parser/parser.y @@ -5770,6 +5770,7 @@ IntegerType: OptInteger: {} | "INTEGER" +| "INT" FixedPointType: "DECIMAL" diff --git a/util/types/convert.go b/util/types/convert.go index b3569ba989ea9..1d60d9ae431e2 100644 --- a/util/types/convert.go +++ b/util/types/convert.go @@ -222,6 +222,7 @@ func floatStrToIntStr(validFloat string) (string, error) { if intCnt <= len(digits) { validInt = string(digits[:intCnt]) } else { + // convert scientific notation decimal number extraZeroCount := intCnt - len(digits) if extraZeroCount > 20 { // Return overflow to avoid allocating too much memory. diff --git a/util/types/errors.go b/util/types/errors.go index e7957f836ad6e..45a4a2ff03273 100644 --- a/util/types/errors.go +++ b/util/types/errors.go @@ -23,33 +23,45 @@ var ( ErrDataTooLong = terror.ClassTypes.New(codeDataTooLong, "Data Too Long") // ErrTruncated is returned when data has been truncated during conversion. ErrTruncated = terror.ClassTypes.New(codeTruncated, "Data Truncated") + // ErrTruncatedWrongVal is returned when data has been truncated during conversion. + ErrTruncatedWrongVal = terror.ClassTypes.New(codeTruncatedWrongValue, msgTruncatedWrongVal) // ErrOverflow is returned when data is out of range for a field type. ErrOverflow = terror.ClassTypes.New(codeOverflow, msgOverflow) // ErrDivByZero is return when do division by 0. ErrDivByZero = terror.ClassTypes.New(codeDivByZero, "Division by 0") // ErrBadNumber is return when parsing an invalid binary decimal number. ErrBadNumber = terror.ClassTypes.New(codeBadNumber, "Bad Number") + // ErrCastSignedOverflow is returned when positive out-of-range integer, and convert to it's negative complement + ErrCastSignedOverflow = terror.ClassTypes.New(codeCastSignedOverflow, msgCastSignedOverflow) ) const ( codeBadNumber terror.ErrCode = 1 - codeDataTooLong terror.ErrCode = terror.ErrCode(mysql.ErrDataTooLong) - codeTruncated terror.ErrCode = terror.ErrCode(mysql.WarnDataTruncated) - codeOverflow terror.ErrCode = terror.ErrCode(mysql.ErrDataOutOfRange) - codeDivByZero terror.ErrCode = terror.ErrCode(mysql.ErrDivisionByZero) + codeDataTooLong terror.ErrCode = terror.ErrCode(mysql.ErrDataTooLong) + codeTruncated terror.ErrCode = terror.ErrCode(mysql.WarnDataTruncated) + codeOverflow terror.ErrCode = terror.ErrCode(mysql.ErrDataOutOfRange) + codeDivByZero terror.ErrCode = terror.ErrCode(mysql.ErrDivisionByZero) + codeTruncatedWrongValue terror.ErrCode = terror.ErrCode(mysql.ErrTruncatedWrongValue) + + // warning caused by `select cast('18446744073709551614' as signed);` + codeCastSignedOverflow terror.ErrCode = terror.ErrCode(mysql.ErrUnknown) ) var ( - msgOverflow = mysql.MySQLErrName[mysql.ErrDataOutOfRange] + msgOverflow = mysql.MySQLErrName[mysql.ErrDataOutOfRange] + msgTruncatedWrongVal = mysql.MySQLErrName[mysql.ErrTruncatedWrongValue] + msgCastSignedOverflow = "Cast to signed converted positive out-of-range integer to it's negative complement" ) func init() { typesMySQLErrCodes := map[terror.ErrCode]uint16{ - codeDataTooLong: mysql.ErrDataTooLong, - codeTruncated: mysql.WarnDataTruncated, - codeOverflow: mysql.ErrDataOutOfRange, - codeDivByZero: mysql.ErrDivisionByZero, + codeDataTooLong: mysql.ErrDataTooLong, + codeTruncated: mysql.WarnDataTruncated, + codeOverflow: mysql.ErrDataOutOfRange, + codeDivByZero: mysql.ErrDivisionByZero, + codeTruncatedWrongValue: mysql.ErrTruncatedWrongValue, + codeCastSignedOverflow: mysql.ErrUnknown, } terror.ErrClassToMySQLCodes[terror.ClassTypes] = typesMySQLErrCodes } From c61fea123e978ff6d3de0d6184f5eb6d1723e0c9 Mon Sep 17 00:00:00 2001 From: winkyao Date: Mon, 17 Jul 2017 18:38:40 +0800 Subject: [PATCH 06/26] Squashed commit of the following: Merge branch winkyao/fix_issue_3762 into winkyao/cast_compability --- .../kvproto/pkg/coprocessor/coprocessor.pb.go | 3 +- .../pingcap/kvproto/pkg/eraftpb/eraftpb.pb.go | 73 +- .../pingcap/kvproto/pkg/errorpb/errorpb.pb.go | 3 +- .../pingcap/kvproto/pkg/kvrpcpb/kvrpcpb.pb.go | 4074 ++++++--- .../pingcap/kvproto/pkg/metapb/metapb.pb.go | 3 +- .../pingcap/kvproto/pkg/pdpb/pdpb.pb.go | 537 +- .../kvproto/pkg/raft_cmdpb/raft_cmdpb.pb.go | 7354 +++++++++++++++++ .../pkg/raft_serverpb/raft_serverpb.pb.go | 3 +- .../pingcap/kvproto/pkg/tikvpb/tikvpb.pb.go | 172 +- ast/dml.go | 1 + bootstrap.go | 1 + domain/schema_validator.go | 4 +- domain/schema_validator_test.go | 3 + executor/executor_test.go | 97 +- executor/set_test.go | 11 + executor/show.go | 68 +- executor/show_stats.go | 169 + executor/show_stats_test.go | 64 + executor/show_test.go | 31 - executor/write.go | 120 +- executor/write_test.go | 16 + expression/builtin_compare.go | 1012 ++- expression/builtin_compare_test.go | 71 + expression/builtin_control_test.go | 28 + expression/builtin_info_test.go | 45 + expression/builtin_math.go | 33 +- expression/builtin_math_test.go | 40 + expression/builtin_miscellaneous.go | 23 +- expression/builtin_miscellaneous_test.go | 16 +- expression/builtin_op.go | 14 +- expression/builtin_op_test.go | 54 + expression/builtin_other_test.go | 155 +- expression/builtin_string.go | 177 +- expression/builtin_string_test.go | 167 +- expression/constant_fold.go | 1 + expression/constant_test.go | 8 +- expression/scalar_function.go | 45 +- expression/schema.go | 9 + expression/util_test.go | 2 +- glide.lock | 2 +- glide.yaml | 2 +- parser/lexer.go | 6 +- parser/lexer_test.go | 12 +- parser/misc.go | 1 + parser/parser.y | 77 +- parser/parser_test.go | 24 +- plan/analyze_test.go | 20 +- plan/dag_plan_test.go | 29 +- plan/logical_plan_builder.go | 15 +- plan/logical_plan_test.go | 63 +- plan/new_physical_plan_builder.go | 153 +- plan/optimizer.go | 1 + plan/physical_plan_builder.go | 18 +- plan/physical_plan_test.go | 12 +- plan/physical_plans.go | 3 + plan/plan.go | 9 +- plan/planbuilder.go | 5 + plan/property_cols_prune.go | 7 +- plan/resolver.go | 5 + plan/stats.go | 121 +- plan/task.go | 104 +- plan/typeinfer_test.go | 7 + server/conn.go | 2 +- server/server_test.go | 4 +- server/tidb_test.go | 14 + session_test.go | 7 +- statistics/ddl_test.go | 2 +- statistics/selectivity.go | 39 +- statistics/statistics_test.go | 70 + store/tikv/client.go | 7 + store/tikv/mock-tikv/cluster.go | 9 +- store/tikv/mock-tikv/mvcc.go | 62 +- store/tikv/mock-tikv/rpc.go | 18 +- store/tikv/rawkv.go | 63 +- store/tikv/rawkv_test.go | 40 +- store/tikv/region_request_test.go | 9 + store/tikv/tikvrpc/tikvrpc.go | 13 + table/column.go | 2 + table/column_test.go | 4 + table/tables/tables_test.go | 2 +- tablecodec/tablecodec.go | 6 +- util/codec/decimal.go | 6 +- util/parser/expression_test.go | 9 + util/ranger/range_test.go | 11 +- util/types/convert_test.go | 5 +- util/types/datum.go | 23 +- 86 files changed, 13642 insertions(+), 2188 deletions(-) create mode 100644 _vendor/src/github.com/pingcap/kvproto/pkg/raft_cmdpb/raft_cmdpb.pb.go create mode 100644 executor/show_stats.go create mode 100644 executor/show_stats_test.go create mode 100644 expression/builtin_compare_test.go create mode 100644 expression/builtin_op_test.go diff --git a/_vendor/src/github.com/pingcap/kvproto/pkg/coprocessor/coprocessor.pb.go b/_vendor/src/github.com/pingcap/kvproto/pkg/coprocessor/coprocessor.pb.go index 9bad357732ed7..cb9c785ba1ed6 100644 --- a/_vendor/src/github.com/pingcap/kvproto/pkg/coprocessor/coprocessor.pb.go +++ b/_vendor/src/github.com/pingcap/kvproto/pkg/coprocessor/coprocessor.pb.go @@ -1,5 +1,6 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-gogo. // source: coprocessor.proto +// DO NOT EDIT! /* Package coprocessor is a generated protocol buffer package. diff --git a/_vendor/src/github.com/pingcap/kvproto/pkg/eraftpb/eraftpb.pb.go b/_vendor/src/github.com/pingcap/kvproto/pkg/eraftpb/eraftpb.pb.go index feccfb86e896a..9ff98fe0b581f 100644 --- a/_vendor/src/github.com/pingcap/kvproto/pkg/eraftpb/eraftpb.pb.go +++ b/_vendor/src/github.com/pingcap/kvproto/pkg/eraftpb/eraftpb.pb.go @@ -1,5 +1,6 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-gogo. // source: eraftpb.proto +// DO NOT EDIT! /* Package eraftpb is a generated protocol buffer package. @@ -1873,67 +1874,25 @@ func (m *ConfState) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEraftpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Nodes = append(m.Nodes, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEraftpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthEraftpb + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEraftpb } - postIndex := iNdEx + packedLen - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEraftpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Nodes = append(m.Nodes, v) + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) } + m.Nodes = append(m.Nodes, v) default: iNdEx = preIndex skippy, err := skipEraftpb(dAtA[iNdEx:]) diff --git a/_vendor/src/github.com/pingcap/kvproto/pkg/errorpb/errorpb.pb.go b/_vendor/src/github.com/pingcap/kvproto/pkg/errorpb/errorpb.pb.go index 2a3d16d867563..0fd66ab25a367 100644 --- a/_vendor/src/github.com/pingcap/kvproto/pkg/errorpb/errorpb.pb.go +++ b/_vendor/src/github.com/pingcap/kvproto/pkg/errorpb/errorpb.pb.go @@ -1,5 +1,6 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-gogo. // source: errorpb.proto +// DO NOT EDIT! /* Package errorpb is a generated protocol buffer package. diff --git a/_vendor/src/github.com/pingcap/kvproto/pkg/kvrpcpb/kvrpcpb.pb.go b/_vendor/src/github.com/pingcap/kvproto/pkg/kvrpcpb/kvrpcpb.pb.go index 09606d96931b0..777181a9da89a 100644 --- a/_vendor/src/github.com/pingcap/kvproto/pkg/kvrpcpb/kvrpcpb.pb.go +++ b/_vendor/src/github.com/pingcap/kvproto/pkg/kvrpcpb/kvrpcpb.pb.go @@ -1,5 +1,6 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-gogo. // source: kvrpcpb.proto +// DO NOT EDIT! /* Package kvrpcpb is a generated protocol buffer package. @@ -41,6 +42,15 @@ RawPutResponse RawDeleteRequest RawDeleteResponse + RawScanRequest + RawScanResponse + WriteInfo + ValueInfo + MvccInfo + MvccGetByKeyRequest + MvccGetByKeyResponse + MvccGetByStartTsRequest + MvccGetByStartTsResponse */ package kvrpcpb @@ -115,20 +125,23 @@ func (IsolationLevel) EnumDescriptor() ([]byte, []int) { return fileDescriptorKv type Op int32 const ( - Op_Put Op = 0 - Op_Del Op = 1 - Op_Lock Op = 2 + Op_Put Op = 0 + Op_Del Op = 1 + Op_Lock Op = 2 + Op_Rollback Op = 3 ) var Op_name = map[int32]string{ 0: "Put", 1: "Del", 2: "Lock", + 3: "Rollback", } var Op_value = map[string]int32{ - "Put": 0, - "Del": 1, - "Lock": 2, + "Put": 0, + "Del": 1, + "Lock": 2, + "Rollback": 3, } func (x Op) String() string { @@ -1154,6 +1167,278 @@ func (m *RawDeleteResponse) GetError() string { return "" } +type RawScanRequest struct { + Context *Context `protobuf:"bytes,1,opt,name=context" json:"context,omitempty"` + StartKey []byte `protobuf:"bytes,2,opt,name=start_key,json=startKey,proto3" json:"start_key,omitempty"` + Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (m *RawScanRequest) Reset() { *m = RawScanRequest{} } +func (m *RawScanRequest) String() string { return proto.CompactTextString(m) } +func (*RawScanRequest) ProtoMessage() {} +func (*RawScanRequest) Descriptor() ([]byte, []int) { return fileDescriptorKvrpcpb, []int{33} } + +func (m *RawScanRequest) GetContext() *Context { + if m != nil { + return m.Context + } + return nil +} + +func (m *RawScanRequest) GetStartKey() []byte { + if m != nil { + return m.StartKey + } + return nil +} + +func (m *RawScanRequest) GetLimit() uint32 { + if m != nil { + return m.Limit + } + return 0 +} + +type RawScanResponse struct { + RegionError *errorpb.Error `protobuf:"bytes,1,opt,name=region_error,json=regionError" json:"region_error,omitempty"` + Kvs []*KvPair `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"` +} + +func (m *RawScanResponse) Reset() { *m = RawScanResponse{} } +func (m *RawScanResponse) String() string { return proto.CompactTextString(m) } +func (*RawScanResponse) ProtoMessage() {} +func (*RawScanResponse) Descriptor() ([]byte, []int) { return fileDescriptorKvrpcpb, []int{34} } + +func (m *RawScanResponse) GetRegionError() *errorpb.Error { + if m != nil { + return m.RegionError + } + return nil +} + +func (m *RawScanResponse) GetKvs() []*KvPair { + if m != nil { + return m.Kvs + } + return nil +} + +type WriteInfo struct { + StartTs uint64 `protobuf:"varint,1,opt,name=start_ts,json=startTs,proto3" json:"start_ts,omitempty"` + Type Op `protobuf:"varint,2,opt,name=type,proto3,enum=kvrpcpb.Op" json:"type,omitempty"` + CommitTs uint64 `protobuf:"varint,3,opt,name=commit_ts,json=commitTs,proto3" json:"commit_ts,omitempty"` +} + +func (m *WriteInfo) Reset() { *m = WriteInfo{} } +func (m *WriteInfo) String() string { return proto.CompactTextString(m) } +func (*WriteInfo) ProtoMessage() {} +func (*WriteInfo) Descriptor() ([]byte, []int) { return fileDescriptorKvrpcpb, []int{35} } + +func (m *WriteInfo) GetStartTs() uint64 { + if m != nil { + return m.StartTs + } + return 0 +} + +func (m *WriteInfo) GetType() Op { + if m != nil { + return m.Type + } + return Op_Put +} + +func (m *WriteInfo) GetCommitTs() uint64 { + if m != nil { + return m.CommitTs + } + return 0 +} + +type ValueInfo struct { + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Ts uint64 `protobuf:"varint,2,opt,name=ts,proto3" json:"ts,omitempty"` + IsShortValue bool `protobuf:"varint,3,opt,name=is_short_value,json=isShortValue,proto3" json:"is_short_value,omitempty"` +} + +func (m *ValueInfo) Reset() { *m = ValueInfo{} } +func (m *ValueInfo) String() string { return proto.CompactTextString(m) } +func (*ValueInfo) ProtoMessage() {} +func (*ValueInfo) Descriptor() ([]byte, []int) { return fileDescriptorKvrpcpb, []int{36} } + +func (m *ValueInfo) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *ValueInfo) GetTs() uint64 { + if m != nil { + return m.Ts + } + return 0 +} + +func (m *ValueInfo) GetIsShortValue() bool { + if m != nil { + return m.IsShortValue + } + return false +} + +type MvccInfo struct { + Lock *LockInfo `protobuf:"bytes,1,opt,name=lock" json:"lock,omitempty"` + Writes []*WriteInfo `protobuf:"bytes,2,rep,name=writes" json:"writes,omitempty"` + Values []*ValueInfo `protobuf:"bytes,3,rep,name=values" json:"values,omitempty"` +} + +func (m *MvccInfo) Reset() { *m = MvccInfo{} } +func (m *MvccInfo) String() string { return proto.CompactTextString(m) } +func (*MvccInfo) ProtoMessage() {} +func (*MvccInfo) Descriptor() ([]byte, []int) { return fileDescriptorKvrpcpb, []int{37} } + +func (m *MvccInfo) GetLock() *LockInfo { + if m != nil { + return m.Lock + } + return nil +} + +func (m *MvccInfo) GetWrites() []*WriteInfo { + if m != nil { + return m.Writes + } + return nil +} + +func (m *MvccInfo) GetValues() []*ValueInfo { + if m != nil { + return m.Values + } + return nil +} + +type MvccGetByKeyRequest struct { + Context *Context `protobuf:"bytes,1,opt,name=context" json:"context,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` +} + +func (m *MvccGetByKeyRequest) Reset() { *m = MvccGetByKeyRequest{} } +func (m *MvccGetByKeyRequest) String() string { return proto.CompactTextString(m) } +func (*MvccGetByKeyRequest) ProtoMessage() {} +func (*MvccGetByKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptorKvrpcpb, []int{38} } + +func (m *MvccGetByKeyRequest) GetContext() *Context { + if m != nil { + return m.Context + } + return nil +} + +func (m *MvccGetByKeyRequest) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +type MvccGetByKeyResponse struct { + RegionError *errorpb.Error `protobuf:"bytes,1,opt,name=region_error,json=regionError" json:"region_error,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Info *MvccInfo `protobuf:"bytes,3,opt,name=info" json:"info,omitempty"` +} + +func (m *MvccGetByKeyResponse) Reset() { *m = MvccGetByKeyResponse{} } +func (m *MvccGetByKeyResponse) String() string { return proto.CompactTextString(m) } +func (*MvccGetByKeyResponse) ProtoMessage() {} +func (*MvccGetByKeyResponse) Descriptor() ([]byte, []int) { return fileDescriptorKvrpcpb, []int{39} } + +func (m *MvccGetByKeyResponse) GetRegionError() *errorpb.Error { + if m != nil { + return m.RegionError + } + return nil +} + +func (m *MvccGetByKeyResponse) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +func (m *MvccGetByKeyResponse) GetInfo() *MvccInfo { + if m != nil { + return m.Info + } + return nil +} + +type MvccGetByStartTsRequest struct { + Context *Context `protobuf:"bytes,1,opt,name=context" json:"context,omitempty"` + StartTs uint64 `protobuf:"varint,2,opt,name=start_ts,json=startTs,proto3" json:"start_ts,omitempty"` +} + +func (m *MvccGetByStartTsRequest) Reset() { *m = MvccGetByStartTsRequest{} } +func (m *MvccGetByStartTsRequest) String() string { return proto.CompactTextString(m) } +func (*MvccGetByStartTsRequest) ProtoMessage() {} +func (*MvccGetByStartTsRequest) Descriptor() ([]byte, []int) { return fileDescriptorKvrpcpb, []int{40} } + +func (m *MvccGetByStartTsRequest) GetContext() *Context { + if m != nil { + return m.Context + } + return nil +} + +func (m *MvccGetByStartTsRequest) GetStartTs() uint64 { + if m != nil { + return m.StartTs + } + return 0 +} + +type MvccGetByStartTsResponse struct { + RegionError *errorpb.Error `protobuf:"bytes,1,opt,name=region_error,json=regionError" json:"region_error,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Info *MvccInfo `protobuf:"bytes,4,opt,name=info" json:"info,omitempty"` +} + +func (m *MvccGetByStartTsResponse) Reset() { *m = MvccGetByStartTsResponse{} } +func (m *MvccGetByStartTsResponse) String() string { return proto.CompactTextString(m) } +func (*MvccGetByStartTsResponse) ProtoMessage() {} +func (*MvccGetByStartTsResponse) Descriptor() ([]byte, []int) { return fileDescriptorKvrpcpb, []int{41} } + +func (m *MvccGetByStartTsResponse) GetRegionError() *errorpb.Error { + if m != nil { + return m.RegionError + } + return nil +} + +func (m *MvccGetByStartTsResponse) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +func (m *MvccGetByStartTsResponse) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *MvccGetByStartTsResponse) GetInfo() *MvccInfo { + if m != nil { + return m.Info + } + return nil +} + func init() { proto.RegisterType((*LockInfo)(nil), "kvrpcpb.LockInfo") proto.RegisterType((*KeyError)(nil), "kvrpcpb.KeyError") @@ -1188,6 +1473,15 @@ func init() { proto.RegisterType((*RawPutResponse)(nil), "kvrpcpb.RawPutResponse") proto.RegisterType((*RawDeleteRequest)(nil), "kvrpcpb.RawDeleteRequest") proto.RegisterType((*RawDeleteResponse)(nil), "kvrpcpb.RawDeleteResponse") + proto.RegisterType((*RawScanRequest)(nil), "kvrpcpb.RawScanRequest") + proto.RegisterType((*RawScanResponse)(nil), "kvrpcpb.RawScanResponse") + proto.RegisterType((*WriteInfo)(nil), "kvrpcpb.WriteInfo") + proto.RegisterType((*ValueInfo)(nil), "kvrpcpb.ValueInfo") + proto.RegisterType((*MvccInfo)(nil), "kvrpcpb.MvccInfo") + proto.RegisterType((*MvccGetByKeyRequest)(nil), "kvrpcpb.MvccGetByKeyRequest") + proto.RegisterType((*MvccGetByKeyResponse)(nil), "kvrpcpb.MvccGetByKeyResponse") + proto.RegisterType((*MvccGetByStartTsRequest)(nil), "kvrpcpb.MvccGetByStartTsRequest") + proto.RegisterType((*MvccGetByStartTsResponse)(nil), "kvrpcpb.MvccGetByStartTsResponse") proto.RegisterEnum("kvrpcpb.CommandPri", CommandPri_name, CommandPri_value) proto.RegisterEnum("kvrpcpb.IsolationLevel", IsolationLevel_name, IsolationLevel_value) proto.RegisterEnum("kvrpcpb.Op", Op_name, Op_value) @@ -2529,214 +2823,578 @@ func (m *RawDeleteResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func encodeFixed64Kvrpcpb(dAtA []byte, offset int, v uint64) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - dAtA[offset+4] = uint8(v >> 32) - dAtA[offset+5] = uint8(v >> 40) - dAtA[offset+6] = uint8(v >> 48) - dAtA[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Kvrpcpb(dAtA []byte, offset int, v uint32) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintKvrpcpb(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *RawScanRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return offset + 1 + return dAtA[:n], nil } -func (m *LockInfo) Size() (n int) { + +func (m *RawScanRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - l = len(m.PrimaryLock) - if l > 0 { - n += 1 + l + sovKvrpcpb(uint64(l)) + if m.Context != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.Context.Size())) + n39, err := m.Context.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n39 } - if m.LockVersion != 0 { - n += 1 + sovKvrpcpb(uint64(m.LockVersion)) + if len(m.StartKey) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(len(m.StartKey))) + i += copy(dAtA[i:], m.StartKey) } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKvrpcpb(uint64(l)) + if m.Limit != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.Limit)) } - if m.LockTtl != 0 { - n += 1 + sovKvrpcpb(uint64(m.LockTtl)) + return i, nil +} + +func (m *RawScanResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *KeyError) Size() (n int) { +func (m *RawScanResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Locked != nil { - l = m.Locked.Size() - n += 1 + l + sovKvrpcpb(uint64(l)) - } - l = len(m.Retryable) - if l > 0 { - n += 1 + l + sovKvrpcpb(uint64(l)) + if m.RegionError != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.RegionError.Size())) + n40, err := m.RegionError.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n40 } - l = len(m.Abort) - if l > 0 { - n += 1 + l + sovKvrpcpb(uint64(l)) + if len(m.Kvs) > 0 { + for _, msg := range m.Kvs { + dAtA[i] = 0x12 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - return n + return i, nil } -func (m *Context) Size() (n int) { +func (m *WriteInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WriteInfo) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.RegionId != 0 { - n += 1 + sovKvrpcpb(uint64(m.RegionId)) - } - if m.RegionEpoch != nil { - l = m.RegionEpoch.Size() - n += 1 + l + sovKvrpcpb(uint64(l)) - } - if m.Peer != nil { - l = m.Peer.Size() - n += 1 + l + sovKvrpcpb(uint64(l)) + if m.StartTs != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.StartTs)) } - if m.Term != 0 { - n += 1 + sovKvrpcpb(uint64(m.Term)) + if m.Type != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.Type)) } - if m.Priority != 0 { - n += 1 + sovKvrpcpb(uint64(m.Priority)) + if m.CommitTs != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.CommitTs)) } - if m.IsolationLevel != 0 { - n += 1 + sovKvrpcpb(uint64(m.IsolationLevel)) + return i, nil +} + +func (m *ValueInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *GetRequest) Size() (n int) { +func (m *ValueInfo) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Context != nil { - l = m.Context.Size() - n += 1 + l + sovKvrpcpb(uint64(l)) + if len(m.Value) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(len(m.Value))) + i += copy(dAtA[i:], m.Value) } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKvrpcpb(uint64(l)) + if m.Ts != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.Ts)) } - if m.Version != 0 { - n += 1 + sovKvrpcpb(uint64(m.Version)) + if m.IsShortValue { + dAtA[i] = 0x18 + i++ + if m.IsShortValue { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ } - return n + return i, nil } -func (m *GetResponse) Size() (n int) { - var l int - _ = l - if m.RegionError != nil { - l = m.RegionError.Size() - n += 1 + l + sovKvrpcpb(uint64(l)) - } - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovKvrpcpb(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovKvrpcpb(uint64(l)) +func (m *MvccInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *ScanRequest) Size() (n int) { +func (m *MvccInfo) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Context != nil { - l = m.Context.Size() - n += 1 + l + sovKvrpcpb(uint64(l)) - } - l = len(m.StartKey) - if l > 0 { - n += 1 + l + sovKvrpcpb(uint64(l)) + if m.Lock != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.Lock.Size())) + n41, err := m.Lock.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n41 } - if m.Limit != 0 { - n += 1 + sovKvrpcpb(uint64(m.Limit)) + if len(m.Writes) > 0 { + for _, msg := range m.Writes { + dAtA[i] = 0x12 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.Version != 0 { - n += 1 + sovKvrpcpb(uint64(m.Version)) + if len(m.Values) > 0 { + for _, msg := range m.Values { + dAtA[i] = 0x1a + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.KeyOnly { - n += 2 + return i, nil +} + +func (m *MvccGetByKeyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *KvPair) Size() (n int) { +func (m *MvccGetByKeyRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovKvrpcpb(uint64(l)) + if m.Context != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.Context.Size())) + n42, err := m.Context.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n42 } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKvrpcpb(uint64(l)) + if len(m.Key) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(len(m.Key))) + i += copy(dAtA[i:], m.Key) } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovKvrpcpb(uint64(l)) + return i, nil +} + +func (m *MvccGetByKeyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *ScanResponse) Size() (n int) { +func (m *MvccGetByKeyResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l if m.RegionError != nil { - l = m.RegionError.Size() - n += 1 + l + sovKvrpcpb(uint64(l)) + dAtA[i] = 0xa + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.RegionError.Size())) + n43, err := m.RegionError.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n43 } - if len(m.Pairs) > 0 { - for _, e := range m.Pairs { - l = e.Size() - n += 1 + l + sovKvrpcpb(uint64(l)) + if len(m.Error) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(len(m.Error))) + i += copy(dAtA[i:], m.Error) + } + if m.Info != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.Info.Size())) + n44, err := m.Info.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } + i += n44 } - return n + return i, nil } -func (m *Mutation) Size() (n int) { - var l int - _ = l - if m.Op != 0 { - n += 1 + sovKvrpcpb(uint64(m.Op)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKvrpcpb(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovKvrpcpb(uint64(l)) +func (m *MvccGetByStartTsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *PrewriteRequest) Size() (n int) { +func (m *MvccGetByStartTsRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l if m.Context != nil { - l = m.Context.Size() - n += 1 + l + sovKvrpcpb(uint64(l)) + dAtA[i] = 0xa + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.Context.Size())) + n45, err := m.Context.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n45 } - if len(m.Mutations) > 0 { + if m.StartTs != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.StartTs)) + } + return i, nil +} + +func (m *MvccGetByStartTsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MvccGetByStartTsResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.RegionError != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.RegionError.Size())) + n46, err := m.RegionError.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n46 + } + if len(m.Error) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(len(m.Error))) + i += copy(dAtA[i:], m.Error) + } + if len(m.Key) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(len(m.Key))) + i += copy(dAtA[i:], m.Key) + } + if m.Info != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintKvrpcpb(dAtA, i, uint64(m.Info.Size())) + n47, err := m.Info.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n47 + } + return i, nil +} + +func encodeFixed64Kvrpcpb(dAtA []byte, offset int, v uint64) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + dAtA[offset+4] = uint8(v >> 32) + dAtA[offset+5] = uint8(v >> 40) + dAtA[offset+6] = uint8(v >> 48) + dAtA[offset+7] = uint8(v >> 56) + return offset + 8 +} +func encodeFixed32Kvrpcpb(dAtA []byte, offset int, v uint32) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + return offset + 4 +} +func encodeVarintKvrpcpb(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *LockInfo) Size() (n int) { + var l int + _ = l + l = len(m.PrimaryLock) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.LockVersion != 0 { + n += 1 + sovKvrpcpb(uint64(m.LockVersion)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.LockTtl != 0 { + n += 1 + sovKvrpcpb(uint64(m.LockTtl)) + } + return n +} + +func (m *KeyError) Size() (n int) { + var l int + _ = l + if m.Locked != nil { + l = m.Locked.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.Retryable) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.Abort) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + return n +} + +func (m *Context) Size() (n int) { + var l int + _ = l + if m.RegionId != 0 { + n += 1 + sovKvrpcpb(uint64(m.RegionId)) + } + if m.RegionEpoch != nil { + l = m.RegionEpoch.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.Peer != nil { + l = m.Peer.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.Term != 0 { + n += 1 + sovKvrpcpb(uint64(m.Term)) + } + if m.Priority != 0 { + n += 1 + sovKvrpcpb(uint64(m.Priority)) + } + if m.IsolationLevel != 0 { + n += 1 + sovKvrpcpb(uint64(m.IsolationLevel)) + } + return n +} + +func (m *GetRequest) Size() (n int) { + var l int + _ = l + if m.Context != nil { + l = m.Context.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.Version != 0 { + n += 1 + sovKvrpcpb(uint64(m.Version)) + } + return n +} + +func (m *GetResponse) Size() (n int) { + var l int + _ = l + if m.RegionError != nil { + l = m.RegionError.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.Error != nil { + l = m.Error.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + return n +} + +func (m *ScanRequest) Size() (n int) { + var l int + _ = l + if m.Context != nil { + l = m.Context.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.StartKey) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.Limit != 0 { + n += 1 + sovKvrpcpb(uint64(m.Limit)) + } + if m.Version != 0 { + n += 1 + sovKvrpcpb(uint64(m.Version)) + } + if m.KeyOnly { + n += 2 + } + return n +} + +func (m *KvPair) Size() (n int) { + var l int + _ = l + if m.Error != nil { + l = m.Error.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + return n +} + +func (m *ScanResponse) Size() (n int) { + var l int + _ = l + if m.RegionError != nil { + l = m.RegionError.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if len(m.Pairs) > 0 { + for _, e := range m.Pairs { + l = e.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + } + return n +} + +func (m *Mutation) Size() (n int) { + var l int + _ = l + if m.Op != 0 { + n += 1 + sovKvrpcpb(uint64(m.Op)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + return n +} + +func (m *PrewriteRequest) Size() (n int) { + var l int + _ = l + if m.Context != nil { + l = m.Context.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if len(m.Mutations) > 0 { for _, e := range m.Mutations { l = e.Size() n += 1 + l + sovKvrpcpb(uint64(l)) @@ -3120,23 +3778,1111 @@ func (m *RawDeleteResponse) Size() (n int) { if l > 0 { n += 1 + l + sovKvrpcpb(uint64(l)) } - return n -} + return n +} + +func (m *RawScanRequest) Size() (n int) { + var l int + _ = l + if m.Context != nil { + l = m.Context.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.StartKey) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.Limit != 0 { + n += 1 + sovKvrpcpb(uint64(m.Limit)) + } + return n +} + +func (m *RawScanResponse) Size() (n int) { + var l int + _ = l + if m.RegionError != nil { + l = m.RegionError.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if len(m.Kvs) > 0 { + for _, e := range m.Kvs { + l = e.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + } + return n +} + +func (m *WriteInfo) Size() (n int) { + var l int + _ = l + if m.StartTs != 0 { + n += 1 + sovKvrpcpb(uint64(m.StartTs)) + } + if m.Type != 0 { + n += 1 + sovKvrpcpb(uint64(m.Type)) + } + if m.CommitTs != 0 { + n += 1 + sovKvrpcpb(uint64(m.CommitTs)) + } + return n +} + +func (m *ValueInfo) Size() (n int) { + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.Ts != 0 { + n += 1 + sovKvrpcpb(uint64(m.Ts)) + } + if m.IsShortValue { + n += 2 + } + return n +} + +func (m *MvccInfo) Size() (n int) { + var l int + _ = l + if m.Lock != nil { + l = m.Lock.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if len(m.Writes) > 0 { + for _, e := range m.Writes { + l = e.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + } + if len(m.Values) > 0 { + for _, e := range m.Values { + l = e.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + } + return n +} + +func (m *MvccGetByKeyRequest) Size() (n int) { + var l int + _ = l + if m.Context != nil { + l = m.Context.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + return n +} + +func (m *MvccGetByKeyResponse) Size() (n int) { + var l int + _ = l + if m.RegionError != nil { + l = m.RegionError.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.Error) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + return n +} + +func (m *MvccGetByStartTsRequest) Size() (n int) { + var l int + _ = l + if m.Context != nil { + l = m.Context.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.StartTs != 0 { + n += 1 + sovKvrpcpb(uint64(m.StartTs)) + } + return n +} + +func (m *MvccGetByStartTsResponse) Size() (n int) { + var l int + _ = l + if m.RegionError != nil { + l = m.RegionError.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.Error) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKvrpcpb(uint64(l)) + } + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovKvrpcpb(uint64(l)) + } + return n +} + +func sovKvrpcpb(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozKvrpcpb(x uint64) (n int) { + return sovKvrpcpb(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *LockInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LockInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LockInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrimaryLock", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PrimaryLock = append(m.PrimaryLock[:0], dAtA[iNdEx:postIndex]...) + if m.PrimaryLock == nil { + m.PrimaryLock = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LockVersion", wireType) + } + m.LockVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LockVersion |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LockTtl", wireType) + } + m.LockTtl = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LockTtl |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipKvrpcpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthKvrpcpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KeyError) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KeyError: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KeyError: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Locked", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Locked == nil { + m.Locked = &LockInfo{} + } + if err := m.Locked.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Retryable", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Retryable = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Abort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Abort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKvrpcpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthKvrpcpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Context) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Context: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Context: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionId", wireType) + } + m.RegionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RegionId |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionEpoch", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegionEpoch == nil { + m.RegionEpoch = &metapb.RegionEpoch{} + } + if err := m.RegionEpoch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Peer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Peer == nil { + m.Peer = &metapb.Peer{} + } + if err := m.Peer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) + } + m.Term = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Term |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + m.Priority = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Priority |= (CommandPri(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsolationLevel", wireType) + } + m.IsolationLevel = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IsolationLevel |= (IsolationLevel(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipKvrpcpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthKvrpcpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Context == nil { + m.Context = &Context{} + } + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipKvrpcpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthKvrpcpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionError", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegionError == nil { + m.RegionError = &errorpb.Error{} + } + if err := m.RegionError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Error == nil { + m.Error = &KeyError{} + } + if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKvrpcpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthKvrpcpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ScanRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ScanRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ScanRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Context == nil { + m.Context = &Context{} + } + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StartKey = append(m.StartKey[:0], dAtA[iNdEx:postIndex]...) + if m.StartKey == nil { + m.StartKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.KeyOnly = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipKvrpcpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthKvrpcpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func sovKvrpcpb(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } + if iNdEx > l { + return io.ErrUnexpectedEOF } - return n -} -func sozKvrpcpb(x uint64) (n int) { - return sovKvrpcpb(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *LockInfo) Unmarshal(dAtA []byte) error { +func (m *KvPair) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3159,15 +4905,48 @@ func (m *LockInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LockInfo: wiretype end group for non-group") + return fmt.Errorf("proto: KvPair: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LockInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: KvPair: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrimaryLock", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Error == nil { + m.Error = &KeyError{} + } + if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -3191,16 +4970,211 @@ func (m *LockInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PrimaryLock = append(m.PrimaryLock[:0], dAtA[iNdEx:postIndex]...) - if m.PrimaryLock == nil { - m.PrimaryLock = []byte{} + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKvrpcpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthKvrpcpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ScanResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ScanResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ScanResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionError", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegionError == nil { + m.RegionError = &errorpb.Error{} + } + if err := m.RegionError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pairs = append(m.Pairs, &KvPair{}) + if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKvrpcpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthKvrpcpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Mutation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Mutation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Mutation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LockVersion", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Op", wireType) } - m.LockVersion = 0 + m.Op = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -3210,12 +5184,12 @@ func (m *LockInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.LockVersion |= (uint64(b) & 0x7F) << shift + m.Op |= (Op(b) & 0x7F) << shift if b < 0x80 { break } } - case 3: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } @@ -3246,11 +5220,11 @@ func (m *LockInfo) Unmarshal(dAtA []byte) error { m.Key = []byte{} } iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LockTtl", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - m.LockTtl = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -3260,11 +5234,23 @@ func (m *LockInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.LockTtl |= (uint64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -3286,7 +5272,7 @@ func (m *LockInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *KeyError) Unmarshal(dAtA []byte) error { +func (m *PrewriteRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3309,15 +5295,15 @@ func (m *KeyError) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: KeyError: wiretype end group for non-group") + return fmt.Errorf("proto: PrewriteRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: KeyError: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PrewriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Locked", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3341,18 +5327,18 @@ func (m *KeyError) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Locked == nil { - m.Locked = &LockInfo{} + if m.Context == nil { + m.Context = &Context{} } - if err := m.Locked.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Retryable", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Mutations", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -3362,26 +5348,28 @@ func (m *KeyError) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Retryable = string(dAtA[iNdEx:postIndex]) + m.Mutations = append(m.Mutations, &Mutation{}) + if err := m.Mutations[len(m.Mutations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Abort", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PrimaryLock", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -3391,21 +5379,81 @@ func (m *KeyError) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Abort = string(dAtA[iNdEx:postIndex]) + m.PrimaryLock = append(m.PrimaryLock[:0], dAtA[iNdEx:postIndex]...) + if m.PrimaryLock == nil { + m.PrimaryLock = []byte{} + } iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartVersion", wireType) + } + m.StartVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartVersion |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LockTtl", wireType) + } + m.LockTtl = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LockTtl |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipConstraintCheck", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.SkipConstraintCheck = bool(v != 0) default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -3427,7 +5475,7 @@ func (m *KeyError) Unmarshal(dAtA []byte) error { } return nil } -func (m *Context) Unmarshal(dAtA []byte) error { +func (m *PrewriteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3450,34 +5498,15 @@ func (m *Context) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Context: wiretype end group for non-group") + return fmt.Errorf("proto: PrewriteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Context: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PrewriteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RegionId", wireType) - } - m.RegionId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RegionId |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RegionEpoch", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RegionError", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3501,16 +5530,16 @@ func (m *Context) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RegionEpoch == nil { - m.RegionEpoch = &metapb.RegionEpoch{} + if m.RegionError == nil { + m.RegionError = &errorpb.Error{} } - if err := m.RegionEpoch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RegionError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Peer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3534,70 +5563,11 @@ func (m *Context) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Peer == nil { - m.Peer = &metapb.Peer{} - } - if err := m.Peer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Errors = append(m.Errors, &KeyError{}) + if err := m.Errors[len(m.Errors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) - } - m.Term = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Term |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) - } - m.Priority = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Priority |= (CommandPri(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsolationLevel", wireType) - } - m.IsolationLevel = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.IsolationLevel |= (IsolationLevel(b) & 0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -3619,7 +5589,7 @@ func (m *Context) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetRequest) Unmarshal(dAtA []byte) error { +func (m *CommitRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3642,10 +5612,10 @@ func (m *GetRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetRequest: wiretype end group for non-group") + return fmt.Errorf("proto: CommitRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CommitRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3680,10 +5650,29 @@ func (m *GetRequest) Unmarshal(dAtA []byte) error { if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - iNdEx = postIndex - case 2: + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartVersion", wireType) + } + m.StartVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartVersion |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -3707,16 +5696,14 @@ func (m *GetRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } + m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) + copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CommitVersion", wireType) } - m.Version = 0 + m.CommitVersion = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -3726,7 +5713,7 @@ func (m *GetRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Version |= (uint64(b) & 0x7F) << shift + m.CommitVersion |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } @@ -3752,7 +5739,7 @@ func (m *GetRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetResponse) Unmarshal(dAtA []byte) error { +func (m *CommitResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3775,10 +5762,10 @@ func (m *GetResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetResponse: wiretype end group for non-group") + return fmt.Errorf("proto: CommitResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CommitResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3847,37 +5834,6 @@ func (m *GetResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -3899,7 +5855,7 @@ func (m *GetResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *ScanRequest) Unmarshal(dAtA []byte) error { +func (m *ImportRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3922,15 +5878,15 @@ func (m *ScanRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ScanRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ImportRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ScanRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ImportRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Mutations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3954,18 +5910,16 @@ func (m *ScanRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Context == nil { - m.Context = &Context{} - } - if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Mutations = append(m.Mutations, &Mutation{}) + if err := m.Mutations[len(m.Mutations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartKey", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CommitVersion", wireType) } - var byteLen int + m.CommitVersion = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -3975,47 +5929,66 @@ func (m *ScanRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + m.CommitVersion |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + default: + iNdEx = preIndex + skippy, err := skipKvrpcpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + byteLen - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.StartKey = append(m.StartKey[:0], dAtA[iNdEx:postIndex]...) - if m.StartKey == nil { - m.StartKey = []byte{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ImportResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ImportResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ImportResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionError", wireType) } - m.Version = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -4025,16 +5998,30 @@ func (m *ScanRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Version |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KeyOnly", wireType) + if msglen < 0 { + return ErrInvalidLengthKvrpcpb } - var v int + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegionError == nil { + m.RegionError = &errorpb.Error{} + } + if err := m.RegionError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -4044,12 +6031,21 @@ func (m *ScanRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - m.KeyOnly = bool(v != 0) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -4071,7 +6067,7 @@ func (m *ScanRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *KvPair) Unmarshal(dAtA []byte) error { +func (m *BatchRollbackRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4094,15 +6090,15 @@ func (m *KvPair) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: KvPair: wiretype end group for non-group") + return fmt.Errorf("proto: BatchRollbackRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: KvPair: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BatchRollbackRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4126,18 +6122,18 @@ func (m *KvPair) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Error == nil { - m.Error = &KeyError{} + if m.Context == nil { + m.Context = &Context{} } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartVersion", wireType) } - var byteLen int + m.StartVersion = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -4147,26 +6143,14 @@ func (m *KvPair) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + m.StartVersion |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -4190,10 +6174,8 @@ func (m *KvPair) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } + m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) + copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4216,7 +6198,7 @@ func (m *KvPair) Unmarshal(dAtA []byte) error { } return nil } -func (m *ScanResponse) Unmarshal(dAtA []byte) error { +func (m *BatchRollbackResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4239,10 +6221,10 @@ func (m *ScanResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ScanResponse: wiretype end group for non-group") + return fmt.Errorf("proto: BatchRollbackResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ScanResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BatchRollbackResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4280,7 +6262,7 @@ func (m *ScanResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4304,8 +6286,10 @@ func (m *ScanResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Pairs = append(m.Pairs, &KvPair{}) - if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Error == nil { + m.Error = &KeyError{} + } + if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4330,7 +6314,7 @@ func (m *ScanResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *Mutation) Unmarshal(dAtA []byte) error { +func (m *CleanupRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4353,17 +6337,17 @@ func (m *Mutation) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Mutation: wiretype end group for non-group") + return fmt.Errorf("proto: CleanupRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Mutation: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CleanupRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Op", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) } - m.Op = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -4373,11 +6357,25 @@ func (m *Mutation) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Op |= (Op(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Context == nil { + m.Context = &Context{} + } + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) @@ -4410,10 +6408,10 @@ func (m *Mutation) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartVersion", wireType) } - var byteLen int + m.StartVersion = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -4423,23 +6421,11 @@ func (m *Mutation) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + m.StartVersion |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -4461,7 +6447,7 @@ func (m *Mutation) Unmarshal(dAtA []byte) error { } return nil } -func (m *PrewriteRequest) Unmarshal(dAtA []byte) error { +func (m *CleanupResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4484,15 +6470,15 @@ func (m *PrewriteRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PrewriteRequest: wiretype end group for non-group") + return fmt.Errorf("proto: CleanupResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PrewriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CleanupResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RegionError", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4516,16 +6502,16 @@ func (m *PrewriteRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Context == nil { - m.Context = &Context{} + if m.RegionError == nil { + m.RegionError = &errorpb.Error{} } - if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RegionError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mutations", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4549,16 +6535,18 @@ func (m *PrewriteRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Mutations = append(m.Mutations, &Mutation{}) - if err := m.Mutations[len(m.Mutations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Error == nil { + m.Error = &KeyError{} + } + if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrimaryLock", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CommitVersion", wireType) } - var byteLen int + m.CommitVersion = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -4568,28 +6556,66 @@ func (m *PrewriteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + m.CommitVersion |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + default: + iNdEx = preIndex + skippy, err := skipKvrpcpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + byteLen - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.PrimaryLock = append(m.PrimaryLock[:0], dAtA[iNdEx:postIndex]...) - if m.PrimaryLock == nil { - m.PrimaryLock = []byte{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BatchGetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartVersion", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - m.StartVersion = 0 + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BatchGetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BatchGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -4599,16 +6625,30 @@ func (m *PrewriteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.StartVersion |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LockTtl", wireType) + if msglen < 0 { + return ErrInvalidLengthKvrpcpb } - m.LockTtl = 0 + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Context == nil { + m.Context = &Context{} + } + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + } + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -4618,16 +6658,26 @@ func (m *PrewriteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.LockTtl |= (uint64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - case 6: + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) + copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SkipConstraintCheck", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - var v int + m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -4637,12 +6687,11 @@ func (m *PrewriteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + m.Version |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - m.SkipConstraintCheck = bool(v != 0) default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -4664,7 +6713,7 @@ func (m *PrewriteRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *PrewriteResponse) Unmarshal(dAtA []byte) error { +func (m *BatchGetResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4687,10 +6736,10 @@ func (m *PrewriteResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PrewriteResponse: wiretype end group for non-group") + return fmt.Errorf("proto: BatchGetResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PrewriteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BatchGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4728,7 +6777,7 @@ func (m *PrewriteResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4752,8 +6801,8 @@ func (m *PrewriteResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Errors = append(m.Errors, &KeyError{}) - if err := m.Errors[len(m.Errors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Pairs = append(m.Pairs, &KvPair{}) + if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4778,7 +6827,7 @@ func (m *PrewriteResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *CommitRequest) Unmarshal(dAtA []byte) error { +func (m *ScanLockRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4801,69 +6850,17 @@ func (m *CommitRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CommitRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ScanLockRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CommitRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ScanLockRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Context == nil { - m.Context = &Context{} - } - if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartVersion", wireType) - } - m.StartVersion = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartVersion |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -4873,26 +6870,30 @@ func (m *CommitRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) - copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) + if m.Context == nil { + m.Context = &Context{} + } + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 4: + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitVersion", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaxVersion", wireType) } - m.CommitVersion = 0 + m.MaxVersion = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -4902,7 +6903,7 @@ func (m *CommitRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CommitVersion |= (uint64(b) & 0x7F) << shift + m.MaxVersion |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } @@ -4928,7 +6929,7 @@ func (m *CommitRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *CommitResponse) Unmarshal(dAtA []byte) error { +func (m *ScanLockResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4951,10 +6952,10 @@ func (m *CommitResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CommitResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ScanLockResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CommitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ScanLockResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5023,6 +7024,37 @@ func (m *CommitResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Locks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Locks = append(m.Locks, &LockInfo{}) + if err := m.Locks[len(m.Locks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -5044,7 +7076,7 @@ func (m *CommitResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *ImportRequest) Unmarshal(dAtA []byte) error { +func (m *ResolveLockRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5067,15 +7099,15 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ImportRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ResolveLockRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ImportRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResolveLockRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mutations", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5099,12 +7131,33 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Mutations = append(m.Mutations, &Mutation{}) - if err := m.Mutations[len(m.Mutations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Context == nil { + m.Context = &Context{} + } + if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartVersion", wireType) + } + m.StartVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartVersion |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CommitVersion", wireType) } @@ -5144,7 +7197,7 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *ImportResponse) Unmarshal(dAtA []byte) error { +func (m *ResolveLockResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5167,10 +7220,10 @@ func (m *ImportResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ImportResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ResolveLockResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ImportResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResolveLockResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5210,7 +7263,7 @@ func (m *ImportResponse) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -5220,20 +7273,24 @@ func (m *ImportResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Error = string(dAtA[iNdEx:postIndex]) + if m.Error == nil { + m.Error = &KeyError{} + } + if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -5256,7 +7313,7 @@ func (m *ImportResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *BatchRollbackRequest) Unmarshal(dAtA []byte) error { +func (m *GCRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5279,10 +7336,10 @@ func (m *BatchRollbackRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BatchRollbackRequest: wiretype end group for non-group") + return fmt.Errorf("proto: GCRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BatchRollbackRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GCRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5320,28 +7377,9 @@ func (m *BatchRollbackRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartVersion", wireType) - } - m.StartVersion = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartVersion |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SafePoint", wireType) } - var byteLen int + m.SafePoint = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -5351,21 +7389,11 @@ func (m *BatchRollbackRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + m.SafePoint |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) - copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -5387,7 +7415,7 @@ func (m *BatchRollbackRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *BatchRollbackResponse) Unmarshal(dAtA []byte) error { +func (m *GCResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5410,10 +7438,10 @@ func (m *BatchRollbackResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BatchRollbackResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GCResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BatchRollbackResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GCResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5503,7 +7531,7 @@ func (m *BatchRollbackResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *CleanupRequest) Unmarshal(dAtA []byte) error { +func (m *RawGetRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5526,10 +7554,10 @@ func (m *CleanupRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CleanupRequest: wiretype end group for non-group") + return fmt.Errorf("proto: RawGetRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CleanupRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RawGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5596,25 +7624,6 @@ func (m *CleanupRequest) Unmarshal(dAtA []byte) error { m.Key = []byte{} } iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartVersion", wireType) - } - m.StartVersion = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartVersion |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -5636,7 +7645,7 @@ func (m *CleanupRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *CleanupResponse) Unmarshal(dAtA []byte) error { +func (m *RawGetResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5659,10 +7668,10 @@ func (m *CleanupResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CleanupResponse: wiretype end group for non-group") + return fmt.Errorf("proto: RawGetResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CleanupResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RawGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5702,7 +7711,7 @@ func (m *CleanupResponse) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -5712,30 +7721,26 @@ func (m *CleanupResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.Error == nil { - m.Error = &KeyError{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitVersion", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - m.CommitVersion = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -5745,11 +7750,23 @@ func (m *CleanupResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CommitVersion |= (uint64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -5771,7 +7788,7 @@ func (m *CleanupResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *BatchGetRequest) Unmarshal(dAtA []byte) error { +func (m *RawPutRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5794,10 +7811,10 @@ func (m *BatchGetRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BatchGetRequest: wiretype end group for non-group") + return fmt.Errorf("proto: RawPutRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BatchGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RawPutRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5835,7 +7852,7 @@ func (m *BatchGetRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -5859,14 +7876,16 @@ func (m *BatchGetRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) - copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - m.Version = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -5876,11 +7895,23 @@ func (m *BatchGetRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Version |= (uint64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -5902,7 +7933,7 @@ func (m *BatchGetRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *BatchGetResponse) Unmarshal(dAtA []byte) error { +func (m *RawPutResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5925,10 +7956,10 @@ func (m *BatchGetResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BatchGetResponse: wiretype end group for non-group") + return fmt.Errorf("proto: RawPutResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BatchGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RawPutResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5966,9 +7997,9 @@ func (m *BatchGetResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -5978,22 +8009,20 @@ func (m *BatchGetResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Pairs = append(m.Pairs, &KvPair{}) - if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6016,7 +8045,7 @@ func (m *BatchGetResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *ScanLockRequest) Unmarshal(dAtA []byte) error { +func (m *RawDeleteRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6039,10 +8068,10 @@ func (m *ScanLockRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ScanLockRequest: wiretype end group for non-group") + return fmt.Errorf("proto: RawDeleteRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ScanLockRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RawDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6079,10 +8108,10 @@ func (m *ScanLockRequest) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxVersion", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } - m.MaxVersion = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -6092,11 +8121,23 @@ func (m *ScanLockRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxVersion |= (uint64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -6118,7 +8159,7 @@ func (m *ScanLockRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *ScanLockResponse) Unmarshal(dAtA []byte) error { +func (m *RawDeleteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6141,10 +8182,10 @@ func (m *ScanLockResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ScanLockResponse: wiretype end group for non-group") + return fmt.Errorf("proto: RawDeleteResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ScanLockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RawDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6184,40 +8225,7 @@ func (m *ScanLockResponse) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &KeyError{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Locks", wireType) - } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -6227,22 +8235,20 @@ func (m *ScanLockResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Locks = append(m.Locks, &LockInfo{}) - if err := m.Locks[len(m.Locks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6265,7 +8271,7 @@ func (m *ScanLockResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResolveLockRequest) Unmarshal(dAtA []byte) error { +func (m *RawScanRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6288,10 +8294,10 @@ func (m *ResolveLockRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResolveLockRequest: wiretype end group for non-group") + return fmt.Errorf("proto: RawScanRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResolveLockRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RawScanRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6328,10 +8334,10 @@ func (m *ResolveLockRequest) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartVersion", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartKey", wireType) } - m.StartVersion = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -6341,16 +8347,28 @@ func (m *ResolveLockRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.StartVersion |= (uint64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StartKey = append(m.StartKey[:0], dAtA[iNdEx:postIndex]...) + if m.StartKey == nil { + m.StartKey = []byte{} + } + iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitVersion", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) } - m.CommitVersion = 0 + m.Limit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -6360,7 +8378,7 @@ func (m *ResolveLockRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CommitVersion |= (uint64(b) & 0x7F) << shift + m.Limit |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } @@ -6386,7 +8404,7 @@ func (m *ResolveLockRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResolveLockResponse) Unmarshal(dAtA []byte) error { +func (m *RawScanResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6409,10 +8427,10 @@ func (m *ResolveLockResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResolveLockResponse: wiretype end group for non-group") + return fmt.Errorf("proto: RawScanResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResolveLockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RawScanResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6450,7 +8468,7 @@ func (m *ResolveLockResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6474,10 +8492,8 @@ func (m *ResolveLockResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Error == nil { - m.Error = &KeyError{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Kvs = append(m.Kvs, &KvPair{}) + if err := m.Kvs[len(m.Kvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6502,7 +8518,7 @@ func (m *ResolveLockResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GCRequest) Unmarshal(dAtA []byte) error { +func (m *WriteInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6525,17 +8541,17 @@ func (m *GCRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GCRequest: wiretype end group for non-group") + return fmt.Errorf("proto: WriteInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GCRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WriteInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTs", wireType) } - var msglen int + m.StartTs = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -6545,99 +8561,16 @@ func (m *GCRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.StartTs |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Context == nil { - m.Context = &Context{} - } - if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SafePoint", wireType) - } - m.SafePoint = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SafePoint |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipKvrpcpb(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthKvrpcpb - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GCResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GCResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GCResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RegionError", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } - var msglen int + m.Type = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -6647,30 +8580,16 @@ func (m *GCResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.Type |= (Op(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RegionError == nil { - m.RegionError = &errorpb.Error{} - } - if err := m.RegionError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CommitTs", wireType) } - var msglen int + m.CommitTs = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -6680,25 +8599,11 @@ func (m *GCResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + m.CommitTs |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &KeyError{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -6720,7 +8625,7 @@ func (m *GCResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *RawGetRequest) Unmarshal(dAtA []byte) error { +func (m *ValueInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6743,17 +8648,17 @@ func (m *RawGetRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RawGetRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ValueInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RawGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ValueInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -6763,30 +8668,28 @@ func (m *RawGetRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } - if m.Context == nil { - m.Context = &Context{} - } - if err := m.Context.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ts", wireType) } - var byteLen int + m.Ts = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -6796,23 +8699,31 @@ func (m *RawGetRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + m.Ts |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsShortValue", wireType) } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex + m.IsShortValue = bool(v != 0) default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -6834,7 +8745,7 @@ func (m *RawGetRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *RawGetResponse) Unmarshal(dAtA []byte) error { +func (m *MvccInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6857,15 +8768,15 @@ func (m *RawGetResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RawGetResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MvccInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RawGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MvccInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RegionError", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Lock", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6889,18 +8800,18 @@ func (m *RawGetResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RegionError == nil { - m.RegionError = &errorpb.Error{} + if m.Lock == nil { + m.Lock = &LockInfo{} } - if err := m.RegionError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Lock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Writes", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -6910,26 +8821,28 @@ func (m *RawGetResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Error = string(dAtA[iNdEx:postIndex]) + m.Writes = append(m.Writes, &WriteInfo{}) + if err := m.Writes[len(m.Writes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -6939,21 +8852,21 @@ func (m *RawGetResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthKvrpcpb } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} + m.Values = append(m.Values, &ValueInfo{}) + if err := m.Values[len(m.Values)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex default: @@ -6977,7 +8890,7 @@ func (m *RawGetResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *RawPutRequest) Unmarshal(dAtA []byte) error { +func (m *MvccGetByKeyRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7000,10 +8913,10 @@ func (m *RawPutRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RawPutRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MvccGetByKeyRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RawPutRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MvccGetByKeyRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7070,37 +8983,6 @@ func (m *RawPutRequest) Unmarshal(dAtA []byte) error { m.Key = []byte{} } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKvrpcpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -7122,7 +9004,7 @@ func (m *RawPutRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *RawPutResponse) Unmarshal(dAtA []byte) error { +func (m *MvccGetByKeyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7145,10 +9027,10 @@ func (m *RawPutResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RawPutResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MvccGetByKeyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RawPutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MvccGetByKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7213,6 +9095,39 @@ func (m *RawPutResponse) Unmarshal(dAtA []byte) error { } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Info == nil { + m.Info = &MvccInfo{} + } + if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -7234,7 +9149,7 @@ func (m *RawPutResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *RawDeleteRequest) Unmarshal(dAtA []byte) error { +func (m *MvccGetByStartTsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7257,10 +9172,10 @@ func (m *RawDeleteRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RawDeleteRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MvccGetByStartTsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RawDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MvccGetByStartTsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7297,10 +9212,10 @@ func (m *RawDeleteRequest) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTs", wireType) } - var byteLen int + m.StartTs = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKvrpcpb @@ -7310,23 +9225,11 @@ func (m *RawDeleteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + m.StartTs |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthKvrpcpb - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -7348,7 +9251,7 @@ func (m *RawDeleteRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *RawDeleteResponse) Unmarshal(dAtA []byte) error { +func (m *MvccGetByStartTsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7371,10 +9274,10 @@ func (m *RawDeleteResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RawDeleteResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MvccGetByStartTsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RawDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MvccGetByStartTsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7439,6 +9342,70 @@ func (m *RawDeleteResponse) Unmarshal(dAtA []byte) error { } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKvrpcpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKvrpcpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Info == nil { + m.Info = &MvccInfo{} + } + if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKvrpcpb(dAtA[iNdEx:]) @@ -7568,79 +9535,94 @@ var ( func init() { proto.RegisterFile("kvrpcpb.proto", fileDescriptorKvrpcpb) } var fileDescriptorKvrpcpb = []byte{ - // 1171 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x5f, 0x6f, 0x1b, 0x45, - 0x10, 0xef, 0x9d, 0xff, 0x9d, 0xc7, 0xff, 0xae, 0x9b, 0x54, 0x98, 0x16, 0x82, 0x39, 0x54, 0x35, - 0x0d, 0x92, 0x2b, 0x8c, 0xc4, 0x33, 0xaa, 0x5b, 0x95, 0x34, 0x29, 0xb1, 0xb6, 0x28, 0x52, 0x24, - 0x84, 0x75, 0xbe, 0x6c, 0xed, 0xd5, 0xfd, 0xd9, 0xcb, 0xde, 0xda, 0x89, 0x85, 0x10, 0x4f, 0xbc, - 0xf1, 0x88, 0x04, 0xe2, 0x8d, 0x47, 0xbe, 0x09, 0x8f, 0x7c, 0x04, 0x14, 0xbe, 0x08, 0xda, 0xbd, - 0x3b, 0x9f, 0x1d, 0xbb, 0x22, 0xb2, 0x5c, 0x3f, 0xf9, 0x76, 0x66, 0x76, 0x67, 0x7e, 0x33, 0xbf, - 0x9d, 0xb9, 0x33, 0xd4, 0xdc, 0x09, 0x0f, 0x9d, 0x70, 0xd0, 0x0e, 0x39, 0x13, 0x0c, 0x95, 0x92, - 0xe5, 0xfd, 0xaa, 0x4f, 0x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, 0xaf, 0x74, 0x76, 0xda, - 0x49, 0x72, 0xb1, 0xd2, 0x3d, 0x97, 0x2a, 0x5c, 0xe1, 0xd9, 0x02, 0xb5, 0x20, 0x1f, 0x12, 0xc2, - 0x95, 0xd7, 0x4a, 0xa7, 0x9a, 0xda, 0xf7, 0x08, 0xe1, 0x58, 0x69, 0x10, 0x82, 0xbc, 0x20, 0xdc, - 0x6f, 0x16, 0x94, 0x47, 0xf5, 0x8c, 0x9e, 0x80, 0x11, 0x72, 0xca, 0x38, 0x15, 0xd3, 0x66, 0xb1, - 0xa5, 0xed, 0xd7, 0x3b, 0x3b, 0x33, 0xdc, 0x5d, 0xe6, 0xfb, 0x76, 0x70, 0xde, 0xe3, 0x14, 0xcf, - 0x8c, 0xd0, 0x97, 0xd0, 0xa0, 0x11, 0xf3, 0x6c, 0x21, 0x23, 0xf4, 0xc8, 0x84, 0x78, 0xcd, 0x92, - 0xda, 0xf7, 0xde, 0x6c, 0xdf, 0x61, 0xaa, 0x3f, 0x96, 0x6a, 0x5c, 0xa7, 0x0b, 0xeb, 0x97, 0x79, - 0x23, 0x6f, 0x16, 0x64, 0xec, 0xf6, 0x79, 0xff, 0x62, 0xcc, 0xf8, 0xd8, 0xb7, 0xce, 0x01, 0x5e, - 0x10, 0x81, 0xc9, 0xc5, 0x98, 0x44, 0x02, 0x1d, 0x40, 0xc9, 0x89, 0x33, 0x95, 0x94, 0xc2, 0x9c, - 0x0b, 0x49, 0xc9, 0x71, 0x6a, 0x90, 0x96, 0x5b, 0xcf, 0xca, 0xdd, 0x84, 0x52, 0x4a, 0x8f, 0x5c, - 0x5c, 0xed, 0x64, 0x69, 0xfd, 0x08, 0x15, 0xe5, 0x25, 0x0a, 0x59, 0x10, 0x11, 0xf4, 0x59, 0x96, - 0x68, 0x49, 0x80, 0xc4, 0x57, 0xbd, 0x9d, 0xf2, 0x56, 0xd1, 0x62, 0x96, 0x63, 0xc5, 0x91, 0x47, - 0x50, 0x88, 0x6d, 0xf5, 0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x62, 0xfb, 0xf2, 0x19, 0xf1, 0xc8, 0x7a, 0xaf, 0x9b, 0xcb, 0x25, - 0xf8, 0x16, 0xee, 0xce, 0x9d, 0xb8, 0xe1, 0x78, 0x0f, 0x3e, 0x05, 0xc8, 0x3e, 0x16, 0x11, 0x40, - 0xf1, 0x6b, 0xc6, 0x7d, 0xdb, 0x33, 0xef, 0xa0, 0x12, 0xe4, 0x8e, 0xd9, 0xa5, 0xa9, 0x21, 0x03, - 0xf2, 0x5f, 0xd1, 0xe1, 0xc8, 0xd4, 0x0f, 0x5a, 0x50, 0x5f, 0xfc, 0x42, 0x44, 0x45, 0xd0, 0x5f, - 0x1f, 0x9a, 0x77, 0xe4, 0x2f, 0xee, 0x9a, 0xda, 0x41, 0x0b, 0xf4, 0x93, 0x50, 0x6e, 0xed, 0x8d, - 0x45, 0x7c, 0xc6, 0x33, 0xe2, 0xc5, 0x67, 0xc8, 0x4b, 0x6c, 0xea, 0x4f, 0x0f, 0xfe, 0xba, 0xde, - 0xd3, 0xfe, 0xbe, 0xde, 0xd3, 0xfe, 0xb9, 0xde, 0xd3, 0x7e, 0xfb, 0x77, 0xef, 0x0e, 0x34, 0x1d, - 0xe6, 0xb7, 0x43, 0x1a, 0x0c, 0x1d, 0x3b, 0x6c, 0x0b, 0xea, 0x4e, 0xda, 0xee, 0x44, 0xfd, 0xc7, - 0x30, 0x28, 0xaa, 0x9f, 0xcf, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x29, 0xf7, 0x57, 0xb4, 0xb7, - 0x10, 0x00, 0x00, + // 1414 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4f, 0x6f, 0xdb, 0xc6, + 0x12, 0x0f, 0x29, 0x4a, 0xa2, 0x46, 0xff, 0x98, 0xb5, 0x83, 0x28, 0xc9, 0x7b, 0x8e, 0xc2, 0xf7, + 0x8c, 0x38, 0x7e,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x8d, 0x9f, 0x68, 0xba, 0x66, 0x14, 0x45, 0xec, 0xd6, 0xd9, 0xe0, 0xf5, 0x84, 0xb2, + 0xc9, 0xd8, 0x3c, 0x03, 0x78, 0x4c, 0x38, 0x26, 0xaf, 0x27, 0x24, 0xe4, 0x68, 0x1f, 0xca, 0x76, + 0x9c, 0xa9, 0xa4, 0x14, 0xc6, 0x4c, 0x48, 0x52, 0x8e, 0x53, 0x83, 0xb4, 0xdc, 0x6a, 0x5e, 0xee, + 0x16, 0x94, 0x53, 0x7a, 0x14, 0xe2, 0x6a, 0x27, 0x43, 0xf3, 0x2b, 0xa8, 0x4a, 0x2f, 0x61, 0x40, + 0xfd, 0x90, 0xa0, 0xff, 0xe7, 0x89, 0x16, 0x04, 0x48, 0x7c, 0x35, 0x3a, 0x29, 0x6f, 0x25, 0x2d, + 0xb2, 0x1c, 0x4b, 0x8e, 0xdc, 0x85, 0x62, 0x6c, 0xab, 0x5e, 0xa0, 0x48, 0xca, 0x22, 0x1c, 0xeb, + 0x05, 0x07, 0xa6, 0x96, 0x37, 0x21, 0x09, 0x0f, 0xe3, 0x81, 0xf9, 0x8b, 0x02, 0xd5, 0x63, 0xdb, + 0xf2, 0x57, 0x01, 0x7a, 0x0b, 0x2a, 0x21, 0xb7, 0x18, 0x1f, 0xe4, 0x70, 0x75, 0x29, 0x38, 0x24, + 0x91, 0x70, 0xe7, 0x39, 0x63, 0x27, 0xa6, 0x5c, 0x1d, 0xc7, 0x83, 0xd9, 0x4c, 0x68, 0x73, 0x99, + 0x10, 0x9f, 0x84, 0x4b, 0xa2, 0x01, 0xf5, 0xbd, 0x48, 0xb2, 0x41, 0xc7, 0x65, 0x97, 0x44, 0x47, + 0xbe, 0x17, 0x99, 0x2f, 0xa1, 0x74, 0x38, 0xed, 0x5b, 0xce, 0x0c, 0x58, 0xe5, 0x1f, 0xc0, 0x2e, + 0xd6, 0x60, 0x39, 0xfc, 0x11, 0xd4, 0x62, 0xf4, 0xab, 0x17, 0x60,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7, 0xa1, 0x31, 0x7f, 0x4b, 0x84, 0x4a, 0xa0, 0x1e, 0x1f, 0x18, 0x57, 0xc4, + 0x13, 0xf7, 0x0c, 0x65, 0xbf, 0x03, 0xea, 0x51, 0x20, 0xa6, 0xf6, 0x27, 0x3c, 0x5e, 0xe3, 0x21, + 0xf1, 0xe2, 0x35, 0x04, 0x5f, 0x0d, 0x15, 0xd5, 0x40, 0x4f, 0x4f, 0xee, 0x46, 0xe1, 0xc1, 0xfe, + 0x6f, 0x6f, 0x77, 0x94, 0xdf, 0xdf, 0xee, 0x28, 0x7f, 0xbc, 0xdd, 0x51, 0x7e, 0xfc, 0x73, 0xe7, + 0x0a, 0xb4, 0x6c, 0x3a, 0xee, 0x04, 0x8e, 0x3f, 0xb4, 0xad, 0xa0, 0xc3, 0x1d, 0x77, 0xda, 0x71, + 0xa7, 0xf2, 0xd6, 0xf1, 0xb4, 0x24, 0x1f, 0x1f, 0xfc, 0x15, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x49, + 0x7a, 0x1e, 0xc9, 0x14, 0x00, 0x00, } diff --git a/_vendor/src/github.com/pingcap/kvproto/pkg/metapb/metapb.pb.go b/_vendor/src/github.com/pingcap/kvproto/pkg/metapb/metapb.pb.go index 59db236b1bf53..782798e0e30e9 100644 --- a/_vendor/src/github.com/pingcap/kvproto/pkg/metapb/metapb.pb.go +++ b/_vendor/src/github.com/pingcap/kvproto/pkg/metapb/metapb.pb.go @@ -1,5 +1,6 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-gogo. // source: metapb.proto +// DO NOT EDIT! /* Package metapb is a generated protocol buffer package. diff --git a/_vendor/src/github.com/pingcap/kvproto/pkg/pdpb/pdpb.pb.go b/_vendor/src/github.com/pingcap/kvproto/pkg/pdpb/pdpb.pb.go index 3b124f17266bd..c3848ccbde724 100644 --- a/_vendor/src/github.com/pingcap/kvproto/pkg/pdpb/pdpb.pb.go +++ b/_vendor/src/github.com/pingcap/kvproto/pkg/pdpb/pdpb.pb.go @@ -1,5 +1,6 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-gogo. // source: pdpb.proto +// DO NOT EDIT! /* Package pdpb is a generated protocol buffer package. @@ -910,6 +911,11 @@ type RegionHeartbeatResponse struct { ChangePeer *ChangePeer `protobuf:"bytes,2,opt,name=change_peer,json=changePeer" json:"change_peer,omitempty"` // Pd can return transfer_leader to let TiKV does leader transfer itself. TransferLeader *TransferLeader `protobuf:"bytes,3,opt,name=transfer_leader,json=transferLeader" json:"transfer_leader,omitempty"` + // ID of the region + RegionId uint64 `protobuf:"varint,4,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` + RegionEpoch *metapb.RegionEpoch `protobuf:"bytes,5,opt,name=region_epoch,json=regionEpoch" json:"region_epoch,omitempty"` + // Leader of the region at the moment of the corresponding request was made. + TargetPeer *metapb.Peer `protobuf:"bytes,6,opt,name=target_peer,json=targetPeer" json:"target_peer,omitempty"` } func (m *RegionHeartbeatResponse) Reset() { *m = RegionHeartbeatResponse{} } @@ -938,6 +944,27 @@ func (m *RegionHeartbeatResponse) GetTransferLeader() *TransferLeader { return nil } +func (m *RegionHeartbeatResponse) GetRegionId() uint64 { + if m != nil { + return m.RegionId + } + return 0 +} + +func (m *RegionHeartbeatResponse) GetRegionEpoch() *metapb.RegionEpoch { + if m != nil { + return m.RegionEpoch + } + return nil +} + +func (m *RegionHeartbeatResponse) GetTargetPeer() *metapb.Peer { + if m != nil { + return m.TargetPeer + } + return nil +} + type AskSplitRequest struct { Header *RequestHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` Region *metapb.Region `protobuf:"bytes,2,opt,name=region" json:"region,omitempty"` @@ -1265,7 +1292,7 @@ type PDClient interface { GetStore(ctx context.Context, in *GetStoreRequest, opts ...grpc.CallOption) (*GetStoreResponse, error) PutStore(ctx context.Context, in *PutStoreRequest, opts ...grpc.CallOption) (*PutStoreResponse, error) StoreHeartbeat(ctx context.Context, in *StoreHeartbeatRequest, opts ...grpc.CallOption) (*StoreHeartbeatResponse, error) - RegionHeartbeat(ctx context.Context, in *RegionHeartbeatRequest, opts ...grpc.CallOption) (*RegionHeartbeatResponse, error) + RegionHeartbeat(ctx context.Context, opts ...grpc.CallOption) (PD_RegionHeartbeatClient, error) GetRegion(ctx context.Context, in *GetRegionRequest, opts ...grpc.CallOption) (*GetRegionResponse, error) GetRegionByID(ctx context.Context, in *GetRegionByIDRequest, opts ...grpc.CallOption) (*GetRegionResponse, error) AskSplit(ctx context.Context, in *AskSplitRequest, opts ...grpc.CallOption) (*AskSplitResponse, error) @@ -1376,13 +1403,35 @@ func (c *pDClient) StoreHeartbeat(ctx context.Context, in *StoreHeartbeatRequest return out, nil } -func (c *pDClient) RegionHeartbeat(ctx context.Context, in *RegionHeartbeatRequest, opts ...grpc.CallOption) (*RegionHeartbeatResponse, error) { - out := new(RegionHeartbeatResponse) - err := grpc.Invoke(ctx, "/pdpb.PD/RegionHeartbeat", in, out, c.cc, opts...) +func (c *pDClient) RegionHeartbeat(ctx context.Context, opts ...grpc.CallOption) (PD_RegionHeartbeatClient, error) { + stream, err := grpc.NewClientStream(ctx, &_PD_serviceDesc.Streams[1], c.cc, "/pdpb.PD/RegionHeartbeat", opts...) if err != nil { return nil, err } - return out, nil + x := &pDRegionHeartbeatClient{stream} + return x, nil +} + +type PD_RegionHeartbeatClient interface { + Send(*RegionHeartbeatRequest) error + Recv() (*RegionHeartbeatResponse, error) + grpc.ClientStream +} + +type pDRegionHeartbeatClient struct { + grpc.ClientStream +} + +func (x *pDRegionHeartbeatClient) Send(m *RegionHeartbeatRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *pDRegionHeartbeatClient) Recv() (*RegionHeartbeatResponse, error) { + m := new(RegionHeartbeatResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil } func (c *pDClient) GetRegion(ctx context.Context, in *GetRegionRequest, opts ...grpc.CallOption) (*GetRegionResponse, error) { @@ -1452,7 +1501,7 @@ type PDServer interface { GetStore(context.Context, *GetStoreRequest) (*GetStoreResponse, error) PutStore(context.Context, *PutStoreRequest) (*PutStoreResponse, error) StoreHeartbeat(context.Context, *StoreHeartbeatRequest) (*StoreHeartbeatResponse, error) - RegionHeartbeat(context.Context, *RegionHeartbeatRequest) (*RegionHeartbeatResponse, error) + RegionHeartbeat(PD_RegionHeartbeatServer) error GetRegion(context.Context, *GetRegionRequest) (*GetRegionResponse, error) GetRegionByID(context.Context, *GetRegionByIDRequest) (*GetRegionResponse, error) AskSplit(context.Context, *AskSplitRequest) (*AskSplitResponse, error) @@ -1617,22 +1666,30 @@ func _PD_StoreHeartbeat_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _PD_RegionHeartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RegionHeartbeatRequest) - if err := dec(in); err != nil { +func _PD_RegionHeartbeat_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(PDServer).RegionHeartbeat(&pDRegionHeartbeatServer{stream}) +} + +type PD_RegionHeartbeatServer interface { + Send(*RegionHeartbeatResponse) error + Recv() (*RegionHeartbeatRequest, error) + grpc.ServerStream +} + +type pDRegionHeartbeatServer struct { + grpc.ServerStream +} + +func (x *pDRegionHeartbeatServer) Send(m *RegionHeartbeatResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *pDRegionHeartbeatServer) Recv() (*RegionHeartbeatRequest, error) { + m := new(RegionHeartbeatRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } - if interceptor == nil { - return srv.(PDServer).RegionHeartbeat(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pdpb.PD/RegionHeartbeat", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PDServer).RegionHeartbeat(ctx, req.(*RegionHeartbeatRequest)) - } - return interceptor(ctx, in, info, handler) + return m, nil } func _PD_GetRegion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -1775,10 +1832,6 @@ var _PD_serviceDesc = grpc.ServiceDesc{ MethodName: "StoreHeartbeat", Handler: _PD_StoreHeartbeat_Handler, }, - { - MethodName: "RegionHeartbeat", - Handler: _PD_RegionHeartbeat_Handler, - }, { MethodName: "GetRegion", Handler: _PD_GetRegion_Handler, @@ -1811,6 +1864,12 @@ var _PD_serviceDesc = grpc.ServiceDesc{ ServerStreams: true, ClientStreams: true, }, + { + StreamName: "RegionHeartbeat", + Handler: _PD_RegionHeartbeat_Handler, + ServerStreams: true, + ClientStreams: true, + }, }, Metadata: "pdpb.proto", } @@ -2959,6 +3018,31 @@ func (m *RegionHeartbeatResponse) MarshalTo(dAtA []byte) (int, error) { } i += n41 } + if m.RegionId != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintPdpb(dAtA, i, uint64(m.RegionId)) + } + if m.RegionEpoch != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintPdpb(dAtA, i, uint64(m.RegionEpoch.Size())) + n42, err := m.RegionEpoch.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n42 + } + if m.TargetPeer != nil { + dAtA[i] = 0x32 + i++ + i = encodeVarintPdpb(dAtA, i, uint64(m.TargetPeer.Size())) + n43, err := m.TargetPeer.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n43 + } return i, nil } @@ -2981,21 +3065,21 @@ func (m *AskSplitRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintPdpb(dAtA, i, uint64(m.Header.Size())) - n42, err := m.Header.MarshalTo(dAtA[i:]) + n44, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n42 + i += n44 } if m.Region != nil { dAtA[i] = 0x12 i++ i = encodeVarintPdpb(dAtA, i, uint64(m.Region.Size())) - n43, err := m.Region.MarshalTo(dAtA[i:]) + n45, err := m.Region.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n43 + i += n45 } return i, nil } @@ -3019,11 +3103,11 @@ func (m *AskSplitResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintPdpb(dAtA, i, uint64(m.Header.Size())) - n44, err := m.Header.MarshalTo(dAtA[i:]) + n46, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n44 + i += n46 } if m.NewRegionId != 0 { dAtA[i] = 0x10 @@ -3031,21 +3115,21 @@ func (m *AskSplitResponse) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPdpb(dAtA, i, uint64(m.NewRegionId)) } if len(m.NewPeerIds) > 0 { - dAtA46 := make([]byte, len(m.NewPeerIds)*10) - var j45 int + dAtA48 := make([]byte, len(m.NewPeerIds)*10) + var j47 int for _, num := range m.NewPeerIds { for num >= 1<<7 { - dAtA46[j45] = uint8(uint64(num)&0x7f | 0x80) + dAtA48[j47] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j45++ + j47++ } - dAtA46[j45] = uint8(num) - j45++ + dAtA48[j47] = uint8(num) + j47++ } dAtA[i] = 0x1a i++ - i = encodeVarintPdpb(dAtA, i, uint64(j45)) - i += copy(dAtA[i:], dAtA46[:j45]) + i = encodeVarintPdpb(dAtA, i, uint64(j47)) + i += copy(dAtA[i:], dAtA48[:j47]) } return i, nil } @@ -3069,31 +3153,31 @@ func (m *ReportSplitRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintPdpb(dAtA, i, uint64(m.Header.Size())) - n47, err := m.Header.MarshalTo(dAtA[i:]) + n49, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n47 + i += n49 } if m.Left != nil { dAtA[i] = 0x12 i++ i = encodeVarintPdpb(dAtA, i, uint64(m.Left.Size())) - n48, err := m.Left.MarshalTo(dAtA[i:]) + n50, err := m.Left.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n48 + i += n50 } if m.Right != nil { dAtA[i] = 0x1a i++ i = encodeVarintPdpb(dAtA, i, uint64(m.Right.Size())) - n49, err := m.Right.MarshalTo(dAtA[i:]) + n51, err := m.Right.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n49 + i += n51 } return i, nil } @@ -3117,11 +3201,11 @@ func (m *ReportSplitResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintPdpb(dAtA, i, uint64(m.Header.Size())) - n50, err := m.Header.MarshalTo(dAtA[i:]) + n52, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n50 + i += n52 } return i, nil } @@ -3228,21 +3312,21 @@ func (m *StoreHeartbeatRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintPdpb(dAtA, i, uint64(m.Header.Size())) - n51, err := m.Header.MarshalTo(dAtA[i:]) + n53, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n51 + i += n53 } if m.Stats != nil { dAtA[i] = 0x12 i++ i = encodeVarintPdpb(dAtA, i, uint64(m.Stats.Size())) - n52, err := m.Stats.MarshalTo(dAtA[i:]) + n54, err := m.Stats.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n52 + i += n54 } return i, nil } @@ -3266,11 +3350,11 @@ func (m *StoreHeartbeatResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintPdpb(dAtA, i, uint64(m.Header.Size())) - n53, err := m.Header.MarshalTo(dAtA[i:]) + n55, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n53 + i += n55 } return i, nil } @@ -3745,6 +3829,17 @@ func (m *RegionHeartbeatResponse) Size() (n int) { l = m.TransferLeader.Size() n += 1 + l + sovPdpb(uint64(l)) } + if m.RegionId != 0 { + n += 1 + sovPdpb(uint64(m.RegionId)) + } + if m.RegionEpoch != nil { + l = m.RegionEpoch.Size() + n += 1 + l + sovPdpb(uint64(l)) + } + if m.TargetPeer != nil { + l = m.TargetPeer.Size() + n += 1 + l + sovPdpb(uint64(l)) + } return n } @@ -7354,6 +7449,91 @@ func (m *RegionHeartbeatResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionId", wireType) + } + m.RegionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RegionId |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionEpoch", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegionEpoch == nil { + m.RegionEpoch = &metapb.RegionEpoch{} + } + if err := m.RegionEpoch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetPeer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TargetPeer == nil { + m.TargetPeer = &metapb.Peer{} + } + if err := m.TargetPeer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPdpb(dAtA[iNdEx:]) @@ -7573,24 +7753,7 @@ func (m *AskSplitResponse) Unmarshal(dAtA []byte) error { } } case 3: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPdpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NewPeerIds = append(m.NewPeerIds, v) - } else if wireType == 2 { + if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { @@ -7631,6 +7794,23 @@ func (m *AskSplitResponse) Unmarshal(dAtA []byte) error { } m.NewPeerIds = append(m.NewPeerIds, v) } + } else if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NewPeerIds = append(m.NewPeerIds, v) } else { return fmt.Errorf("proto: wrong wireType = %d for field NewPeerIds", wireType) } @@ -8473,110 +8653,113 @@ var ( func init() { proto.RegisterFile("pdpb.proto", fileDescriptorPdpb) } var fileDescriptorPdpb = []byte{ - // 1679 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x6e, 0xdb, 0xce, - 0x11, 0x37, 0xf5, 0xcd, 0xd1, 0xa7, 0xd7, 0x5f, 0x8a, 0x12, 0xbb, 0xce, 0x26, 0x28, 0xdc, 0x34, - 0x51, 0x13, 0x17, 0x05, 0x0a, 0x04, 0x09, 0x22, 0x7f, 0x25, 0x46, 0x12, 0x4b, 0x58, 0x29, 0x08, - 0x72, 0xa9, 0x4a, 0x89, 0x6b, 0x99, 0xb5, 0x44, 0x32, 0x5c, 0xca, 0x86, 0x72, 0xea, 0xa9, 0x97, - 0x16, 0x68, 0xd1, 0x53, 0x5f, 0xa3, 0xc7, 0xbe, 0x41, 0x8f, 0x7d, 0x84, 0x22, 0x7d, 0x8b, 0x9e, - 0x8a, 0xdd, 0x25, 0x29, 0x92, 0x92, 0x53, 0x97, 0xe9, 0xff, 0x24, 0xee, 0xcc, 0xec, 0x6f, 0x67, - 0x7f, 0x3b, 0x33, 0xbb, 0x23, 0x00, 0x5b, 0xb7, 0x07, 0x4d, 0xdb, 0xb1, 0x5c, 0x0b, 0x65, 0xf8, - 0x77, 0xa3, 0x34, 0xa1, 0xae, 0xe6, 0xcb, 0x1a, 0xeb, 0x23, 0x6b, 0x64, 0x89, 0xcf, 0x9f, 0xf1, - 0x2f, 0x29, 0xc5, 0x4d, 0x28, 0x13, 0xfa, 0x79, 0x4a, 0x99, 0xfb, 0x86, 0x6a, 0x3a, 0x75, 0xd0, - 0x36, 0xc0, 0x70, 0x3c, 0x65, 0x2e, 0x75, 0xfa, 0x86, 0x5e, 0x57, 0x76, 0x95, 0xbd, 0x0c, 0x51, - 0x3d, 0xc9, 0xa9, 0x8e, 0x09, 0x54, 0x08, 0x65, 0xb6, 0x65, 0x32, 0x7a, 0xab, 0x09, 0xe8, 0x3e, - 0x64, 0xa9, 0xe3, 0x58, 0x4e, 0x3d, 0xb5, 0xab, 0xec, 0x15, 0xf7, 0x8b, 0x4d, 0xe1, 0xe6, 0x31, - 0x17, 0x11, 0xa9, 0xc1, 0x27, 0x90, 0x15, 0x63, 0xf4, 0x00, 0x32, 0xee, 0xcc, 0xa6, 0x02, 0xa4, - 0xb2, 0x5f, 0x0d, 0x99, 0xf6, 0x66, 0x36, 0x25, 0x42, 0x89, 0xea, 0x90, 0x9f, 0x50, 0xc6, 0xb4, - 0x11, 0x15, 0x90, 0x2a, 0xf1, 0x87, 0xb8, 0x0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 0x76, 0x19, 0xa3, 0x7b, 0x7e, 0x50, 0x2f, 0x7b, 0xbb, 0x35, - 0xb6, 0x6f, 0xd0, 0x06, 0x88, 0x2f, 0x41, 0x0d, 0x7a, 0x2e, 0x34, 0x27, 0x21, 0xd2, 0x76, 0x36, - 0xb6, 0x16, 0xe4, 0xc1, 0xfc, 0x13, 0x28, 0x47, 0x7a, 0x36, 0xd4, 0x88, 0xd9, 0x86, 0x1a, 0xb9, - 0x6f, 0xe1, 0x3c, 0x87, 0x82, 0x7f, 0x85, 0xfa, 0x2c, 0xc7, 0xee, 0x6e, 0x9f, 0xe5, 0xf8, 0x4d, - 0x8b, 0x57, 0xd0, 0x11, 0x14, 0x43, 0x37, 0x0d, 0xaa, 0xfb, 0x9b, 0x8e, 0xdf, 0x84, 0x8d, 0x3b, - 0x4b, 0x34, 0x01, 0x4a, 0x57, 0x34, 0xdc, 0x91, 0x66, 0x07, 0x6d, 0x07, 0x1e, 0x2f, 0xeb, 0xbb, - 0x1a, 0x3b, 0x37, 0xa9, 0xc3, 0xa0, 0xf1, 0x0e, 0xca, 0x07, 0xbd, 0xa1, 0x99, 0xf3, 0x41, 0x6f, - 0x6a, 0xbc, 0xf0, 0xca, 0xc1, 0xa3, 0xbf, 0x7f, 0xdd, 0x51, 0xfe, 0xf1, 0x75, 0x47, 0xf9, 0xe7, - 0xd7, 0x1d, 0xe5, 0x2f, 0xff, 0xda, 0x59, 0x81, 0xfa, 0xd0, 0x9a, 0x34, 0x6d, 0xc3, 0x1c, 0x0d, - 0x35, 0xbb, 0xe9, 0x1a, 0x97, 0x57, 0xcd, 0xcb, 0x2b, 0xf1, 0x37, 0xed, 0x20, 0x27, 0x7e, 0x7e, - 0xfe, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x43, 0x79, 0x80, 0xeb, 0xe5, 0x15, 0x00, 0x00, + // 1725 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0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 0x57, 0xbb, 0xd4, 0x0c, 0xad, 0x88, 0x94, 0x12, 0xad, 0xc5, + 0x3d, 0xb8, 0x17, 0xf3, 0x26, 0x0b, 0x2d, 0xf8, 0x04, 0x1e, 0x9c, 0xb1, 0x08, 0xc4, 0xa7, 0x76, + 0x96, 0xa8, 0xf0, 0x6f, 0x60, 0x27, 0x8d, 0x92, 0x69, 0x93, 0x30, 0xd4, 0xc7, 0x31, 0x14, 0x49, + 0x52, 0x85, 0x24, 0x64, 0xf8, 0x33, 0x68, 0xf6, 0x66, 0x33, 0x6f, 0x72, 0x76, 0x92, 0xc9, 0xd5, + 0x3e, 0xb4, 0xa2, 0xe9, 0x99, 0x7c, 0x6c, 0x42, 0xce, 0x51, 0x9e, 0x15, 0x48, 0xce, 0xb1, 0xf1, + 0x37, 0xd0, 0xfa, 0x82, 0x72, 0xb5, 0x7f, 0x59, 0x32, 0xe2, 0x03, 0xa8, 0xc8, 0x5d, 0x1f, 0x45, + 0xa8, 0x65, 0x39, 0x3e, 0xb3, 0x31, 0x85, 0xf6, 0x0a, 0x3a, 0x93, 0xb3, 0x77, 0x49, 0x37, 0x3c, + 0x81, 0xd6, 0xc5, 0xe2, 0x3d, 0x22, 0xb8, 0xd3, 0x22, 0x9f, 0x43, 0x7b, 0xb5, 0x48, 0xa6, 0x54, + 0xfd, 0x95, 0x64, 0x43, 0x97, 0x40, 0x16, 0x3f, 0xf7, 0x00, 0x54, 0xe1, 0x8c, 0xae, 0xe8, 0x52, + 0x3a, 0x5b, 0x27, 0x55, 0x25, 0x79, 0x45, 0x97, 0xf8, 0x8f, 0x06, 0xdc, 0x8b, 0x2d, 0x90, 0x89, + 0xef, 0x55, 0xe5, 0xe6, 0xde, 0x55, 0xb9, 0xe8, 0x23, 0x28, 0xcd, 0x14, 0xaa, 0xaa, 0xf0, 0x7a, + 0x68, 0x77, 0x41, 0x05, 0x9a, 0xd2, 0xe1, 0x5f, 0xc3, 0x76, 0xe4, 0xd0, 0xd1, 0x32, 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0e, 0x9a, 0xee, 0xe4, 0x42, 0xd0, 0x5b, 0x9a, 0xca, 0x10, 0xf4, 0xb6, 0x06, + 0x10, 0x6f, 0x1d, 0x3d, 0xfd, 0xfb, 0xdb, 0x7d, 0xe3, 0x1f, 0x6f, 0xf7, 0x8d, 0x7f, 0xbe, 0xdd, + 0x37, 0xfe, 0xf2, 0xaf, 0xfd, 0x2d, 0x30, 0x27, 0xde, 0xbc, 0xeb, 0x3b, 0xee, 0x74, 0x62, 0xf9, + 0x5d, 0xee, 0x5c, 0x5d, 0x77, 0xaf, 0xae, 0xe5, 0xdf, 0xc5, 0xe3, 0x92, 0xfc, 0xf9, 0xe9, 0x7f, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x9e, 0xdd, 0x36, 0xc7, 0x6d, 0x16, 0x00, 0x00, } diff --git a/_vendor/src/github.com/pingcap/kvproto/pkg/raft_cmdpb/raft_cmdpb.pb.go b/_vendor/src/github.com/pingcap/kvproto/pkg/raft_cmdpb/raft_cmdpb.pb.go new file mode 100644 index 0000000000000..46217fbb60d82 --- /dev/null +++ b/_vendor/src/github.com/pingcap/kvproto/pkg/raft_cmdpb/raft_cmdpb.pb.go @@ -0,0 +1,7354 @@ +// Code generated by protoc-gen-gogo. +// source: raft_cmdpb.proto +// DO NOT EDIT! + +/* + Package raft_cmdpb is a generated protocol buffer package. + + It is generated from these files: + raft_cmdpb.proto + + It has these top-level messages: + GetRequest + GetResponse + PutRequest + PutResponse + DeleteRequest + DeleteResponse + SnapRequest + SnapResponse + PrewriteRequest + PrewriteResponse + Request + Response + ChangePeerRequest + ChangePeerResponse + SplitRequest + SplitResponse + CompactLogRequest + CompactLogResponse + TransferLeaderRequest + TransferLeaderResponse + VerifyHashRequest + VerifyHashResponse + AdminRequest + AdminResponse + RegionLeaderRequest + RegionLeaderResponse + RegionDetailRequest + RegionDetailResponse + StatusRequest + StatusResponse + RaftRequestHeader + RaftResponseHeader + RaftCmdRequest + RaftCmdResponse +*/ +package raft_cmdpb + +import ( + "fmt" + "io" + "math" + + proto "github.com/golang/protobuf/proto" + + metapb "github.com/pingcap/kvproto/pkg/metapb" + + errorpb "github.com/pingcap/kvproto/pkg/errorpb" + + eraftpb "github.com/pingcap/kvproto/pkg/eraftpb" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type CmdType int32 + +const ( + CmdType_Invalid CmdType = 0 + CmdType_Get CmdType = 1 + CmdType_Put CmdType = 3 + CmdType_Delete CmdType = 4 + CmdType_Snap CmdType = 5 + CmdType_Prewrite CmdType = 6 +) + +var CmdType_name = map[int32]string{ + 0: "Invalid", + 1: "Get", + 3: "Put", + 4: "Delete", + 5: "Snap", + 6: "Prewrite", +} +var CmdType_value = map[string]int32{ + "Invalid": 0, + "Get": 1, + "Put": 3, + "Delete": 4, + "Snap": 5, + "Prewrite": 6, +} + +func (x CmdType) Enum() *CmdType { + p := new(CmdType) + *p = x + return p +} +func (x CmdType) String() string { + return proto.EnumName(CmdType_name, int32(x)) +} +func (x *CmdType) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(CmdType_value, data, "CmdType") + if err != nil { + return err + } + *x = CmdType(value) + return nil +} +func (CmdType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{0} } + +type AdminCmdType int32 + +const ( + AdminCmdType_InvalidAdmin AdminCmdType = 0 + AdminCmdType_ChangePeer AdminCmdType = 1 + AdminCmdType_Split AdminCmdType = 2 + AdminCmdType_CompactLog AdminCmdType = 3 + AdminCmdType_TransferLeader AdminCmdType = 4 + AdminCmdType_ComputeHash AdminCmdType = 5 + AdminCmdType_VerifyHash AdminCmdType = 6 +) + +var AdminCmdType_name = map[int32]string{ + 0: "InvalidAdmin", + 1: "ChangePeer", + 2: "Split", + 3: "CompactLog", + 4: "TransferLeader", + 5: "ComputeHash", + 6: "VerifyHash", +} +var AdminCmdType_value = map[string]int32{ + "InvalidAdmin": 0, + "ChangePeer": 1, + "Split": 2, + "CompactLog": 3, + "TransferLeader": 4, + "ComputeHash": 5, + "VerifyHash": 6, +} + +func (x AdminCmdType) Enum() *AdminCmdType { + p := new(AdminCmdType) + *p = x + return p +} +func (x AdminCmdType) String() string { + return proto.EnumName(AdminCmdType_name, int32(x)) +} +func (x *AdminCmdType) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(AdminCmdType_value, data, "AdminCmdType") + if err != nil { + return err + } + *x = AdminCmdType(value) + return nil +} +func (AdminCmdType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{1} } + +type StatusCmdType int32 + +const ( + StatusCmdType_InvalidStatus StatusCmdType = 0 + StatusCmdType_RegionLeader StatusCmdType = 1 + StatusCmdType_RegionDetail StatusCmdType = 2 +) + +var StatusCmdType_name = map[int32]string{ + 0: "InvalidStatus", + 1: "RegionLeader", + 2: "RegionDetail", +} +var StatusCmdType_value = map[string]int32{ + "InvalidStatus": 0, + "RegionLeader": 1, + "RegionDetail": 2, +} + +func (x StatusCmdType) Enum() *StatusCmdType { + p := new(StatusCmdType) + *p = x + return p +} +func (x StatusCmdType) String() string { + return proto.EnumName(StatusCmdType_name, int32(x)) +} +func (x *StatusCmdType) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(StatusCmdType_value, data, "StatusCmdType") + if err != nil { + return err + } + *x = StatusCmdType(value) + return nil +} +func (StatusCmdType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{2} } + +type GetRequest struct { + Cf *string `protobuf:"bytes,1,opt,name=cf" json:"cf,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GetRequest) Reset() { *m = GetRequest{} } +func (m *GetRequest) String() string { return proto.CompactTextString(m) } +func (*GetRequest) ProtoMessage() {} +func (*GetRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{0} } + +func (m *GetRequest) GetCf() string { + if m != nil && m.Cf != nil { + return *m.Cf + } + return "" +} + +func (m *GetRequest) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +type GetResponse struct { + Value []byte `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GetResponse) Reset() { *m = GetResponse{} } +func (m *GetResponse) String() string { return proto.CompactTextString(m) } +func (*GetResponse) ProtoMessage() {} +func (*GetResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{1} } + +func (m *GetResponse) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +type PutRequest struct { + Cf *string `protobuf:"bytes,1,opt,name=cf" json:"cf,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` + Value []byte `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *PutRequest) Reset() { *m = PutRequest{} } +func (m *PutRequest) String() string { return proto.CompactTextString(m) } +func (*PutRequest) ProtoMessage() {} +func (*PutRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{2} } + +func (m *PutRequest) GetCf() string { + if m != nil && m.Cf != nil { + return *m.Cf + } + return "" +} + +func (m *PutRequest) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *PutRequest) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +type PutResponse struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *PutResponse) Reset() { *m = PutResponse{} } +func (m *PutResponse) String() string { return proto.CompactTextString(m) } +func (*PutResponse) ProtoMessage() {} +func (*PutResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{3} } + +type DeleteRequest struct { + Cf *string `protobuf:"bytes,1,opt,name=cf" json:"cf,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } +func (m *DeleteRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteRequest) ProtoMessage() {} +func (*DeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{4} } + +func (m *DeleteRequest) GetCf() string { + if m != nil && m.Cf != nil { + return *m.Cf + } + return "" +} + +func (m *DeleteRequest) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +type DeleteResponse struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *DeleteResponse) Reset() { *m = DeleteResponse{} } +func (m *DeleteResponse) String() string { return proto.CompactTextString(m) } +func (*DeleteResponse) ProtoMessage() {} +func (*DeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{5} } + +type SnapRequest struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *SnapRequest) Reset() { *m = SnapRequest{} } +func (m *SnapRequest) String() string { return proto.CompactTextString(m) } +func (*SnapRequest) ProtoMessage() {} +func (*SnapRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{6} } + +type SnapResponse struct { + Region *metapb.Region `protobuf:"bytes,1,opt,name=region" json:"region,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SnapResponse) Reset() { *m = SnapResponse{} } +func (m *SnapResponse) String() string { return proto.CompactTextString(m) } +func (*SnapResponse) ProtoMessage() {} +func (*SnapResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{7} } + +func (m *SnapResponse) GetRegion() *metapb.Region { + if m != nil { + return m.Region + } + return nil +} + +type PrewriteRequest struct { + Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + Lock []byte `protobuf:"bytes,3,opt,name=lock" json:"lock,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *PrewriteRequest) Reset() { *m = PrewriteRequest{} } +func (m *PrewriteRequest) String() string { return proto.CompactTextString(m) } +func (*PrewriteRequest) ProtoMessage() {} +func (*PrewriteRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{8} } + +func (m *PrewriteRequest) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *PrewriteRequest) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *PrewriteRequest) GetLock() []byte { + if m != nil { + return m.Lock + } + return nil +} + +type PrewriteResponse struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *PrewriteResponse) Reset() { *m = PrewriteResponse{} } +func (m *PrewriteResponse) String() string { return proto.CompactTextString(m) } +func (*PrewriteResponse) ProtoMessage() {} +func (*PrewriteResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{9} } + +type Request struct { + CmdType *CmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.CmdType" json:"cmd_type,omitempty"` + Get *GetRequest `protobuf:"bytes,2,opt,name=get" json:"get,omitempty"` + Put *PutRequest `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"` + Delete *DeleteRequest `protobuf:"bytes,5,opt,name=delete" json:"delete,omitempty"` + Snap *SnapRequest `protobuf:"bytes,6,opt,name=snap" json:"snap,omitempty"` + Prewrite *PrewriteRequest `protobuf:"bytes,7,opt,name=prewrite" json:"prewrite,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Request) Reset() { *m = Request{} } +func (m *Request) String() string { return proto.CompactTextString(m) } +func (*Request) ProtoMessage() {} +func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{10} } + +func (m *Request) GetCmdType() CmdType { + if m != nil && m.CmdType != nil { + return *m.CmdType + } + return CmdType_Invalid +} + +func (m *Request) GetGet() *GetRequest { + if m != nil { + return m.Get + } + return nil +} + +func (m *Request) GetPut() *PutRequest { + if m != nil { + return m.Put + } + return nil +} + +func (m *Request) GetDelete() *DeleteRequest { + if m != nil { + return m.Delete + } + return nil +} + +func (m *Request) GetSnap() *SnapRequest { + if m != nil { + return m.Snap + } + return nil +} + +func (m *Request) GetPrewrite() *PrewriteRequest { + if m != nil { + return m.Prewrite + } + return nil +} + +type Response struct { + CmdType *CmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.CmdType" json:"cmd_type,omitempty"` + Get *GetResponse `protobuf:"bytes,2,opt,name=get" json:"get,omitempty"` + Put *PutResponse `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"` + Delete *DeleteResponse `protobuf:"bytes,5,opt,name=delete" json:"delete,omitempty"` + Snap *SnapResponse `protobuf:"bytes,6,opt,name=snap" json:"snap,omitempty"` + Prewrite *PrewriteResponse `protobuf:"bytes,7,opt,name=prewrite" json:"prewrite,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Response) Reset() { *m = Response{} } +func (m *Response) String() string { return proto.CompactTextString(m) } +func (*Response) ProtoMessage() {} +func (*Response) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{11} } + +func (m *Response) GetCmdType() CmdType { + if m != nil && m.CmdType != nil { + return *m.CmdType + } + return CmdType_Invalid +} + +func (m *Response) GetGet() *GetResponse { + if m != nil { + return m.Get + } + return nil +} + +func (m *Response) GetPut() *PutResponse { + if m != nil { + return m.Put + } + return nil +} + +func (m *Response) GetDelete() *DeleteResponse { + if m != nil { + return m.Delete + } + return nil +} + +func (m *Response) GetSnap() *SnapResponse { + if m != nil { + return m.Snap + } + return nil +} + +func (m *Response) GetPrewrite() *PrewriteResponse { + if m != nil { + return m.Prewrite + } + return nil +} + +type ChangePeerRequest struct { + // This can be only called in internal RaftStore now. + ChangeType *eraftpb.ConfChangeType `protobuf:"varint,1,opt,name=change_type,json=changeType,enum=eraftpb.ConfChangeType" json:"change_type,omitempty"` + Peer *metapb.Peer `protobuf:"bytes,2,opt,name=peer" json:"peer,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *ChangePeerRequest) Reset() { *m = ChangePeerRequest{} } +func (m *ChangePeerRequest) String() string { return proto.CompactTextString(m) } +func (*ChangePeerRequest) ProtoMessage() {} +func (*ChangePeerRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{12} } + +func (m *ChangePeerRequest) GetChangeType() eraftpb.ConfChangeType { + if m != nil && m.ChangeType != nil { + return *m.ChangeType + } + return eraftpb.ConfChangeType_AddNode +} + +func (m *ChangePeerRequest) GetPeer() *metapb.Peer { + if m != nil { + return m.Peer + } + return nil +} + +type ChangePeerResponse struct { + Region *metapb.Region `protobuf:"bytes,1,opt,name=region" json:"region,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *ChangePeerResponse) Reset() { *m = ChangePeerResponse{} } +func (m *ChangePeerResponse) String() string { return proto.CompactTextString(m) } +func (*ChangePeerResponse) ProtoMessage() {} +func (*ChangePeerResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{13} } + +func (m *ChangePeerResponse) GetRegion() *metapb.Region { + if m != nil { + return m.Region + } + return nil +} + +type SplitRequest struct { + // This can be only called in internal RaftStore now. + // The split_key must be in the been splitting region. + SplitKey []byte `protobuf:"bytes,1,opt,name=split_key,json=splitKey" json:"split_key,omitempty"` + // We split the region into two, first uses the origin + // parent region id, and the second uses the new_region_id. + // We must guarantee that the new_region_id is global unique. + NewRegionId *uint64 `protobuf:"varint,2,opt,name=new_region_id,json=newRegionId" json:"new_region_id,omitempty"` + // The peer ids for the new split region. + NewPeerIds []uint64 `protobuf:"varint,3,rep,name=new_peer_ids,json=newPeerIds" json:"new_peer_ids,omitempty"` + // If true, right region derive the origin region_id, + // left region use new_region_id. + RightDerive *bool `protobuf:"varint,4,opt,name=right_derive,json=rightDerive" json:"right_derive,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SplitRequest) Reset() { *m = SplitRequest{} } +func (m *SplitRequest) String() string { return proto.CompactTextString(m) } +func (*SplitRequest) ProtoMessage() {} +func (*SplitRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{14} } + +func (m *SplitRequest) GetSplitKey() []byte { + if m != nil { + return m.SplitKey + } + return nil +} + +func (m *SplitRequest) GetNewRegionId() uint64 { + if m != nil && m.NewRegionId != nil { + return *m.NewRegionId + } + return 0 +} + +func (m *SplitRequest) GetNewPeerIds() []uint64 { + if m != nil { + return m.NewPeerIds + } + return nil +} + +func (m *SplitRequest) GetRightDerive() bool { + if m != nil && m.RightDerive != nil { + return *m.RightDerive + } + return false +} + +type SplitResponse struct { + Left *metapb.Region `protobuf:"bytes,1,opt,name=left" json:"left,omitempty"` + Right *metapb.Region `protobuf:"bytes,2,opt,name=right" json:"right,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SplitResponse) Reset() { *m = SplitResponse{} } +func (m *SplitResponse) String() string { return proto.CompactTextString(m) } +func (*SplitResponse) ProtoMessage() {} +func (*SplitResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{15} } + +func (m *SplitResponse) GetLeft() *metapb.Region { + if m != nil { + return m.Left + } + return nil +} + +func (m *SplitResponse) GetRight() *metapb.Region { + if m != nil { + return m.Right + } + return nil +} + +type CompactLogRequest struct { + CompactIndex *uint64 `protobuf:"varint,1,opt,name=compact_index,json=compactIndex" json:"compact_index,omitempty"` + CompactTerm *uint64 `protobuf:"varint,2,opt,name=compact_term,json=compactTerm" json:"compact_term,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *CompactLogRequest) Reset() { *m = CompactLogRequest{} } +func (m *CompactLogRequest) String() string { return proto.CompactTextString(m) } +func (*CompactLogRequest) ProtoMessage() {} +func (*CompactLogRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{16} } + +func (m *CompactLogRequest) GetCompactIndex() uint64 { + if m != nil && m.CompactIndex != nil { + return *m.CompactIndex + } + return 0 +} + +func (m *CompactLogRequest) GetCompactTerm() uint64 { + if m != nil && m.CompactTerm != nil { + return *m.CompactTerm + } + return 0 +} + +type CompactLogResponse struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *CompactLogResponse) Reset() { *m = CompactLogResponse{} } +func (m *CompactLogResponse) String() string { return proto.CompactTextString(m) } +func (*CompactLogResponse) ProtoMessage() {} +func (*CompactLogResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{17} } + +type TransferLeaderRequest struct { + Peer *metapb.Peer `protobuf:"bytes,1,opt,name=peer" json:"peer,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *TransferLeaderRequest) Reset() { *m = TransferLeaderRequest{} } +func (m *TransferLeaderRequest) String() string { return proto.CompactTextString(m) } +func (*TransferLeaderRequest) ProtoMessage() {} +func (*TransferLeaderRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{18} } + +func (m *TransferLeaderRequest) GetPeer() *metapb.Peer { + if m != nil { + return m.Peer + } + return nil +} + +type TransferLeaderResponse struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *TransferLeaderResponse) Reset() { *m = TransferLeaderResponse{} } +func (m *TransferLeaderResponse) String() string { return proto.CompactTextString(m) } +func (*TransferLeaderResponse) ProtoMessage() {} +func (*TransferLeaderResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{19} } + +type VerifyHashRequest struct { + Index *uint64 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash" json:"hash,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *VerifyHashRequest) Reset() { *m = VerifyHashRequest{} } +func (m *VerifyHashRequest) String() string { return proto.CompactTextString(m) } +func (*VerifyHashRequest) ProtoMessage() {} +func (*VerifyHashRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{20} } + +func (m *VerifyHashRequest) GetIndex() uint64 { + if m != nil && m.Index != nil { + return *m.Index + } + return 0 +} + +func (m *VerifyHashRequest) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +type VerifyHashResponse struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *VerifyHashResponse) Reset() { *m = VerifyHashResponse{} } +func (m *VerifyHashResponse) String() string { return proto.CompactTextString(m) } +func (*VerifyHashResponse) ProtoMessage() {} +func (*VerifyHashResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{21} } + +type AdminRequest struct { + CmdType *AdminCmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.AdminCmdType" json:"cmd_type,omitempty"` + ChangePeer *ChangePeerRequest `protobuf:"bytes,2,opt,name=change_peer,json=changePeer" json:"change_peer,omitempty"` + Split *SplitRequest `protobuf:"bytes,3,opt,name=split" json:"split,omitempty"` + CompactLog *CompactLogRequest `protobuf:"bytes,4,opt,name=compact_log,json=compactLog" json:"compact_log,omitempty"` + TransferLeader *TransferLeaderRequest `protobuf:"bytes,5,opt,name=transfer_leader,json=transferLeader" json:"transfer_leader,omitempty"` + VerifyHash *VerifyHashRequest `protobuf:"bytes,6,opt,name=verify_hash,json=verifyHash" json:"verify_hash,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AdminRequest) Reset() { *m = AdminRequest{} } +func (m *AdminRequest) String() string { return proto.CompactTextString(m) } +func (*AdminRequest) ProtoMessage() {} +func (*AdminRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{22} } + +func (m *AdminRequest) GetCmdType() AdminCmdType { + if m != nil && m.CmdType != nil { + return *m.CmdType + } + return AdminCmdType_InvalidAdmin +} + +func (m *AdminRequest) GetChangePeer() *ChangePeerRequest { + if m != nil { + return m.ChangePeer + } + return nil +} + +func (m *AdminRequest) GetSplit() *SplitRequest { + if m != nil { + return m.Split + } + return nil +} + +func (m *AdminRequest) GetCompactLog() *CompactLogRequest { + if m != nil { + return m.CompactLog + } + return nil +} + +func (m *AdminRequest) GetTransferLeader() *TransferLeaderRequest { + if m != nil { + return m.TransferLeader + } + return nil +} + +func (m *AdminRequest) GetVerifyHash() *VerifyHashRequest { + if m != nil { + return m.VerifyHash + } + return nil +} + +type AdminResponse struct { + CmdType *AdminCmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.AdminCmdType" json:"cmd_type,omitempty"` + ChangePeer *ChangePeerResponse `protobuf:"bytes,2,opt,name=change_peer,json=changePeer" json:"change_peer,omitempty"` + Split *SplitResponse `protobuf:"bytes,3,opt,name=split" json:"split,omitempty"` + CompactLog *CompactLogResponse `protobuf:"bytes,4,opt,name=compact_log,json=compactLog" json:"compact_log,omitempty"` + TransferLeader *TransferLeaderResponse `protobuf:"bytes,5,opt,name=transfer_leader,json=transferLeader" json:"transfer_leader,omitempty"` + VerifyHash *VerifyHashResponse `protobuf:"bytes,6,opt,name=verify_hash,json=verifyHash" json:"verify_hash,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *AdminResponse) Reset() { *m = AdminResponse{} } +func (m *AdminResponse) String() string { return proto.CompactTextString(m) } +func (*AdminResponse) ProtoMessage() {} +func (*AdminResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{23} } + +func (m *AdminResponse) GetCmdType() AdminCmdType { + if m != nil && m.CmdType != nil { + return *m.CmdType + } + return AdminCmdType_InvalidAdmin +} + +func (m *AdminResponse) GetChangePeer() *ChangePeerResponse { + if m != nil { + return m.ChangePeer + } + return nil +} + +func (m *AdminResponse) GetSplit() *SplitResponse { + if m != nil { + return m.Split + } + return nil +} + +func (m *AdminResponse) GetCompactLog() *CompactLogResponse { + if m != nil { + return m.CompactLog + } + return nil +} + +func (m *AdminResponse) GetTransferLeader() *TransferLeaderResponse { + if m != nil { + return m.TransferLeader + } + return nil +} + +func (m *AdminResponse) GetVerifyHash() *VerifyHashResponse { + if m != nil { + return m.VerifyHash + } + return nil +} + +// For get the leader of the region. +type RegionLeaderRequest struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *RegionLeaderRequest) Reset() { *m = RegionLeaderRequest{} } +func (m *RegionLeaderRequest) String() string { return proto.CompactTextString(m) } +func (*RegionLeaderRequest) ProtoMessage() {} +func (*RegionLeaderRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{24} } + +type RegionLeaderResponse struct { + Leader *metapb.Peer `protobuf:"bytes,1,opt,name=leader" json:"leader,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *RegionLeaderResponse) Reset() { *m = RegionLeaderResponse{} } +func (m *RegionLeaderResponse) String() string { return proto.CompactTextString(m) } +func (*RegionLeaderResponse) ProtoMessage() {} +func (*RegionLeaderResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{25} } + +func (m *RegionLeaderResponse) GetLeader() *metapb.Peer { + if m != nil { + return m.Leader + } + return nil +} + +// For getting more information of the region. +// We add some admin operations (ChangePeer, Split...) into the pb job list, +// then pd server will peek the first one, handle it and then pop it from the job lib. +// But sometimes, the pd server may crash before popping. When another pd server +// starts and finds the job is running but not finished, it will first check whether +// the raft server already has handled this job. +// E,g, for ChangePeer, if we add Peer10 into region1 and find region1 has already had +// Peer10, we can think this ChangePeer is finished, and can pop this job from job list +// directly. +type RegionDetailRequest struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *RegionDetailRequest) Reset() { *m = RegionDetailRequest{} } +func (m *RegionDetailRequest) String() string { return proto.CompactTextString(m) } +func (*RegionDetailRequest) ProtoMessage() {} +func (*RegionDetailRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{26} } + +type RegionDetailResponse struct { + Region *metapb.Region `protobuf:"bytes,1,opt,name=region" json:"region,omitempty"` + Leader *metapb.Peer `protobuf:"bytes,2,opt,name=leader" json:"leader,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *RegionDetailResponse) Reset() { *m = RegionDetailResponse{} } +func (m *RegionDetailResponse) String() string { return proto.CompactTextString(m) } +func (*RegionDetailResponse) ProtoMessage() {} +func (*RegionDetailResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{27} } + +func (m *RegionDetailResponse) GetRegion() *metapb.Region { + if m != nil { + return m.Region + } + return nil +} + +func (m *RegionDetailResponse) GetLeader() *metapb.Peer { + if m != nil { + return m.Leader + } + return nil +} + +type StatusRequest struct { + CmdType *StatusCmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.StatusCmdType" json:"cmd_type,omitempty"` + RegionLeader *RegionLeaderRequest `protobuf:"bytes,2,opt,name=region_leader,json=regionLeader" json:"region_leader,omitempty"` + RegionDetail *RegionDetailRequest `protobuf:"bytes,3,opt,name=region_detail,json=regionDetail" json:"region_detail,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *StatusRequest) Reset() { *m = StatusRequest{} } +func (m *StatusRequest) String() string { return proto.CompactTextString(m) } +func (*StatusRequest) ProtoMessage() {} +func (*StatusRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{28} } + +func (m *StatusRequest) GetCmdType() StatusCmdType { + if m != nil && m.CmdType != nil { + return *m.CmdType + } + return StatusCmdType_InvalidStatus +} + +func (m *StatusRequest) GetRegionLeader() *RegionLeaderRequest { + if m != nil { + return m.RegionLeader + } + return nil +} + +func (m *StatusRequest) GetRegionDetail() *RegionDetailRequest { + if m != nil { + return m.RegionDetail + } + return nil +} + +type StatusResponse struct { + CmdType *StatusCmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.StatusCmdType" json:"cmd_type,omitempty"` + RegionLeader *RegionLeaderResponse `protobuf:"bytes,2,opt,name=region_leader,json=regionLeader" json:"region_leader,omitempty"` + RegionDetail *RegionDetailResponse `protobuf:"bytes,3,opt,name=region_detail,json=regionDetail" json:"region_detail,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *StatusResponse) Reset() { *m = StatusResponse{} } +func (m *StatusResponse) String() string { return proto.CompactTextString(m) } +func (*StatusResponse) ProtoMessage() {} +func (*StatusResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{29} } + +func (m *StatusResponse) GetCmdType() StatusCmdType { + if m != nil && m.CmdType != nil { + return *m.CmdType + } + return StatusCmdType_InvalidStatus +} + +func (m *StatusResponse) GetRegionLeader() *RegionLeaderResponse { + if m != nil { + return m.RegionLeader + } + return nil +} + +func (m *StatusResponse) GetRegionDetail() *RegionDetailResponse { + if m != nil { + return m.RegionDetail + } + return nil +} + +type RaftRequestHeader struct { + RegionId *uint64 `protobuf:"varint,1,opt,name=region_id,json=regionId" json:"region_id,omitempty"` + Peer *metapb.Peer `protobuf:"bytes,2,opt,name=peer" json:"peer,omitempty"` + // true for read linearization + ReadQuorum *bool `protobuf:"varint,3,opt,name=read_quorum,json=readQuorum" json:"read_quorum,omitempty"` + // 16 bytes, to distinguish request. + Uuid []byte `protobuf:"bytes,4,opt,name=uuid" json:"uuid,omitempty"` + RegionEpoch *metapb.RegionEpoch `protobuf:"bytes,5,opt,name=region_epoch,json=regionEpoch" json:"region_epoch,omitempty"` + Term *uint64 `protobuf:"varint,6,opt,name=term" json:"term,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *RaftRequestHeader) Reset() { *m = RaftRequestHeader{} } +func (m *RaftRequestHeader) String() string { return proto.CompactTextString(m) } +func (*RaftRequestHeader) ProtoMessage() {} +func (*RaftRequestHeader) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{30} } + +func (m *RaftRequestHeader) GetRegionId() uint64 { + if m != nil && m.RegionId != nil { + return *m.RegionId + } + return 0 +} + +func (m *RaftRequestHeader) GetPeer() *metapb.Peer { + if m != nil { + return m.Peer + } + return nil +} + +func (m *RaftRequestHeader) GetReadQuorum() bool { + if m != nil && m.ReadQuorum != nil { + return *m.ReadQuorum + } + return false +} + +func (m *RaftRequestHeader) GetUuid() []byte { + if m != nil { + return m.Uuid + } + return nil +} + +func (m *RaftRequestHeader) GetRegionEpoch() *metapb.RegionEpoch { + if m != nil { + return m.RegionEpoch + } + return nil +} + +func (m *RaftRequestHeader) GetTerm() uint64 { + if m != nil && m.Term != nil { + return *m.Term + } + return 0 +} + +type RaftResponseHeader struct { + Error *errorpb.Error `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` + Uuid []byte `protobuf:"bytes,2,opt,name=uuid" json:"uuid,omitempty"` + CurrentTerm *uint64 `protobuf:"varint,3,opt,name=current_term,json=currentTerm" json:"current_term,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *RaftResponseHeader) Reset() { *m = RaftResponseHeader{} } +func (m *RaftResponseHeader) String() string { return proto.CompactTextString(m) } +func (*RaftResponseHeader) ProtoMessage() {} +func (*RaftResponseHeader) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{31} } + +func (m *RaftResponseHeader) GetError() *errorpb.Error { + if m != nil { + return m.Error + } + return nil +} + +func (m *RaftResponseHeader) GetUuid() []byte { + if m != nil { + return m.Uuid + } + return nil +} + +func (m *RaftResponseHeader) GetCurrentTerm() uint64 { + if m != nil && m.CurrentTerm != nil { + return *m.CurrentTerm + } + return 0 +} + +type RaftCmdRequest struct { + Header *RaftRequestHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + // We can't enclose normal requests and administrator request + // at same time. + Requests []*Request `protobuf:"bytes,2,rep,name=requests" json:"requests,omitempty"` + AdminRequest *AdminRequest `protobuf:"bytes,3,opt,name=admin_request,json=adminRequest" json:"admin_request,omitempty"` + StatusRequest *StatusRequest `protobuf:"bytes,4,opt,name=status_request,json=statusRequest" json:"status_request,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *RaftCmdRequest) Reset() { *m = RaftCmdRequest{} } +func (m *RaftCmdRequest) String() string { return proto.CompactTextString(m) } +func (*RaftCmdRequest) ProtoMessage() {} +func (*RaftCmdRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{32} } + +func (m *RaftCmdRequest) GetHeader() *RaftRequestHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *RaftCmdRequest) GetRequests() []*Request { + if m != nil { + return m.Requests + } + return nil +} + +func (m *RaftCmdRequest) GetAdminRequest() *AdminRequest { + if m != nil { + return m.AdminRequest + } + return nil +} + +func (m *RaftCmdRequest) GetStatusRequest() *StatusRequest { + if m != nil { + return m.StatusRequest + } + return nil +} + +type RaftCmdResponse struct { + Header *RaftResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Responses []*Response `protobuf:"bytes,2,rep,name=responses" json:"responses,omitempty"` + AdminResponse *AdminResponse `protobuf:"bytes,3,opt,name=admin_response,json=adminResponse" json:"admin_response,omitempty"` + StatusResponse *StatusResponse `protobuf:"bytes,4,opt,name=status_response,json=statusResponse" json:"status_response,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *RaftCmdResponse) Reset() { *m = RaftCmdResponse{} } +func (m *RaftCmdResponse) String() string { return proto.CompactTextString(m) } +func (*RaftCmdResponse) ProtoMessage() {} +func (*RaftCmdResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{33} } + +func (m *RaftCmdResponse) GetHeader() *RaftResponseHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *RaftCmdResponse) GetResponses() []*Response { + if m != nil { + return m.Responses + } + return nil +} + +func (m *RaftCmdResponse) GetAdminResponse() *AdminResponse { + if m != nil { + return m.AdminResponse + } + return nil +} + +func (m *RaftCmdResponse) GetStatusResponse() *StatusResponse { + if m != nil { + return m.StatusResponse + } + return nil +} + +func init() { + proto.RegisterType((*GetRequest)(nil), "raft_cmdpb.GetRequest") + proto.RegisterType((*GetResponse)(nil), "raft_cmdpb.GetResponse") + proto.RegisterType((*PutRequest)(nil), "raft_cmdpb.PutRequest") + proto.RegisterType((*PutResponse)(nil), "raft_cmdpb.PutResponse") + proto.RegisterType((*DeleteRequest)(nil), "raft_cmdpb.DeleteRequest") + proto.RegisterType((*DeleteResponse)(nil), "raft_cmdpb.DeleteResponse") + proto.RegisterType((*SnapRequest)(nil), "raft_cmdpb.SnapRequest") + proto.RegisterType((*SnapResponse)(nil), "raft_cmdpb.SnapResponse") + proto.RegisterType((*PrewriteRequest)(nil), "raft_cmdpb.PrewriteRequest") + proto.RegisterType((*PrewriteResponse)(nil), "raft_cmdpb.PrewriteResponse") + proto.RegisterType((*Request)(nil), "raft_cmdpb.Request") + proto.RegisterType((*Response)(nil), "raft_cmdpb.Response") + proto.RegisterType((*ChangePeerRequest)(nil), "raft_cmdpb.ChangePeerRequest") + proto.RegisterType((*ChangePeerResponse)(nil), "raft_cmdpb.ChangePeerResponse") + proto.RegisterType((*SplitRequest)(nil), "raft_cmdpb.SplitRequest") + proto.RegisterType((*SplitResponse)(nil), "raft_cmdpb.SplitResponse") + proto.RegisterType((*CompactLogRequest)(nil), "raft_cmdpb.CompactLogRequest") + proto.RegisterType((*CompactLogResponse)(nil), "raft_cmdpb.CompactLogResponse") + proto.RegisterType((*TransferLeaderRequest)(nil), "raft_cmdpb.TransferLeaderRequest") + proto.RegisterType((*TransferLeaderResponse)(nil), "raft_cmdpb.TransferLeaderResponse") + proto.RegisterType((*VerifyHashRequest)(nil), "raft_cmdpb.VerifyHashRequest") + proto.RegisterType((*VerifyHashResponse)(nil), "raft_cmdpb.VerifyHashResponse") + proto.RegisterType((*AdminRequest)(nil), "raft_cmdpb.AdminRequest") + proto.RegisterType((*AdminResponse)(nil), "raft_cmdpb.AdminResponse") + proto.RegisterType((*RegionLeaderRequest)(nil), "raft_cmdpb.RegionLeaderRequest") + proto.RegisterType((*RegionLeaderResponse)(nil), "raft_cmdpb.RegionLeaderResponse") + proto.RegisterType((*RegionDetailRequest)(nil), "raft_cmdpb.RegionDetailRequest") + proto.RegisterType((*RegionDetailResponse)(nil), "raft_cmdpb.RegionDetailResponse") + proto.RegisterType((*StatusRequest)(nil), "raft_cmdpb.StatusRequest") + proto.RegisterType((*StatusResponse)(nil), "raft_cmdpb.StatusResponse") + proto.RegisterType((*RaftRequestHeader)(nil), "raft_cmdpb.RaftRequestHeader") + proto.RegisterType((*RaftResponseHeader)(nil), "raft_cmdpb.RaftResponseHeader") + proto.RegisterType((*RaftCmdRequest)(nil), "raft_cmdpb.RaftCmdRequest") + proto.RegisterType((*RaftCmdResponse)(nil), "raft_cmdpb.RaftCmdResponse") + proto.RegisterEnum("raft_cmdpb.CmdType", CmdType_name, CmdType_value) + proto.RegisterEnum("raft_cmdpb.AdminCmdType", AdminCmdType_name, AdminCmdType_value) + proto.RegisterEnum("raft_cmdpb.StatusCmdType", StatusCmdType_name, StatusCmdType_value) +} +func (m *GetRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Cf != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(*m.Cf))) + i += copy(dAtA[i:], *m.Cf) + } + if m.Key != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.Key))) + i += copy(dAtA[i:], m.Key) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *GetResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Value != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.Value))) + i += copy(dAtA[i:], m.Value) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *PutRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PutRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Cf != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(*m.Cf))) + i += copy(dAtA[i:], *m.Cf) + } + if m.Key != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.Key))) + i += copy(dAtA[i:], m.Key) + } + if m.Value != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.Value))) + i += copy(dAtA[i:], m.Value) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *PutResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PutResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *DeleteRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Cf != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(*m.Cf))) + i += copy(dAtA[i:], *m.Cf) + } + if m.Key != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.Key))) + i += copy(dAtA[i:], m.Key) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *DeleteResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *SnapRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SnapRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *SnapResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SnapResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Region != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Region.Size())) + n1, err := m.Region.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *PrewriteRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PrewriteRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Key != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.Key))) + i += copy(dAtA[i:], m.Key) + } + if m.Value != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.Value))) + i += copy(dAtA[i:], m.Value) + } + if m.Lock != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.Lock))) + i += copy(dAtA[i:], m.Lock) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *PrewriteResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PrewriteResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Request) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Request) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.CmdType != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.CmdType)) + } + if m.Get != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Get.Size())) + n2, err := m.Get.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } + if m.Put != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Put.Size())) + n3, err := m.Put.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 + } + if m.Delete != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Delete.Size())) + n4, err := m.Delete.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 + } + if m.Snap != nil { + dAtA[i] = 0x32 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Snap.Size())) + n5, err := m.Snap.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 + } + if m.Prewrite != nil { + dAtA[i] = 0x3a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Prewrite.Size())) + n6, err := m.Prewrite.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n6 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Response) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Response) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.CmdType != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.CmdType)) + } + if m.Get != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Get.Size())) + n7, err := m.Get.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n7 + } + if m.Put != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Put.Size())) + n8, err := m.Put.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n8 + } + if m.Delete != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Delete.Size())) + n9, err := m.Delete.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n9 + } + if m.Snap != nil { + dAtA[i] = 0x32 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Snap.Size())) + n10, err := m.Snap.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n10 + } + if m.Prewrite != nil { + dAtA[i] = 0x3a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Prewrite.Size())) + n11, err := m.Prewrite.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n11 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *ChangePeerRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChangePeerRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ChangeType != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.ChangeType)) + } + if m.Peer != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Peer.Size())) + n12, err := m.Peer.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n12 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *ChangePeerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChangePeerResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Region != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Region.Size())) + n13, err := m.Region.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n13 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *SplitRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SplitRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.SplitKey != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.SplitKey))) + i += copy(dAtA[i:], m.SplitKey) + } + if m.NewRegionId != nil { + dAtA[i] = 0x10 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.NewRegionId)) + } + if len(m.NewPeerIds) > 0 { + for _, num := range m.NewPeerIds { + dAtA[i] = 0x18 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(num)) + } + } + if m.RightDerive != nil { + dAtA[i] = 0x20 + i++ + if *m.RightDerive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *SplitResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SplitResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Left != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Left.Size())) + n14, err := m.Left.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n14 + } + if m.Right != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Right.Size())) + n15, err := m.Right.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n15 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *CompactLogRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompactLogRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.CompactIndex != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.CompactIndex)) + } + if m.CompactTerm != nil { + dAtA[i] = 0x10 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.CompactTerm)) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *CompactLogResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompactLogResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *TransferLeaderRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TransferLeaderRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Peer != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Peer.Size())) + n16, err := m.Peer.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n16 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *TransferLeaderResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TransferLeaderResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *VerifyHashRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VerifyHashRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Index != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.Index)) + } + if m.Hash != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.Hash))) + i += copy(dAtA[i:], m.Hash) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *VerifyHashResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VerifyHashResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *AdminRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AdminRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.CmdType != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.CmdType)) + } + if m.ChangePeer != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.ChangePeer.Size())) + n17, err := m.ChangePeer.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n17 + } + if m.Split != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Split.Size())) + n18, err := m.Split.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n18 + } + if m.CompactLog != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.CompactLog.Size())) + n19, err := m.CompactLog.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n19 + } + if m.TransferLeader != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.TransferLeader.Size())) + n20, err := m.TransferLeader.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n20 + } + if m.VerifyHash != nil { + dAtA[i] = 0x32 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.VerifyHash.Size())) + n21, err := m.VerifyHash.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n21 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *AdminResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AdminResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.CmdType != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.CmdType)) + } + if m.ChangePeer != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.ChangePeer.Size())) + n22, err := m.ChangePeer.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n22 + } + if m.Split != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Split.Size())) + n23, err := m.Split.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n23 + } + if m.CompactLog != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.CompactLog.Size())) + n24, err := m.CompactLog.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n24 + } + if m.TransferLeader != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.TransferLeader.Size())) + n25, err := m.TransferLeader.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n25 + } + if m.VerifyHash != nil { + dAtA[i] = 0x32 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.VerifyHash.Size())) + n26, err := m.VerifyHash.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n26 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *RegionLeaderRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RegionLeaderRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *RegionLeaderResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RegionLeaderResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Leader != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Leader.Size())) + n27, err := m.Leader.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n27 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *RegionDetailRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RegionDetailRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *RegionDetailResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RegionDetailResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Region != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Region.Size())) + n28, err := m.Region.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n28 + } + if m.Leader != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Leader.Size())) + n29, err := m.Leader.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n29 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *StatusRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.CmdType != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.CmdType)) + } + if m.RegionLeader != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.RegionLeader.Size())) + n30, err := m.RegionLeader.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n30 + } + if m.RegionDetail != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.RegionDetail.Size())) + n31, err := m.RegionDetail.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n31 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *StatusResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.CmdType != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.CmdType)) + } + if m.RegionLeader != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.RegionLeader.Size())) + n32, err := m.RegionLeader.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n32 + } + if m.RegionDetail != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.RegionDetail.Size())) + n33, err := m.RegionDetail.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n33 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *RaftRequestHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RaftRequestHeader) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.RegionId != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.RegionId)) + } + if m.Peer != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Peer.Size())) + n34, err := m.Peer.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n34 + } + if m.ReadQuorum != nil { + dAtA[i] = 0x18 + i++ + if *m.ReadQuorum { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.Uuid != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.Uuid))) + i += copy(dAtA[i:], m.Uuid) + } + if m.RegionEpoch != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.RegionEpoch.Size())) + n35, err := m.RegionEpoch.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n35 + } + if m.Term != nil { + dAtA[i] = 0x30 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.Term)) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *RaftResponseHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RaftResponseHeader) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Error != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Error.Size())) + n36, err := m.Error.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n36 + } + if m.Uuid != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(len(m.Uuid))) + i += copy(dAtA[i:], m.Uuid) + } + if m.CurrentTerm != nil { + dAtA[i] = 0x18 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(*m.CurrentTerm)) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *RaftCmdRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RaftCmdRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Header != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Header.Size())) + n37, err := m.Header.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n37 + } + if len(m.Requests) > 0 { + for _, msg := range m.Requests { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.AdminRequest != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.AdminRequest.Size())) + n38, err := m.AdminRequest.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n38 + } + if m.StatusRequest != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.StatusRequest.Size())) + n39, err := m.StatusRequest.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n39 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *RaftCmdResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RaftCmdResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Header != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.Header.Size())) + n40, err := m.Header.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n40 + } + if len(m.Responses) > 0 { + for _, msg := range m.Responses { + dAtA[i] = 0x12 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.AdminResponse != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.AdminResponse.Size())) + n41, err := m.AdminResponse.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n41 + } + if m.StatusResponse != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintRaftCmdpb(dAtA, i, uint64(m.StatusResponse.Size())) + n42, err := m.StatusResponse.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n42 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func encodeFixed64RaftCmdpb(dAtA []byte, offset int, v uint64) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + dAtA[offset+4] = uint8(v >> 32) + dAtA[offset+5] = uint8(v >> 40) + dAtA[offset+6] = uint8(v >> 48) + dAtA[offset+7] = uint8(v >> 56) + return offset + 8 +} +func encodeFixed32RaftCmdpb(dAtA []byte, offset int, v uint32) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + return offset + 4 +} +func encodeVarintRaftCmdpb(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *GetRequest) Size() (n int) { + var l int + _ = l + if m.Cf != nil { + l = len(*m.Cf) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Key != nil { + l = len(m.Key) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *GetResponse) Size() (n int) { + var l int + _ = l + if m.Value != nil { + l = len(m.Value) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PutRequest) Size() (n int) { + var l int + _ = l + if m.Cf != nil { + l = len(*m.Cf) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Key != nil { + l = len(m.Key) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Value != nil { + l = len(m.Value) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PutResponse) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DeleteRequest) Size() (n int) { + var l int + _ = l + if m.Cf != nil { + l = len(*m.Cf) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Key != nil { + l = len(m.Key) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DeleteResponse) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SnapRequest) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SnapResponse) Size() (n int) { + var l int + _ = l + if m.Region != nil { + l = m.Region.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PrewriteRequest) Size() (n int) { + var l int + _ = l + if m.Key != nil { + l = len(m.Key) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Value != nil { + l = len(m.Value) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Lock != nil { + l = len(m.Lock) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PrewriteResponse) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Request) Size() (n int) { + var l int + _ = l + if m.CmdType != nil { + n += 1 + sovRaftCmdpb(uint64(*m.CmdType)) + } + if m.Get != nil { + l = m.Get.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Put != nil { + l = m.Put.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Delete != nil { + l = m.Delete.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Snap != nil { + l = m.Snap.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Prewrite != nil { + l = m.Prewrite.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Response) Size() (n int) { + var l int + _ = l + if m.CmdType != nil { + n += 1 + sovRaftCmdpb(uint64(*m.CmdType)) + } + if m.Get != nil { + l = m.Get.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Put != nil { + l = m.Put.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Delete != nil { + l = m.Delete.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Snap != nil { + l = m.Snap.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Prewrite != nil { + l = m.Prewrite.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ChangePeerRequest) Size() (n int) { + var l int + _ = l + if m.ChangeType != nil { + n += 1 + sovRaftCmdpb(uint64(*m.ChangeType)) + } + if m.Peer != nil { + l = m.Peer.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ChangePeerResponse) Size() (n int) { + var l int + _ = l + if m.Region != nil { + l = m.Region.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SplitRequest) Size() (n int) { + var l int + _ = l + if m.SplitKey != nil { + l = len(m.SplitKey) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.NewRegionId != nil { + n += 1 + sovRaftCmdpb(uint64(*m.NewRegionId)) + } + if len(m.NewPeerIds) > 0 { + for _, e := range m.NewPeerIds { + n += 1 + sovRaftCmdpb(uint64(e)) + } + } + if m.RightDerive != nil { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SplitResponse) Size() (n int) { + var l int + _ = l + if m.Left != nil { + l = m.Left.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Right != nil { + l = m.Right.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CompactLogRequest) Size() (n int) { + var l int + _ = l + if m.CompactIndex != nil { + n += 1 + sovRaftCmdpb(uint64(*m.CompactIndex)) + } + if m.CompactTerm != nil { + n += 1 + sovRaftCmdpb(uint64(*m.CompactTerm)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CompactLogResponse) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TransferLeaderRequest) Size() (n int) { + var l int + _ = l + if m.Peer != nil { + l = m.Peer.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TransferLeaderResponse) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *VerifyHashRequest) Size() (n int) { + var l int + _ = l + if m.Index != nil { + n += 1 + sovRaftCmdpb(uint64(*m.Index)) + } + if m.Hash != nil { + l = len(m.Hash) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *VerifyHashResponse) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AdminRequest) Size() (n int) { + var l int + _ = l + if m.CmdType != nil { + n += 1 + sovRaftCmdpb(uint64(*m.CmdType)) + } + if m.ChangePeer != nil { + l = m.ChangePeer.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Split != nil { + l = m.Split.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.CompactLog != nil { + l = m.CompactLog.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.TransferLeader != nil { + l = m.TransferLeader.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.VerifyHash != nil { + l = m.VerifyHash.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *AdminResponse) Size() (n int) { + var l int + _ = l + if m.CmdType != nil { + n += 1 + sovRaftCmdpb(uint64(*m.CmdType)) + } + if m.ChangePeer != nil { + l = m.ChangePeer.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Split != nil { + l = m.Split.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.CompactLog != nil { + l = m.CompactLog.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.TransferLeader != nil { + l = m.TransferLeader.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.VerifyHash != nil { + l = m.VerifyHash.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RegionLeaderRequest) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RegionLeaderResponse) Size() (n int) { + var l int + _ = l + if m.Leader != nil { + l = m.Leader.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RegionDetailRequest) Size() (n int) { + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RegionDetailResponse) Size() (n int) { + var l int + _ = l + if m.Region != nil { + l = m.Region.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Leader != nil { + l = m.Leader.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *StatusRequest) Size() (n int) { + var l int + _ = l + if m.CmdType != nil { + n += 1 + sovRaftCmdpb(uint64(*m.CmdType)) + } + if m.RegionLeader != nil { + l = m.RegionLeader.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.RegionDetail != nil { + l = m.RegionDetail.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *StatusResponse) Size() (n int) { + var l int + _ = l + if m.CmdType != nil { + n += 1 + sovRaftCmdpb(uint64(*m.CmdType)) + } + if m.RegionLeader != nil { + l = m.RegionLeader.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.RegionDetail != nil { + l = m.RegionDetail.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RaftRequestHeader) Size() (n int) { + var l int + _ = l + if m.RegionId != nil { + n += 1 + sovRaftCmdpb(uint64(*m.RegionId)) + } + if m.Peer != nil { + l = m.Peer.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.ReadQuorum != nil { + n += 2 + } + if m.Uuid != nil { + l = len(m.Uuid) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.RegionEpoch != nil { + l = m.RegionEpoch.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Term != nil { + n += 1 + sovRaftCmdpb(uint64(*m.Term)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RaftResponseHeader) Size() (n int) { + var l int + _ = l + if m.Error != nil { + l = m.Error.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.Uuid != nil { + l = len(m.Uuid) + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.CurrentTerm != nil { + n += 1 + sovRaftCmdpb(uint64(*m.CurrentTerm)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RaftCmdRequest) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if len(m.Requests) > 0 { + for _, e := range m.Requests { + l = e.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + } + if m.AdminRequest != nil { + l = m.AdminRequest.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.StatusRequest != nil { + l = m.StatusRequest.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RaftCmdResponse) Size() (n int) { + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if len(m.Responses) > 0 { + for _, e := range m.Responses { + l = e.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + } + if m.AdminResponse != nil { + l = m.AdminResponse.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.StatusResponse != nil { + l = m.StatusResponse.Size() + n += 1 + l + sovRaftCmdpb(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovRaftCmdpb(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozRaftCmdpb(x uint64) (n int) { + return sovRaftCmdpb(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cf", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Cf = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PutRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PutRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PutRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cf", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Cf = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PutResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PutResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cf", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Cf = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Region == nil { + m.Region = &metapb.Region{} + } + if err := m.Region.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrewriteRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PrewriteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrewriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Lock", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Lock = append(m.Lock[:0], dAtA[iNdEx:postIndex]...) + if m.Lock == nil { + m.Lock = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrewriteResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PrewriteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrewriteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Request) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Request: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CmdType", wireType) + } + var v CmdType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (CmdType(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CmdType = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Get", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Get == nil { + m.Get = &GetRequest{} + } + if err := m.Get.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Put", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Put == nil { + m.Put = &PutRequest{} + } + if err := m.Put.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delete", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Delete == nil { + m.Delete = &DeleteRequest{} + } + if err := m.Delete.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Snap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Snap == nil { + m.Snap = &SnapRequest{} + } + if err := m.Snap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prewrite", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Prewrite == nil { + m.Prewrite = &PrewriteRequest{} + } + if err := m.Prewrite.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Response) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Response: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CmdType", wireType) + } + var v CmdType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (CmdType(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CmdType = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Get", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Get == nil { + m.Get = &GetResponse{} + } + if err := m.Get.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Put", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Put == nil { + m.Put = &PutResponse{} + } + if err := m.Put.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delete", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Delete == nil { + m.Delete = &DeleteResponse{} + } + if err := m.Delete.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Snap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Snap == nil { + m.Snap = &SnapResponse{} + } + if err := m.Snap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prewrite", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Prewrite == nil { + m.Prewrite = &PrewriteResponse{} + } + if err := m.Prewrite.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChangePeerRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChangePeerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChangePeerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChangeType", wireType) + } + var v eraftpb.ConfChangeType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (eraftpb.ConfChangeType(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ChangeType = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Peer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Peer == nil { + m.Peer = &metapb.Peer{} + } + if err := m.Peer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChangePeerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChangePeerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChangePeerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Region == nil { + m.Region = &metapb.Region{} + } + if err := m.Region.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SplitRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SplitRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SplitRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SplitKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SplitKey = append(m.SplitKey[:0], dAtA[iNdEx:postIndex]...) + if m.SplitKey == nil { + m.SplitKey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewRegionId", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NewRegionId = &v + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewPeerIds", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.NewPeerIds = append(m.NewPeerIds, v) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RightDerive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.RightDerive = &b + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SplitResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SplitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SplitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Left", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Left == nil { + m.Left = &metapb.Region{} + } + if err := m.Left.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Right", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Right == nil { + m.Right = &metapb.Region{} + } + if err := m.Right.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompactLogRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompactLogRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompactLogRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CompactIndex", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CompactIndex = &v + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CompactTerm", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CompactTerm = &v + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompactLogResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompactLogResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompactLogResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransferLeaderRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TransferLeaderRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransferLeaderRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Peer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Peer == nil { + m.Peer = &metapb.Peer{} + } + if err := m.Peer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransferLeaderResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TransferLeaderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransferLeaderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VerifyHashRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VerifyHashRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VerifyHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Index = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VerifyHashResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VerifyHashResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VerifyHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AdminRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AdminRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AdminRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CmdType", wireType) + } + var v AdminCmdType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (AdminCmdType(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CmdType = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChangePeer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ChangePeer == nil { + m.ChangePeer = &ChangePeerRequest{} + } + if err := m.ChangePeer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Split", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Split == nil { + m.Split = &SplitRequest{} + } + if err := m.Split.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompactLog", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CompactLog == nil { + m.CompactLog = &CompactLogRequest{} + } + if err := m.CompactLog.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferLeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TransferLeader == nil { + m.TransferLeader = &TransferLeaderRequest{} + } + if err := m.TransferLeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VerifyHash", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VerifyHash == nil { + m.VerifyHash = &VerifyHashRequest{} + } + if err := m.VerifyHash.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AdminResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AdminResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AdminResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CmdType", wireType) + } + var v AdminCmdType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (AdminCmdType(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CmdType = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChangePeer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ChangePeer == nil { + m.ChangePeer = &ChangePeerResponse{} + } + if err := m.ChangePeer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Split", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Split == nil { + m.Split = &SplitResponse{} + } + if err := m.Split.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompactLog", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CompactLog == nil { + m.CompactLog = &CompactLogResponse{} + } + if err := m.CompactLog.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferLeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TransferLeader == nil { + m.TransferLeader = &TransferLeaderResponse{} + } + if err := m.TransferLeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VerifyHash", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VerifyHash == nil { + m.VerifyHash = &VerifyHashResponse{} + } + if err := m.VerifyHash.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RegionLeaderRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RegionLeaderRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegionLeaderRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RegionLeaderResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RegionLeaderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegionLeaderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Leader == nil { + m.Leader = &metapb.Peer{} + } + if err := m.Leader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RegionDetailRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RegionDetailRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegionDetailRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RegionDetailResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RegionDetailResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegionDetailResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Region == nil { + m.Region = &metapb.Region{} + } + if err := m.Region.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Leader == nil { + m.Leader = &metapb.Peer{} + } + if err := m.Leader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CmdType", wireType) + } + var v StatusCmdType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (StatusCmdType(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CmdType = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionLeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegionLeader == nil { + m.RegionLeader = &RegionLeaderRequest{} + } + if err := m.RegionLeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionDetail", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegionDetail == nil { + m.RegionDetail = &RegionDetailRequest{} + } + if err := m.RegionDetail.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CmdType", wireType) + } + var v StatusCmdType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (StatusCmdType(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CmdType = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionLeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegionLeader == nil { + m.RegionLeader = &RegionLeaderResponse{} + } + if err := m.RegionLeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionDetail", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegionDetail == nil { + m.RegionDetail = &RegionDetailResponse{} + } + if err := m.RegionDetail.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RaftRequestHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RaftRequestHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RaftRequestHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionId", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.RegionId = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Peer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Peer == nil { + m.Peer = &metapb.Peer{} + } + if err := m.Peer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadQuorum", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.ReadQuorum = &b + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uuid = append(m.Uuid[:0], dAtA[iNdEx:postIndex]...) + if m.Uuid == nil { + m.Uuid = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegionEpoch", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegionEpoch == nil { + m.RegionEpoch = &metapb.RegionEpoch{} + } + if err := m.RegionEpoch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Term = &v + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RaftResponseHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RaftResponseHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RaftResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Error == nil { + m.Error = &errorpb.Error{} + } + if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uuid = append(m.Uuid[:0], dAtA[iNdEx:postIndex]...) + if m.Uuid == nil { + m.Uuid = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentTerm", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CurrentTerm = &v + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RaftCmdRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RaftCmdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RaftCmdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &RaftRequestHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Requests = append(m.Requests, &Request{}) + if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AdminRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AdminRequest == nil { + m.AdminRequest = &AdminRequest{} + } + if err := m.AdminRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StatusRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StatusRequest == nil { + m.StatusRequest = &StatusRequest{} + } + if err := m.StatusRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RaftCmdResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RaftCmdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RaftCmdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &RaftResponseHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Responses = append(m.Responses, &Response{}) + if err := m.Responses[len(m.Responses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AdminResponse", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AdminResponse == nil { + m.AdminResponse = &AdminResponse{} + } + if err := m.AdminResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StatusResponse", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftCmdpb + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StatusResponse == nil { + m.StatusResponse = &StatusResponse{} + } + if err := m.StatusResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRaftCmdpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRaftCmdpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRaftCmdpb(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthRaftCmdpb + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRaftCmdpb + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipRaftCmdpb(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthRaftCmdpb = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRaftCmdpb = fmt.Errorf("proto: integer overflow") +) + +func init() { proto.RegisterFile("raft_cmdpb.proto", fileDescriptorRaftCmdpb) } + +var fileDescriptorRaftCmdpb = []byte{ + // 1485 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0xdd, 0x72, 0xdb, 0xc4, + 0x17, 0x8f, 0xfc, 0x15, 0xe7, 0x58, 0x76, 0x94, 0x6d, 0xda, 0xb8, 0xed, 0xff, 0xef, 0xba, 0x6a, + 0x87, 0x49, 0x03, 0xe3, 0x4e, 0x03, 0x94, 0x32, 0xd3, 0x52, 0x20, 0x09, 0x6d, 0x68, 0x99, 0x09, + 0xdb, 0x0e, 0x33, 0x0c, 0x17, 0x1e, 0x61, 0xad, 0x13, 0x4d, 0x6c, 0x49, 0x95, 0xe4, 0x84, 0xdc, + 0x71, 0x01, 0x6f, 0xc0, 0x05, 0x4f, 0xc0, 0x15, 0x0f, 0xc2, 0x25, 0x0c, 0x3c, 0x00, 0x53, 0x9e, + 0x82, 0x2b, 0x98, 0xdd, 0x3d, 0x2b, 0xad, 0x2c, 0xb9, 0xb4, 0xbd, 0xca, 0xee, 0xd9, 0xb3, 0x67, + 0xcf, 0xf9, 0xfd, 0xce, 0x87, 0x1c, 0xb0, 0x22, 0x67, 0x9c, 0x0c, 0x47, 0x53, 0x37, 0xfc, 0x7a, + 0x10, 0x46, 0x41, 0x12, 0x10, 0xc8, 0x24, 0x97, 0xcc, 0x29, 0x4b, 0x1c, 0x75, 0x72, 0xa9, 0xcd, + 0xa2, 0x28, 0x88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x96, 0x01, 0x3b, 0x53, 0xf7, 0xe9, 0x59, + 0xc8, 0xe8, 0xf2, 0x48, 0x2e, 0xc8, 0x26, 0x54, 0x0f, 0x59, 0x22, 0xde, 0x6d, 0x6d, 0x5f, 0xd0, + 0x55, 0x33, 0xae, 0x29, 0x57, 0xe1, 0x9a, 0xe1, 0x2c, 0xe9, 0xd6, 0x8a, 0x9a, 0x19, 0x81, 0x94, + 0xab, 0x90, 0x5b, 0xd0, 0x70, 0x05, 0x96, 0xdd, 0xba, 0x50, 0xbe, 0xa8, 0x2b, 0xe7, 0x88, 0xa1, + 0xa8, 0x48, 0xde, 0x84, 0x5a, 0xec, 0x3b, 0x61, 0xb7, 0x21, 0x2e, 0x6c, 0xe8, 0x17, 0x34, 0x12, + 0xa8, 0x50, 0x22, 0xef, 0x41, 0x33, 0x44, 0x0c, 0xba, 0xcb, 0xe2, 0xc2, 0xe5, 0x9c, 0x3b, 0x79, + 0xb8, 0x69, 0xaa, 0x6c, 0xff, 0x5c, 0x81, 0x66, 0x4a, 0xe0, 0xab, 0x22, 0x75, 0x43, 0x47, 0x6a, + 0xa3, 0x80, 0x94, 0xb4, 0x2a, 0xa1, 0xba, 0xa1, 0x43, 0xb5, 0x51, 0x80, 0x4a, 0xa9, 0x72, 0xac, + 0xb6, 0xe7, 0xb0, 0xba, 0x54, 0x86, 0x15, 0x5e, 0x50, 0x60, 0xbd, 0x95, 0x03, 0xab, 0x5b, 0x04, + 0x0b, 0xf5, 0x25, 0x5a, 0x77, 0x0a, 0x68, 0xfd, 0xaf, 0x1c, 0x2d, 0xbc, 0x95, 0xc1, 0x15, 0xc0, + 0xda, 0xce, 0x91, 0xe3, 0x1f, 0xb2, 0x03, 0xc6, 0x22, 0x95, 0x60, 0x77, 0xa0, 0x35, 0x12, 0x42, + 0x1d, 0xb9, 0x8d, 0x81, 0x6a, 0x15, 0x3b, 0x81, 0x3f, 0x96, 0x97, 0x04, 0x7a, 0x30, 0x4a, 0xd7, + 0xa4, 0x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14, 0x60, 0x17, + 0xd3, 0x39, 0xb8, 0x99, 0xe7, 0xe0, 0x62, 0x09, 0x07, 0x78, 0x0b, 0x49, 0xb8, 0x5f, 0x46, 0x42, + 0x6f, 0x11, 0x09, 0xe9, 0x8b, 0x19, 0x0b, 0x8f, 0x16, 0xb1, 0x60, 0xbf, 0x88, 0x05, 0x34, 0x34, + 0x4f, 0xc3, 0xfd, 0x32, 0x1a, 0x7a, 0x8b, 0x68, 0x50, 0xde, 0x68, 0x3c, 0x9c, 0x87, 0x73, 0xb2, + 0x6f, 0xe4, 0xe8, 0xb6, 0xef, 0xc2, 0x7a, 0x5e, 0x8c, 0x24, 0x5d, 0x87, 0x06, 0xfa, 0x5c, 0x56, + 0xcb, 0x78, 0x96, 0x19, 0xdd, 0x65, 0x89, 0xe3, 0x4d, 0x94, 0x51, 0x57, 0x19, 0x55, 0xe2, 0x57, + 0x6b, 0xe2, 0xda, 0xe3, 0x95, 0x17, 0x3c, 0xfe, 0x9b, 0x01, 0xed, 0x27, 0x89, 0x93, 0xcc, 0x62, + 0x55, 0xdc, 0xef, 0x14, 0x32, 0x2b, 0x4f, 0xb3, 0x50, 0x2e, 0xa4, 0xd6, 0x2e, 0xb4, 0x71, 0x00, + 0xe4, 0x1e, 0xbd, 0xa2, 0x5f, 0x2d, 0x81, 0x8e, 0x9a, 0x91, 0x26, 0xd4, 0xac, 0xb8, 0x22, 0x68, + 0xcc, 0xb3, 0x12, 0x2b, 0x39, 0xac, 0x94, 0x15, 0x29, 0xb4, 0xff, 0x30, 0xa0, 0xa3, 0x62, 0x42, + 0xd0, 0x5e, 0x2f, 0xa8, 0xbd, 0xf2, 0xa0, 0xfa, 0x8b, 0x83, 0xc2, 0x9c, 0xc9, 0x47, 0xb5, 0x57, + 0x1e, 0x55, 0x7f, 0x71, 0x54, 0x79, 0x33, 0x18, 0xd6, 0xef, 0x06, 0xac, 0x51, 0x67, 0xac, 0xfa, + 0xdc, 0x43, 0x69, 0xfc, 0x32, 0xac,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d, 0x5c, 0xb9, 0xb0, 0x06, 0x6d, 0x74, 0x41, 0xca, 0xad, 0x25, 0xee, 0x95, 0xde, + 0xad, 0x2c, 0x23, 0x93, 0xc8, 0x16, 0x63, 0x55, 0x3e, 0xde, 0xfa, 0xe5, 0x79, 0xcf, 0xf8, 0xf5, + 0x79, 0xcf, 0xf8, 0xf3, 0x79, 0xcf, 0xf8, 0xf1, 0xaf, 0xde, 0x12, 0x74, 0x47, 0xc1, 0x74, 0x10, + 0x7a, 0xfe, 0xe1, 0xc8, 0x09, 0x07, 0x89, 0x77, 0x7c, 0x32, 0x38, 0x3e, 0x11, 0xff, 0xc6, 0xf8, + 0x37, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x09, 0xc6, 0x3e, 0x11, 0x11, 0x00, 0x00, +} diff --git a/_vendor/src/github.com/pingcap/kvproto/pkg/raft_serverpb/raft_serverpb.pb.go b/_vendor/src/github.com/pingcap/kvproto/pkg/raft_serverpb/raft_serverpb.pb.go index 6da373f44e5ab..18cabe2072c49 100644 --- a/_vendor/src/github.com/pingcap/kvproto/pkg/raft_serverpb/raft_serverpb.pb.go +++ b/_vendor/src/github.com/pingcap/kvproto/pkg/raft_serverpb/raft_serverpb.pb.go @@ -1,5 +1,6 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-gogo. // source: raft_serverpb.proto +// DO NOT EDIT! /* Package raft_serverpb is a generated protocol buffer package. diff --git a/_vendor/src/github.com/pingcap/kvproto/pkg/tikvpb/tikvpb.pb.go b/_vendor/src/github.com/pingcap/kvproto/pkg/tikvpb/tikvpb.pb.go index d004efa2a5db3..94131823fa0d9 100644 --- a/_vendor/src/github.com/pingcap/kvproto/pkg/tikvpb/tikvpb.pb.go +++ b/_vendor/src/github.com/pingcap/kvproto/pkg/tikvpb/tikvpb.pb.go @@ -1,5 +1,6 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-gogo. // source: tikvpb.proto +// DO NOT EDIT! /* Package tikvpb is a generated protocol buffer package. @@ -66,11 +67,15 @@ type TikvClient interface { RawGet(ctx context.Context, in *kvrpcpb.RawGetRequest, opts ...grpc.CallOption) (*kvrpcpb.RawGetResponse, error) RawPut(ctx context.Context, in *kvrpcpb.RawPutRequest, opts ...grpc.CallOption) (*kvrpcpb.RawPutResponse, error) RawDelete(ctx context.Context, in *kvrpcpb.RawDeleteRequest, opts ...grpc.CallOption) (*kvrpcpb.RawDeleteResponse, error) + RawScan(ctx context.Context, in *kvrpcpb.RawScanRequest, opts ...grpc.CallOption) (*kvrpcpb.RawScanResponse, error) // SQL push down commands. Coprocessor(ctx context.Context, in *coprocessor.Request, opts ...grpc.CallOption) (*coprocessor.Response, error) // Raft commands (tikv <-> tikv). Raft(ctx context.Context, opts ...grpc.CallOption) (Tikv_RaftClient, error) Snapshot(ctx context.Context, opts ...grpc.CallOption) (Tikv_SnapshotClient, error) + // transaction debugger commands. + MvccGetByKey(ctx context.Context, in *kvrpcpb.MvccGetByKeyRequest, opts ...grpc.CallOption) (*kvrpcpb.MvccGetByKeyResponse, error) + MvccGetByStartTs(ctx context.Context, in *kvrpcpb.MvccGetByStartTsRequest, opts ...grpc.CallOption) (*kvrpcpb.MvccGetByStartTsResponse, error) } type tikvClient struct { @@ -207,6 +212,15 @@ func (c *tikvClient) RawDelete(ctx context.Context, in *kvrpcpb.RawDeleteRequest return out, nil } +func (c *tikvClient) RawScan(ctx context.Context, in *kvrpcpb.RawScanRequest, opts ...grpc.CallOption) (*kvrpcpb.RawScanResponse, error) { + out := new(kvrpcpb.RawScanResponse) + err := grpc.Invoke(ctx, "/tikvpb.Tikv/RawScan", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *tikvClient) Coprocessor(ctx context.Context, in *coprocessor.Request, opts ...grpc.CallOption) (*coprocessor.Response, error) { out := new(coprocessor.Response) err := grpc.Invoke(ctx, "/tikvpb.Tikv/Coprocessor", in, out, c.cc, opts...) @@ -284,6 +298,24 @@ func (x *tikvSnapshotClient) CloseAndRecv() (*raft_serverpb.Done, error) { return m, nil } +func (c *tikvClient) MvccGetByKey(ctx context.Context, in *kvrpcpb.MvccGetByKeyRequest, opts ...grpc.CallOption) (*kvrpcpb.MvccGetByKeyResponse, error) { + out := new(kvrpcpb.MvccGetByKeyResponse) + err := grpc.Invoke(ctx, "/tikvpb.Tikv/MvccGetByKey", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tikvClient) MvccGetByStartTs(ctx context.Context, in *kvrpcpb.MvccGetByStartTsRequest, opts ...grpc.CallOption) (*kvrpcpb.MvccGetByStartTsResponse, error) { + out := new(kvrpcpb.MvccGetByStartTsResponse) + err := grpc.Invoke(ctx, "/tikvpb.Tikv/MvccGetByStartTs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for Tikv service type TikvServer interface { @@ -303,11 +335,15 @@ type TikvServer interface { RawGet(context.Context, *kvrpcpb.RawGetRequest) (*kvrpcpb.RawGetResponse, error) RawPut(context.Context, *kvrpcpb.RawPutRequest) (*kvrpcpb.RawPutResponse, error) RawDelete(context.Context, *kvrpcpb.RawDeleteRequest) (*kvrpcpb.RawDeleteResponse, error) + RawScan(context.Context, *kvrpcpb.RawScanRequest) (*kvrpcpb.RawScanResponse, error) // SQL push down commands. Coprocessor(context.Context, *coprocessor.Request) (*coprocessor.Response, error) // Raft commands (tikv <-> tikv). Raft(Tikv_RaftServer) error Snapshot(Tikv_SnapshotServer) error + // transaction debugger commands. + MvccGetByKey(context.Context, *kvrpcpb.MvccGetByKeyRequest) (*kvrpcpb.MvccGetByKeyResponse, error) + MvccGetByStartTs(context.Context, *kvrpcpb.MvccGetByStartTsRequest) (*kvrpcpb.MvccGetByStartTsResponse, error) } func RegisterTikvServer(s *grpc.Server, srv TikvServer) { @@ -566,6 +602,24 @@ func _Tikv_RawDelete_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Tikv_RawScan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(kvrpcpb.RawScanRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TikvServer).RawScan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tikvpb.Tikv/RawScan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TikvServer).RawScan(ctx, req.(*kvrpcpb.RawScanRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Tikv_Coprocessor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(coprocessor.Request) if err := dec(in); err != nil { @@ -636,6 +690,42 @@ func (x *tikvSnapshotServer) Recv() (*raft_serverpb.SnapshotChunk, error) { return m, nil } +func _Tikv_MvccGetByKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(kvrpcpb.MvccGetByKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TikvServer).MvccGetByKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tikvpb.Tikv/MvccGetByKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TikvServer).MvccGetByKey(ctx, req.(*kvrpcpb.MvccGetByKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Tikv_MvccGetByStartTs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(kvrpcpb.MvccGetByStartTsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TikvServer).MvccGetByStartTs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tikvpb.Tikv/MvccGetByStartTs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TikvServer).MvccGetByStartTs(ctx, req.(*kvrpcpb.MvccGetByStartTsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Tikv_serviceDesc = grpc.ServiceDesc{ ServiceName: "tikvpb.Tikv", HandlerType: (*TikvServer)(nil), @@ -696,10 +786,22 @@ var _Tikv_serviceDesc = grpc.ServiceDesc{ MethodName: "RawDelete", Handler: _Tikv_RawDelete_Handler, }, + { + MethodName: "RawScan", + Handler: _Tikv_RawScan_Handler, + }, { MethodName: "Coprocessor", Handler: _Tikv_Coprocessor_Handler, }, + { + MethodName: "MvccGetByKey", + Handler: _Tikv_MvccGetByKey_Handler, + }, + { + MethodName: "MvccGetByStartTs", + Handler: _Tikv_MvccGetByStartTs_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -719,36 +821,40 @@ var _Tikv_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("tikvpb.proto", fileDescriptorTikvpb) } var fileDescriptorTikvpb = []byte{ - // 494 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0xcb, 0x8e, 0xd3, 0x30, - 0x14, 0x86, 0x5b, 0xa9, 0x54, 0x1d, 0xc3, 0x08, 0xe1, 0x16, 0xe8, 0x84, 0x21, 0x8b, 0x59, 0x21, - 0x16, 0x41, 0x5c, 0x24, 0x16, 0x80, 0x04, 0x93, 0x4a, 0x15, 0xca, 0x20, 0x55, 0x19, 0xf6, 0xc8, - 0x8d, 0xce, 0xb4, 0x51, 0xd2, 0xd8, 0xd8, 0x8e, 0xfb, 0x2a, 0x3c, 0x12, 0x4b, 0x76, 0x6c, 0x51, - 0x79, 0x11, 0x94, 0x84, 0xe3, 0xdc, 0x3a, 0xab, 0x26, 0xdf, 0x7f, 0xa9, 0x7b, 0x5c, 0x9b, 0xdc, - 0xd3, 0x71, 0x62, 0xc4, 0xda, 0x13, 0x92, 0x6b, 0x4e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c, 0x73, 0x70, 0x87, 0x3f, 0xfe, 0xba, 0x03, 0x32, 0x8f, 0xf8, 0xce, 0x13, 0x71, - 0xb6, 0x89, 0x98, 0xf0, 0x8a, 0xcb, 0xcc, 0x4b, 0x4c, 0x79, 0x0b, 0xad, 0xc7, 0xe5, 0xc7, 0xeb, - 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe5, 0x20, 0x6d, 0xc5, 0xf1, 0x04, 0x00, 0x00, + // 560 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0x4d, 0x6f, 0xd3, 0x30, + 0x18, 0xc7, 0x5b, 0xa9, 0x94, 0xcd, 0x6c, 0x02, 0xdc, 0x02, 0x5d, 0xd8, 0x2a, 0xd8, 0x09, 0x71, + 0x08, 0xe2, 0x45, 0xe2, 0xc0, 0x8b, 0xa0, 0xa9, 0x54, 0xa1, 0xac, 0x52, 0x95, 0xee, 0xc2, 0x09, + 0xb9, 0xd6, 0xb3, 0xb6, 0x4a, 0x1b, 0x07, 0xdb, 0x75, 0xb5, 0x6f, 0xc2, 0xd7, 0xe1, 0xc6, 0x91, + 0x8f, 0x80, 0xca, 0x17, 0x41, 0x49, 0xf6, 0x38, 0x49, 0xd3, 0x72, 0x4a, 0xf2, 0xfb, 0xbf, 0xc4, + 0xb1, 0x63, 0x93, 0x23, 0x3d, 0x0f, 0x4d, 0x3c, 0x71, 0x63, 0x29, 0xb4, 0xa0, 0xcd, 0xec, 0xc9, + 0xb9, 0xcf, 0x45, 0x2c, 0x05, 0x07, 0xa5, 0x84, 0xcc, 0x24, 0xe7, 0x38, 0x34, 0x32, 0xe6, 0xe8, + 0x74, 0x5a, 0x92, 0x5d, 0xe9, 0x6f, 0x0a, 0xa4, 0x01, 0x69, 0x61, 0x7b, 0x2a, 0xa6, 0x22, 0xbd, + 0x7d, 0x91, 0xdc, 0x65, 0xf4, 0xd5, 0x4f,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48, 0x58, 0xfb, 0xf4, 0x3f, 0x0e, 0xac, 0xee, 0x3d, 0xff, 0xb5, 0xe9, 0xd6, + 0x7f, 0x6f, 0xba, 0xf5, 0x3f, 0x9b, 0x6e, 0xfd, 0xc7, 0xdf, 0x6e, 0x8d, 0x74, 0xb8, 0x58, 0xba, + 0xf1, 0x3c, 0x9a, 0x72, 0x16, 0xbb, 0xc9, 0xb1, 0xed, 0x86, 0x26, 0x3d, 0x6f, 0x27, 0xcd, 0xf4, + 0xf2, 0xfa, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1e, 0xbe, 0x8c, 0x6b, 0xdb, 0x05, 0x00, 0x00, } diff --git a/ast/dml.go b/ast/dml.go index e2fae1a35d882..134dc5edbe9ae 100644 --- a/ast/dml.go +++ b/ast/dml.go @@ -946,6 +946,7 @@ const ( ShowEvents ShowStatsMeta ShowStatsHistograms + ShowStatsBuckets ) // ShowStmt is a statement to provide information about databases, tables, columns and so on. diff --git a/bootstrap.go b/bootstrap.go index 06311deec8aac..3796f7880df5b 100644 --- a/bootstrap.go +++ b/bootstrap.go @@ -184,6 +184,7 @@ func bootstrap(s Session) { } if b { upgrade(s) + return } doDDLWorks(s) doDMLWorks(s) diff --git a/domain/schema_validator.go b/domain/schema_validator.go index 6706fe0ca01fc..a3b9af1dd3ab9 100644 --- a/domain/schema_validator.go +++ b/domain/schema_validator.go @@ -52,7 +52,7 @@ func newSchemaValidator(lease time.Duration) SchemaValidator { func (s *schemaValidator) Stop() { log.Info("the schema validator stops") s.mux.Lock() - defer s.mux.Lock() + defer s.mux.Unlock() s.items = nil s.latestSchemaVer = 0 } @@ -60,7 +60,7 @@ func (s *schemaValidator) Stop() { func (s *schemaValidator) Restart() { log.Info("the schema validator restarts") s.mux.Lock() - defer s.mux.Lock() + defer s.mux.Unlock() s.items = make(map[int64]time.Time) } diff --git a/domain/schema_validator_test.go b/domain/schema_validator_test.go index f2b4d46a2ff15..49dcb78f59423 100644 --- a/domain/schema_validator_test.go +++ b/domain/schema_validator_test.go @@ -55,6 +55,9 @@ func (*testSuite) TestSchemaValidator(c *C) { valid = validator.Check(ts, item.schemaVer) c.Assert(valid, IsFalse) + validator.Stop() + validator.Restart() + reload(validator, leaseGrantCh) valid = validator.Check(ts, item.schemaVer) c.Assert(valid, IsFalse) diff --git a/executor/executor_test.go b/executor/executor_test.go index e0c69991ee0a4..552d52676cdd2 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -17,6 +17,7 @@ import ( "flag" "fmt" "os" + "strings" "testing" "time" @@ -546,6 +547,12 @@ func (s *testSuite) TestUnion(c *C) { tk.MustExec("CREATE TABLE t (a int, b int)") tk.MustExec("INSERT INTO t VALUES ('1', '1')") r = tk.MustQuery("select b from (SELECT * FROM t UNION ALL SELECT a, b FROM t order by a) t") + + tk.MustExec("drop table if exists t") + tk.MustExec("CREATE TABLE t (a DECIMAL(4,2))") + tk.MustExec("INSERT INTO t VALUE(12.34)") + r = tk.MustQuery("SELECT 1 AS c UNION select a FROM t") + r.Check(testkit.Rows("1.00", "12.34")) } func (s *testSuite) TestIn(c *C) { @@ -911,6 +918,26 @@ func (s *testSuite) TestStringBuiltin(c *C) { tk.MustExec(`insert into t values(1, 1.1, "2017-01-01 12:01:01", "12:01:01", "abcdef", 0b10101, "512", "abc")`) result = tk.MustQuery("select to_base64(a), to_base64(b), to_base64(c), to_base64(d), to_base64(e), to_base64(f), to_base64(g), to_base64(h), to_base64(null) from t") result.Check(testkit.Rows("MQ== MS4x MjAxNy0wMS0wMSAxMjowMTowMQ== MTI6MDE6MDE= YWJjZGVm ABU= NTEyAAAAAAAAAAAAAAAAAAAAAAA= YWJj ")) + + // for substr + tk.MustExec("drop table if exists t") + tk.MustExec("create table t(a char(10), b int, c double, d datetime, e time)") + tk.MustExec(`insert into t values('Sakila', 12345, 123.45, "2017-01-01 12:01:01", "12:01:01")`) + result = tk.MustQuery(`select substr(a, 3), substr(b, 2, 3), substr(c, -3), substr(d, -8), substr(e, -3, 100) from t`) + result.Check(testkit.Rows("kila 234 .45 12:01:01 :01")) + result = tk.MustQuery(`select substr('Sakila', 100), substr('Sakila', -100), substr('Sakila', -5, 3), substr('Sakila', 2, -1)`) + result.Check(testutil.RowsWithSep(",", ",,aki,")) + result = tk.MustQuery(`select substr('foobarbar' from 4), substr('Sakila' from -4 for 2)`) + result.Check(testkit.Rows("barbar ki")) + result = tk.MustQuery(`select substr(null, 2, 3), substr('foo', null, 3), substr('foo', 2, null)`) + result.Check(testkit.Rows(" ")) + + // for bit_length + tk.MustExec("drop table if exists t") + tk.MustExec("create table t(a int, b double, c datetime, d time, e char(20), f bit(10), g binary(20), h varbinary(20))") + tk.MustExec(`insert into t values(1, 1.1, "2017-01-01 12:01:01", "12:01:01", "abcdef", 0b10101, "g", "h")`) + result = tk.MustQuery("select bit_length(a), bit_length(b), bit_length(c), bit_length(d), bit_length(e), bit_length(f), bit_length(g), bit_length(h), bit_length(null) from t") + result.Check(testkit.Rows("8 24 152 64 48 16 160 8 ")) } func (s *testSuite) TestEncryptionBuiltin(c *C) { @@ -1045,6 +1072,12 @@ func (s *testSuite) TestBuiltin(c *C) { result = tk.MustQuery("select cast(a as signed) from t") result.Check(testkit.Rows("130000")) + // fixed issue #3762 + result = tk.MustQuery("select -9223372036854775809;") + result.Check(testkit.Rows("-9223372036854775809")) + result = tk.MustQuery("select -9223372036854775808;") + result.Check(testkit.Rows("-9223372036854775808")) + // test unhex and hex result = tk.MustQuery("select unhex('4D7953514C')") result.Check(testkit.Rows("MySQL")) @@ -1246,6 +1279,18 @@ func (s *testSuite) TestMathBuiltin(c *C) { result.Check(testkit.Rows("")) result = tk.MustQuery("select log2(NULL)") result.Check(testkit.Rows("")) + + //for log10 + result = tk.MustQuery("select log10(0.0)") + result.Check(testkit.Rows("")) + result = tk.MustQuery("select log10(100)") + result.Check(testkit.Rows("2")) + result = tk.MustQuery("select log10('1000.0abcd')") + result.Check(testkit.Rows("3")) + result = tk.MustQuery("select log10(-1)") + result.Check(testkit.Rows("")) + result = tk.MustQuery("select log10(NULL)") + result.Check(testkit.Rows("")) } func (s *testSuite) TestJSON(c *C) { @@ -1609,8 +1654,6 @@ func (s *testSuite) TestPointGet(c *C) { } func (s *testSuite) TestRow(c *C) { - // There exists a constant folding problem when the arguments of compare functions are Rows, - // the switch will be opened after the problem be fixed. defer func() { s.cleanEnv(c) testleak.AfterTest(c)() @@ -2022,4 +2065,52 @@ func (s *testSuite) TestFuncREPEAT(c *C) { r = tk.MustQuery("SELECT REPEAT(a, 16777217), REPEAT(b, 16777217), REPEAT(c, 16777217), REPEAT(d, 16777217), REPEAT(e, 16777217), REPEAT(f, 16777217) FROM table_string;") r.Check(testkit.Rows(" ")) } -`` \ No newline at end of file + +func (s *testSuite) TestEmptyEnum(c *C) { + tk := testkit.NewTestKit(c, s.store) + defer func() { + s.cleanEnv(c) + testleak.AfterTest(c)() + }() + tk.MustExec("use test") + tk.MustExec("drop table if exists t") + tk.MustExec("create table t (e enum('Y', 'N'))") + tk.MustExec("set sql_mode='STRICT_TRANS_TABLES'") + _, err := tk.Exec("insert into t values (0)") + c.Assert(terror.ErrorEqual(err, types.ErrTruncated), IsTrue) + _, err = tk.Exec("insert into t values ('abc')") + c.Assert(terror.ErrorEqual(err, types.ErrTruncated), IsTrue) + + tk.MustExec("set sql_mode=''") + tk.MustExec("insert into t values (0)") + tk.MustQuery("select * from t").Check(testkit.Rows("")) + tk.MustExec("insert into t values ('abc')") + tk.MustQuery("select * from t").Check(testkit.Rows("", "")) + tk.MustExec("insert into t values (null)") + tk.MustQuery("select * from t").Check(testkit.Rows("", "", "")) +} + +func (s *testSuite) TestMiscellaneousBuiltin(c *C) { + defer func() { + s.cleanEnv(c) + testleak.AfterTest(c)() + }() + + tk := testkit.NewTestKit(c, s.store) + tk.MustExec("use test") + // for uuid + r := tk.MustQuery("select uuid(), uuid(), uuid(), uuid(), uuid(), uuid();") + for _, it := range r.Rows() { + for _, item := range it { + uuid, ok := item.(string) + c.Assert(ok, Equals, true) + list := strings.Split(uuid, "-") + c.Assert(len(list), Equals, 5) + c.Assert(len(list[0]), Equals, 8) + c.Assert(len(list[1]), Equals, 4) + c.Assert(len(list[2]), Equals, 4) + c.Assert(len(list[3]), Equals, 4) + c.Assert(len(list[4]), Equals, 12) + } + } +} diff --git a/executor/set_test.go b/executor/set_test.go index bd159da8cf47d..7fd4f68de6ded 100644 --- a/executor/set_test.go +++ b/executor/set_test.go @@ -123,6 +123,17 @@ func (s *testSuite) TestSetVar(c *C) { c.Assert(vars.SkipConstraintCheck, IsTrue) tk.MustExec("set @@tidb_skip_constraint_check = '0'") c.Assert(vars.SkipConstraintCheck, IsFalse) + + tk.MustExec("set global avoid_temporal_upgrade = on") + tk.MustQuery(`select @@global.avoid_temporal_upgrade;`).Check(testkit.Rows("ON")) + tk.MustExec("set @@global.avoid_temporal_upgrade = off") + tk.MustQuery(`select @@global.avoid_temporal_upgrade;`).Check(testkit.Rows("off")) + tk.MustExec("set session sql_log_bin = on") + tk.MustQuery(`select @@session.sql_log_bin;`).Check(testkit.Rows("ON")) + tk.MustExec("set sql_log_bin = off") + tk.MustQuery(`select @@session.sql_log_bin;`).Check(testkit.Rows("off")) + tk.MustExec("set @@sql_log_bin = on") + tk.MustQuery(`select @@session.sql_log_bin;`).Check(testkit.Rows("ON")) } func (s *testSuite) TestSetCharset(c *C) { diff --git a/executor/show.go b/executor/show.go index 97f67af6f5c4e..5e8e5c0422b9d 100644 --- a/executor/show.go +++ b/executor/show.go @@ -26,11 +26,8 @@ import ( "github.com/pingcap/tidb/model" "github.com/pingcap/tidb/mysql" "github.com/pingcap/tidb/privilege" - "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/sessionctx/varsutil" - "github.com/pingcap/tidb/statistics" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/terror" "github.com/pingcap/tidb/util/charset" @@ -117,6 +114,8 @@ func (e *ShowExec) fetchAll() error { return e.fetchShowStatsMeta() case ast.ShowStatsHistograms: return e.fetchShowStatsHistogram() + case ast.ShowStatsBuckets: + return e.fetchShowStatsBuckets() } return nil } @@ -631,66 +630,3 @@ func (e *ShowExec) getTable() (table.Table, error) { } return tb, nil } - -func (e *ShowExec) fetchShowStatsMeta() error { - do := sessionctx.GetDomain(e.ctx) - h := do.StatsHandle() - dbs := do.InfoSchema().AllSchemas() - for _, db := range dbs { - for _, tbl := range db.Tables { - statsTbl := h.GetTableStats(tbl.ID) - if !statsTbl.Pseudo { - row := &Row{ - Data: types.MakeDatums( - db.Name.O, - tbl.Name.O, - e.versionToTime(statsTbl.Version), - statsTbl.ModifyCount, - statsTbl.Count, - ), - } - e.rows = append(e.rows, row) - } - } - } - return nil -} - -func (e *ShowExec) fetchShowStatsHistogram() error { - do := sessionctx.GetDomain(e.ctx) - h := do.StatsHandle() - dbs := do.InfoSchema().AllSchemas() - for _, db := range dbs { - for _, tbl := range db.Tables { - statsTbl := h.GetTableStats(tbl.ID) - if !statsTbl.Pseudo { - for _, col := range statsTbl.Columns { - e.rows = append(e.rows, e.histogramToRow(db.Name.O, tbl.Name.O, col.Info.Name.O, 0, col.Histogram)) - } - for _, idx := range statsTbl.Indices { - e.rows = append(e.rows, e.histogramToRow(db.Name.O, tbl.Name.O, idx.Info.Name.O, 1, idx.Histogram)) - } - } - } - } - return nil -} - -func (e *ShowExec) histogramToRow(dbName string, tblName string, colName string, isIndex int, hist statistics.Histogram) *Row { - return &Row{ - Data: types.MakeDatums( - dbName, - tblName, - colName, - isIndex, - e.versionToTime(hist.LastUpdateVersion), - hist.NDV, - hist.NullCount, - ), - } -} - -func (e *ShowExec) versionToTime(version uint64) types.Time { - t := time.Unix(0, oracle.ExtractPhysical(version)*int64(time.Millisecond)) - return types.Time{Time: types.FromGoTime(t), Type: mysql.TypeDatetime} -} diff --git a/executor/show_stats.go b/executor/show_stats.go new file mode 100644 index 0000000000000..49940f505cecb --- /dev/null +++ b/executor/show_stats.go @@ -0,0 +1,169 @@ +// Copyright 2017 PingCAP, Inc. +// +// Licensed 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, +// See the License for the specific language governing permissions and +// limitations under the License. + +package executor + +import ( + "time" + + "github.com/juju/errors" + "github.com/pingcap/tidb/mysql" + "github.com/pingcap/tidb/sessionctx" + "github.com/pingcap/tidb/statistics" + "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/pingcap/tidb/util/codec" + "github.com/pingcap/tidb/util/types" +) + +func (e *ShowExec) fetchShowStatsMeta() error { + do := sessionctx.GetDomain(e.ctx) + h := do.StatsHandle() + dbs := do.InfoSchema().AllSchemas() + for _, db := range dbs { + for _, tbl := range db.Tables { + statsTbl := h.GetTableStats(tbl.ID) + if !statsTbl.Pseudo { + row := &Row{ + Data: types.MakeDatums( + db.Name.O, + tbl.Name.O, + e.versionToTime(statsTbl.Version), + statsTbl.ModifyCount, + statsTbl.Count, + ), + } + e.rows = append(e.rows, row) + } + } + } + return nil +} + +func (e *ShowExec) fetchShowStatsHistogram() error { + do := sessionctx.GetDomain(e.ctx) + h := do.StatsHandle() + dbs := do.InfoSchema().AllSchemas() + for _, db := range dbs { + for _, tbl := range db.Tables { + statsTbl := h.GetTableStats(tbl.ID) + if !statsTbl.Pseudo { + for _, col := range statsTbl.Columns { + e.rows = append(e.rows, e.histogramToRow(db.Name.O, tbl.Name.O, col.Info.Name.O, 0, col.Histogram)) + } + for _, idx := range statsTbl.Indices { + e.rows = append(e.rows, e.histogramToRow(db.Name.O, tbl.Name.O, idx.Info.Name.O, 1, idx.Histogram)) + } + } + } + } + return nil +} + +func (e *ShowExec) histogramToRow(dbName string, tblName string, colName string, isIndex int, hist statistics.Histogram) *Row { + return &Row{ + Data: types.MakeDatums( + dbName, + tblName, + colName, + isIndex, + e.versionToTime(hist.LastUpdateVersion), + hist.NDV, + hist.NullCount, + ), + } +} + +func (e *ShowExec) versionToTime(version uint64) types.Time { + t := time.Unix(0, oracle.ExtractPhysical(version)*int64(time.Millisecond)) + return types.Time{Time: types.FromGoTime(t), Type: mysql.TypeDatetime} +} + +func (e *ShowExec) fetchShowStatsBuckets() error { + do := sessionctx.GetDomain(e.ctx) + h := do.StatsHandle() + dbs := do.InfoSchema().AllSchemas() + for _, db := range dbs { + for _, tbl := range db.Tables { + statsTbl := h.GetTableStats(tbl.ID) + if !statsTbl.Pseudo { + for _, col := range statsTbl.Columns { + rows, err := e.bucketsToRows(db.Name.O, tbl.Name.O, col.Info.Name.O, 0, col.Histogram) + if err != nil { + return errors.Trace(err) + } + e.rows = append(e.rows, rows...) + } + for _, idx := range statsTbl.Indices { + rows, err := e.bucketsToRows(db.Name.O, tbl.Name.O, idx.Info.Name.O, len(idx.Info.Columns), idx.Histogram) + if err != nil { + return errors.Trace(err) + } + e.rows = append(e.rows, rows...) + } + } + } + } + return nil +} + +// bucketsToRows converts histogram buckets to rows. If the histogram is built from index, then numOfCols equals to number +// of index columns, else numOfCols is 0. +func (e *ShowExec) bucketsToRows(dbName, tblName, colName string, numOfCols int, hist statistics.Histogram) ([]*Row, error) { + isIndex := 0 + if numOfCols > 0 { + isIndex = 1 + } + var rows []*Row + for i, bkt := range hist.Buckets { + lowerBoundStr, err := e.valueToString(bkt.LowerBound, numOfCols) + if err != nil { + return nil, errors.Trace(err) + } + upperBoundStr, err := e.valueToString(bkt.UpperBound, numOfCols) + if err != nil { + return nil, errors.Trace(err) + } + row := &Row{ + Data: types.MakeDatums( + dbName, + tblName, + colName, + isIndex, + i, + bkt.Count, + bkt.Repeats, + lowerBoundStr, + upperBoundStr, + ), + } + rows = append(rows, row) + } + return rows, nil +} + +// valueToString converts a possible encoded value to a formatted string. If the value is encoded, then +// size equals to number of origin values, else size is 0. +func (e *ShowExec) valueToString(value types.Datum, size int) (string, error) { + if size == 0 { + return value.ToString() + } + decodedVals, err := codec.Decode(value.GetBytes(), size) + if err != nil { + return "", errors.Trace(err) + } + str, err := types.DatumsToString(decodedVals) + if err != nil { + return "", errors.Trace(err) + } + return str, nil +} diff --git a/executor/show_stats_test.go b/executor/show_stats_test.go new file mode 100644 index 0000000000000..ddfafa5b3b18e --- /dev/null +++ b/executor/show_stats_test.go @@ -0,0 +1,64 @@ +// Copyright 2017 PingCAP, Inc. +// +// Licensed 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, +// See the License for the specific language governing permissions and +// limitations under the License. + +package executor_test + +import ( + . "github.com/pingcap/check" + "github.com/pingcap/tidb/util/testkit" +) + +func (s *testSuite) TestShowStatsMeta(c *C) { + tk := testkit.NewTestKit(c, s.store) + tk.MustExec("use test") + tk.MustExec("drop table if exists t, t1") + tk.MustExec("create table t (a int, b int)") + tk.MustExec("create table t1 (a int, b int)") + tk.MustExec("analyze table t, t1") + result := tk.MustQuery("show stats_meta") + c.Assert(len(result.Rows()), Equals, 2) + c.Assert(result.Rows()[0][1], Equals, "t") + c.Assert(result.Rows()[1][1], Equals, "t1") + result = tk.MustQuery("show stats_meta where table_name = 't'") + c.Assert(len(result.Rows()), Equals, 1) + c.Assert(result.Rows()[0][1], Equals, "t") +} + +func (s *testSuite) TestShowStatsHistograms(c *C) { + tk := testkit.NewTestKit(c, s.store) + tk.MustExec("use test") + tk.MustExec("drop table if exists t") + tk.MustExec("create table t (a int, b int)") + tk.MustExec("analyze table t") + result := tk.MustQuery("show stats_histograms").Sort() + c.Assert(len(result.Rows()), Equals, 2) + c.Assert(result.Rows()[0][2], Equals, "a") + c.Assert(result.Rows()[1][2], Equals, "b") + result = tk.MustQuery("show stats_histograms where column_name = 'a'") + c.Assert(len(result.Rows()), Equals, 1) + c.Assert(result.Rows()[0][2], Equals, "a") +} + +func (s *testSuite) TestShowStatsBuckets(c *C) { + tk := testkit.NewTestKit(c, s.store) + tk.MustExec("use test") + tk.MustExec("drop table if exists t") + tk.MustExec("create table t (a int, b int)") + tk.MustExec("create index idx on t(a,b)") + tk.MustExec("insert into t values (1,1)") + tk.MustExec("analyze table t") + result := tk.MustQuery("show stats_buckets").Sort() + result.Check(testkit.Rows("test t idx 1 0 1 1 (1, 1) (1, 1)", "test t a 0 0 1 1 1 1", "test t b 0 0 1 1 1 1")) + result = tk.MustQuery("show stats_buckets where column_name = 'idx'") + result.Check(testkit.Rows("test t idx 1 0 1 1 (1, 1) (1, 1)")) +} diff --git a/executor/show_test.go b/executor/show_test.go index 2425d0e2fae3d..96828386b695f 100644 --- a/executor/show_test.go +++ b/executor/show_test.go @@ -261,22 +261,6 @@ func (s *testSuite) TestShowWarnings(c *C) { c.Assert(tk.Se.GetSessionVars().StmtCtx.WarningCount(), Equals, uint16(0)) } -func (s *testSuite) TestShowStatsMeta(c *C) { - tk := testkit.NewTestKit(c, s.store) - tk.MustExec("use test") - tk.MustExec("drop table if exists t, t1") - tk.MustExec("create table t (a int, b int)") - tk.MustExec("create table t1 (a int, b int)") - tk.MustExec("analyze table t, t1") - result := tk.MustQuery("show stats_meta") - c.Assert(len(result.Rows()), Equals, 2) - c.Assert(result.Rows()[0][1], Equals, "t") - c.Assert(result.Rows()[1][1], Equals, "t1") - result = tk.MustQuery("show stats_meta where table_name = 't'") - c.Assert(len(result.Rows()), Equals, 1) - c.Assert(result.Rows()[0][1], Equals, "t") -} - func (s *testSuite) TestIssue3641(c *C) { tk := testkit.NewTestKit(c, s.store) _, err := tk.Exec("show tables;") @@ -284,18 +268,3 @@ func (s *testSuite) TestIssue3641(c *C) { _, err = tk.Exec("show table status;") c.Assert(err.Error(), Equals, plan.ErrNoDB.Error()) } - -func (s *testSuite) TestShowStatsHistograms(c *C) { - tk := testkit.NewTestKit(c, s.store) - tk.MustExec("use test") - tk.MustExec("drop table if exists t") - tk.MustExec("create table t (a int, b int)") - tk.MustExec("analyze table t") - result := tk.MustQuery("show stats_histograms").Sort() - c.Assert(len(result.Rows()), Equals, 2) - c.Assert(result.Rows()[0][2], Equals, "a") - c.Assert(result.Rows()[1][2], Equals, "b") - result = tk.MustQuery("show stats_histograms where column_name = 'a'") - c.Assert(len(result.Rows()), Equals, 1) - c.Assert(result.Rows()[0][2], Equals, "a") -} diff --git a/executor/write.go b/executor/write.go index aa22a61f0afaf..999daa6424d4b 100644 --- a/executor/write.go +++ b/executor/write.go @@ -855,15 +855,13 @@ func (e *InsertValues) getRowsSelect(cols []*table.Column) ([][]types.Datum, err func (e *InsertValues) fillRowData(cols []*table.Column, vals []types.Datum, ignoreErr bool) ([]types.Datum, error) { row := make([]types.Datum, len(e.Table.Cols())) - marked := make(map[int]struct{}, len(vals)) + hasValue := make([]bool, len(e.Table.Cols())) for i, v := range vals { offset := cols[i].Offset row[offset] = v - if !ignoreErr { - marked[offset] = struct{}{} - } + hasValue[offset] = true } - err := e.initDefaultValues(row, marked, ignoreErr) + err := e.initDefaultValues(row, hasValue, ignoreErr) if err != nil { return nil, errors.Trace(err) } @@ -889,64 +887,36 @@ func (e *InsertValues) filterErr(err error, ignoreErr bool) error { return nil } -func (e *InsertValues) initDefaultValues(row []types.Datum, marked map[int]struct{}, ignoreErr bool) error { +func (e *InsertValues) initDefaultValues(row []types.Datum, hasValue []bool, ignoreErr bool) error { var defaultValueCols []*table.Column - sc := e.ctx.GetSessionVars().StmtCtx - for i, c := range e.Table.Cols() { - // It's used for retry. - if mysql.HasAutoIncrementFlag(c.Flag) && row[i].IsNull() && - e.ctx.GetSessionVars().RetryInfo.Retrying { - id, err := e.ctx.GetSessionVars().RetryInfo.GetCurrAutoIncrementID() - if err != nil { - return errors.Trace(err) - } - row[i].SetInt64(id) - } - if !row[i].IsNull() { - // Column value isn't nil and column isn't auto-increment, continue. - if !mysql.HasAutoIncrementFlag(c.Flag) { - continue - } - val, err := row[i].ToInt64(sc) - if e.filterErr(errors.Trace(err), ignoreErr) != nil { - return errors.Trace(err) - } - row[i].SetInt64(val) - if val != 0 || (e.ctx.GetSessionVars().SQLMode&mysql.ModeNoAutoValueOnZero) > 0 { - e.ctx.GetSessionVars().InsertID = uint64(val) - e.Table.RebaseAutoID(val, true) - continue - } - } + strictSQL := e.ctx.GetSessionVars().StrictSQLMode - // If the nil value is evaluated in insert list, we will use nil except auto increment column. - if _, ok := marked[i]; ok && !mysql.HasAutoIncrementFlag(c.Flag) && !mysql.HasTimestampFlag(c.Flag) { - continue + for i, c := range e.Table.Cols() { + var needDefaultValue bool + if !hasValue[i] { + needDefaultValue = true + } else if mysql.HasNotNullFlag(c.Flag) && row[i].IsNull() && !strictSQL { + needDefaultValue = true + // TODO: Append Warning ErrColumnCantNull. } - if mysql.HasAutoIncrementFlag(c.Flag) { - recordID, err := e.Table.AllocAutoID() - if err != nil { - return errors.Trace(err) - } - row[i].SetInt64(recordID) - // It's compatible with mysql. So it sets last insert id to the first row. - if e.currRow == 0 { - e.lastInsertID = uint64(recordID) - } - // It's used for retry. - if !e.ctx.GetSessionVars().RetryInfo.Retrying { - e.ctx.GetSessionVars().RetryInfo.AddAutoIncrementID(recordID) - } - } else { + needDefaultValue = false + } + if needDefaultValue { var err error row[i], err = table.GetColDefaultValue(e.ctx, c.ToInfo()) if e.filterErr(err, ignoreErr) != nil { return errors.Trace(err) } + defaultValueCols = append(defaultValueCols, c) } - defaultValueCols = append(defaultValueCols, c) + // Adjust the value if this column has auto increment flag. + if mysql.HasAutoIncrementFlag(c.Flag) { + if err := e.adjustAutoIncrementDatum(row, i, c, ignoreErr); err != nil { + return errors.Trace(err) + } + } } if err := table.CastValues(e.ctx, row, defaultValueCols, ignoreErr); err != nil { return errors.Trace(err) @@ -955,6 +925,52 @@ func (e *InsertValues) initDefaultValues(row []types.Datum, marked map[int]struc return nil } +func (e *InsertValues) adjustAutoIncrementDatum(row []types.Datum, i int, c *table.Column, ignoreErr bool) error { + retryInfo := e.ctx.GetSessionVars().RetryInfo + if retryInfo.Retrying { + id, err := retryInfo.GetCurrAutoIncrementID() + if err != nil { + return errors.Trace(err) + } + row[i].SetInt64(id) + return nil + } + + var err error + var recordID int64 + if !row[i].IsNull() { + recordID, err = row[i].ToInt64(e.ctx.GetSessionVars().StmtCtx) + if e.filterErr(errors.Trace(err), ignoreErr) != nil { + return errors.Trace(err) + } + } + // Use the value if it's not null and not 0. + if recordID != 0 { + e.Table.RebaseAutoID(recordID, true) + e.ctx.GetSessionVars().InsertID = uint64(recordID) + row[i].SetInt64(recordID) + retryInfo.AddAutoIncrementID(recordID) + return nil + } + + // Change NULL to auto id. + // Change value 0 to auto id, if NoAutoValueOnZero SQL mode is not set. + if row[i].IsNull() || e.ctx.GetSessionVars().SQLMode&mysql.ModeNoAutoValueOnZero == 0 { + recordID, err = e.Table.AllocAutoID() + if e.filterErr(errors.Trace(err), ignoreErr) != nil { + return errors.Trace(err) + } + // It's compatible with mysql. So it sets last insert id to the first row. + if e.currRow == 0 { + e.lastInsertID = uint64(recordID) + } + } + + row[i].SetInt64(recordID) + retryInfo.AddAutoIncrementID(recordID) + return nil +} + // onDuplicateUpdate updates the duplicate row. // TODO: Report rows affected and last insert id. func (e *InsertExec) onDuplicateUpdate(row []types.Datum, h int64, cols []*expression.Assignment) error { diff --git a/executor/write_test.go b/executor/write_test.go index 1a3921d52c16f..88ac13a05d159 100644 --- a/executor/write_test.go +++ b/executor/write_test.go @@ -1006,3 +1006,19 @@ func (s *testSuite) TestBatchInsert(c *C) { r = tk.MustQuery("select count(*) from batch_insert;") r.Check(testkit.Rows("320")) } + +func (s *testSuite) TestNullDefault(c *C) { + defer func() { + s.cleanEnv(c) + testleak.AfterTest(c)() + }() + tk := testkit.NewTestKit(c, s.store) + tk.MustExec("use test; drop table if exists test_null_default;") + tk.MustExec("set timestamp = 1234") + tk.MustExec("set time_zone = '+08:00'") + tk.MustExec("create table test_null_default (ts timestamp null default current_timestamp)") + tk.MustExec("insert into test_null_default values (null)") + tk.MustQuery("select * from test_null_default").Check(testkit.Rows("")) + tk.MustExec("insert into test_null_default values ()") + tk.MustQuery("select * from test_null_default").Check(testkit.Rows("", "1970-01-01 08:20:34")) +} diff --git a/expression/builtin_compare.go b/expression/builtin_compare.go index 679df5ccd9887..c8a290e1cdd58 100644 --- a/expression/builtin_compare.go +++ b/expression/builtin_compare.go @@ -18,7 +18,6 @@ import ( "sort" "github.com/juju/errors" - "github.com/pingcap/tidb/ast" "github.com/pingcap/tidb/context" "github.com/pingcap/tidb/mysql" "github.com/pingcap/tidb/parser/opcode" @@ -38,7 +37,48 @@ var ( _ builtinFunc = &builtinGreatestSig{} _ builtinFunc = &builtinLeastSig{} _ builtinFunc = &builtinIntervalSig{} - _ builtinFunc = &builtinCompareSig{} + + _ builtinFunc = &builtinLTIntSig{} + _ builtinFunc = &builtinLTRealSig{} + _ builtinFunc = &builtinLTDecimalSig{} + _ builtinFunc = &builtinLTStringSig{} + _ builtinFunc = &builtinLTDurationSig{} + _ builtinFunc = &builtinLTTimeSig{} + + _ builtinFunc = &builtinLEIntSig{} + _ builtinFunc = &builtinLERealSig{} + _ builtinFunc = &builtinLEDecimalSig{} + _ builtinFunc = &builtinLEStringSig{} + _ builtinFunc = &builtinLEDurationSig{} + _ builtinFunc = &builtinLETimeSig{} + + _ builtinFunc = &builtinGTIntSig{} + _ builtinFunc = &builtinGTRealSig{} + _ builtinFunc = &builtinGTDecimalSig{} + _ builtinFunc = &builtinGTStringSig{} + _ builtinFunc = &builtinGTTimeSig{} + _ builtinFunc = &builtinGTDurationSig{} + + _ builtinFunc = &builtinGEIntSig{} + _ builtinFunc = &builtinGERealSig{} + _ builtinFunc = &builtinGEDecimalSig{} + _ builtinFunc = &builtinGEStringSig{} + _ builtinFunc = &builtinGETimeSig{} + _ builtinFunc = &builtinGEDurationSig{} + + _ builtinFunc = &builtinNEIntSig{} + _ builtinFunc = &builtinNERealSig{} + _ builtinFunc = &builtinNEDecimalSig{} + _ builtinFunc = &builtinNEStringSig{} + _ builtinFunc = &builtinNETimeSig{} + _ builtinFunc = &builtinNEDurationSig{} + + _ builtinFunc = &builtinNullEQIntSig{} + _ builtinFunc = &builtinNullEQRealSig{} + _ builtinFunc = &builtinNullEQDecimalSig{} + _ builtinFunc = &builtinNullEQStringSig{} + _ builtinFunc = &builtinNullEQTimeSig{} + _ builtinFunc = &builtinNullEQDurationSig{} ) type coalesceFunctionClass struct { @@ -215,11 +255,676 @@ type compareFunctionClass struct { op opcode.Op } -func (c *compareFunctionClass) getFunction(args []Expression, ctx context.Context) (builtinFunc, error) { - sig := &builtinCompareSig{newBaseBuiltinFunc(args, ctx), c.op} +// getCmpType gets the ClassType that the two args will be treated as when comparing. +func getCmpType(a types.TypeClass, b types.TypeClass) types.TypeClass { + if a == types.ClassString && b == types.ClassString { + return types.ClassString + } else if a == types.ClassInt && b == types.ClassInt { + return types.ClassInt + } else if (a == types.ClassInt || a == types.ClassDecimal) && + (b == types.ClassInt || b == types.ClassDecimal) { + return types.ClassDecimal + } + return types.ClassReal +} + +// isTemporalColumn checks if a expression is a temporal column, +// temporal column indicates time column or duration column. +func isTemporalColumn(expr Expression) bool { + ft := expr.GetType() + if _, isCol := expr.(*Column); !isCol { + return false + } + if !types.IsTypeTime(ft.Tp) && ft.Tp != mysql.TypeDuration { + return false + } + return true +} + +// getFunction sets compare built-in function signatures for various types. +func (c *compareFunctionClass) getFunction(args []Expression, ctx context.Context) (sig builtinFunc, err error) { + // TODO: we do not support JSON in new expression evaluation architecture now. + if args[0].GetType().Tp == mysql.TypeJSON || args[1].GetType().Tp == mysql.TypeJSON { + bf := newBaseBuiltinFunc(args, ctx) + bf.tp = &types.FieldType{Tp: mysql.TypeLonglong, Flen: 1, Decimal: 0} + types.SetBinChsClnFlag(bf.tp) + sig = &builtinCompareSig{bf, c.op} + return sig.setSelf(sig), c.verifyArgs(args) + } + ft0, ft1 := args[0].GetType(), args[1].GetType() + tc0, tc1 := ft0.ToClass(), ft1.ToClass() + cmpType := getCmpType(tc0, tc1) + if cmpType == types.ClassString && (types.IsTypeTime(ft0.Tp) || types.IsTypeTime(ft1.Tp)) { + // date[time] date[time] + // string date[time] + // compare as time + sig, err = c.generateCmpSigs(args, tpTime, ctx) + } else if ft0.Tp == mysql.TypeDuration && ft1.Tp == mysql.TypeDuration { + // duration duration + // compare as duration + sig, err = c.generateCmpSigs(args, tpDuration, ctx) + } else if cmpType == types.ClassReal { + _, isConst0 := args[0].(*Constant) + _, isConst1 := args[1].(*Constant) + if (tc0 == types.ClassDecimal && !isConst0 && tc1 == types.ClassString && isConst1) || + (tc1 == types.ClassDecimal && !isConst1 && tc0 == types.ClassString && isConst0) { + /* + + or + + + Do comparision as decimal rather than float, in order not to lose precision. + )*/ + cmpType = types.ClassDecimal + } else if isTemporalColumn(args[0]) && isConst1 || + isTemporalColumn(args[1]) && isConst0 { + /* +