From e80d5c5e56ffd14aef57e25f6113a73c37719ab2 Mon Sep 17 00:00:00 2001 From: Denis Boulas Date: Sat, 27 Oct 2018 03:20:43 +0300 Subject: [PATCH 01/18] Add base system, curl and jq for debug and checks. --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 12e25ce45..e4f057564 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,10 +5,12 @@ COPY . /go/src/github.com/pilosa/pilosa/ RUN cd /go/src/github.com/pilosa/pilosa \ && CGO_ENABLED=0 make install-dep install FLAGS="-a" -FROM scratch +FROM alpine:3.8 LABEL maintainer "dev@pilosa.com" +RUN apk add --no-cache curl jq + COPY --from=builder /go/bin/pilosa /pilosa COPY LICENSE /LICENSE From ce815471fee78e7357cf14e9fe27cfe26daa7cde Mon Sep 17 00:00:00 2001 From: Seebs Date: Thu, 1 Nov 2018 12:49:17 -0500 Subject: [PATCH 02/18] Drop now-superfluous methodNotAllowedHandler Long ago, the maintainers of gorilla/mux concluded that it was a "wontfix" to return StatusMethodNotAllowed instead of StatusNotFound for a method mismatch. Pilosa had a workaround for this for the most common case (GET requests to /index/{index}/query), and a TODO to address the other cases. While browsing the go-pilosa client code, I noticed that there is a test for roaring import support which relies on getting StatusMethodNotAllowed. But how can this work, if gorilla/mux doesn't do that? Answer: They started doing it in mid-2017, apparently: https://github.com/gorilla/mux/issues/271 Dropping this code changes the exact text of the message produced for that one case, but not the status code, and makes the behavior less confusing. --- http/handler.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/http/handler.go b/http/handler.go index 6007d72a8..1d5dee6f7 100644 --- a/http/handler.go +++ b/http/handler.go @@ -260,20 +260,10 @@ func newRouter(handler *Handler) *mux.Router { router.HandleFunc("/internal/shards/max", handler.handleGetShardsMax).Methods("GET").Name("GetShardsMax") // TODO: deprecate, but it's being used by the client router.HandleFunc("/internal/translate/data", handler.handleGetTranslateData).Methods("GET").Name("GetTranslateData") - // TODO: Apply MethodNotAllowed statuses to all endpoints. - // Ideally this would be automatic, as described in this (wontfix) ticket: - // https://github.com/gorilla/mux/issues/6 - // For now we just do it for the most commonly used handler, /query - router.HandleFunc("/index/{index}/query", handler.methodNotAllowedHandler).Methods("GET") - router.Use(handler.queryArgValidator) return router } -func (h *Handler) methodNotAllowedHandler(w http.ResponseWriter, _ *http.Request) { - http.Error(w, "method not allowed", http.StatusMethodNotAllowed) -} - // ServeHTTP handles an HTTP request. func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { defer func() { From 3cb3a065dd6230deed03d376cfa653e33d424702 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 1 Nov 2018 21:56:34 +0300 Subject: [PATCH 03/18] allow backlash, carriage return in pql strings --- pql/parser_test.go | 15 +- pql/pql.peg | 4 +- pql/pql.peg.go | 620 +++++++++++++++++++++------------------------ 3 files changed, 302 insertions(+), 337 deletions(-) diff --git a/pql/parser_test.go b/pql/parser_test.go index b5d98fb13..0d29eea4f 100644 --- a/pql/parser_test.go +++ b/pql/parser_test.go @@ -75,19 +75,20 @@ func TestParser_Parse(t *testing.T) { // Parse with only arguments. t.Run("ArgumentsOnly", func(t *testing.T) { - q, err := pql.ParseString(`MyCall( key= value, foo="bar", age = 12 , bool0=true, bool1=false, x=null )`) + q, err := pql.ParseString("MyCall( key= value, foo='bar', age = 12 , bool0=true, bool1=false, x=null, escape='\\escape\n' )") if err != nil { t.Fatal(err) } else if !reflect.DeepEqual(q.Calls[0], &pql.Call{ Name: "MyCall", Args: map[string]interface{}{ - "key": "value", - "foo": "bar", - "age": int64(12), - "bool0": true, - "bool1": false, - "x": nil, + "key": "value", + "foo": "bar", + "age": int64(12), + "bool0": true, + "bool1": false, + "x": nil, + "escape": "\\escape\n", }, }, ) { diff --git a/pql/pql.peg b/pql/pql.peg index 9e0087046..4db0b1c97 100644 --- a/pql/pql.peg +++ b/pql/pql.peg @@ -49,8 +49,8 @@ item <- ( 'null' &(comma / sp close) { p.addVal(nil) } / '\'' < singlequotedstring > '\'' { p.addVal(buffer[begin:end]) } ) -doublequotedstring <- ( [^"\\\n] / '\\n' / '\\\"' / '\\\'' / '\\\\' )* -singlequotedstring <- ( [^'\\\n] / '\\n' / '\\\"' / '\\\'' / '\\\\' )* +doublequotedstring <- ( [^"] / '\\n' / '\\\"' / '\\\'' / '\\\\' )* +singlequotedstring <- ( [^'] / '\\n' / '\\\"' / '\\\'' / '\\\\' )* fieldExpr <- [[A-Z]] ( [[A-Z]] / [0-9] / '_' / '-' )* field <- { p.addField(buffer[begin:end]) } diff --git a/pql/pql.peg.go b/pql/pql.peg.go index 2d5877fbb..eb40c5a21 100644 --- a/pql/pql.peg.go +++ b/pql/pql.peg.go @@ -2107,7 +2107,7 @@ func (p *PQL) Init() { position, tokenIndex = position140, tokenIndex140 return false }, - /* 14 doublequotedstring <- <((!('"' / '\\' / '\n') .) / ('\\' 'n') / ('\\' '"') / ('\\' '\'') / ('\\' '\\'))*> */ + /* 14 doublequotedstring <- <((!'"' .) / ('\\' 'n') / ('\\' '"') / ('\\' '\'') / ('\\' '\\'))*> */ func() bool { { position199 := position @@ -2118,28 +2118,10 @@ func (p *PQL) Init() { position202, tokenIndex202 := position, tokenIndex { position204, tokenIndex204 := position, tokenIndex - { - position205, tokenIndex205 := position, tokenIndex - if buffer[position] != rune('"') { - goto l206 - } - position++ - goto l205 - l206: - position, tokenIndex = position205, tokenIndex205 - if buffer[position] != rune('\\') { - goto l207 - } - position++ - goto l205 - l207: - position, tokenIndex = position205, tokenIndex205 - if buffer[position] != rune('\n') { - goto l204 - } - position++ + if buffer[position] != rune('"') { + goto l204 } - l205: + position++ goto l203 l204: position, tokenIndex = position204, tokenIndex204 @@ -2151,37 +2133,37 @@ func (p *PQL) Init() { l203: position, tokenIndex = position202, tokenIndex202 if buffer[position] != rune('\\') { - goto l208 + goto l205 } position++ if buffer[position] != rune('n') { - goto l208 + goto l205 } position++ goto l202 - l208: + l205: position, tokenIndex = position202, tokenIndex202 if buffer[position] != rune('\\') { - goto l209 + goto l206 } position++ if buffer[position] != rune('"') { - goto l209 + goto l206 } position++ goto l202 - l209: + l206: position, tokenIndex = position202, tokenIndex202 if buffer[position] != rune('\\') { - goto l210 + goto l207 } position++ if buffer[position] != rune('\'') { - goto l210 + goto l207 } position++ goto l202 - l210: + l207: position, tokenIndex = position202, tokenIndex202 if buffer[position] != rune('\\') { goto l201 @@ -2201,587 +2183,569 @@ func (p *PQL) Init() { } return true }, - /* 15 singlequotedstring <- <((!('\'' / '\\' / '\n') .) / ('\\' 'n') / ('\\' '"') / ('\\' '\'') / ('\\' '\\'))*> */ + /* 15 singlequotedstring <- <((!'\'' .) / ('\\' 'n') / ('\\' '"') / ('\\' '\'') / ('\\' '\\'))*> */ func() bool { { - position212 := position - l213: + position209 := position + l210: { - position214, tokenIndex214 := position, tokenIndex + position211, tokenIndex211 := position, tokenIndex { - position215, tokenIndex215 := position, tokenIndex + position212, tokenIndex212 := position, tokenIndex { - position217, tokenIndex217 := position, tokenIndex - { - position218, tokenIndex218 := position, tokenIndex - if buffer[position] != rune('\'') { - goto l219 - } - position++ - goto l218 - l219: - position, tokenIndex = position218, tokenIndex218 - if buffer[position] != rune('\\') { - goto l220 - } - position++ - goto l218 - l220: - position, tokenIndex = position218, tokenIndex218 - if buffer[position] != rune('\n') { - goto l217 - } - position++ + position214, tokenIndex214 := position, tokenIndex + if buffer[position] != rune('\'') { + goto l214 } - l218: - goto l216 - l217: - position, tokenIndex = position217, tokenIndex217 + position++ + goto l213 + l214: + position, tokenIndex = position214, tokenIndex214 } if !matchDot() { - goto l216 + goto l213 } - goto l215 - l216: - position, tokenIndex = position215, tokenIndex215 + goto l212 + l213: + position, tokenIndex = position212, tokenIndex212 if buffer[position] != rune('\\') { - goto l221 + goto l215 } position++ if buffer[position] != rune('n') { - goto l221 + goto l215 } position++ - goto l215 - l221: - position, tokenIndex = position215, tokenIndex215 + goto l212 + l215: + position, tokenIndex = position212, tokenIndex212 if buffer[position] != rune('\\') { - goto l222 + goto l216 } position++ if buffer[position] != rune('"') { - goto l222 + goto l216 } position++ - goto l215 - l222: - position, tokenIndex = position215, tokenIndex215 + goto l212 + l216: + position, tokenIndex = position212, tokenIndex212 if buffer[position] != rune('\\') { - goto l223 + goto l217 } position++ if buffer[position] != rune('\'') { - goto l223 + goto l217 } position++ - goto l215 - l223: - position, tokenIndex = position215, tokenIndex215 + goto l212 + l217: + position, tokenIndex = position212, tokenIndex212 if buffer[position] != rune('\\') { - goto l214 + goto l211 } position++ if buffer[position] != rune('\\') { - goto l214 + goto l211 } position++ } - l215: - goto l213 - l214: - position, tokenIndex = position214, tokenIndex214 + l212: + goto l210 + l211: + position, tokenIndex = position211, tokenIndex211 } - add(rulesinglequotedstring, position212) + add(rulesinglequotedstring, position209) } return true }, /* 16 fieldExpr <- <(([a-z] / [A-Z]) ([a-z] / [A-Z] / [0-9] / '_' / '-')*)> */ func() bool { - position224, tokenIndex224 := position, tokenIndex + position218, tokenIndex218 := position, tokenIndex { - position225 := position + position219 := position { - position226, tokenIndex226 := position, tokenIndex + position220, tokenIndex220 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l227 + goto l221 } position++ - goto l226 - l227: - position, tokenIndex = position226, tokenIndex226 + goto l220 + l221: + position, tokenIndex = position220, tokenIndex220 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l224 + goto l218 } position++ } - l226: - l228: + l220: + l222: { - position229, tokenIndex229 := position, tokenIndex + position223, tokenIndex223 := position, tokenIndex { - position230, tokenIndex230 := position, tokenIndex + position224, tokenIndex224 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l231 + goto l225 } position++ - goto l230 - l231: - position, tokenIndex = position230, tokenIndex230 + goto l224 + l225: + position, tokenIndex = position224, tokenIndex224 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l232 + goto l226 } position++ - goto l230 - l232: - position, tokenIndex = position230, tokenIndex230 + goto l224 + l226: + position, tokenIndex = position224, tokenIndex224 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l233 + goto l227 } position++ - goto l230 - l233: - position, tokenIndex = position230, tokenIndex230 + goto l224 + l227: + position, tokenIndex = position224, tokenIndex224 if buffer[position] != rune('_') { - goto l234 + goto l228 } position++ - goto l230 - l234: - position, tokenIndex = position230, tokenIndex230 + goto l224 + l228: + position, tokenIndex = position224, tokenIndex224 if buffer[position] != rune('-') { - goto l229 + goto l223 } position++ } - l230: - goto l228 - l229: - position, tokenIndex = position229, tokenIndex229 + l224: + goto l222 + l223: + position, tokenIndex = position223, tokenIndex223 } - add(rulefieldExpr, position225) + add(rulefieldExpr, position219) } return true - l224: - position, tokenIndex = position224, tokenIndex224 + l218: + position, tokenIndex = position218, tokenIndex218 return false }, /* 17 field <- <(<(fieldExpr / reserved)> Action42)> */ func() bool { - position235, tokenIndex235 := position, tokenIndex + position229, tokenIndex229 := position, tokenIndex { - position236 := position + position230 := position { - position237 := position + position231 := position { - position238, tokenIndex238 := position, tokenIndex + position232, tokenIndex232 := position, tokenIndex if !_rules[rulefieldExpr]() { - goto l239 + goto l233 } - goto l238 - l239: - position, tokenIndex = position238, tokenIndex238 + goto l232 + l233: + position, tokenIndex = position232, tokenIndex232 { - position240 := position + position234 := position { - position241, tokenIndex241 := position, tokenIndex + position235, tokenIndex235 := position, tokenIndex if buffer[position] != rune('_') { - goto l242 + goto l236 } position++ if buffer[position] != rune('r') { - goto l242 + goto l236 } position++ if buffer[position] != rune('o') { - goto l242 + goto l236 } position++ if buffer[position] != rune('w') { - goto l242 + goto l236 } position++ - goto l241 - l242: - position, tokenIndex = position241, tokenIndex241 + goto l235 + l236: + position, tokenIndex = position235, tokenIndex235 if buffer[position] != rune('_') { - goto l243 + goto l237 } position++ if buffer[position] != rune('c') { - goto l243 + goto l237 } position++ if buffer[position] != rune('o') { - goto l243 + goto l237 } position++ if buffer[position] != rune('l') { - goto l243 + goto l237 } position++ - goto l241 - l243: - position, tokenIndex = position241, tokenIndex241 + goto l235 + l237: + position, tokenIndex = position235, tokenIndex235 if buffer[position] != rune('_') { - goto l244 + goto l238 } position++ if buffer[position] != rune('s') { - goto l244 + goto l238 } position++ if buffer[position] != rune('t') { - goto l244 + goto l238 } position++ if buffer[position] != rune('a') { - goto l244 + goto l238 } position++ if buffer[position] != rune('r') { - goto l244 + goto l238 } position++ if buffer[position] != rune('t') { - goto l244 + goto l238 } position++ - goto l241 - l244: - position, tokenIndex = position241, tokenIndex241 + goto l235 + l238: + position, tokenIndex = position235, tokenIndex235 if buffer[position] != rune('_') { - goto l245 + goto l239 } position++ if buffer[position] != rune('e') { - goto l245 + goto l239 } position++ if buffer[position] != rune('n') { - goto l245 + goto l239 } position++ if buffer[position] != rune('d') { - goto l245 + goto l239 } position++ - goto l241 - l245: - position, tokenIndex = position241, tokenIndex241 + goto l235 + l239: + position, tokenIndex = position235, tokenIndex235 if buffer[position] != rune('_') { - goto l246 + goto l240 } position++ if buffer[position] != rune('t') { - goto l246 + goto l240 } position++ if buffer[position] != rune('i') { - goto l246 + goto l240 } position++ if buffer[position] != rune('m') { - goto l246 + goto l240 } position++ if buffer[position] != rune('e') { - goto l246 + goto l240 } position++ if buffer[position] != rune('s') { - goto l246 + goto l240 } position++ if buffer[position] != rune('t') { - goto l246 + goto l240 } position++ if buffer[position] != rune('a') { - goto l246 + goto l240 } position++ if buffer[position] != rune('m') { - goto l246 + goto l240 } position++ if buffer[position] != rune('p') { - goto l246 + goto l240 } position++ - goto l241 - l246: - position, tokenIndex = position241, tokenIndex241 + goto l235 + l240: + position, tokenIndex = position235, tokenIndex235 if buffer[position] != rune('_') { - goto l235 + goto l229 } position++ if buffer[position] != rune('f') { - goto l235 + goto l229 } position++ if buffer[position] != rune('i') { - goto l235 + goto l229 } position++ if buffer[position] != rune('e') { - goto l235 + goto l229 } position++ if buffer[position] != rune('l') { - goto l235 + goto l229 } position++ if buffer[position] != rune('d') { - goto l235 + goto l229 } position++ } - l241: - add(rulereserved, position240) + l235: + add(rulereserved, position234) } } - l238: - add(rulePegText, position237) + l232: + add(rulePegText, position231) } { add(ruleAction42, position) } - add(rulefield, position236) + add(rulefield, position230) } return true - l235: - position, tokenIndex = position235, tokenIndex235 + l229: + position, tokenIndex = position229, tokenIndex229 return false }, /* 18 reserved <- <(('_' 'r' 'o' 'w') / ('_' 'c' 'o' 'l') / ('_' 's' 't' 'a' 'r' 't') / ('_' 'e' 'n' 'd') / ('_' 't' 'i' 'm' 'e' 's' 't' 'a' 'm' 'p') / ('_' 'f' 'i' 'e' 'l' 'd'))> */ nil, /* 19 posfield <- <( Action43)> */ func() bool { - position249, tokenIndex249 := position, tokenIndex + position243, tokenIndex243 := position, tokenIndex { - position250 := position + position244 := position { - position251 := position + position245 := position if !_rules[rulefieldExpr]() { - goto l249 + goto l243 } - add(rulePegText, position251) + add(rulePegText, position245) } { add(ruleAction43, position) } - add(ruleposfield, position250) + add(ruleposfield, position244) } return true - l249: - position, tokenIndex = position249, tokenIndex249 + l243: + position, tokenIndex = position243, tokenIndex243 return false }, /* 20 uint <- <(([1-9] [0-9]*) / '0')> */ func() bool { - position253, tokenIndex253 := position, tokenIndex + position247, tokenIndex247 := position, tokenIndex { - position254 := position + position248 := position { - position255, tokenIndex255 := position, tokenIndex + position249, tokenIndex249 := position, tokenIndex if c := buffer[position]; c < rune('1') || c > rune('9') { - goto l256 + goto l250 } position++ - l257: + l251: { - position258, tokenIndex258 := position, tokenIndex + position252, tokenIndex252 := position, tokenIndex if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l258 + goto l252 } position++ - goto l257 - l258: - position, tokenIndex = position258, tokenIndex258 + goto l251 + l252: + position, tokenIndex = position252, tokenIndex252 } - goto l255 - l256: - position, tokenIndex = position255, tokenIndex255 + goto l249 + l250: + position, tokenIndex = position249, tokenIndex249 if buffer[position] != rune('0') { - goto l253 + goto l247 } position++ } - l255: - add(ruleuint, position254) + l249: + add(ruleuint, position248) } return true - l253: - position, tokenIndex = position253, tokenIndex253 + l247: + position, tokenIndex = position247, tokenIndex247 return false }, /* 21 uintrow <- <( Action44)> */ nil, /* 22 col <- <(( Action45) / ('\'' '\'' Action46) / ('"' '"' Action47))> */ func() bool { - position260, tokenIndex260 := position, tokenIndex + position254, tokenIndex254 := position, tokenIndex { - position261 := position + position255 := position { - position262, tokenIndex262 := position, tokenIndex + position256, tokenIndex256 := position, tokenIndex { - position264 := position + position258 := position if !_rules[ruleuint]() { - goto l263 + goto l257 } - add(rulePegText, position264) + add(rulePegText, position258) } { add(ruleAction45, position) } - goto l262 - l263: - position, tokenIndex = position262, tokenIndex262 + goto l256 + l257: + position, tokenIndex = position256, tokenIndex256 if buffer[position] != rune('\'') { - goto l266 + goto l260 } position++ { - position267 := position + position261 := position if !_rules[rulesinglequotedstring]() { - goto l266 + goto l260 } - add(rulePegText, position267) + add(rulePegText, position261) } if buffer[position] != rune('\'') { - goto l266 + goto l260 } position++ { add(ruleAction46, position) } - goto l262 - l266: - position, tokenIndex = position262, tokenIndex262 + goto l256 + l260: + position, tokenIndex = position256, tokenIndex256 if buffer[position] != rune('"') { - goto l260 + goto l254 } position++ { - position269 := position + position263 := position if !_rules[ruledoublequotedstring]() { - goto l260 + goto l254 } - add(rulePegText, position269) + add(rulePegText, position263) } if buffer[position] != rune('"') { - goto l260 + goto l254 } position++ { add(ruleAction47, position) } } - l262: - add(rulecol, position261) + l256: + add(rulecol, position255) } return true - l260: - position, tokenIndex = position260, tokenIndex260 + l254: + position, tokenIndex = position254, tokenIndex254 return false }, /* 23 row <- <(( Action48) / ('\'' '\'' Action49) / ('"' '"' Action50))> */ nil, /* 24 open <- <('(' sp)> */ func() bool { - position272, tokenIndex272 := position, tokenIndex + position266, tokenIndex266 := position, tokenIndex { - position273 := position + position267 := position if buffer[position] != rune('(') { - goto l272 + goto l266 } position++ if !_rules[rulesp]() { - goto l272 + goto l266 } - add(ruleopen, position273) + add(ruleopen, position267) } return true - l272: - position, tokenIndex = position272, tokenIndex272 + l266: + position, tokenIndex = position266, tokenIndex266 return false }, /* 25 close <- <(')' sp)> */ func() bool { - position274, tokenIndex274 := position, tokenIndex + position268, tokenIndex268 := position, tokenIndex { - position275 := position + position269 := position if buffer[position] != rune(')') { - goto l274 + goto l268 } position++ if !_rules[rulesp]() { - goto l274 + goto l268 } - add(ruleclose, position275) + add(ruleclose, position269) } return true - l274: - position, tokenIndex = position274, tokenIndex274 + l268: + position, tokenIndex = position268, tokenIndex268 return false }, /* 26 sp <- <(' ' / '\t' / '\n')*> */ func() bool { { - position277 := position - l278: + position271 := position + l272: { - position279, tokenIndex279 := position, tokenIndex + position273, tokenIndex273 := position, tokenIndex { - position280, tokenIndex280 := position, tokenIndex + position274, tokenIndex274 := position, tokenIndex if buffer[position] != rune(' ') { - goto l281 + goto l275 } position++ - goto l280 - l281: - position, tokenIndex = position280, tokenIndex280 + goto l274 + l275: + position, tokenIndex = position274, tokenIndex274 if buffer[position] != rune('\t') { - goto l282 + goto l276 } position++ - goto l280 - l282: - position, tokenIndex = position280, tokenIndex280 + goto l274 + l276: + position, tokenIndex = position274, tokenIndex274 if buffer[position] != rune('\n') { - goto l279 + goto l273 } position++ } - l280: - goto l278 - l279: - position, tokenIndex = position279, tokenIndex279 + l274: + goto l272 + l273: + position, tokenIndex = position273, tokenIndex273 } - add(rulesp, position277) + add(rulesp, position271) } return true }, /* 27 comma <- <(sp ',' sp)> */ func() bool { - position283, tokenIndex283 := position, tokenIndex + position277, tokenIndex277 := position, tokenIndex { - position284 := position + position278 := position if !_rules[rulesp]() { - goto l283 + goto l277 } if buffer[position] != rune(',') { - goto l283 + goto l277 } position++ if !_rules[rulesp]() { - goto l283 + goto l277 } - add(rulecomma, position284) + add(rulecomma, position278) } return true - l283: - position, tokenIndex = position283, tokenIndex283 + l277: + position, tokenIndex = position277, tokenIndex277 return false }, /* 28 lbrack <- <('[' sp)> */ @@ -2792,136 +2756,136 @@ func (p *PQL) Init() { nil, /* 31 timestampbasicfmt <- <([0-9] [0-9] [0-9] [0-9] '-' ('0' / '1') [0-9] '-' [0-3] [0-9] 'T' [0-9] [0-9] ':' [0-9] [0-9])> */ func() bool { - position288, tokenIndex288 := position, tokenIndex + position282, tokenIndex282 := position, tokenIndex { - position289 := position + position283 := position if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l288 + goto l282 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l288 + goto l282 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l288 + goto l282 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l288 + goto l282 } position++ if buffer[position] != rune('-') { - goto l288 + goto l282 } position++ { - position290, tokenIndex290 := position, tokenIndex + position284, tokenIndex284 := position, tokenIndex if buffer[position] != rune('0') { - goto l291 + goto l285 } position++ - goto l290 - l291: - position, tokenIndex = position290, tokenIndex290 + goto l284 + l285: + position, tokenIndex = position284, tokenIndex284 if buffer[position] != rune('1') { - goto l288 + goto l282 } position++ } - l290: + l284: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l288 + goto l282 } position++ if buffer[position] != rune('-') { - goto l288 + goto l282 } position++ if c := buffer[position]; c < rune('0') || c > rune('3') { - goto l288 + goto l282 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l288 + goto l282 } position++ if buffer[position] != rune('T') { - goto l288 + goto l282 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l288 + goto l282 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l288 + goto l282 } position++ if buffer[position] != rune(':') { - goto l288 + goto l282 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l288 + goto l282 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l288 + goto l282 } position++ - add(ruletimestampbasicfmt, position289) + add(ruletimestampbasicfmt, position283) } return true - l288: - position, tokenIndex = position288, tokenIndex288 + l282: + position, tokenIndex = position282, tokenIndex282 return false }, /* 32 timestampfmt <- <(('"' timestampbasicfmt '"') / ('\'' timestampbasicfmt '\'') / timestampbasicfmt)> */ func() bool { - position292, tokenIndex292 := position, tokenIndex + position286, tokenIndex286 := position, tokenIndex { - position293 := position + position287 := position { - position294, tokenIndex294 := position, tokenIndex + position288, tokenIndex288 := position, tokenIndex if buffer[position] != rune('"') { - goto l295 + goto l289 } position++ if !_rules[ruletimestampbasicfmt]() { - goto l295 + goto l289 } if buffer[position] != rune('"') { - goto l295 + goto l289 } position++ - goto l294 - l295: - position, tokenIndex = position294, tokenIndex294 + goto l288 + l289: + position, tokenIndex = position288, tokenIndex288 if buffer[position] != rune('\'') { - goto l296 + goto l290 } position++ if !_rules[ruletimestampbasicfmt]() { - goto l296 + goto l290 } if buffer[position] != rune('\'') { - goto l296 + goto l290 } position++ - goto l294 - l296: - position, tokenIndex = position294, tokenIndex294 + goto l288 + l290: + position, tokenIndex = position288, tokenIndex288 if !_rules[ruletimestampbasicfmt]() { - goto l292 + goto l286 } } - l294: - add(ruletimestampfmt, position293) + l288: + add(ruletimestampfmt, position287) } return true - l292: - position, tokenIndex = position292, tokenIndex292 + l286: + position, tokenIndex = position286, tokenIndex286 return false }, /* 33 timestamp <- <( Action51)> */ From 456c0929308c1ffe6dea65ea90d9d754edf1e745 Mon Sep 17 00:00:00 2001 From: Seebs Date: Thu, 1 Nov 2018 13:56:48 -0500 Subject: [PATCH 04/18] enterprise/b: Ensure 64-bit range for btree keys. The cmp() function used to compare btree keys was using the trick of comparing unsigned values by coercing the result of subtraction to a signed type. This is fine as long as the range of differences never actually exceeds the limits of the signed type. For instance, with int64, as long as the magnitude of the difference is under 2^63 or so, it works reasonably well. Plain int, however, can be a 32-bit type, at which point the magnitude of difference needed to break it is only 2^31 or so. Subtraction and type conversion is enough cheaper than branches that this is worth preserving, but it's worth preserving by switching to an explicit int64 for the operation and return type. This will not actually affect performance except for people using the btree code on 32-bit machines, so it probably won't ever matter. Which may also be true of the potential wrong answers, but "might be slower" is a better risk than "might crash". --- enterprise/b/btree.go | 2 +- enterprise/b/containers_btree.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enterprise/b/btree.go b/enterprise/b/btree.go index 7b9b34e76..c61f5c5b6 100644 --- a/enterprise/b/btree.go +++ b/enterprise/b/btree.go @@ -75,7 +75,7 @@ type ( // 0 if a == b // > 0 if a > b // - Cmp func(a, b uint64) int + Cmp func(a, b uint64) int64 d struct { // data page c int diff --git a/enterprise/b/containers_btree.go b/enterprise/b/containers_btree.go index 7487eea70..c2f95c0c7 100644 --- a/enterprise/b/containers_btree.go +++ b/enterprise/b/containers_btree.go @@ -23,8 +23,8 @@ import ( "github.com/pilosa/pilosa/roaring" ) -func cmp(a, b uint64) int { - return int(a - b) +func cmp(a, b uint64) int64 { + return int64(a - b) } type bTreeContainers struct { From 100c7807046e457a4b6f529a60e23f8b3edd0e50 Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Mon, 5 Nov 2018 11:36:55 -0600 Subject: [PATCH 05/18] Switch data model diagrams to png --- docs/data-model.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/data-model.md b/docs/data-model.md index bababdd34..91d9de0db 100644 --- a/docs/data-model.md +++ b/docs/data-model.md @@ -26,7 +26,7 @@ Pilosa lays out data first in rows, so queries which get all the set bits in one Please note that Pilosa is most performant when row and column IDs are sequential starting from 0. You can deviate from this to some degree, but setting a bit with column ID 263 on a single-node cluster, for example, will not work well due to memory limitations. -![basic data model diagram](/img/docs/data-model.svg) +![basic data model diagram](/img/docs/data-model.png) *Basic data model diagram* ### Index @@ -89,14 +89,14 @@ This is one major component of Pilosa's ability to combine relationships from mu Ranked Fields maintain a sorted cache of column counts by Row ID (yielding the top rows by columns with a bit set in each). This cache facilitates the TopN query. The cache size defaults to 50,000 and can be set at Field creation. -![ranked field diagram](/img/docs/field-ranked.svg) +![ranked field diagram](/img/docs/field-ranked.png) *Ranked field diagram* #### LRU The LRU cache maintains the most recently accessed Rows. -![lru field diagram](/img/docs/field-lru.svg) +![lru field diagram](/img/docs/field-lru.png) *LRU field diagram* ### Time Quantum @@ -161,7 +161,7 @@ Set(2, B=1) Set(3, B=6) ``` -![BSI field diagram](/img/docs/field-bsi.svg) +![BSI field diagram](/img/docs/field-bsi.png) *BSI field diagram* Check out this [blog post](/blog/range-encoded-bitmaps/) for some more details about BSI in Pilosa. @@ -186,7 +186,7 @@ Set(3, A=8, 2017-05-18T00:00) Set(3, A=8, 2017-05-19T00:00) ``` -![time quantum field diagram](/img/docs/field-time-quantum.svg) +![time quantum field diagram](/img/docs/field-time-quantum.png) *Time quantum fueld diagram* #### Mutex From 497c541affba5dcb2af87b89d34adcb822d4d6c4 Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Mon, 5 Nov 2018 11:37:03 -0600 Subject: [PATCH 06/18] Remove outdated anchor link --- docs/glossary.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/glossary.md b/docs/glossary.md index fccbe0ae8..86ae6bd70 100644 --- a/docs/glossary.md +++ b/docs/glossary.md @@ -70,4 +70,4 @@ nav = [] [TopN](../query-language/#topn): A [PQL](#pql) query that returns a list of rows, sorted by the count of [columns](#column) set in the [row](#row), within a specified [field](#field). -[View](../data-model/#view): Views separate the different data layouts within a [Field](#field). The primary view is standard, which represents the typical [row](#row)/[column](#column) data. Time based field views are automatically generated for each [time quantum](#time-quantum). Views are internally managed by Pilosa, and never exposed directly via the API. This simplifies the functional interface by separating it from the physical data representation. +View: Views separate the different data layouts within a [Field](#field). The primary view is standard, which represents the typical [row](#row)/[column](#column) data. Time based field views are automatically generated for each [time quantum](#time-quantum). Views are internally managed by Pilosa, and never exposed directly via the API. This simplifies the functional interface by separating it from the physical data representation. From be5f8c923d84cc1ab6dddd6d97a975b4783b00ec Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Mon, 5 Nov 2018 12:34:08 -0600 Subject: [PATCH 07/18] Remove 'view' from nav --- docs/data-model.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/data-model.md b/docs/data-model.md index 91d9de0db..9bb44bb99 100644 --- a/docs/data-model.md +++ b/docs/data-model.md @@ -10,7 +10,6 @@ nav = [ "Time Quantum", "Attribute", "Shard", - "View", ] +++ From 063caed8d1ef2eff6f40c757bec9533fe5a47a80 Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Fri, 2 Nov 2018 19:17:07 -0500 Subject: [PATCH 08/18] forward imports to non-coordinator shards --- api.go | 171 ++++++++++++++++++++++++++--------- api_test.go | 232 ++++++++++++++++++++++++++++++++++++++++++++++++ http/client.go | 3 + http/handler.go | 12 ++- 4 files changed, 371 insertions(+), 47 deletions(-) create mode 100644 api_test.go diff --git a/api.go b/api.go index af206496b..dcedc3d92 100644 --- a/api.go +++ b/api.go @@ -690,7 +690,8 @@ func (api *API) FieldAttrDiff(_ context.Context, indexName string, fieldName str // ImportOptions holds the options for the API.Import method. type ImportOptions struct { - Clear bool + Clear bool + IgnoreKeyCheck bool } // ImportOption is a functional option type for API.Import. @@ -703,8 +704,15 @@ func OptImportOptionsClear(c bool) ImportOption { } } +func OptImportOptionsIgnoreKeyCheck(b bool) ImportOption { + return func(o *ImportOptions) error { + o.IgnoreKeyCheck = b + return nil + } +} + // Import bulk imports data into a particular index,field,shard. -func (api *API) Import(_ context.Context, req *ImportRequest, opts ...ImportOption) error { +func (api *API) Import(ctx context.Context, req *ImportRequest, opts ...ImportOption) error { if err := api.validate(apiImport); err != nil { return errors.Wrap(err, "validating api method") } @@ -715,34 +723,71 @@ func (api *API) Import(_ context.Context, req *ImportRequest, opts ...ImportOpti return errors.Wrap(err, "setting up import options") } - index := api.holder.Index(req.Index) - if index == nil { - return newNotFoundError(ErrIndexNotFound) - } - - field, err := api.indexField(req.Index, req.Field, req.Shard) + index, field, err := api.indexField(req.Index, req.Field, req.Shard) if err != nil { - return errors.Wrap(err, "getting field") + return errors.Wrap(err, "getting index and field") } - // Translate row keys. - if field.keys() { - if len(req.RowIDs) != 0 { - return errors.New("row ids cannot be used because field uses string keys") + // Unless explicitly ignoring key validation (meaning keys have been + // translated to ids in a previous step at the coordinator node), then + // check to see if keys need translation. + if !options.IgnoreKeyCheck { + // Translate row keys. + if field.keys() { + if len(req.RowIDs) != 0 { + return errors.New("row ids cannot be used because field uses string keys") + } + if req.RowIDs, err = api.holder.translateFile.TranslateRowsToUint64(index.Name(), field.Name(), req.RowKeys); err != nil { + return errors.Wrap(err, "translating rows") + } } - if req.RowIDs, err = api.holder.translateFile.TranslateRowsToUint64(index.Name(), field.Name(), req.RowKeys); err != nil { - return errors.Wrap(err, "translating rows") + + // Translate column keys. + if index.Keys() { + if len(req.ColumnIDs) != 0 { + return errors.New("column ids cannot be used because index uses string keys") + } + if req.ColumnIDs, err = api.holder.translateFile.TranslateColumnsToUint64(index.Name(), req.ColumnKeys); err != nil { + return errors.Wrap(err, "translating columns") + } + } + + // For translated data, map the columnIDs to shards. If + // this node does not own the shard, forward to the node that does. + if index.Keys() || field.keys() { + m := make(map[uint64][]Bit) + + for i, colID := range req.ColumnIDs { + shard := colID / ShardWidth + if _, ok := m[shard]; !ok { + m[shard] = make([]Bit, 0) + } + m[shard] = append(m[shard], Bit{ + RowID: req.RowIDs[i], + ColumnID: colID, + Timestamp: req.Timestamps[i], + }) + } + + // Signal to the receiving nodes to ignore checking for key translation. + opts = append(opts, OptImportOptionsIgnoreKeyCheck(true)) + + var eg errgroup.Group + for shard, bits := range m { + // TODO: if local node owns this shard we don't need to go through the client + shard := shard + bits := bits + eg.Go(func() error { + return api.server.defaultClient.Import(ctx, req.Index, req.Field, shard, bits, opts...) + }) + } + return eg.Wait() } } - // Translate column keys. - if index.Keys() { - if len(req.ColumnIDs) != 0 { - return errors.New("column ids cannot be used because index uses string keys") - } - if req.ColumnIDs, err = api.holder.translateFile.TranslateColumnsToUint64(index.Name(), req.ColumnKeys); err != nil { - return errors.Wrap(err, "translating columns") - } + // Validate shard ownership. + if err := api.validateShardOwnership(req.Index, req.Shard); err != nil { + return errors.Wrap(err, "validating shard ownership") } // Convert timestamps to time.Time. @@ -772,7 +817,7 @@ func (api *API) Import(_ context.Context, req *ImportRequest, opts ...ImportOpti } // ImportValue bulk imports values into a particular field. -func (api *API) ImportValue(_ context.Context, req *ImportValueRequest, opts ...ImportOption) error { +func (api *API) ImportValue(ctx context.Context, req *ImportValueRequest, opts ...ImportOption) error { if err := api.validate(apiImportValue); err != nil { return errors.Wrap(err, "validating api method") } @@ -783,26 +828,60 @@ func (api *API) ImportValue(_ context.Context, req *ImportValueRequest, opts ... return errors.Wrap(err, "setting up import options") } - index := api.holder.Index(req.Index) - if index == nil { - return newNotFoundError(ErrIndexNotFound) - } - - field, err := api.indexField(req.Index, req.Field, req.Shard) + index, field, err := api.indexField(req.Index, req.Field, req.Shard) if err != nil { - return errors.Wrap(err, "getting field") + return errors.Wrap(err, "getting index and field") } - // Translate column keys. - if index.Keys() { - if len(req.ColumnIDs) != 0 { - return errors.New("column ids cannot be used because index uses string keys") - } - if req.ColumnIDs, err = api.holder.translateFile.TranslateColumnsToUint64(index.Name(), req.ColumnKeys); err != nil { - return errors.Wrap(err, "translating columns") + // Unless explicitly ignoring key validation (meaning keys have been + // translate to ids in a previous step at the coordinator node), then + // check to see if keys need translation. + if !options.IgnoreKeyCheck { + // Translate column keys. + if index.Keys() { + if len(req.ColumnIDs) != 0 { + return errors.New("column ids cannot be used because index uses string keys") + } + if req.ColumnIDs, err = api.holder.translateFile.TranslateColumnsToUint64(index.Name(), req.ColumnKeys); err != nil { + return errors.Wrap(err, "translating columns") + } + + // For translated data, map the columnIDs to shards. If + // this node does not own the shard, forward to the node that does. + m := make(map[uint64][]FieldValue) + + for i, colID := range req.ColumnIDs { + shard := colID / ShardWidth + if _, ok := m[shard]; !ok { + m[shard] = make([]FieldValue, 0) + } + m[shard] = append(m[shard], FieldValue{ + Value: req.Values[i], + ColumnID: colID, + }) + } + + // Signal to the receiving nodes to ignore checking for key translation. + opts = append(opts, OptImportOptionsIgnoreKeyCheck(true)) + + var eg errgroup.Group + for shard, vals := range m { + // TODO: if local node owns this shard we don't need to go through the client + shard := shard + vals := vals + eg.Go(func() error { + return api.server.defaultClient.ImportValue(ctx, req.Index, req.Field, shard, vals, opts...) + }) + } + return eg.Wait() } } + // Validate shard ownership. + if err := api.validateShardOwnership(req.Index, req.Shard); err != nil { + return errors.Wrap(err, "validating shard ownership") + } + // Import columnIDs into existence field. if !options.Clear { if err := importExistenceColumns(index, req.ColumnIDs); err != nil { @@ -863,28 +942,32 @@ func (api *API) LongQueryTime() time.Duration { return api.cluster.longQueryTime } -func (api *API) indexField(indexName string, fieldName string, shard uint64) (*Field, error) { +func (api *API) validateShardOwnership(indexName string, shard uint64) error { // Validate that this handler owns the shard. if !api.cluster.ownsShard(api.Node().ID, indexName, shard) { api.server.logger.Printf("node %s does not own shard %d of index %s", api.Node().ID, shard, indexName) - return nil, ErrClusterDoesNotOwnShard + return ErrClusterDoesNotOwnShard } + return nil +} + +func (api *API) indexField(indexName string, fieldName string, shard uint64) (*Index, *Field, error) { + api.server.logger.Printf("importing: %v %v %v", indexName, fieldName, shard) // Find the Index. - api.server.logger.Printf("importing: %v %v %v", indexName, fieldName, shard) index := api.holder.Index(indexName) if index == nil { api.server.logger.Printf("fragment error: index=%s, field=%s, shard=%d, err=%s", indexName, fieldName, shard, ErrIndexNotFound.Error()) - return nil, newNotFoundError(ErrIndexNotFound) + return nil, nil, newNotFoundError(ErrIndexNotFound) } // Retrieve field. field := index.Field(fieldName) if field == nil { api.server.logger.Printf("field error: index=%s, field=%s, shard=%d, err=%s", indexName, fieldName, shard, ErrFieldNotFound.Error()) - return nil, ErrFieldNotFound + return nil, nil, ErrFieldNotFound } - return field, nil + return index, field, nil } // SetCoordinator makes a new Node the cluster coordinator. diff --git a/api_test.go b/api_test.go new file mode 100644 index 000000000..e569896f0 --- /dev/null +++ b/api_test.go @@ -0,0 +1,232 @@ +// Copyright 2017 Pilosa Corp. +// +// 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, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pilosa_test + +import ( + "context" + "fmt" + "reflect" + "testing" + + "github.com/pilosa/pilosa" + "github.com/pilosa/pilosa/server" + "github.com/pilosa/pilosa/test" +) + +func TestAPI_Import(t *testing.T) { + c := test.MustRunCluster(t, 2, + []server.CommandOption{ + server.OptCommandServerOptions( + pilosa.OptServerNodeID("node0"), + pilosa.OptServerClusterHasher(&offsetModHasher{}), + )}, + []server.CommandOption{ + server.OptCommandServerOptions( + pilosa.OptServerNodeID("node1"), + pilosa.OptServerClusterHasher(&offsetModHasher{}), + )}, + ) + defer c.Close() + + m0 := c[0] + m1 := c[1] + + t.Run("RowIDColumnKey", func(t *testing.T) { + ctx := context.Background() + index := "rick" + field := "f" + + _, err := m0.API.CreateIndex(ctx, index, pilosa.IndexOptions{Keys: true}) + if err != nil { + t.Fatalf("creating index: %v", err) + } + _, err = m0.API.CreateField(ctx, index, field, pilosa.OptFieldTypeSet(pilosa.DefaultCacheType, 100)) + if err != nil { + t.Fatalf("creating field: %v", err) + } + + rowID := uint64(1) + timestamp := int64(0) + + // Generate some keyed records. + rowIDs := []uint64{} + colKeys := []string{} + timestamps := []int64{} + for i := 1; i <= 10; i++ { + rowIDs = append(rowIDs, rowID) + timestamps = append(timestamps, timestamp) + colKeys = append(colKeys, fmt.Sprintf("col%d", i)) + } + + // Import data with keys to the coordinator (node0) and verify that it gets + // translated and forwarded to the owner of shard 0 (node1; because of offsetModHasher) + req := &pilosa.ImportRequest{ + Index: index, + Field: field, + Shard: 0, + RowIDs: rowIDs, + ColumnKeys: colKeys, + Timestamps: timestamps, + } + if err := m0.API.Import(ctx, req); err != nil { + t.Fatal(err) + } + + pql := fmt.Sprintf("Row(%s=%d)", field, rowID) + + // Query node0. + if res, err := m0.API.Query(ctx, &pilosa.QueryRequest{Index: index, Query: pql}); err != nil { + t.Fatal(err) + } else if keys := res.Results[0].(*pilosa.Row).Keys; !reflect.DeepEqual(keys, colKeys) { + t.Fatalf("unexpected column keys: %+v", keys) + } + + // Query node1. + if res, err := m1.API.Query(ctx, &pilosa.QueryRequest{Index: index, Query: pql}); err != nil { + t.Fatal(err) + } else if keys := res.Results[0].(*pilosa.Row).Keys; !reflect.DeepEqual(keys, colKeys) { + t.Fatalf("unexpected column keys: %+v", keys) + } + }) + + t.Run("RowKeyColumnID", func(t *testing.T) { + ctx := context.Background() + index := "rkci" + field := "f" + + _, err := m0.API.CreateIndex(ctx, index, pilosa.IndexOptions{Keys: false}) + if err != nil { + t.Fatalf("creating index: %v", err) + } + _, err = m0.API.CreateField(ctx, index, field, pilosa.OptFieldTypeSet(pilosa.DefaultCacheType, 100), pilosa.OptFieldKeys()) + if err != nil { + t.Fatalf("creating field: %v", err) + } + + rowKey := "rowkey" + + // Generate some keyed records. + rowKeys := []string{rowKey, rowKey, rowKey} + colIDs := []uint64{1, 2, pilosa.ShardWidth + 1} + timestamps := []int64{0, 0, 0} + + // Import data with keys to the coordinator (node0) and verify that it gets + // translated and forwarded to the owner of shard 0 (node1; because of offsetModHasher) + req := &pilosa.ImportRequest{ + Index: index, + Field: field, + Shard: 0, + RowKeys: rowKeys, + ColumnIDs: colIDs, + Timestamps: timestamps, + } + if err := m0.API.Import(ctx, req); err != nil { + t.Fatal(err) + } + + pql := fmt.Sprintf("Row(%s=%s)", field, rowKey) + + // Query node0. + if res, err := m0.API.Query(ctx, &pilosa.QueryRequest{Index: index, Query: pql}); err != nil { + t.Fatal(err) + } else if columns := res.Results[0].(*pilosa.Row).Columns(); !reflect.DeepEqual(columns, colIDs) { + t.Fatalf("unexpected column ids: %+v", columns) + } + + // Query node1. + if res, err := m1.API.Query(ctx, &pilosa.QueryRequest{Index: index, Query: pql}); err != nil { + t.Fatal(err) + } else if columns := res.Results[0].(*pilosa.Row).Columns(); !reflect.DeepEqual(columns, colIDs) { + t.Fatalf("unexpected column ids: %+v", columns) + } + }) +} + +func TestAPI_ImportValue(t *testing.T) { + c := test.MustRunCluster(t, 2, + []server.CommandOption{ + server.OptCommandServerOptions( + pilosa.OptServerNodeID("node0"), + pilosa.OptServerClusterHasher(&offsetModHasher{}), + )}, + []server.CommandOption{ + server.OptCommandServerOptions( + pilosa.OptServerNodeID("node1"), + pilosa.OptServerClusterHasher(&offsetModHasher{}), + )}, + ) + defer c.Close() + + m0 := c[0] + m1 := c[1] + + t.Run("ValColumnKey", func(t *testing.T) { + ctx := context.Background() + index := "valck" + field := "f" + + _, err := m0.API.CreateIndex(ctx, index, pilosa.IndexOptions{Keys: true}) + if err != nil { + t.Fatalf("creating index: %v", err) + } + _, err = m0.API.CreateField(ctx, index, field, pilosa.OptFieldTypeInt(0, 100)) + if err != nil { + t.Fatalf("creating field: %v", err) + } + + // Generate some keyed records. + values := []int64{} + colKeys := []string{} + for i := 1; i <= 10; i++ { + values = append(values, int64(i)) + colKeys = append(colKeys, fmt.Sprintf("col%d", i)) + } + + // Import data with keys to the coordinator (node0) and verify that it gets + // translated and forwarded to the owner of shard 0 (node1; because of offsetModHasher) + req := &pilosa.ImportValueRequest{ + Index: index, + Field: field, + ColumnKeys: colKeys, + Values: values, + } + if err := m0.API.ImportValue(ctx, req); err != nil { + t.Fatal(err) + } + + pql := fmt.Sprintf("Range(%s>0)", field) + + // Query node0. + if res, err := m0.API.Query(ctx, &pilosa.QueryRequest{Index: index, Query: pql}); err != nil { + t.Fatal(err) + } else if keys := res.Results[0].(*pilosa.Row).Keys; !reflect.DeepEqual(keys, colKeys) { + t.Fatalf("unexpected column keys: %+v", keys) + } + + // Query node1. + if res, err := m1.API.Query(ctx, &pilosa.QueryRequest{Index: index, Query: pql}); err != nil { + t.Fatal(err) + } else if keys := res.Results[0].(*pilosa.Row).Keys; !reflect.DeepEqual(keys, colKeys) { + t.Fatalf("unexpected column keys: %+v", keys) + } + }) +} + +// offsetModHasher represents a simple, mod-based hashing offset by 1. +type offsetModHasher struct{} + +func (*offsetModHasher) Hash(key uint64, n int) int { + return int(key+1) % n +} diff --git a/http/client.go b/http/client.go index 06bb31479..75d3c75c7 100644 --- a/http/client.go +++ b/http/client.go @@ -437,6 +437,9 @@ func (c *InternalClient) importNode(ctx context.Context, node *pilosa.Node, inde if opts.Clear { vals.Set("clear", "true") } + if opts.IgnoreKeyCheck { + vals.Set("ignoreKeyCheck", "true") + } url := fmt.Sprintf("%s?%s", u.String(), vals.Encode()) req, err := http.NewRequest("POST", url, bytes.NewReader(buf)) diff --git a/http/handler.go b/http/handler.go index 1d5dee6f7..81e31a82b 100644 --- a/http/handler.go +++ b/http/handler.go @@ -181,7 +181,7 @@ func (h *Handler) populateValidators() { h.validators["DeleteIndex"] = queryValidationSpecRequired() h.validators["PostField"] = queryValidationSpecRequired() h.validators["DeleteField"] = queryValidationSpecRequired() - h.validators["PostImport"] = queryValidationSpecRequired().Optional("clear") + h.validators["PostImport"] = queryValidationSpecRequired().Optional("clear", "ignoreKeyCheck") h.validators["PostImportRoaring"] = queryValidationSpecRequired().Optional("remote", "clear") h.validators["PostQuery"] = queryValidationSpecRequired().Optional("shards", "columnAttrs", "excludeRowAttrs", "excludeColumns") h.validators["GetInfo"] = queryValidationSpecRequired() @@ -987,6 +987,12 @@ func (h *Handler) handlePostImport(w http.ResponseWriter, r *http.Request) { // If the clear flag is true, treat the import as clear bits. q := r.URL.Query() doClear := q.Get("clear") == "true" + doIgnoreKeyCheck := q.Get("ignoreKeyCheck") == "true" + + opts := []pilosa.ImportOption{ + pilosa.OptImportOptionsClear(doClear), + pilosa.OptImportOptionsIgnoreKeyCheck(doIgnoreKeyCheck), + } // Get index and field type to determine how to handle the // import data. @@ -1020,7 +1026,7 @@ func (h *Handler) handlePostImport(w http.ResponseWriter, r *http.Request) { return } - if err := h.api.ImportValue(r.Context(), req, pilosa.OptImportOptionsClear(doClear)); err != nil { + if err := h.api.ImportValue(r.Context(), req, opts...); err != nil { switch errors.Cause(err) { case pilosa.ErrClusterDoesNotOwnShard: http.Error(w, err.Error(), http.StatusPreconditionFailed) @@ -1038,7 +1044,7 @@ func (h *Handler) handlePostImport(w http.ResponseWriter, r *http.Request) { return } - if err := h.api.Import(r.Context(), req, pilosa.OptImportOptionsClear(doClear)); err != nil { + if err := h.api.Import(r.Context(), req, opts...); err != nil { switch errors.Cause(err) { case pilosa.ErrClusterDoesNotOwnShard: http.Error(w, err.Error(), http.StatusPreconditionFailed) From 2a8f2c2026946fcd1f7dbc2d36fbd830ba55929e Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Tue, 6 Nov 2018 14:09:32 +0300 Subject: [PATCH 09/18] minor grammar fix --- pql/parser_test.go | 4 +- pql/pql.peg | 4 +- pql/pql.peg.go | 626 ++++++++++++++++++++------------------------- 3 files changed, 284 insertions(+), 350 deletions(-) diff --git a/pql/parser_test.go b/pql/parser_test.go index 0d29eea4f..f63bc3763 100644 --- a/pql/parser_test.go +++ b/pql/parser_test.go @@ -75,7 +75,7 @@ func TestParser_Parse(t *testing.T) { // Parse with only arguments. t.Run("ArgumentsOnly", func(t *testing.T) { - q, err := pql.ParseString("MyCall( key= value, foo='bar', age = 12 , bool0=true, bool1=false, x=null, escape='\\escape\n' )") + q, err := pql.ParseString(`MyCall( key= value, foo='bar', age = 12 , bool0=true, bool1=false, x=null, escape="\" \\escape\n" )`) if err != nil { t.Fatal(err) } else if !reflect.DeepEqual(q.Calls[0], @@ -88,7 +88,7 @@ func TestParser_Parse(t *testing.T) { "bool0": true, "bool1": false, "x": nil, - "escape": "\\escape\n", + "escape": `\" \\escape\n`, }, }, ) { diff --git a/pql/pql.peg b/pql/pql.peg index 4db0b1c97..2a6620960 100644 --- a/pql/pql.peg +++ b/pql/pql.peg @@ -49,8 +49,8 @@ item <- ( 'null' &(comma / sp close) { p.addVal(nil) } / '\'' < singlequotedstring > '\'' { p.addVal(buffer[begin:end]) } ) -doublequotedstring <- ( [^"] / '\\n' / '\\\"' / '\\\'' / '\\\\' )* -singlequotedstring <- ( [^'] / '\\n' / '\\\"' / '\\\'' / '\\\\' )* +doublequotedstring <- ( '\\\"' / [^"] )* +singlequotedstring <- ( '\\\'' / [^'] )* fieldExpr <- [[A-Z]] ( [[A-Z]] / [0-9] / '_' / '-' )* field <- { p.addField(buffer[begin:end]) } diff --git a/pql/pql.peg.go b/pql/pql.peg.go index eb40c5a21..e98ed9ce9 100644 --- a/pql/pql.peg.go +++ b/pql/pql.peg.go @@ -2107,7 +2107,7 @@ func (p *PQL) Init() { position, tokenIndex = position140, tokenIndex140 return false }, - /* 14 doublequotedstring <- <((!'"' .) / ('\\' 'n') / ('\\' '"') / ('\\' '\'') / ('\\' '\\'))*> */ + /* 14 doublequotedstring <- <(('\\' '"') / (!'"' .))*> */ func() bool { { position199 := position @@ -2116,63 +2116,30 @@ func (p *PQL) Init() { position201, tokenIndex201 := position, tokenIndex { position202, tokenIndex202 := position, tokenIndex + if buffer[position] != rune('\\') { + goto l203 + } + position++ + if buffer[position] != rune('"') { + goto l203 + } + position++ + goto l202 + l203: + position, tokenIndex = position202, tokenIndex202 { position204, tokenIndex204 := position, tokenIndex if buffer[position] != rune('"') { goto l204 } position++ - goto l203 + goto l201 l204: position, tokenIndex = position204, tokenIndex204 } if !matchDot() { - goto l203 - } - goto l202 - l203: - position, tokenIndex = position202, tokenIndex202 - if buffer[position] != rune('\\') { - goto l205 - } - position++ - if buffer[position] != rune('n') { - goto l205 - } - position++ - goto l202 - l205: - position, tokenIndex = position202, tokenIndex202 - if buffer[position] != rune('\\') { - goto l206 - } - position++ - if buffer[position] != rune('"') { - goto l206 - } - position++ - goto l202 - l206: - position, tokenIndex = position202, tokenIndex202 - if buffer[position] != rune('\\') { - goto l207 - } - position++ - if buffer[position] != rune('\'') { - goto l207 - } - position++ - goto l202 - l207: - position, tokenIndex = position202, tokenIndex202 - if buffer[position] != rune('\\') { goto l201 } - position++ - if buffer[position] != rune('\\') { - goto l201 - } - position++ } l202: goto l200 @@ -2183,569 +2150,536 @@ func (p *PQL) Init() { } return true }, - /* 15 singlequotedstring <- <((!'\'' .) / ('\\' 'n') / ('\\' '"') / ('\\' '\'') / ('\\' '\\'))*> */ + /* 15 singlequotedstring <- <(('\\' '\'') / (!'\'' .))*> */ func() bool { { - position209 := position - l210: + position206 := position + l207: { - position211, tokenIndex211 := position, tokenIndex + position208, tokenIndex208 := position, tokenIndex { - position212, tokenIndex212 := position, tokenIndex - { - position214, tokenIndex214 := position, tokenIndex - if buffer[position] != rune('\'') { - goto l214 - } - position++ - goto l213 - l214: - position, tokenIndex = position214, tokenIndex214 - } - if !matchDot() { - goto l213 - } - goto l212 - l213: - position, tokenIndex = position212, tokenIndex212 + position209, tokenIndex209 := position, tokenIndex if buffer[position] != rune('\\') { - goto l215 - } - position++ - if buffer[position] != rune('n') { - goto l215 - } - position++ - goto l212 - l215: - position, tokenIndex = position212, tokenIndex212 - if buffer[position] != rune('\\') { - goto l216 - } - position++ - if buffer[position] != rune('"') { - goto l216 - } - position++ - goto l212 - l216: - position, tokenIndex = position212, tokenIndex212 - if buffer[position] != rune('\\') { - goto l217 + goto l210 } position++ if buffer[position] != rune('\'') { - goto l217 + goto l210 } position++ - goto l212 - l217: - position, tokenIndex = position212, tokenIndex212 - if buffer[position] != rune('\\') { - goto l211 + goto l209 + l210: + position, tokenIndex = position209, tokenIndex209 + { + position211, tokenIndex211 := position, tokenIndex + if buffer[position] != rune('\'') { + goto l211 + } + position++ + goto l208 + l211: + position, tokenIndex = position211, tokenIndex211 } - position++ - if buffer[position] != rune('\\') { - goto l211 + if !matchDot() { + goto l208 } - position++ } - l212: - goto l210 - l211: - position, tokenIndex = position211, tokenIndex211 + l209: + goto l207 + l208: + position, tokenIndex = position208, tokenIndex208 } - add(rulesinglequotedstring, position209) + add(rulesinglequotedstring, position206) } return true }, /* 16 fieldExpr <- <(([a-z] / [A-Z]) ([a-z] / [A-Z] / [0-9] / '_' / '-')*)> */ func() bool { - position218, tokenIndex218 := position, tokenIndex + position212, tokenIndex212 := position, tokenIndex { - position219 := position + position213 := position { - position220, tokenIndex220 := position, tokenIndex + position214, tokenIndex214 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l221 + goto l215 } position++ - goto l220 - l221: - position, tokenIndex = position220, tokenIndex220 + goto l214 + l215: + position, tokenIndex = position214, tokenIndex214 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l218 + goto l212 } position++ } - l220: - l222: + l214: + l216: { - position223, tokenIndex223 := position, tokenIndex + position217, tokenIndex217 := position, tokenIndex { - position224, tokenIndex224 := position, tokenIndex + position218, tokenIndex218 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l225 + goto l219 } position++ - goto l224 - l225: - position, tokenIndex = position224, tokenIndex224 + goto l218 + l219: + position, tokenIndex = position218, tokenIndex218 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l226 + goto l220 } position++ - goto l224 - l226: - position, tokenIndex = position224, tokenIndex224 + goto l218 + l220: + position, tokenIndex = position218, tokenIndex218 if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l227 + goto l221 } position++ - goto l224 - l227: - position, tokenIndex = position224, tokenIndex224 + goto l218 + l221: + position, tokenIndex = position218, tokenIndex218 if buffer[position] != rune('_') { - goto l228 + goto l222 } position++ - goto l224 - l228: - position, tokenIndex = position224, tokenIndex224 + goto l218 + l222: + position, tokenIndex = position218, tokenIndex218 if buffer[position] != rune('-') { - goto l223 + goto l217 } position++ } - l224: - goto l222 - l223: - position, tokenIndex = position223, tokenIndex223 + l218: + goto l216 + l217: + position, tokenIndex = position217, tokenIndex217 } - add(rulefieldExpr, position219) + add(rulefieldExpr, position213) } return true - l218: - position, tokenIndex = position218, tokenIndex218 + l212: + position, tokenIndex = position212, tokenIndex212 return false }, /* 17 field <- <(<(fieldExpr / reserved)> Action42)> */ func() bool { - position229, tokenIndex229 := position, tokenIndex + position223, tokenIndex223 := position, tokenIndex { - position230 := position + position224 := position { - position231 := position + position225 := position { - position232, tokenIndex232 := position, tokenIndex + position226, tokenIndex226 := position, tokenIndex if !_rules[rulefieldExpr]() { - goto l233 + goto l227 } - goto l232 - l233: - position, tokenIndex = position232, tokenIndex232 + goto l226 + l227: + position, tokenIndex = position226, tokenIndex226 { - position234 := position + position228 := position { - position235, tokenIndex235 := position, tokenIndex + position229, tokenIndex229 := position, tokenIndex if buffer[position] != rune('_') { - goto l236 + goto l230 } position++ if buffer[position] != rune('r') { - goto l236 + goto l230 } position++ if buffer[position] != rune('o') { - goto l236 + goto l230 } position++ if buffer[position] != rune('w') { - goto l236 + goto l230 } position++ - goto l235 - l236: - position, tokenIndex = position235, tokenIndex235 + goto l229 + l230: + position, tokenIndex = position229, tokenIndex229 if buffer[position] != rune('_') { - goto l237 + goto l231 } position++ if buffer[position] != rune('c') { - goto l237 + goto l231 } position++ if buffer[position] != rune('o') { - goto l237 + goto l231 } position++ if buffer[position] != rune('l') { - goto l237 + goto l231 } position++ - goto l235 - l237: - position, tokenIndex = position235, tokenIndex235 + goto l229 + l231: + position, tokenIndex = position229, tokenIndex229 if buffer[position] != rune('_') { - goto l238 + goto l232 } position++ if buffer[position] != rune('s') { - goto l238 + goto l232 } position++ if buffer[position] != rune('t') { - goto l238 + goto l232 } position++ if buffer[position] != rune('a') { - goto l238 + goto l232 } position++ if buffer[position] != rune('r') { - goto l238 + goto l232 } position++ if buffer[position] != rune('t') { - goto l238 + goto l232 } position++ - goto l235 - l238: - position, tokenIndex = position235, tokenIndex235 + goto l229 + l232: + position, tokenIndex = position229, tokenIndex229 if buffer[position] != rune('_') { - goto l239 + goto l233 } position++ if buffer[position] != rune('e') { - goto l239 + goto l233 } position++ if buffer[position] != rune('n') { - goto l239 + goto l233 } position++ if buffer[position] != rune('d') { - goto l239 + goto l233 } position++ - goto l235 - l239: - position, tokenIndex = position235, tokenIndex235 + goto l229 + l233: + position, tokenIndex = position229, tokenIndex229 if buffer[position] != rune('_') { - goto l240 + goto l234 } position++ if buffer[position] != rune('t') { - goto l240 + goto l234 } position++ if buffer[position] != rune('i') { - goto l240 + goto l234 } position++ if buffer[position] != rune('m') { - goto l240 + goto l234 } position++ if buffer[position] != rune('e') { - goto l240 + goto l234 } position++ if buffer[position] != rune('s') { - goto l240 + goto l234 } position++ if buffer[position] != rune('t') { - goto l240 + goto l234 } position++ if buffer[position] != rune('a') { - goto l240 + goto l234 } position++ if buffer[position] != rune('m') { - goto l240 + goto l234 } position++ if buffer[position] != rune('p') { - goto l240 + goto l234 } position++ - goto l235 - l240: - position, tokenIndex = position235, tokenIndex235 + goto l229 + l234: + position, tokenIndex = position229, tokenIndex229 if buffer[position] != rune('_') { - goto l229 + goto l223 } position++ if buffer[position] != rune('f') { - goto l229 + goto l223 } position++ if buffer[position] != rune('i') { - goto l229 + goto l223 } position++ if buffer[position] != rune('e') { - goto l229 + goto l223 } position++ if buffer[position] != rune('l') { - goto l229 + goto l223 } position++ if buffer[position] != rune('d') { - goto l229 + goto l223 } position++ } - l235: - add(rulereserved, position234) + l229: + add(rulereserved, position228) } } - l232: - add(rulePegText, position231) + l226: + add(rulePegText, position225) } { add(ruleAction42, position) } - add(rulefield, position230) + add(rulefield, position224) } return true - l229: - position, tokenIndex = position229, tokenIndex229 + l223: + position, tokenIndex = position223, tokenIndex223 return false }, /* 18 reserved <- <(('_' 'r' 'o' 'w') / ('_' 'c' 'o' 'l') / ('_' 's' 't' 'a' 'r' 't') / ('_' 'e' 'n' 'd') / ('_' 't' 'i' 'm' 'e' 's' 't' 'a' 'm' 'p') / ('_' 'f' 'i' 'e' 'l' 'd'))> */ nil, /* 19 posfield <- <( Action43)> */ func() bool { - position243, tokenIndex243 := position, tokenIndex + position237, tokenIndex237 := position, tokenIndex { - position244 := position + position238 := position { - position245 := position + position239 := position if !_rules[rulefieldExpr]() { - goto l243 + goto l237 } - add(rulePegText, position245) + add(rulePegText, position239) } { add(ruleAction43, position) } - add(ruleposfield, position244) + add(ruleposfield, position238) } return true - l243: - position, tokenIndex = position243, tokenIndex243 + l237: + position, tokenIndex = position237, tokenIndex237 return false }, /* 20 uint <- <(([1-9] [0-9]*) / '0')> */ func() bool { - position247, tokenIndex247 := position, tokenIndex + position241, tokenIndex241 := position, tokenIndex { - position248 := position + position242 := position { - position249, tokenIndex249 := position, tokenIndex + position243, tokenIndex243 := position, tokenIndex if c := buffer[position]; c < rune('1') || c > rune('9') { - goto l250 + goto l244 } position++ - l251: + l245: { - position252, tokenIndex252 := position, tokenIndex + position246, tokenIndex246 := position, tokenIndex if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l252 + goto l246 } position++ - goto l251 - l252: - position, tokenIndex = position252, tokenIndex252 + goto l245 + l246: + position, tokenIndex = position246, tokenIndex246 } - goto l249 - l250: - position, tokenIndex = position249, tokenIndex249 + goto l243 + l244: + position, tokenIndex = position243, tokenIndex243 if buffer[position] != rune('0') { - goto l247 + goto l241 } position++ } - l249: - add(ruleuint, position248) + l243: + add(ruleuint, position242) } return true - l247: - position, tokenIndex = position247, tokenIndex247 + l241: + position, tokenIndex = position241, tokenIndex241 return false }, /* 21 uintrow <- <( Action44)> */ nil, /* 22 col <- <(( Action45) / ('\'' '\'' Action46) / ('"' '"' Action47))> */ func() bool { - position254, tokenIndex254 := position, tokenIndex + position248, tokenIndex248 := position, tokenIndex { - position255 := position + position249 := position { - position256, tokenIndex256 := position, tokenIndex + position250, tokenIndex250 := position, tokenIndex { - position258 := position + position252 := position if !_rules[ruleuint]() { - goto l257 + goto l251 } - add(rulePegText, position258) + add(rulePegText, position252) } { add(ruleAction45, position) } - goto l256 - l257: - position, tokenIndex = position256, tokenIndex256 + goto l250 + l251: + position, tokenIndex = position250, tokenIndex250 if buffer[position] != rune('\'') { - goto l260 + goto l254 } position++ { - position261 := position + position255 := position if !_rules[rulesinglequotedstring]() { - goto l260 + goto l254 } - add(rulePegText, position261) + add(rulePegText, position255) } if buffer[position] != rune('\'') { - goto l260 + goto l254 } position++ { add(ruleAction46, position) } - goto l256 - l260: - position, tokenIndex = position256, tokenIndex256 + goto l250 + l254: + position, tokenIndex = position250, tokenIndex250 if buffer[position] != rune('"') { - goto l254 + goto l248 } position++ { - position263 := position + position257 := position if !_rules[ruledoublequotedstring]() { - goto l254 + goto l248 } - add(rulePegText, position263) + add(rulePegText, position257) } if buffer[position] != rune('"') { - goto l254 + goto l248 } position++ { add(ruleAction47, position) } } - l256: - add(rulecol, position255) + l250: + add(rulecol, position249) } return true - l254: - position, tokenIndex = position254, tokenIndex254 + l248: + position, tokenIndex = position248, tokenIndex248 return false }, /* 23 row <- <(( Action48) / ('\'' '\'' Action49) / ('"' '"' Action50))> */ nil, /* 24 open <- <('(' sp)> */ func() bool { - position266, tokenIndex266 := position, tokenIndex + position260, tokenIndex260 := position, tokenIndex { - position267 := position + position261 := position if buffer[position] != rune('(') { - goto l266 + goto l260 } position++ if !_rules[rulesp]() { - goto l266 + goto l260 } - add(ruleopen, position267) + add(ruleopen, position261) } return true - l266: - position, tokenIndex = position266, tokenIndex266 + l260: + position, tokenIndex = position260, tokenIndex260 return false }, /* 25 close <- <(')' sp)> */ func() bool { - position268, tokenIndex268 := position, tokenIndex + position262, tokenIndex262 := position, tokenIndex { - position269 := position + position263 := position if buffer[position] != rune(')') { - goto l268 + goto l262 } position++ if !_rules[rulesp]() { - goto l268 + goto l262 } - add(ruleclose, position269) + add(ruleclose, position263) } return true - l268: - position, tokenIndex = position268, tokenIndex268 + l262: + position, tokenIndex = position262, tokenIndex262 return false }, /* 26 sp <- <(' ' / '\t' / '\n')*> */ func() bool { { - position271 := position - l272: + position265 := position + l266: { - position273, tokenIndex273 := position, tokenIndex + position267, tokenIndex267 := position, tokenIndex { - position274, tokenIndex274 := position, tokenIndex + position268, tokenIndex268 := position, tokenIndex if buffer[position] != rune(' ') { - goto l275 + goto l269 } position++ - goto l274 - l275: - position, tokenIndex = position274, tokenIndex274 + goto l268 + l269: + position, tokenIndex = position268, tokenIndex268 if buffer[position] != rune('\t') { - goto l276 + goto l270 } position++ - goto l274 - l276: - position, tokenIndex = position274, tokenIndex274 + goto l268 + l270: + position, tokenIndex = position268, tokenIndex268 if buffer[position] != rune('\n') { - goto l273 + goto l267 } position++ } - l274: - goto l272 - l273: - position, tokenIndex = position273, tokenIndex273 + l268: + goto l266 + l267: + position, tokenIndex = position267, tokenIndex267 } - add(rulesp, position271) + add(rulesp, position265) } return true }, /* 27 comma <- <(sp ',' sp)> */ func() bool { - position277, tokenIndex277 := position, tokenIndex + position271, tokenIndex271 := position, tokenIndex { - position278 := position + position272 := position if !_rules[rulesp]() { - goto l277 + goto l271 } if buffer[position] != rune(',') { - goto l277 + goto l271 } position++ if !_rules[rulesp]() { - goto l277 + goto l271 } - add(rulecomma, position278) + add(rulecomma, position272) } return true - l277: - position, tokenIndex = position277, tokenIndex277 + l271: + position, tokenIndex = position271, tokenIndex271 return false }, /* 28 lbrack <- <('[' sp)> */ @@ -2756,136 +2690,136 @@ func (p *PQL) Init() { nil, /* 31 timestampbasicfmt <- <([0-9] [0-9] [0-9] [0-9] '-' ('0' / '1') [0-9] '-' [0-3] [0-9] 'T' [0-9] [0-9] ':' [0-9] [0-9])> */ func() bool { - position282, tokenIndex282 := position, tokenIndex + position276, tokenIndex276 := position, tokenIndex { - position283 := position + position277 := position if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l282 + goto l276 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l282 + goto l276 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l282 + goto l276 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l282 + goto l276 } position++ if buffer[position] != rune('-') { - goto l282 + goto l276 } position++ { - position284, tokenIndex284 := position, tokenIndex + position278, tokenIndex278 := position, tokenIndex if buffer[position] != rune('0') { - goto l285 + goto l279 } position++ - goto l284 - l285: - position, tokenIndex = position284, tokenIndex284 + goto l278 + l279: + position, tokenIndex = position278, tokenIndex278 if buffer[position] != rune('1') { - goto l282 + goto l276 } position++ } - l284: + l278: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l282 + goto l276 } position++ if buffer[position] != rune('-') { - goto l282 + goto l276 } position++ if c := buffer[position]; c < rune('0') || c > rune('3') { - goto l282 + goto l276 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l282 + goto l276 } position++ if buffer[position] != rune('T') { - goto l282 + goto l276 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l282 + goto l276 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l282 + goto l276 } position++ if buffer[position] != rune(':') { - goto l282 + goto l276 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l282 + goto l276 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l282 + goto l276 } position++ - add(ruletimestampbasicfmt, position283) + add(ruletimestampbasicfmt, position277) } return true - l282: - position, tokenIndex = position282, tokenIndex282 + l276: + position, tokenIndex = position276, tokenIndex276 return false }, /* 32 timestampfmt <- <(('"' timestampbasicfmt '"') / ('\'' timestampbasicfmt '\'') / timestampbasicfmt)> */ func() bool { - position286, tokenIndex286 := position, tokenIndex + position280, tokenIndex280 := position, tokenIndex { - position287 := position + position281 := position { - position288, tokenIndex288 := position, tokenIndex + position282, tokenIndex282 := position, tokenIndex if buffer[position] != rune('"') { - goto l289 + goto l283 } position++ if !_rules[ruletimestampbasicfmt]() { - goto l289 + goto l283 } if buffer[position] != rune('"') { - goto l289 + goto l283 } position++ - goto l288 - l289: - position, tokenIndex = position288, tokenIndex288 + goto l282 + l283: + position, tokenIndex = position282, tokenIndex282 if buffer[position] != rune('\'') { - goto l290 + goto l284 } position++ if !_rules[ruletimestampbasicfmt]() { - goto l290 + goto l284 } if buffer[position] != rune('\'') { - goto l290 + goto l284 } position++ - goto l288 - l290: - position, tokenIndex = position288, tokenIndex288 + goto l282 + l284: + position, tokenIndex = position282, tokenIndex282 if !_rules[ruletimestampbasicfmt]() { - goto l286 + goto l280 } } - l288: - add(ruletimestampfmt, position287) + l282: + add(ruletimestampfmt, position281) } return true - l286: - position, tokenIndex = position286, tokenIndex286 + l280: + position, tokenIndex = position280, tokenIndex280 return false }, /* 33 timestamp <- <( Action51)> */ From b158f1c378e20d8fad68b7dcb7731b9023c49931 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Tue, 6 Nov 2018 22:47:09 +0300 Subject: [PATCH 10/18] unquote attribute values --- pql/pql.peg | 4 ++-- pql/pql.peg.go | 44 +++++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/pql/pql.peg b/pql/pql.peg index 2a6620960..1d07798a2 100644 --- a/pql/pql.peg +++ b/pql/pql.peg @@ -45,8 +45,8 @@ item <- ( 'null' &(comma / sp close) { p.addVal(nil) } / < '-'? [0-9]+ ('.'[0-9]*)? > { p.addNumVal(buffer[begin:end]) } / < '-'? '.'[0-9]+ > { p.addNumVal(buffer[begin:end]) } / < ([[A-Z]] / [0-9] / '-' / '_' / ':')+ > { p.addVal(buffer[begin:end]) } - / '"' < doublequotedstring > '"' { p.addVal(buffer[begin:end]) } - / '\'' < singlequotedstring > '\'' { p.addVal(buffer[begin:end]) } + / < '"' doublequotedstring '"' > { s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) } + / < '\'' singlequotedstring '\'' > { s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) } ) doublequotedstring <- ( '\\\"' / [^"] )* diff --git a/pql/pql.peg.go b/pql/pql.peg.go index e98ed9ce9..a108bc985 100644 --- a/pql/pql.peg.go +++ b/pql/pql.peg.go @@ -483,9 +483,11 @@ func (p *PQL) Execute() { case ruleAction39: p.addVal(buffer[begin:end]) case ruleAction40: - p.addVal(buffer[begin:end]) + s, _ := strconv.Unquote(buffer[begin:end]) + p.addVal(s) case ruleAction41: - p.addVal(buffer[begin:end]) + s, _ := strconv.Unquote(buffer[begin:end]) + p.addVal(s) case ruleAction42: p.addField(buffer[begin:end]) case ruleAction43: @@ -1721,7 +1723,7 @@ func (p *PQL) Init() { position, tokenIndex = position136, tokenIndex136 return false }, - /* 13 item <- <(('n' 'u' 'l' 'l' &(comma / (sp close)) Action34) / ('t' 'r' 'u' 'e' &(comma / (sp close)) Action35) / ('f' 'a' 'l' 's' 'e' &(comma / (sp close)) Action36) / (<('-'? [0-9]+ ('.' [0-9]*)?)> Action37) / (<('-'? '.' [0-9]+)> Action38) / (<([a-z] / [A-Z] / [0-9] / '-' / '_' / ':')+> Action39) / ('"' '"' Action40) / ('\'' '\'' Action41))> */ + /* 13 item <- <(('n' 'u' 'l' 'l' &(comma / (sp close)) Action34) / ('t' 'r' 'u' 'e' &(comma / (sp close)) Action35) / ('f' 'a' 'l' 's' 'e' &(comma / (sp close)) Action36) / (<('-'? [0-9]+ ('.' [0-9]*)?)> Action37) / (<('-'? '.' [0-9]+)> Action38) / (<([a-z] / [A-Z] / [0-9] / '-' / '_' / ':')+> Action39) / (<('"' doublequotedstring '"')> Action40) / (<('\'' singlequotedstring '\'')> Action41))> */ func() bool { position140, tokenIndex140 := position, tokenIndex { @@ -2059,42 +2061,42 @@ func (p *PQL) Init() { goto l142 l176: position, tokenIndex = position142, tokenIndex142 - if buffer[position] != rune('"') { - goto l193 - } - position++ { position194 := position + if buffer[position] != rune('"') { + goto l193 + } + position++ if !_rules[ruledoublequotedstring]() { goto l193 } + if buffer[position] != rune('"') { + goto l193 + } + position++ add(rulePegText, position194) } - if buffer[position] != rune('"') { - goto l193 - } - position++ { add(ruleAction40, position) } goto l142 l193: position, tokenIndex = position142, tokenIndex142 - if buffer[position] != rune('\'') { - goto l140 - } - position++ { position196 := position + if buffer[position] != rune('\'') { + goto l140 + } + position++ if !_rules[rulesinglequotedstring]() { goto l140 } + if buffer[position] != rune('\'') { + goto l140 + } + position++ add(rulePegText, position196) } - if buffer[position] != rune('\'') { - goto l140 - } - position++ { add(ruleAction41, position) } @@ -2905,9 +2907,9 @@ func (p *PQL) Init() { nil, /* 75 Action39 <- <{ p.addVal(buffer[begin:end]) }> */ nil, - /* 76 Action40 <- <{ p.addVal(buffer[begin:end]) }> */ + /* 76 Action40 <- <{ s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) }> */ nil, - /* 77 Action41 <- <{ p.addVal(buffer[begin:end]) }> */ + /* 77 Action41 <- <{ s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) }> */ nil, /* 78 Action42 <- <{ p.addField(buffer[begin:end]) }> */ nil, From 1e30a9372deefd4c23f132c53331c9ff126ba194 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Tue, 6 Nov 2018 22:58:37 +0300 Subject: [PATCH 11/18] Disabled unquoting for single quoted attribute values; updated test --- pql/parser_test.go | 2 +- pql/pql.peg | 2 +- pql/pql.peg.go | 23 +++++++++++------------ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/pql/parser_test.go b/pql/parser_test.go index f63bc3763..e88244f70 100644 --- a/pql/parser_test.go +++ b/pql/parser_test.go @@ -88,7 +88,7 @@ func TestParser_Parse(t *testing.T) { "bool0": true, "bool1": false, "x": nil, - "escape": `\" \\escape\n`, + "escape": "\" \\escape\n", }, }, ) { diff --git a/pql/pql.peg b/pql/pql.peg index 1d07798a2..3f151c334 100644 --- a/pql/pql.peg +++ b/pql/pql.peg @@ -46,7 +46,7 @@ item <- ( 'null' &(comma / sp close) { p.addVal(nil) } / < '-'? '.'[0-9]+ > { p.addNumVal(buffer[begin:end]) } / < ([[A-Z]] / [0-9] / '-' / '_' / ':')+ > { p.addVal(buffer[begin:end]) } / < '"' doublequotedstring '"' > { s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) } - / < '\'' singlequotedstring '\'' > { s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) } + / '\'' < singlequotedstring > '\'' { p.addVal(buffer[begin:end]) } ) doublequotedstring <- ( '\\\"' / [^"] )* diff --git a/pql/pql.peg.go b/pql/pql.peg.go index a108bc985..7bc7de6fc 100644 --- a/pql/pql.peg.go +++ b/pql/pql.peg.go @@ -486,8 +486,7 @@ func (p *PQL) Execute() { s, _ := strconv.Unquote(buffer[begin:end]) p.addVal(s) case ruleAction41: - s, _ := strconv.Unquote(buffer[begin:end]) - p.addVal(s) + p.addVal(buffer[begin:end]) case ruleAction42: p.addField(buffer[begin:end]) case ruleAction43: @@ -1723,7 +1722,7 @@ func (p *PQL) Init() { position, tokenIndex = position136, tokenIndex136 return false }, - /* 13 item <- <(('n' 'u' 'l' 'l' &(comma / (sp close)) Action34) / ('t' 'r' 'u' 'e' &(comma / (sp close)) Action35) / ('f' 'a' 'l' 's' 'e' &(comma / (sp close)) Action36) / (<('-'? [0-9]+ ('.' [0-9]*)?)> Action37) / (<('-'? '.' [0-9]+)> Action38) / (<([a-z] / [A-Z] / [0-9] / '-' / '_' / ':')+> Action39) / (<('"' doublequotedstring '"')> Action40) / (<('\'' singlequotedstring '\'')> Action41))> */ + /* 13 item <- <(('n' 'u' 'l' 'l' &(comma / (sp close)) Action34) / ('t' 'r' 'u' 'e' &(comma / (sp close)) Action35) / ('f' 'a' 'l' 's' 'e' &(comma / (sp close)) Action36) / (<('-'? [0-9]+ ('.' [0-9]*)?)> Action37) / (<('-'? '.' [0-9]+)> Action38) / (<([a-z] / [A-Z] / [0-9] / '-' / '_' / ':')+> Action39) / (<('"' doublequotedstring '"')> Action40) / ('\'' '\'' Action41))> */ func() bool { position140, tokenIndex140 := position, tokenIndex { @@ -2082,21 +2081,21 @@ func (p *PQL) Init() { goto l142 l193: position, tokenIndex = position142, tokenIndex142 + if buffer[position] != rune('\'') { + goto l140 + } + position++ { position196 := position - if buffer[position] != rune('\'') { - goto l140 - } - position++ if !_rules[rulesinglequotedstring]() { goto l140 } - if buffer[position] != rune('\'') { - goto l140 - } - position++ add(rulePegText, position196) } + if buffer[position] != rune('\'') { + goto l140 + } + position++ { add(ruleAction41, position) } @@ -2909,7 +2908,7 @@ func (p *PQL) Init() { nil, /* 76 Action40 <- <{ s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) }> */ nil, - /* 77 Action41 <- <{ s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) }> */ + /* 77 Action41 <- <{ p.addVal(buffer[begin:end]) }> */ nil, /* 78 Action42 <- <{ p.addField(buffer[begin:end]) }> */ nil, From be202a61a79012a8df6f07420dfb9ab2f2f440ba Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Tue, 6 Nov 2018 14:01:09 -0600 Subject: [PATCH 12/18] upgrade to protoc 3.6.1. (also updated protoc-gen-gofast). --- internal/private.pb.go | 1915 ++++++++++++++++++++++++++++++++++------ internal/public.pb.go | 985 ++++++++++++++++++--- 2 files changed, 2492 insertions(+), 408 deletions(-) diff --git a/internal/private.pb.go b/internal/private.pb.go index be4719e2f..3d5762de1 100644 --- a/internal/private.pb.go +++ b/internal/private.pb.go @@ -1,48 +1,6 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: private.proto -/* - Package internal is a generated protocol buffer package. - - It is generated from these files: - private.proto - - It has these top-level messages: - IndexMeta - FieldOptions - ImportResponse - BlockDataRequest - BlockDataResponse - Cache - MaxShards - CreateShardMessage - DeleteIndexMessage - CreateIndexMessage - CreateFieldMessage - DeleteFieldMessage - DeleteAvailableShardMessage - Field - Schema - Index - URI - Node - NodeStateMessage - NodeEventMessage - NodeStatus - IndexStatus - FieldStatus - ClusterStatus - BSIGroup - CreateViewMessage - DeleteViewMessage - ResizeInstruction - ResizeSource - ResizeInstructionComplete - SetCoordinatorMessage - UpdateCoordinatorMessage - Topology - RecalculateCaches -*/ package internal import proto "github.com/golang/protobuf/proto" @@ -63,14 +21,45 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type IndexMeta struct { - Keys bool `protobuf:"varint,3,opt,name=Keys,proto3" json:"Keys,omitempty"` - TrackExistence bool `protobuf:"varint,4,opt,name=TrackExistence,proto3" json:"TrackExistence,omitempty"` + Keys bool `protobuf:"varint,3,opt,name=Keys,proto3" json:"Keys,omitempty"` + TrackExistence bool `protobuf:"varint,4,opt,name=TrackExistence,proto3" json:"TrackExistence,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *IndexMeta) Reset() { *m = IndexMeta{} } -func (m *IndexMeta) String() string { return proto.CompactTextString(m) } -func (*IndexMeta) ProtoMessage() {} -func (*IndexMeta) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{0} } +func (m *IndexMeta) Reset() { *m = IndexMeta{} } +func (m *IndexMeta) String() string { return proto.CompactTextString(m) } +func (*IndexMeta) ProtoMessage() {} +func (*IndexMeta) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{0} +} +func (m *IndexMeta) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IndexMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IndexMeta.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *IndexMeta) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexMeta.Merge(dst, src) +} +func (m *IndexMeta) XXX_Size() int { + return m.Size() +} +func (m *IndexMeta) XXX_DiscardUnknown() { + xxx_messageInfo_IndexMeta.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexMeta proto.InternalMessageInfo func (m *IndexMeta) GetKeys() bool { if m != nil { @@ -87,19 +76,50 @@ func (m *IndexMeta) GetTrackExistence() bool { } type FieldOptions struct { - Type string `protobuf:"bytes,8,opt,name=Type,proto3" json:"Type,omitempty"` - CacheType string `protobuf:"bytes,3,opt,name=CacheType,proto3" json:"CacheType,omitempty"` - CacheSize uint32 `protobuf:"varint,4,opt,name=CacheSize,proto3" json:"CacheSize,omitempty"` - Min int64 `protobuf:"varint,9,opt,name=Min,proto3" json:"Min,omitempty"` - Max int64 `protobuf:"varint,10,opt,name=Max,proto3" json:"Max,omitempty"` - TimeQuantum string `protobuf:"bytes,5,opt,name=TimeQuantum,proto3" json:"TimeQuantum,omitempty"` - Keys bool `protobuf:"varint,11,opt,name=Keys,proto3" json:"Keys,omitempty"` + Type string `protobuf:"bytes,8,opt,name=Type,proto3" json:"Type,omitempty"` + CacheType string `protobuf:"bytes,3,opt,name=CacheType,proto3" json:"CacheType,omitempty"` + CacheSize uint32 `protobuf:"varint,4,opt,name=CacheSize,proto3" json:"CacheSize,omitempty"` + Min int64 `protobuf:"varint,9,opt,name=Min,proto3" json:"Min,omitempty"` + Max int64 `protobuf:"varint,10,opt,name=Max,proto3" json:"Max,omitempty"` + TimeQuantum string `protobuf:"bytes,5,opt,name=TimeQuantum,proto3" json:"TimeQuantum,omitempty"` + Keys bool `protobuf:"varint,11,opt,name=Keys,proto3" json:"Keys,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *FieldOptions) Reset() { *m = FieldOptions{} } -func (m *FieldOptions) String() string { return proto.CompactTextString(m) } -func (*FieldOptions) ProtoMessage() {} -func (*FieldOptions) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{1} } +func (m *FieldOptions) Reset() { *m = FieldOptions{} } +func (m *FieldOptions) String() string { return proto.CompactTextString(m) } +func (*FieldOptions) ProtoMessage() {} +func (*FieldOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{1} +} +func (m *FieldOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FieldOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FieldOptions.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *FieldOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_FieldOptions.Merge(dst, src) +} +func (m *FieldOptions) XXX_Size() int { + return m.Size() +} +func (m *FieldOptions) XXX_DiscardUnknown() { + xxx_messageInfo_FieldOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_FieldOptions proto.InternalMessageInfo func (m *FieldOptions) GetType() string { if m != nil { @@ -151,13 +171,44 @@ func (m *FieldOptions) GetKeys() bool { } type ImportResponse struct { - Err string `protobuf:"bytes,1,opt,name=Err,proto3" json:"Err,omitempty"` + Err string `protobuf:"bytes,1,opt,name=Err,proto3" json:"Err,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ImportResponse) Reset() { *m = ImportResponse{} } -func (m *ImportResponse) String() string { return proto.CompactTextString(m) } -func (*ImportResponse) ProtoMessage() {} -func (*ImportResponse) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{2} } +func (m *ImportResponse) Reset() { *m = ImportResponse{} } +func (m *ImportResponse) String() string { return proto.CompactTextString(m) } +func (*ImportResponse) ProtoMessage() {} +func (*ImportResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{2} +} +func (m *ImportResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ImportResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ImportResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ImportResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImportResponse.Merge(dst, src) +} +func (m *ImportResponse) XXX_Size() int { + return m.Size() +} +func (m *ImportResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ImportResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ImportResponse proto.InternalMessageInfo func (m *ImportResponse) GetErr() string { if m != nil { @@ -167,17 +218,48 @@ func (m *ImportResponse) GetErr() string { } type BlockDataRequest struct { - Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` - Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` - View string `protobuf:"bytes,5,opt,name=View,proto3" json:"View,omitempty"` - Shard uint64 `protobuf:"varint,4,opt,name=Shard,proto3" json:"Shard,omitempty"` - Block uint64 `protobuf:"varint,3,opt,name=Block,proto3" json:"Block,omitempty"` + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + View string `protobuf:"bytes,5,opt,name=View,proto3" json:"View,omitempty"` + Shard uint64 `protobuf:"varint,4,opt,name=Shard,proto3" json:"Shard,omitempty"` + Block uint64 `protobuf:"varint,3,opt,name=Block,proto3" json:"Block,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *BlockDataRequest) Reset() { *m = BlockDataRequest{} } -func (m *BlockDataRequest) String() string { return proto.CompactTextString(m) } -func (*BlockDataRequest) ProtoMessage() {} -func (*BlockDataRequest) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{3} } +func (m *BlockDataRequest) Reset() { *m = BlockDataRequest{} } +func (m *BlockDataRequest) String() string { return proto.CompactTextString(m) } +func (*BlockDataRequest) ProtoMessage() {} +func (*BlockDataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{3} +} +func (m *BlockDataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockDataRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *BlockDataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockDataRequest.Merge(dst, src) +} +func (m *BlockDataRequest) XXX_Size() int { + return m.Size() +} +func (m *BlockDataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BlockDataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockDataRequest proto.InternalMessageInfo func (m *BlockDataRequest) GetIndex() string { if m != nil { @@ -215,14 +297,45 @@ func (m *BlockDataRequest) GetBlock() uint64 { } type BlockDataResponse struct { - RowIDs []uint64 `protobuf:"varint,1,rep,packed,name=RowIDs" json:"RowIDs,omitempty"` - ColumnIDs []uint64 `protobuf:"varint,2,rep,packed,name=ColumnIDs" json:"ColumnIDs,omitempty"` + RowIDs []uint64 `protobuf:"varint,1,rep,packed,name=RowIDs" json:"RowIDs,omitempty"` + ColumnIDs []uint64 `protobuf:"varint,2,rep,packed,name=ColumnIDs" json:"ColumnIDs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *BlockDataResponse) Reset() { *m = BlockDataResponse{} } -func (m *BlockDataResponse) String() string { return proto.CompactTextString(m) } -func (*BlockDataResponse) ProtoMessage() {} -func (*BlockDataResponse) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{4} } +func (m *BlockDataResponse) Reset() { *m = BlockDataResponse{} } +func (m *BlockDataResponse) String() string { return proto.CompactTextString(m) } +func (*BlockDataResponse) ProtoMessage() {} +func (*BlockDataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{4} +} +func (m *BlockDataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockDataResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *BlockDataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockDataResponse.Merge(dst, src) +} +func (m *BlockDataResponse) XXX_Size() int { + return m.Size() +} +func (m *BlockDataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_BlockDataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockDataResponse proto.InternalMessageInfo func (m *BlockDataResponse) GetRowIDs() []uint64 { if m != nil { @@ -239,13 +352,44 @@ func (m *BlockDataResponse) GetColumnIDs() []uint64 { } type Cache struct { - IDs []uint64 `protobuf:"varint,1,rep,packed,name=IDs" json:"IDs,omitempty"` + IDs []uint64 `protobuf:"varint,1,rep,packed,name=IDs" json:"IDs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Cache) Reset() { *m = Cache{} } -func (m *Cache) String() string { return proto.CompactTextString(m) } -func (*Cache) ProtoMessage() {} -func (*Cache) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{5} } +func (m *Cache) Reset() { *m = Cache{} } +func (m *Cache) String() string { return proto.CompactTextString(m) } +func (*Cache) ProtoMessage() {} +func (*Cache) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{5} +} +func (m *Cache) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Cache) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Cache.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Cache) XXX_Merge(src proto.Message) { + xxx_messageInfo_Cache.Merge(dst, src) +} +func (m *Cache) XXX_Size() int { + return m.Size() +} +func (m *Cache) XXX_DiscardUnknown() { + xxx_messageInfo_Cache.DiscardUnknown(m) +} + +var xxx_messageInfo_Cache proto.InternalMessageInfo func (m *Cache) GetIDs() []uint64 { if m != nil { @@ -255,13 +399,44 @@ func (m *Cache) GetIDs() []uint64 { } type MaxShards struct { - Standard map[string]uint64 `protobuf:"bytes,1,rep,name=Standard" json:"Standard,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Standard map[string]uint64 `protobuf:"bytes,1,rep,name=Standard" json:"Standard,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *MaxShards) Reset() { *m = MaxShards{} } -func (m *MaxShards) String() string { return proto.CompactTextString(m) } -func (*MaxShards) ProtoMessage() {} -func (*MaxShards) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{6} } +func (m *MaxShards) Reset() { *m = MaxShards{} } +func (m *MaxShards) String() string { return proto.CompactTextString(m) } +func (*MaxShards) ProtoMessage() {} +func (*MaxShards) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{6} +} +func (m *MaxShards) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MaxShards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MaxShards.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *MaxShards) XXX_Merge(src proto.Message) { + xxx_messageInfo_MaxShards.Merge(dst, src) +} +func (m *MaxShards) XXX_Size() int { + return m.Size() +} +func (m *MaxShards) XXX_DiscardUnknown() { + xxx_messageInfo_MaxShards.DiscardUnknown(m) +} + +var xxx_messageInfo_MaxShards proto.InternalMessageInfo func (m *MaxShards) GetStandard() map[string]uint64 { if m != nil { @@ -271,15 +446,46 @@ func (m *MaxShards) GetStandard() map[string]uint64 { } type CreateShardMessage struct { - Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` - Field string `protobuf:"bytes,3,opt,name=Field,proto3" json:"Field,omitempty"` - Shard uint64 `protobuf:"varint,2,opt,name=Shard,proto3" json:"Shard,omitempty"` + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Field string `protobuf:"bytes,3,opt,name=Field,proto3" json:"Field,omitempty"` + Shard uint64 `protobuf:"varint,2,opt,name=Shard,proto3" json:"Shard,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *CreateShardMessage) Reset() { *m = CreateShardMessage{} } -func (m *CreateShardMessage) String() string { return proto.CompactTextString(m) } -func (*CreateShardMessage) ProtoMessage() {} -func (*CreateShardMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{7} } +func (m *CreateShardMessage) Reset() { *m = CreateShardMessage{} } +func (m *CreateShardMessage) String() string { return proto.CompactTextString(m) } +func (*CreateShardMessage) ProtoMessage() {} +func (*CreateShardMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{7} +} +func (m *CreateShardMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateShardMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateShardMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *CreateShardMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateShardMessage.Merge(dst, src) +} +func (m *CreateShardMessage) XXX_Size() int { + return m.Size() +} +func (m *CreateShardMessage) XXX_DiscardUnknown() { + xxx_messageInfo_CreateShardMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateShardMessage proto.InternalMessageInfo func (m *CreateShardMessage) GetIndex() string { if m != nil { @@ -303,13 +509,44 @@ func (m *CreateShardMessage) GetShard() uint64 { } type DeleteIndexMessage struct { - Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *DeleteIndexMessage) Reset() { *m = DeleteIndexMessage{} } -func (m *DeleteIndexMessage) String() string { return proto.CompactTextString(m) } -func (*DeleteIndexMessage) ProtoMessage() {} -func (*DeleteIndexMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{8} } +func (m *DeleteIndexMessage) Reset() { *m = DeleteIndexMessage{} } +func (m *DeleteIndexMessage) String() string { return proto.CompactTextString(m) } +func (*DeleteIndexMessage) ProtoMessage() {} +func (*DeleteIndexMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{8} +} +func (m *DeleteIndexMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteIndexMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteIndexMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *DeleteIndexMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteIndexMessage.Merge(dst, src) +} +func (m *DeleteIndexMessage) XXX_Size() int { + return m.Size() +} +func (m *DeleteIndexMessage) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteIndexMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteIndexMessage proto.InternalMessageInfo func (m *DeleteIndexMessage) GetIndex() string { if m != nil { @@ -319,14 +556,45 @@ func (m *DeleteIndexMessage) GetIndex() string { } type CreateIndexMessage struct { - Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` - Meta *IndexMeta `protobuf:"bytes,2,opt,name=Meta" json:"Meta,omitempty"` + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Meta *IndexMeta `protobuf:"bytes,2,opt,name=Meta" json:"Meta,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *CreateIndexMessage) Reset() { *m = CreateIndexMessage{} } -func (m *CreateIndexMessage) String() string { return proto.CompactTextString(m) } -func (*CreateIndexMessage) ProtoMessage() {} -func (*CreateIndexMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{9} } +func (m *CreateIndexMessage) Reset() { *m = CreateIndexMessage{} } +func (m *CreateIndexMessage) String() string { return proto.CompactTextString(m) } +func (*CreateIndexMessage) ProtoMessage() {} +func (*CreateIndexMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{9} +} +func (m *CreateIndexMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateIndexMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateIndexMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *CreateIndexMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateIndexMessage.Merge(dst, src) +} +func (m *CreateIndexMessage) XXX_Size() int { + return m.Size() +} +func (m *CreateIndexMessage) XXX_DiscardUnknown() { + xxx_messageInfo_CreateIndexMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateIndexMessage proto.InternalMessageInfo func (m *CreateIndexMessage) GetIndex() string { if m != nil { @@ -343,15 +611,46 @@ func (m *CreateIndexMessage) GetMeta() *IndexMeta { } type CreateFieldMessage struct { - Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` - Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` - Meta *FieldOptions `protobuf:"bytes,3,opt,name=Meta" json:"Meta,omitempty"` + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + Meta *FieldOptions `protobuf:"bytes,3,opt,name=Meta" json:"Meta,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *CreateFieldMessage) Reset() { *m = CreateFieldMessage{} } -func (m *CreateFieldMessage) String() string { return proto.CompactTextString(m) } -func (*CreateFieldMessage) ProtoMessage() {} -func (*CreateFieldMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{10} } +func (m *CreateFieldMessage) Reset() { *m = CreateFieldMessage{} } +func (m *CreateFieldMessage) String() string { return proto.CompactTextString(m) } +func (*CreateFieldMessage) ProtoMessage() {} +func (*CreateFieldMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{10} +} +func (m *CreateFieldMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateFieldMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateFieldMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *CreateFieldMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateFieldMessage.Merge(dst, src) +} +func (m *CreateFieldMessage) XXX_Size() int { + return m.Size() +} +func (m *CreateFieldMessage) XXX_DiscardUnknown() { + xxx_messageInfo_CreateFieldMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateFieldMessage proto.InternalMessageInfo func (m *CreateFieldMessage) GetIndex() string { if m != nil { @@ -375,14 +674,45 @@ func (m *CreateFieldMessage) GetMeta() *FieldOptions { } type DeleteFieldMessage struct { - Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` - Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *DeleteFieldMessage) Reset() { *m = DeleteFieldMessage{} } -func (m *DeleteFieldMessage) String() string { return proto.CompactTextString(m) } -func (*DeleteFieldMessage) ProtoMessage() {} -func (*DeleteFieldMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{11} } +func (m *DeleteFieldMessage) Reset() { *m = DeleteFieldMessage{} } +func (m *DeleteFieldMessage) String() string { return proto.CompactTextString(m) } +func (*DeleteFieldMessage) ProtoMessage() {} +func (*DeleteFieldMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{11} +} +func (m *DeleteFieldMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteFieldMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteFieldMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *DeleteFieldMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteFieldMessage.Merge(dst, src) +} +func (m *DeleteFieldMessage) XXX_Size() int { + return m.Size() +} +func (m *DeleteFieldMessage) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteFieldMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteFieldMessage proto.InternalMessageInfo func (m *DeleteFieldMessage) GetIndex() string { if m != nil { @@ -399,17 +729,46 @@ func (m *DeleteFieldMessage) GetField() string { } type DeleteAvailableShardMessage struct { - Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` - Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` - ShardID uint64 `protobuf:"varint,3,opt,name=ShardID,proto3" json:"ShardID,omitempty"` + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + ShardID uint64 `protobuf:"varint,3,opt,name=ShardID,proto3" json:"ShardID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *DeleteAvailableShardMessage) Reset() { *m = DeleteAvailableShardMessage{} } func (m *DeleteAvailableShardMessage) String() string { return proto.CompactTextString(m) } func (*DeleteAvailableShardMessage) ProtoMessage() {} func (*DeleteAvailableShardMessage) Descriptor() ([]byte, []int) { - return fileDescriptorPrivate, []int{12} + return fileDescriptor_private_ef0da41f92e2513d, []int{12} } +func (m *DeleteAvailableShardMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteAvailableShardMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteAvailableShardMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *DeleteAvailableShardMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteAvailableShardMessage.Merge(dst, src) +} +func (m *DeleteAvailableShardMessage) XXX_Size() int { + return m.Size() +} +func (m *DeleteAvailableShardMessage) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteAvailableShardMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteAvailableShardMessage proto.InternalMessageInfo func (m *DeleteAvailableShardMessage) GetIndex() string { if m != nil { @@ -433,15 +792,46 @@ func (m *DeleteAvailableShardMessage) GetShardID() uint64 { } type Field struct { - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` - Meta *FieldOptions `protobuf:"bytes,2,opt,name=Meta" json:"Meta,omitempty"` - Views []string `protobuf:"bytes,3,rep,name=Views" json:"Views,omitempty"` + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + Meta *FieldOptions `protobuf:"bytes,2,opt,name=Meta" json:"Meta,omitempty"` + Views []string `protobuf:"bytes,3,rep,name=Views" json:"Views,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Field) Reset() { *m = Field{} } -func (m *Field) String() string { return proto.CompactTextString(m) } -func (*Field) ProtoMessage() {} -func (*Field) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{13} } +func (m *Field) Reset() { *m = Field{} } +func (m *Field) String() string { return proto.CompactTextString(m) } +func (*Field) ProtoMessage() {} +func (*Field) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{13} +} +func (m *Field) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Field.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Field) XXX_Merge(src proto.Message) { + xxx_messageInfo_Field.Merge(dst, src) +} +func (m *Field) XXX_Size() int { + return m.Size() +} +func (m *Field) XXX_DiscardUnknown() { + xxx_messageInfo_Field.DiscardUnknown(m) +} + +var xxx_messageInfo_Field proto.InternalMessageInfo func (m *Field) GetName() string { if m != nil { @@ -465,13 +855,44 @@ func (m *Field) GetViews() []string { } type Schema struct { - Indexes []*Index `protobuf:"bytes,1,rep,name=Indexes" json:"Indexes,omitempty"` + Indexes []*Index `protobuf:"bytes,1,rep,name=Indexes" json:"Indexes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Schema) Reset() { *m = Schema{} } -func (m *Schema) String() string { return proto.CompactTextString(m) } -func (*Schema) ProtoMessage() {} -func (*Schema) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{14} } +func (m *Schema) Reset() { *m = Schema{} } +func (m *Schema) String() string { return proto.CompactTextString(m) } +func (*Schema) ProtoMessage() {} +func (*Schema) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{14} +} +func (m *Schema) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Schema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Schema.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Schema) XXX_Merge(src proto.Message) { + xxx_messageInfo_Schema.Merge(dst, src) +} +func (m *Schema) XXX_Size() int { + return m.Size() +} +func (m *Schema) XXX_DiscardUnknown() { + xxx_messageInfo_Schema.DiscardUnknown(m) +} + +var xxx_messageInfo_Schema proto.InternalMessageInfo func (m *Schema) GetIndexes() []*Index { if m != nil { @@ -481,14 +902,45 @@ func (m *Schema) GetIndexes() []*Index { } type Index struct { - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` - Fields []*Field `protobuf:"bytes,4,rep,name=Fields" json:"Fields,omitempty"` + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + Fields []*Field `protobuf:"bytes,4,rep,name=Fields" json:"Fields,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Index) Reset() { *m = Index{} } -func (m *Index) String() string { return proto.CompactTextString(m) } -func (*Index) ProtoMessage() {} -func (*Index) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{15} } +func (m *Index) Reset() { *m = Index{} } +func (m *Index) String() string { return proto.CompactTextString(m) } +func (*Index) ProtoMessage() {} +func (*Index) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{15} +} +func (m *Index) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Index) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Index.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Index) XXX_Merge(src proto.Message) { + xxx_messageInfo_Index.Merge(dst, src) +} +func (m *Index) XXX_Size() int { + return m.Size() +} +func (m *Index) XXX_DiscardUnknown() { + xxx_messageInfo_Index.DiscardUnknown(m) +} + +var xxx_messageInfo_Index proto.InternalMessageInfo func (m *Index) GetName() string { if m != nil { @@ -505,15 +957,46 @@ func (m *Index) GetFields() []*Field { } type URI struct { - Scheme string `protobuf:"bytes,1,opt,name=Scheme,proto3" json:"Scheme,omitempty"` - Host string `protobuf:"bytes,2,opt,name=Host,proto3" json:"Host,omitempty"` - Port uint32 `protobuf:"varint,3,opt,name=Port,proto3" json:"Port,omitempty"` + Scheme string `protobuf:"bytes,1,opt,name=Scheme,proto3" json:"Scheme,omitempty"` + Host string `protobuf:"bytes,2,opt,name=Host,proto3" json:"Host,omitempty"` + Port uint32 `protobuf:"varint,3,opt,name=Port,proto3" json:"Port,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *URI) Reset() { *m = URI{} } -func (m *URI) String() string { return proto.CompactTextString(m) } -func (*URI) ProtoMessage() {} -func (*URI) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{16} } +func (m *URI) Reset() { *m = URI{} } +func (m *URI) String() string { return proto.CompactTextString(m) } +func (*URI) ProtoMessage() {} +func (*URI) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{16} +} +func (m *URI) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *URI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_URI.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *URI) XXX_Merge(src proto.Message) { + xxx_messageInfo_URI.Merge(dst, src) +} +func (m *URI) XXX_Size() int { + return m.Size() +} +func (m *URI) XXX_DiscardUnknown() { + xxx_messageInfo_URI.DiscardUnknown(m) +} + +var xxx_messageInfo_URI proto.InternalMessageInfo func (m *URI) GetScheme() string { if m != nil { @@ -537,15 +1020,46 @@ func (m *URI) GetPort() uint32 { } type Node struct { - ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` - URI *URI `protobuf:"bytes,2,opt,name=URI" json:"URI,omitempty"` - IsCoordinator bool `protobuf:"varint,3,opt,name=IsCoordinator,proto3" json:"IsCoordinator,omitempty"` + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` + URI *URI `protobuf:"bytes,2,opt,name=URI" json:"URI,omitempty"` + IsCoordinator bool `protobuf:"varint,3,opt,name=IsCoordinator,proto3" json:"IsCoordinator,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Node) Reset() { *m = Node{} } -func (m *Node) String() string { return proto.CompactTextString(m) } -func (*Node) ProtoMessage() {} -func (*Node) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{17} } +func (m *Node) Reset() { *m = Node{} } +func (m *Node) String() string { return proto.CompactTextString(m) } +func (*Node) ProtoMessage() {} +func (*Node) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{17} +} +func (m *Node) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Node.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Node) XXX_Merge(src proto.Message) { + xxx_messageInfo_Node.Merge(dst, src) +} +func (m *Node) XXX_Size() int { + return m.Size() +} +func (m *Node) XXX_DiscardUnknown() { + xxx_messageInfo_Node.DiscardUnknown(m) +} + +var xxx_messageInfo_Node proto.InternalMessageInfo func (m *Node) GetID() string { if m != nil { @@ -569,14 +1083,45 @@ func (m *Node) GetIsCoordinator() bool { } type NodeStateMessage struct { - NodeID string `protobuf:"bytes,1,opt,name=NodeID,proto3" json:"NodeID,omitempty"` - State string `protobuf:"bytes,2,opt,name=State,proto3" json:"State,omitempty"` + NodeID string `protobuf:"bytes,1,opt,name=NodeID,proto3" json:"NodeID,omitempty"` + State string `protobuf:"bytes,2,opt,name=State,proto3" json:"State,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *NodeStateMessage) Reset() { *m = NodeStateMessage{} } -func (m *NodeStateMessage) String() string { return proto.CompactTextString(m) } -func (*NodeStateMessage) ProtoMessage() {} -func (*NodeStateMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{18} } +func (m *NodeStateMessage) Reset() { *m = NodeStateMessage{} } +func (m *NodeStateMessage) String() string { return proto.CompactTextString(m) } +func (*NodeStateMessage) ProtoMessage() {} +func (*NodeStateMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{18} +} +func (m *NodeStateMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NodeStateMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NodeStateMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *NodeStateMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeStateMessage.Merge(dst, src) +} +func (m *NodeStateMessage) XXX_Size() int { + return m.Size() +} +func (m *NodeStateMessage) XXX_DiscardUnknown() { + xxx_messageInfo_NodeStateMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeStateMessage proto.InternalMessageInfo func (m *NodeStateMessage) GetNodeID() string { if m != nil { @@ -593,14 +1138,45 @@ func (m *NodeStateMessage) GetState() string { } type NodeEventMessage struct { - Event uint32 `protobuf:"varint,1,opt,name=Event,proto3" json:"Event,omitempty"` - Node *Node `protobuf:"bytes,2,opt,name=Node" json:"Node,omitempty"` + Event uint32 `protobuf:"varint,1,opt,name=Event,proto3" json:"Event,omitempty"` + Node *Node `protobuf:"bytes,2,opt,name=Node" json:"Node,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *NodeEventMessage) Reset() { *m = NodeEventMessage{} } -func (m *NodeEventMessage) String() string { return proto.CompactTextString(m) } -func (*NodeEventMessage) ProtoMessage() {} -func (*NodeEventMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{19} } +func (m *NodeEventMessage) Reset() { *m = NodeEventMessage{} } +func (m *NodeEventMessage) String() string { return proto.CompactTextString(m) } +func (*NodeEventMessage) ProtoMessage() {} +func (*NodeEventMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{19} +} +func (m *NodeEventMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NodeEventMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NodeEventMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *NodeEventMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeEventMessage.Merge(dst, src) +} +func (m *NodeEventMessage) XXX_Size() int { + return m.Size() +} +func (m *NodeEventMessage) XXX_DiscardUnknown() { + xxx_messageInfo_NodeEventMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeEventMessage proto.InternalMessageInfo func (m *NodeEventMessage) GetEvent() uint32 { if m != nil { @@ -617,15 +1193,46 @@ func (m *NodeEventMessage) GetNode() *Node { } type NodeStatus struct { - Node *Node `protobuf:"bytes,1,opt,name=Node" json:"Node,omitempty"` - Schema *Schema `protobuf:"bytes,3,opt,name=Schema" json:"Schema,omitempty"` - Indexes []*IndexStatus `protobuf:"bytes,4,rep,name=Indexes" json:"Indexes,omitempty"` + Node *Node `protobuf:"bytes,1,opt,name=Node" json:"Node,omitempty"` + Schema *Schema `protobuf:"bytes,3,opt,name=Schema" json:"Schema,omitempty"` + Indexes []*IndexStatus `protobuf:"bytes,4,rep,name=Indexes" json:"Indexes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *NodeStatus) Reset() { *m = NodeStatus{} } -func (m *NodeStatus) String() string { return proto.CompactTextString(m) } -func (*NodeStatus) ProtoMessage() {} -func (*NodeStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{20} } +func (m *NodeStatus) Reset() { *m = NodeStatus{} } +func (m *NodeStatus) String() string { return proto.CompactTextString(m) } +func (*NodeStatus) ProtoMessage() {} +func (*NodeStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{20} +} +func (m *NodeStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NodeStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NodeStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *NodeStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeStatus.Merge(dst, src) +} +func (m *NodeStatus) XXX_Size() int { + return m.Size() +} +func (m *NodeStatus) XXX_DiscardUnknown() { + xxx_messageInfo_NodeStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeStatus proto.InternalMessageInfo func (m *NodeStatus) GetNode() *Node { if m != nil { @@ -649,14 +1256,45 @@ func (m *NodeStatus) GetIndexes() []*IndexStatus { } type IndexStatus struct { - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` - Fields []*FieldStatus `protobuf:"bytes,2,rep,name=Fields" json:"Fields,omitempty"` + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + Fields []*FieldStatus `protobuf:"bytes,2,rep,name=Fields" json:"Fields,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *IndexStatus) Reset() { *m = IndexStatus{} } -func (m *IndexStatus) String() string { return proto.CompactTextString(m) } -func (*IndexStatus) ProtoMessage() {} -func (*IndexStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{21} } +func (m *IndexStatus) Reset() { *m = IndexStatus{} } +func (m *IndexStatus) String() string { return proto.CompactTextString(m) } +func (*IndexStatus) ProtoMessage() {} +func (*IndexStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{21} +} +func (m *IndexStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IndexStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IndexStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *IndexStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexStatus.Merge(dst, src) +} +func (m *IndexStatus) XXX_Size() int { + return m.Size() +} +func (m *IndexStatus) XXX_DiscardUnknown() { + xxx_messageInfo_IndexStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexStatus proto.InternalMessageInfo func (m *IndexStatus) GetName() string { if m != nil { @@ -673,14 +1311,45 @@ func (m *IndexStatus) GetFields() []*FieldStatus { } type FieldStatus struct { - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` - AvailableShards []uint64 `protobuf:"varint,2,rep,packed,name=AvailableShards" json:"AvailableShards,omitempty"` + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + AvailableShards []uint64 `protobuf:"varint,2,rep,packed,name=AvailableShards" json:"AvailableShards,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *FieldStatus) Reset() { *m = FieldStatus{} } -func (m *FieldStatus) String() string { return proto.CompactTextString(m) } -func (*FieldStatus) ProtoMessage() {} -func (*FieldStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{22} } +func (m *FieldStatus) Reset() { *m = FieldStatus{} } +func (m *FieldStatus) String() string { return proto.CompactTextString(m) } +func (*FieldStatus) ProtoMessage() {} +func (*FieldStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{22} +} +func (m *FieldStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FieldStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FieldStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *FieldStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_FieldStatus.Merge(dst, src) +} +func (m *FieldStatus) XXX_Size() int { + return m.Size() +} +func (m *FieldStatus) XXX_DiscardUnknown() { + xxx_messageInfo_FieldStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_FieldStatus proto.InternalMessageInfo func (m *FieldStatus) GetName() string { if m != nil { @@ -697,15 +1366,46 @@ func (m *FieldStatus) GetAvailableShards() []uint64 { } type ClusterStatus struct { - ClusterID string `protobuf:"bytes,1,opt,name=ClusterID,proto3" json:"ClusterID,omitempty"` - State string `protobuf:"bytes,2,opt,name=State,proto3" json:"State,omitempty"` - Nodes []*Node `protobuf:"bytes,3,rep,name=Nodes" json:"Nodes,omitempty"` + ClusterID string `protobuf:"bytes,1,opt,name=ClusterID,proto3" json:"ClusterID,omitempty"` + State string `protobuf:"bytes,2,opt,name=State,proto3" json:"State,omitempty"` + Nodes []*Node `protobuf:"bytes,3,rep,name=Nodes" json:"Nodes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ClusterStatus) Reset() { *m = ClusterStatus{} } -func (m *ClusterStatus) String() string { return proto.CompactTextString(m) } -func (*ClusterStatus) ProtoMessage() {} -func (*ClusterStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{23} } +func (m *ClusterStatus) Reset() { *m = ClusterStatus{} } +func (m *ClusterStatus) String() string { return proto.CompactTextString(m) } +func (*ClusterStatus) ProtoMessage() {} +func (*ClusterStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{23} +} +func (m *ClusterStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClusterStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClusterStatus.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ClusterStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClusterStatus.Merge(dst, src) +} +func (m *ClusterStatus) XXX_Size() int { + return m.Size() +} +func (m *ClusterStatus) XXX_DiscardUnknown() { + xxx_messageInfo_ClusterStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_ClusterStatus proto.InternalMessageInfo func (m *ClusterStatus) GetClusterID() string { if m != nil { @@ -729,16 +1429,47 @@ func (m *ClusterStatus) GetNodes() []*Node { } type BSIGroup struct { - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` - Type string `protobuf:"bytes,2,opt,name=Type,proto3" json:"Type,omitempty"` - Min int64 `protobuf:"varint,3,opt,name=Min,proto3" json:"Min,omitempty"` - Max int64 `protobuf:"varint,4,opt,name=Max,proto3" json:"Max,omitempty"` + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` + Type string `protobuf:"bytes,2,opt,name=Type,proto3" json:"Type,omitempty"` + Min int64 `protobuf:"varint,3,opt,name=Min,proto3" json:"Min,omitempty"` + Max int64 `protobuf:"varint,4,opt,name=Max,proto3" json:"Max,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *BSIGroup) Reset() { *m = BSIGroup{} } -func (m *BSIGroup) String() string { return proto.CompactTextString(m) } -func (*BSIGroup) ProtoMessage() {} -func (*BSIGroup) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{24} } +func (m *BSIGroup) Reset() { *m = BSIGroup{} } +func (m *BSIGroup) String() string { return proto.CompactTextString(m) } +func (*BSIGroup) ProtoMessage() {} +func (*BSIGroup) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{24} +} +func (m *BSIGroup) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BSIGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BSIGroup.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *BSIGroup) XXX_Merge(src proto.Message) { + xxx_messageInfo_BSIGroup.Merge(dst, src) +} +func (m *BSIGroup) XXX_Size() int { + return m.Size() +} +func (m *BSIGroup) XXX_DiscardUnknown() { + xxx_messageInfo_BSIGroup.DiscardUnknown(m) +} + +var xxx_messageInfo_BSIGroup proto.InternalMessageInfo func (m *BSIGroup) GetName() string { if m != nil { @@ -769,15 +1500,46 @@ func (m *BSIGroup) GetMax() int64 { } type CreateViewMessage struct { - Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` - Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` - View string `protobuf:"bytes,3,opt,name=View,proto3" json:"View,omitempty"` + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + View string `protobuf:"bytes,3,opt,name=View,proto3" json:"View,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *CreateViewMessage) Reset() { *m = CreateViewMessage{} } -func (m *CreateViewMessage) String() string { return proto.CompactTextString(m) } -func (*CreateViewMessage) ProtoMessage() {} -func (*CreateViewMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{25} } +func (m *CreateViewMessage) Reset() { *m = CreateViewMessage{} } +func (m *CreateViewMessage) String() string { return proto.CompactTextString(m) } +func (*CreateViewMessage) ProtoMessage() {} +func (*CreateViewMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{25} +} +func (m *CreateViewMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateViewMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateViewMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *CreateViewMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateViewMessage.Merge(dst, src) +} +func (m *CreateViewMessage) XXX_Size() int { + return m.Size() +} +func (m *CreateViewMessage) XXX_DiscardUnknown() { + xxx_messageInfo_CreateViewMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateViewMessage proto.InternalMessageInfo func (m *CreateViewMessage) GetIndex() string { if m != nil { @@ -801,15 +1563,46 @@ func (m *CreateViewMessage) GetView() string { } type DeleteViewMessage struct { - Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` - Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` - View string `protobuf:"bytes,3,opt,name=View,proto3" json:"View,omitempty"` + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + View string `protobuf:"bytes,3,opt,name=View,proto3" json:"View,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *DeleteViewMessage) Reset() { *m = DeleteViewMessage{} } -func (m *DeleteViewMessage) String() string { return proto.CompactTextString(m) } -func (*DeleteViewMessage) ProtoMessage() {} -func (*DeleteViewMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{26} } +func (m *DeleteViewMessage) Reset() { *m = DeleteViewMessage{} } +func (m *DeleteViewMessage) String() string { return proto.CompactTextString(m) } +func (*DeleteViewMessage) ProtoMessage() {} +func (*DeleteViewMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{26} +} +func (m *DeleteViewMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteViewMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteViewMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *DeleteViewMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteViewMessage.Merge(dst, src) +} +func (m *DeleteViewMessage) XXX_Size() int { + return m.Size() +} +func (m *DeleteViewMessage) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteViewMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteViewMessage proto.InternalMessageInfo func (m *DeleteViewMessage) GetIndex() string { if m != nil { @@ -833,18 +1626,49 @@ func (m *DeleteViewMessage) GetView() string { } type ResizeInstruction struct { - JobID int64 `protobuf:"varint,1,opt,name=JobID,proto3" json:"JobID,omitempty"` - Node *Node `protobuf:"bytes,2,opt,name=Node" json:"Node,omitempty"` - Coordinator *Node `protobuf:"bytes,3,opt,name=Coordinator" json:"Coordinator,omitempty"` - Sources []*ResizeSource `protobuf:"bytes,4,rep,name=Sources" json:"Sources,omitempty"` - Schema *Schema `protobuf:"bytes,5,opt,name=Schema" json:"Schema,omitempty"` - ClusterStatus *ClusterStatus `protobuf:"bytes,6,opt,name=ClusterStatus" json:"ClusterStatus,omitempty"` + JobID int64 `protobuf:"varint,1,opt,name=JobID,proto3" json:"JobID,omitempty"` + Node *Node `protobuf:"bytes,2,opt,name=Node" json:"Node,omitempty"` + Coordinator *Node `protobuf:"bytes,3,opt,name=Coordinator" json:"Coordinator,omitempty"` + Sources []*ResizeSource `protobuf:"bytes,4,rep,name=Sources" json:"Sources,omitempty"` + Schema *Schema `protobuf:"bytes,5,opt,name=Schema" json:"Schema,omitempty"` + ClusterStatus *ClusterStatus `protobuf:"bytes,6,opt,name=ClusterStatus" json:"ClusterStatus,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResizeInstruction) Reset() { *m = ResizeInstruction{} } -func (m *ResizeInstruction) String() string { return proto.CompactTextString(m) } -func (*ResizeInstruction) ProtoMessage() {} -func (*ResizeInstruction) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{27} } +func (m *ResizeInstruction) Reset() { *m = ResizeInstruction{} } +func (m *ResizeInstruction) String() string { return proto.CompactTextString(m) } +func (*ResizeInstruction) ProtoMessage() {} +func (*ResizeInstruction) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{27} +} +func (m *ResizeInstruction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResizeInstruction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResizeInstruction.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResizeInstruction) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResizeInstruction.Merge(dst, src) +} +func (m *ResizeInstruction) XXX_Size() int { + return m.Size() +} +func (m *ResizeInstruction) XXX_DiscardUnknown() { + xxx_messageInfo_ResizeInstruction.DiscardUnknown(m) +} + +var xxx_messageInfo_ResizeInstruction proto.InternalMessageInfo func (m *ResizeInstruction) GetJobID() int64 { if m != nil { @@ -889,17 +1713,48 @@ func (m *ResizeInstruction) GetClusterStatus() *ClusterStatus { } type ResizeSource struct { - Node *Node `protobuf:"bytes,1,opt,name=Node" json:"Node,omitempty"` - Index string `protobuf:"bytes,2,opt,name=Index,proto3" json:"Index,omitempty"` - Field string `protobuf:"bytes,3,opt,name=Field,proto3" json:"Field,omitempty"` - View string `protobuf:"bytes,4,opt,name=View,proto3" json:"View,omitempty"` - Shard uint64 `protobuf:"varint,5,opt,name=Shard,proto3" json:"Shard,omitempty"` + Node *Node `protobuf:"bytes,1,opt,name=Node" json:"Node,omitempty"` + Index string `protobuf:"bytes,2,opt,name=Index,proto3" json:"Index,omitempty"` + Field string `protobuf:"bytes,3,opt,name=Field,proto3" json:"Field,omitempty"` + View string `protobuf:"bytes,4,opt,name=View,proto3" json:"View,omitempty"` + Shard uint64 `protobuf:"varint,5,opt,name=Shard,proto3" json:"Shard,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ResizeSource) Reset() { *m = ResizeSource{} } -func (m *ResizeSource) String() string { return proto.CompactTextString(m) } -func (*ResizeSource) ProtoMessage() {} -func (*ResizeSource) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{28} } +func (m *ResizeSource) Reset() { *m = ResizeSource{} } +func (m *ResizeSource) String() string { return proto.CompactTextString(m) } +func (*ResizeSource) ProtoMessage() {} +func (*ResizeSource) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{28} +} +func (m *ResizeSource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResizeSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResizeSource.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResizeSource) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResizeSource.Merge(dst, src) +} +func (m *ResizeSource) XXX_Size() int { + return m.Size() +} +func (m *ResizeSource) XXX_DiscardUnknown() { + xxx_messageInfo_ResizeSource.DiscardUnknown(m) +} + +var xxx_messageInfo_ResizeSource proto.InternalMessageInfo func (m *ResizeSource) GetNode() *Node { if m != nil { @@ -937,17 +1792,46 @@ func (m *ResizeSource) GetShard() uint64 { } type ResizeInstructionComplete struct { - JobID int64 `protobuf:"varint,1,opt,name=JobID,proto3" json:"JobID,omitempty"` - Node *Node `protobuf:"bytes,2,opt,name=Node" json:"Node,omitempty"` - Error string `protobuf:"bytes,3,opt,name=Error,proto3" json:"Error,omitempty"` + JobID int64 `protobuf:"varint,1,opt,name=JobID,proto3" json:"JobID,omitempty"` + Node *Node `protobuf:"bytes,2,opt,name=Node" json:"Node,omitempty"` + Error string `protobuf:"bytes,3,opt,name=Error,proto3" json:"Error,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ResizeInstructionComplete) Reset() { *m = ResizeInstructionComplete{} } func (m *ResizeInstructionComplete) String() string { return proto.CompactTextString(m) } func (*ResizeInstructionComplete) ProtoMessage() {} func (*ResizeInstructionComplete) Descriptor() ([]byte, []int) { - return fileDescriptorPrivate, []int{29} + return fileDescriptor_private_ef0da41f92e2513d, []int{29} } +func (m *ResizeInstructionComplete) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResizeInstructionComplete) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResizeInstructionComplete.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResizeInstructionComplete) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResizeInstructionComplete.Merge(dst, src) +} +func (m *ResizeInstructionComplete) XXX_Size() int { + return m.Size() +} +func (m *ResizeInstructionComplete) XXX_DiscardUnknown() { + xxx_messageInfo_ResizeInstructionComplete.DiscardUnknown(m) +} + +var xxx_messageInfo_ResizeInstructionComplete proto.InternalMessageInfo func (m *ResizeInstructionComplete) GetJobID() int64 { if m != nil { @@ -971,13 +1855,44 @@ func (m *ResizeInstructionComplete) GetError() string { } type SetCoordinatorMessage struct { - New *Node `protobuf:"bytes,1,opt,name=New" json:"New,omitempty"` + New *Node `protobuf:"bytes,1,opt,name=New" json:"New,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *SetCoordinatorMessage) Reset() { *m = SetCoordinatorMessage{} } -func (m *SetCoordinatorMessage) String() string { return proto.CompactTextString(m) } -func (*SetCoordinatorMessage) ProtoMessage() {} -func (*SetCoordinatorMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{30} } +func (m *SetCoordinatorMessage) Reset() { *m = SetCoordinatorMessage{} } +func (m *SetCoordinatorMessage) String() string { return proto.CompactTextString(m) } +func (*SetCoordinatorMessage) ProtoMessage() {} +func (*SetCoordinatorMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{30} +} +func (m *SetCoordinatorMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SetCoordinatorMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SetCoordinatorMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *SetCoordinatorMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetCoordinatorMessage.Merge(dst, src) +} +func (m *SetCoordinatorMessage) XXX_Size() int { + return m.Size() +} +func (m *SetCoordinatorMessage) XXX_DiscardUnknown() { + xxx_messageInfo_SetCoordinatorMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_SetCoordinatorMessage proto.InternalMessageInfo func (m *SetCoordinatorMessage) GetNew() *Node { if m != nil { @@ -987,13 +1902,44 @@ func (m *SetCoordinatorMessage) GetNew() *Node { } type UpdateCoordinatorMessage struct { - New *Node `protobuf:"bytes,1,opt,name=New" json:"New,omitempty"` + New *Node `protobuf:"bytes,1,opt,name=New" json:"New,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *UpdateCoordinatorMessage) Reset() { *m = UpdateCoordinatorMessage{} } -func (m *UpdateCoordinatorMessage) String() string { return proto.CompactTextString(m) } -func (*UpdateCoordinatorMessage) ProtoMessage() {} -func (*UpdateCoordinatorMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{31} } +func (m *UpdateCoordinatorMessage) Reset() { *m = UpdateCoordinatorMessage{} } +func (m *UpdateCoordinatorMessage) String() string { return proto.CompactTextString(m) } +func (*UpdateCoordinatorMessage) ProtoMessage() {} +func (*UpdateCoordinatorMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{31} +} +func (m *UpdateCoordinatorMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateCoordinatorMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateCoordinatorMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *UpdateCoordinatorMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateCoordinatorMessage.Merge(dst, src) +} +func (m *UpdateCoordinatorMessage) XXX_Size() int { + return m.Size() +} +func (m *UpdateCoordinatorMessage) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateCoordinatorMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateCoordinatorMessage proto.InternalMessageInfo func (m *UpdateCoordinatorMessage) GetNew() *Node { if m != nil { @@ -1003,14 +1949,45 @@ func (m *UpdateCoordinatorMessage) GetNew() *Node { } type Topology struct { - ClusterID string `protobuf:"bytes,1,opt,name=ClusterID,proto3" json:"ClusterID,omitempty"` - NodeIDs []string `protobuf:"bytes,2,rep,name=NodeIDs" json:"NodeIDs,omitempty"` + ClusterID string `protobuf:"bytes,1,opt,name=ClusterID,proto3" json:"ClusterID,omitempty"` + NodeIDs []string `protobuf:"bytes,2,rep,name=NodeIDs" json:"NodeIDs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Topology) Reset() { *m = Topology{} } -func (m *Topology) String() string { return proto.CompactTextString(m) } -func (*Topology) ProtoMessage() {} -func (*Topology) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{32} } +func (m *Topology) Reset() { *m = Topology{} } +func (m *Topology) String() string { return proto.CompactTextString(m) } +func (*Topology) ProtoMessage() {} +func (*Topology) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{32} +} +func (m *Topology) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Topology) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Topology.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Topology) XXX_Merge(src proto.Message) { + xxx_messageInfo_Topology.Merge(dst, src) +} +func (m *Topology) XXX_Size() int { + return m.Size() +} +func (m *Topology) XXX_DiscardUnknown() { + xxx_messageInfo_Topology.DiscardUnknown(m) +} + +var xxx_messageInfo_Topology proto.InternalMessageInfo func (m *Topology) GetClusterID() string { if m != nil { @@ -1027,12 +2004,43 @@ func (m *Topology) GetNodeIDs() []string { } type RecalculateCaches struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RecalculateCaches) Reset() { *m = RecalculateCaches{} } -func (m *RecalculateCaches) String() string { return proto.CompactTextString(m) } -func (*RecalculateCaches) ProtoMessage() {} -func (*RecalculateCaches) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{33} } +func (m *RecalculateCaches) Reset() { *m = RecalculateCaches{} } +func (m *RecalculateCaches) String() string { return proto.CompactTextString(m) } +func (*RecalculateCaches) ProtoMessage() {} +func (*RecalculateCaches) Descriptor() ([]byte, []int) { + return fileDescriptor_private_ef0da41f92e2513d, []int{33} +} +func (m *RecalculateCaches) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RecalculateCaches) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RecalculateCaches.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RecalculateCaches) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecalculateCaches.Merge(dst, src) +} +func (m *RecalculateCaches) XXX_Size() int { + return m.Size() +} +func (m *RecalculateCaches) XXX_DiscardUnknown() { + xxx_messageInfo_RecalculateCaches.DiscardUnknown(m) +} + +var xxx_messageInfo_RecalculateCaches proto.InternalMessageInfo func init() { proto.RegisterType((*IndexMeta)(nil), "internal.IndexMeta") @@ -1042,6 +2050,7 @@ func init() { proto.RegisterType((*BlockDataResponse)(nil), "internal.BlockDataResponse") proto.RegisterType((*Cache)(nil), "internal.Cache") proto.RegisterType((*MaxShards)(nil), "internal.MaxShards") + proto.RegisterMapType((map[string]uint64)(nil), "internal.MaxShards.StandardEntry") proto.RegisterType((*CreateShardMessage)(nil), "internal.CreateShardMessage") proto.RegisterType((*DeleteIndexMessage)(nil), "internal.DeleteIndexMessage") proto.RegisterType((*CreateIndexMessage)(nil), "internal.CreateIndexMessage") @@ -1105,6 +2114,9 @@ func (m *IndexMeta) MarshalTo(dAtA []byte) (int, error) { } i++ } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1166,6 +2178,9 @@ func (m *FieldOptions) MarshalTo(dAtA []byte) (int, error) { } i++ } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1190,6 +2205,9 @@ func (m *ImportResponse) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(len(m.Err))) i += copy(dAtA[i:], m.Err) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1236,6 +2254,9 @@ func (m *BlockDataRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(len(m.View))) i += copy(dAtA[i:], m.View) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1288,6 +2309,9 @@ func (m *BlockDataResponse) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(j3)) i += copy(dAtA[i:], dAtA4[:j3]) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1323,6 +2347,9 @@ func (m *Cache) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(j5)) i += copy(dAtA[i:], dAtA6[:j5]) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1357,6 +2384,9 @@ func (m *MaxShards) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(v)) } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1392,6 +2422,9 @@ func (m *CreateShardMessage) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(len(m.Field))) i += copy(dAtA[i:], m.Field) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1416,6 +2449,9 @@ func (m *DeleteIndexMessage) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(len(m.Index))) i += copy(dAtA[i:], m.Index) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1450,6 +2486,9 @@ func (m *CreateIndexMessage) MarshalTo(dAtA []byte) (int, error) { } i += n7 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1490,6 +2529,9 @@ func (m *CreateFieldMessage) MarshalTo(dAtA []byte) (int, error) { } i += n8 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1520,6 +2562,9 @@ func (m *DeleteFieldMessage) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(len(m.Field))) i += copy(dAtA[i:], m.Field) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1555,6 +2600,9 @@ func (m *DeleteAvailableShardMessage) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintPrivate(dAtA, i, uint64(m.ShardID)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1604,6 +2652,9 @@ func (m *Field) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], s) } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1634,6 +2685,9 @@ func (m *Schema) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1670,6 +2724,9 @@ func (m *Index) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1705,6 +2762,9 @@ func (m *URI) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintPrivate(dAtA, i, uint64(m.Port)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1749,6 +2809,9 @@ func (m *Node) MarshalTo(dAtA []byte) (int, error) { } i++ } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1779,6 +2842,9 @@ func (m *NodeStateMessage) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(len(m.State))) i += copy(dAtA[i:], m.State) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1812,6 +2878,9 @@ func (m *NodeEventMessage) MarshalTo(dAtA []byte) (int, error) { } i += n11 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1862,6 +2931,9 @@ func (m *NodeStatus) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1898,6 +2970,9 @@ func (m *IndexStatus) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1939,6 +3014,9 @@ func (m *FieldStatus) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(j14)) i += copy(dAtA[i:], dAtA15[:j14]) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1981,6 +3059,9 @@ func (m *ClusterStatus) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -2021,6 +3102,9 @@ func (m *BSIGroup) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintPrivate(dAtA, i, uint64(m.Max)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -2057,6 +3141,9 @@ func (m *CreateViewMessage) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(len(m.View))) i += copy(dAtA[i:], m.View) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -2093,6 +3180,9 @@ func (m *DeleteViewMessage) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(len(m.View))) i += copy(dAtA[i:], m.View) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -2168,6 +3258,9 @@ func (m *ResizeInstruction) MarshalTo(dAtA []byte) (int, error) { } i += n19 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -2219,6 +3312,9 @@ func (m *ResizeSource) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintPrivate(dAtA, i, uint64(m.Shard)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -2258,6 +3354,9 @@ func (m *ResizeInstructionComplete) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPrivate(dAtA, i, uint64(len(m.Error))) i += copy(dAtA[i:], m.Error) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -2286,6 +3385,9 @@ func (m *SetCoordinatorMessage) MarshalTo(dAtA []byte) (int, error) { } i += n22 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -2314,6 +3416,9 @@ func (m *UpdateCoordinatorMessage) MarshalTo(dAtA []byte) (int, error) { } i += n23 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -2353,6 +3458,9 @@ func (m *Topology) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], s) } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -2371,6 +3479,9 @@ func (m *RecalculateCaches) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -2384,6 +3495,9 @@ func encodeVarintPrivate(dAtA []byte, offset int, v uint64) int { return offset + 1 } func (m *IndexMeta) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Keys { @@ -2392,10 +3506,16 @@ func (m *IndexMeta) Size() (n int) { if m.TrackExistence { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *FieldOptions) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.CacheType) @@ -2422,20 +3542,32 @@ func (m *FieldOptions) Size() (n int) { if m.Keys { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ImportResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Err) if l > 0 { n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *BlockDataRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Index) @@ -2456,10 +3588,16 @@ func (m *BlockDataRequest) Size() (n int) { if l > 0 { n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *BlockDataResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.RowIDs) > 0 { @@ -2476,10 +3614,16 @@ func (m *BlockDataResponse) Size() (n int) { } n += 1 + sovPrivate(uint64(l)) + l } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Cache) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.IDs) > 0 { @@ -2489,10 +3633,16 @@ func (m *Cache) Size() (n int) { } n += 1 + sovPrivate(uint64(l)) + l } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *MaxShards) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.Standard) > 0 { @@ -2503,10 +3653,16 @@ func (m *MaxShards) Size() (n int) { n += mapEntrySize + 1 + sovPrivate(uint64(mapEntrySize)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *CreateShardMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Index) @@ -2520,20 +3676,32 @@ func (m *CreateShardMessage) Size() (n int) { if l > 0 { n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *DeleteIndexMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Index) if l > 0 { n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *CreateIndexMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Index) @@ -2544,10 +3712,16 @@ func (m *CreateIndexMessage) Size() (n int) { l = m.Meta.Size() n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *CreateFieldMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Index) @@ -2562,10 +3736,16 @@ func (m *CreateFieldMessage) Size() (n int) { l = m.Meta.Size() n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *DeleteFieldMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Index) @@ -2576,10 +3756,16 @@ func (m *DeleteFieldMessage) Size() (n int) { if l > 0 { n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *DeleteAvailableShardMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Index) @@ -2593,10 +3779,16 @@ func (m *DeleteAvailableShardMessage) Size() (n int) { if m.ShardID != 0 { n += 1 + sovPrivate(uint64(m.ShardID)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Field) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -2613,10 +3805,16 @@ func (m *Field) Size() (n int) { n += 1 + l + sovPrivate(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Schema) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.Indexes) > 0 { @@ -2625,10 +3823,16 @@ func (m *Schema) Size() (n int) { n += 1 + l + sovPrivate(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Index) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -2641,10 +3845,16 @@ func (m *Index) Size() (n int) { n += 1 + l + sovPrivate(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *URI) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Scheme) @@ -2658,10 +3868,16 @@ func (m *URI) Size() (n int) { if m.Port != 0 { n += 1 + sovPrivate(uint64(m.Port)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Node) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.ID) @@ -2675,10 +3891,16 @@ func (m *Node) Size() (n int) { if m.IsCoordinator { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *NodeStateMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.NodeID) @@ -2689,10 +3911,16 @@ func (m *NodeStateMessage) Size() (n int) { if l > 0 { n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *NodeEventMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Event != 0 { @@ -2702,10 +3930,16 @@ func (m *NodeEventMessage) Size() (n int) { l = m.Node.Size() n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *NodeStatus) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Node != nil { @@ -2722,10 +3956,16 @@ func (m *NodeStatus) Size() (n int) { n += 1 + l + sovPrivate(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *IndexStatus) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -2738,10 +3978,16 @@ func (m *IndexStatus) Size() (n int) { n += 1 + l + sovPrivate(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *FieldStatus) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -2755,10 +4001,16 @@ func (m *FieldStatus) Size() (n int) { } n += 1 + sovPrivate(uint64(l)) + l } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ClusterStatus) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.ClusterID) @@ -2775,10 +4027,16 @@ func (m *ClusterStatus) Size() (n int) { n += 1 + l + sovPrivate(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *BSIGroup) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Name) @@ -2795,10 +4053,16 @@ func (m *BSIGroup) Size() (n int) { if m.Max != 0 { n += 1 + sovPrivate(uint64(m.Max)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *CreateViewMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Index) @@ -2813,10 +4077,16 @@ func (m *CreateViewMessage) Size() (n int) { if l > 0 { n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *DeleteViewMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Index) @@ -2831,10 +4101,16 @@ func (m *DeleteViewMessage) Size() (n int) { if l > 0 { n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ResizeInstruction) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.JobID != 0 { @@ -2862,10 +4138,16 @@ func (m *ResizeInstruction) Size() (n int) { l = m.ClusterStatus.Size() n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ResizeSource) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Node != nil { @@ -2887,10 +4169,16 @@ func (m *ResizeSource) Size() (n int) { if m.Shard != 0 { n += 1 + sovPrivate(uint64(m.Shard)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ResizeInstructionComplete) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.JobID != 0 { @@ -2904,30 +4192,48 @@ func (m *ResizeInstructionComplete) Size() (n int) { if l > 0 { n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *SetCoordinatorMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.New != nil { l = m.New.Size() n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *UpdateCoordinatorMessage) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.New != nil { l = m.New.Size() n += 1 + l + sovPrivate(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Topology) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.ClusterID) @@ -2940,12 +4246,21 @@ func (m *Topology) Size() (n int) { n += 1 + l + sovPrivate(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *RecalculateCaches) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -3043,6 +4358,7 @@ func (m *IndexMeta) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -3257,6 +4573,7 @@ func (m *FieldOptions) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -3336,6 +4653,7 @@ func (m *ImportResponse) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -3511,6 +4829,7 @@ func (m *BlockDataRequest) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -3590,6 +4909,17 @@ func (m *BlockDataResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.RowIDs) == 0 { + m.RowIDs = make([]uint64, 0, elementCount) + } for iNdEx < postIndex { var v uint64 for shift := uint(0); ; shift += 7 { @@ -3652,6 +4982,17 @@ func (m *BlockDataResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.ColumnIDs) == 0 { + m.ColumnIDs = make([]uint64, 0, elementCount) + } for iNdEx < postIndex { var v uint64 for shift := uint(0); ; shift += 7 { @@ -3685,6 +5026,7 @@ func (m *BlockDataResponse) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -3764,6 +5106,17 @@ func (m *Cache) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.IDs) == 0 { + m.IDs = make([]uint64, 0, elementCount) + } for iNdEx < postIndex { var v uint64 for shift := uint(0); ; shift += 7 { @@ -3797,6 +5150,7 @@ func (m *Cache) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -3954,6 +5308,7 @@ func (m *MaxShards) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -4081,6 +5436,7 @@ func (m *CreateShardMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -4160,6 +5516,7 @@ func (m *DeleteIndexMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -4272,6 +5629,7 @@ func (m *CreateIndexMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -4413,6 +5771,7 @@ func (m *CreateFieldMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -4521,6 +5880,7 @@ func (m *DeleteFieldMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -4648,6 +6008,7 @@ func (m *DeleteAvailableShardMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -4789,6 +6150,7 @@ func (m *Field) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -4870,6 +6232,7 @@ func (m *Schema) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -4980,6 +6343,7 @@ func (m *Index) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -5107,6 +6471,7 @@ func (m *URI) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -5239,6 +6604,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -5347,6 +6713,7 @@ func (m *NodeStateMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -5449,6 +6816,7 @@ func (m *NodeEventMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -5596,6 +6964,7 @@ func (m *NodeStatus) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -5706,6 +7075,7 @@ func (m *IndexStatus) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -5814,6 +7184,17 @@ func (m *FieldStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.AvailableShards) == 0 { + m.AvailableShards = make([]uint64, 0, elementCount) + } for iNdEx < postIndex { var v uint64 for shift := uint(0); ; shift += 7 { @@ -5847,6 +7228,7 @@ func (m *FieldStatus) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -5986,6 +7368,7 @@ func (m *ClusterStatus) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -6132,6 +7515,7 @@ func (m *BSIGroup) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -6269,6 +7653,7 @@ func (m *CreateViewMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -6406,6 +7791,7 @@ func (m *DeleteViewMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -6638,6 +8024,7 @@ func (m *ResizeInstruction) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -6827,6 +8214,7 @@ func (m *ResizeSource) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -6958,6 +8346,7 @@ func (m *ResizeInstructionComplete) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -7041,6 +8430,7 @@ func (m *SetCoordinatorMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -7124,6 +8514,7 @@ func (m *UpdateCoordinatorMessage) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -7232,6 +8623,7 @@ func (m *Topology) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -7282,6 +8674,7 @@ func (m *RecalculateCaches) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -7396,9 +8789,9 @@ var ( ErrIntOverflowPrivate = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("private.proto", fileDescriptorPrivate) } +func init() { proto.RegisterFile("private.proto", fileDescriptor_private_ef0da41f92e2513d) } -var fileDescriptorPrivate = []byte{ +var fileDescriptor_private_ef0da41f92e2513d = []byte{ // 1113 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xdb, 0x6e, 0x1b, 0x45, 0x18, 0x66, 0x0f, 0x76, 0xec, 0xdf, 0x75, 0x9a, 0x6c, 0x69, 0xd9, 0x02, 0x0a, 0x61, 0x54, 0xd1, diff --git a/internal/public.pb.go b/internal/public.pb.go index bfa0b3be1..8d78db985 100644 --- a/internal/public.pb.go +++ b/internal/public.pb.go @@ -1,36 +1,13 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: public.proto -/* - Package internal is a generated protocol buffer package. - - It is generated from these files: - public.proto - - It has these top-level messages: - Row - RowIdentifiers - Pair - FieldRow - GroupCount - ValCount - Bit - ColumnAttrSet - Attr - AttrMap - QueryRequest - QueryResponse - QueryResult - ImportRequest - ImportValueRequest -*/ package internal import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import binary "encoding/binary" +import encoding_binary "encoding/binary" import io "io" @@ -46,15 +23,46 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Row struct { - Columns []uint64 `protobuf:"varint,1,rep,packed,name=Columns" json:"Columns,omitempty"` - Keys []string `protobuf:"bytes,3,rep,name=Keys" json:"Keys,omitempty"` - Attrs []*Attr `protobuf:"bytes,2,rep,name=Attrs" json:"Attrs,omitempty"` + Columns []uint64 `protobuf:"varint,1,rep,packed,name=Columns" json:"Columns,omitempty"` + Keys []string `protobuf:"bytes,3,rep,name=Keys" json:"Keys,omitempty"` + Attrs []*Attr `protobuf:"bytes,2,rep,name=Attrs" json:"Attrs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Row) Reset() { *m = Row{} } -func (m *Row) String() string { return proto.CompactTextString(m) } -func (*Row) ProtoMessage() {} -func (*Row) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{0} } +func (m *Row) Reset() { *m = Row{} } +func (m *Row) String() string { return proto.CompactTextString(m) } +func (*Row) ProtoMessage() {} +func (*Row) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{0} +} +func (m *Row) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Row) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Row.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Row) XXX_Merge(src proto.Message) { + xxx_messageInfo_Row.Merge(dst, src) +} +func (m *Row) XXX_Size() int { + return m.Size() +} +func (m *Row) XXX_DiscardUnknown() { + xxx_messageInfo_Row.DiscardUnknown(m) +} + +var xxx_messageInfo_Row proto.InternalMessageInfo func (m *Row) GetColumns() []uint64 { if m != nil { @@ -78,14 +86,45 @@ func (m *Row) GetAttrs() []*Attr { } type RowIdentifiers struct { - Rows []uint64 `protobuf:"varint,1,rep,packed,name=Rows" json:"Rows,omitempty"` - Keys []string `protobuf:"bytes,2,rep,name=Keys" json:"Keys,omitempty"` + Rows []uint64 `protobuf:"varint,1,rep,packed,name=Rows" json:"Rows,omitempty"` + Keys []string `protobuf:"bytes,2,rep,name=Keys" json:"Keys,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RowIdentifiers) Reset() { *m = RowIdentifiers{} } -func (m *RowIdentifiers) String() string { return proto.CompactTextString(m) } -func (*RowIdentifiers) ProtoMessage() {} -func (*RowIdentifiers) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{1} } +func (m *RowIdentifiers) Reset() { *m = RowIdentifiers{} } +func (m *RowIdentifiers) String() string { return proto.CompactTextString(m) } +func (*RowIdentifiers) ProtoMessage() {} +func (*RowIdentifiers) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{1} +} +func (m *RowIdentifiers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RowIdentifiers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RowIdentifiers.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RowIdentifiers) XXX_Merge(src proto.Message) { + xxx_messageInfo_RowIdentifiers.Merge(dst, src) +} +func (m *RowIdentifiers) XXX_Size() int { + return m.Size() +} +func (m *RowIdentifiers) XXX_DiscardUnknown() { + xxx_messageInfo_RowIdentifiers.DiscardUnknown(m) +} + +var xxx_messageInfo_RowIdentifiers proto.InternalMessageInfo func (m *RowIdentifiers) GetRows() []uint64 { if m != nil { @@ -102,15 +141,46 @@ func (m *RowIdentifiers) GetKeys() []string { } type Pair struct { - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - Key string `protobuf:"bytes,3,opt,name=Key,proto3" json:"Key,omitempty"` - Count uint64 `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"` + ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + Key string `protobuf:"bytes,3,opt,name=Key,proto3" json:"Key,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Pair) Reset() { *m = Pair{} } -func (m *Pair) String() string { return proto.CompactTextString(m) } -func (*Pair) ProtoMessage() {} -func (*Pair) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{2} } +func (m *Pair) Reset() { *m = Pair{} } +func (m *Pair) String() string { return proto.CompactTextString(m) } +func (*Pair) ProtoMessage() {} +func (*Pair) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{2} +} +func (m *Pair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Pair.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Pair) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pair.Merge(dst, src) +} +func (m *Pair) XXX_Size() int { + return m.Size() +} +func (m *Pair) XXX_DiscardUnknown() { + xxx_messageInfo_Pair.DiscardUnknown(m) +} + +var xxx_messageInfo_Pair proto.InternalMessageInfo func (m *Pair) GetID() uint64 { if m != nil { @@ -134,14 +204,45 @@ func (m *Pair) GetCount() uint64 { } type FieldRow struct { - Field string `protobuf:"bytes,1,opt,name=Field,proto3" json:"Field,omitempty"` - RowID uint64 `protobuf:"varint,2,opt,name=RowID,proto3" json:"RowID,omitempty"` + Field string `protobuf:"bytes,1,opt,name=Field,proto3" json:"Field,omitempty"` + RowID uint64 `protobuf:"varint,2,opt,name=RowID,proto3" json:"RowID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *FieldRow) Reset() { *m = FieldRow{} } -func (m *FieldRow) String() string { return proto.CompactTextString(m) } -func (*FieldRow) ProtoMessage() {} -func (*FieldRow) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{3} } +func (m *FieldRow) Reset() { *m = FieldRow{} } +func (m *FieldRow) String() string { return proto.CompactTextString(m) } +func (*FieldRow) ProtoMessage() {} +func (*FieldRow) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{3} +} +func (m *FieldRow) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FieldRow) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FieldRow.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *FieldRow) XXX_Merge(src proto.Message) { + xxx_messageInfo_FieldRow.Merge(dst, src) +} +func (m *FieldRow) XXX_Size() int { + return m.Size() +} +func (m *FieldRow) XXX_DiscardUnknown() { + xxx_messageInfo_FieldRow.DiscardUnknown(m) +} + +var xxx_messageInfo_FieldRow proto.InternalMessageInfo func (m *FieldRow) GetField() string { if m != nil { @@ -158,14 +259,45 @@ func (m *FieldRow) GetRowID() uint64 { } type GroupCount struct { - Group []*FieldRow `protobuf:"bytes,1,rep,name=Group" json:"Group,omitempty"` - Count uint64 `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"` + Group []*FieldRow `protobuf:"bytes,1,rep,name=Group" json:"Group,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *GroupCount) Reset() { *m = GroupCount{} } -func (m *GroupCount) String() string { return proto.CompactTextString(m) } -func (*GroupCount) ProtoMessage() {} -func (*GroupCount) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{4} } +func (m *GroupCount) Reset() { *m = GroupCount{} } +func (m *GroupCount) String() string { return proto.CompactTextString(m) } +func (*GroupCount) ProtoMessage() {} +func (*GroupCount) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{4} +} +func (m *GroupCount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GroupCount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GroupCount.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *GroupCount) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupCount.Merge(dst, src) +} +func (m *GroupCount) XXX_Size() int { + return m.Size() +} +func (m *GroupCount) XXX_DiscardUnknown() { + xxx_messageInfo_GroupCount.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupCount proto.InternalMessageInfo func (m *GroupCount) GetGroup() []*FieldRow { if m != nil { @@ -182,14 +314,45 @@ func (m *GroupCount) GetCount() uint64 { } type ValCount struct { - Val int64 `protobuf:"varint,1,opt,name=Val,proto3" json:"Val,omitempty"` - Count int64 `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"` + Val int64 `protobuf:"varint,1,opt,name=Val,proto3" json:"Val,omitempty"` + Count int64 `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ValCount) Reset() { *m = ValCount{} } -func (m *ValCount) String() string { return proto.CompactTextString(m) } -func (*ValCount) ProtoMessage() {} -func (*ValCount) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{5} } +func (m *ValCount) Reset() { *m = ValCount{} } +func (m *ValCount) String() string { return proto.CompactTextString(m) } +func (*ValCount) ProtoMessage() {} +func (*ValCount) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{5} +} +func (m *ValCount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValCount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValCount.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ValCount) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValCount.Merge(dst, src) +} +func (m *ValCount) XXX_Size() int { + return m.Size() +} +func (m *ValCount) XXX_DiscardUnknown() { + xxx_messageInfo_ValCount.DiscardUnknown(m) +} + +var xxx_messageInfo_ValCount proto.InternalMessageInfo func (m *ValCount) GetVal() int64 { if m != nil { @@ -206,15 +369,46 @@ func (m *ValCount) GetCount() int64 { } type Bit struct { - RowID uint64 `protobuf:"varint,1,opt,name=RowID,proto3" json:"RowID,omitempty"` - ColumnID uint64 `protobuf:"varint,2,opt,name=ColumnID,proto3" json:"ColumnID,omitempty"` - Timestamp int64 `protobuf:"varint,3,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` + RowID uint64 `protobuf:"varint,1,opt,name=RowID,proto3" json:"RowID,omitempty"` + ColumnID uint64 `protobuf:"varint,2,opt,name=ColumnID,proto3" json:"ColumnID,omitempty"` + Timestamp int64 `protobuf:"varint,3,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Bit) Reset() { *m = Bit{} } -func (m *Bit) String() string { return proto.CompactTextString(m) } -func (*Bit) ProtoMessage() {} -func (*Bit) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{6} } +func (m *Bit) Reset() { *m = Bit{} } +func (m *Bit) String() string { return proto.CompactTextString(m) } +func (*Bit) ProtoMessage() {} +func (*Bit) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{6} +} +func (m *Bit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Bit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Bit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Bit) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bit.Merge(dst, src) +} +func (m *Bit) XXX_Size() int { + return m.Size() +} +func (m *Bit) XXX_DiscardUnknown() { + xxx_messageInfo_Bit.DiscardUnknown(m) +} + +var xxx_messageInfo_Bit proto.InternalMessageInfo func (m *Bit) GetRowID() uint64 { if m != nil { @@ -238,15 +432,46 @@ func (m *Bit) GetTimestamp() int64 { } type ColumnAttrSet struct { - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - Key string `protobuf:"bytes,3,opt,name=Key,proto3" json:"Key,omitempty"` - Attrs []*Attr `protobuf:"bytes,2,rep,name=Attrs" json:"Attrs,omitempty"` + ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + Key string `protobuf:"bytes,3,opt,name=Key,proto3" json:"Key,omitempty"` + Attrs []*Attr `protobuf:"bytes,2,rep,name=Attrs" json:"Attrs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ColumnAttrSet) Reset() { *m = ColumnAttrSet{} } -func (m *ColumnAttrSet) String() string { return proto.CompactTextString(m) } -func (*ColumnAttrSet) ProtoMessage() {} -func (*ColumnAttrSet) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{7} } +func (m *ColumnAttrSet) Reset() { *m = ColumnAttrSet{} } +func (m *ColumnAttrSet) String() string { return proto.CompactTextString(m) } +func (*ColumnAttrSet) ProtoMessage() {} +func (*ColumnAttrSet) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{7} +} +func (m *ColumnAttrSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ColumnAttrSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ColumnAttrSet.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ColumnAttrSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_ColumnAttrSet.Merge(dst, src) +} +func (m *ColumnAttrSet) XXX_Size() int { + return m.Size() +} +func (m *ColumnAttrSet) XXX_DiscardUnknown() { + xxx_messageInfo_ColumnAttrSet.DiscardUnknown(m) +} + +var xxx_messageInfo_ColumnAttrSet proto.InternalMessageInfo func (m *ColumnAttrSet) GetID() uint64 { if m != nil { @@ -270,18 +495,49 @@ func (m *ColumnAttrSet) GetAttrs() []*Attr { } type Attr struct { - Key string `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` - Type uint64 `protobuf:"varint,2,opt,name=Type,proto3" json:"Type,omitempty"` - StringValue string `protobuf:"bytes,3,opt,name=StringValue,proto3" json:"StringValue,omitempty"` - IntValue int64 `protobuf:"varint,4,opt,name=IntValue,proto3" json:"IntValue,omitempty"` - BoolValue bool `protobuf:"varint,5,opt,name=BoolValue,proto3" json:"BoolValue,omitempty"` - FloatValue float64 `protobuf:"fixed64,6,opt,name=FloatValue,proto3" json:"FloatValue,omitempty"` + Key string `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` + Type uint64 `protobuf:"varint,2,opt,name=Type,proto3" json:"Type,omitempty"` + StringValue string `protobuf:"bytes,3,opt,name=StringValue,proto3" json:"StringValue,omitempty"` + IntValue int64 `protobuf:"varint,4,opt,name=IntValue,proto3" json:"IntValue,omitempty"` + BoolValue bool `protobuf:"varint,5,opt,name=BoolValue,proto3" json:"BoolValue,omitempty"` + FloatValue float64 `protobuf:"fixed64,6,opt,name=FloatValue,proto3" json:"FloatValue,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Attr) Reset() { *m = Attr{} } -func (m *Attr) String() string { return proto.CompactTextString(m) } -func (*Attr) ProtoMessage() {} -func (*Attr) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{8} } +func (m *Attr) Reset() { *m = Attr{} } +func (m *Attr) String() string { return proto.CompactTextString(m) } +func (*Attr) ProtoMessage() {} +func (*Attr) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{8} +} +func (m *Attr) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Attr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Attr.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Attr) XXX_Merge(src proto.Message) { + xxx_messageInfo_Attr.Merge(dst, src) +} +func (m *Attr) XXX_Size() int { + return m.Size() +} +func (m *Attr) XXX_DiscardUnknown() { + xxx_messageInfo_Attr.DiscardUnknown(m) +} + +var xxx_messageInfo_Attr proto.InternalMessageInfo func (m *Attr) GetKey() string { if m != nil { @@ -326,13 +582,44 @@ func (m *Attr) GetFloatValue() float64 { } type AttrMap struct { - Attrs []*Attr `protobuf:"bytes,1,rep,name=Attrs" json:"Attrs,omitempty"` + Attrs []*Attr `protobuf:"bytes,1,rep,name=Attrs" json:"Attrs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *AttrMap) Reset() { *m = AttrMap{} } -func (m *AttrMap) String() string { return proto.CompactTextString(m) } -func (*AttrMap) ProtoMessage() {} -func (*AttrMap) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{9} } +func (m *AttrMap) Reset() { *m = AttrMap{} } +func (m *AttrMap) String() string { return proto.CompactTextString(m) } +func (*AttrMap) ProtoMessage() {} +func (*AttrMap) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{9} +} +func (m *AttrMap) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AttrMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AttrMap.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *AttrMap) XXX_Merge(src proto.Message) { + xxx_messageInfo_AttrMap.Merge(dst, src) +} +func (m *AttrMap) XXX_Size() int { + return m.Size() +} +func (m *AttrMap) XXX_DiscardUnknown() { + xxx_messageInfo_AttrMap.DiscardUnknown(m) +} + +var xxx_messageInfo_AttrMap proto.InternalMessageInfo func (m *AttrMap) GetAttrs() []*Attr { if m != nil { @@ -342,18 +629,49 @@ func (m *AttrMap) GetAttrs() []*Attr { } type QueryRequest struct { - Query string `protobuf:"bytes,1,opt,name=Query,proto3" json:"Query,omitempty"` - Shards []uint64 `protobuf:"varint,2,rep,packed,name=Shards" json:"Shards,omitempty"` - ColumnAttrs bool `protobuf:"varint,3,opt,name=ColumnAttrs,proto3" json:"ColumnAttrs,omitempty"` - Remote bool `protobuf:"varint,5,opt,name=Remote,proto3" json:"Remote,omitempty"` - ExcludeRowAttrs bool `protobuf:"varint,6,opt,name=ExcludeRowAttrs,proto3" json:"ExcludeRowAttrs,omitempty"` - ExcludeColumns bool `protobuf:"varint,7,opt,name=ExcludeColumns,proto3" json:"ExcludeColumns,omitempty"` + Query string `protobuf:"bytes,1,opt,name=Query,proto3" json:"Query,omitempty"` + Shards []uint64 `protobuf:"varint,2,rep,packed,name=Shards" json:"Shards,omitempty"` + ColumnAttrs bool `protobuf:"varint,3,opt,name=ColumnAttrs,proto3" json:"ColumnAttrs,omitempty"` + Remote bool `protobuf:"varint,5,opt,name=Remote,proto3" json:"Remote,omitempty"` + ExcludeRowAttrs bool `protobuf:"varint,6,opt,name=ExcludeRowAttrs,proto3" json:"ExcludeRowAttrs,omitempty"` + ExcludeColumns bool `protobuf:"varint,7,opt,name=ExcludeColumns,proto3" json:"ExcludeColumns,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *QueryRequest) Reset() { *m = QueryRequest{} } -func (m *QueryRequest) String() string { return proto.CompactTextString(m) } -func (*QueryRequest) ProtoMessage() {} -func (*QueryRequest) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{10} } +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{10} +} +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(dst, src) +} +func (m *QueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo func (m *QueryRequest) GetQuery() string { if m != nil { @@ -398,15 +716,46 @@ func (m *QueryRequest) GetExcludeColumns() bool { } type QueryResponse struct { - Err string `protobuf:"bytes,1,opt,name=Err,proto3" json:"Err,omitempty"` - Results []*QueryResult `protobuf:"bytes,2,rep,name=Results" json:"Results,omitempty"` - ColumnAttrSets []*ColumnAttrSet `protobuf:"bytes,3,rep,name=ColumnAttrSets" json:"ColumnAttrSets,omitempty"` + Err string `protobuf:"bytes,1,opt,name=Err,proto3" json:"Err,omitempty"` + Results []*QueryResult `protobuf:"bytes,2,rep,name=Results" json:"Results,omitempty"` + ColumnAttrSets []*ColumnAttrSet `protobuf:"bytes,3,rep,name=ColumnAttrSets" json:"ColumnAttrSets,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *QueryResponse) Reset() { *m = QueryResponse{} } -func (m *QueryResponse) String() string { return proto.CompactTextString(m) } -func (*QueryResponse) ProtoMessage() {} -func (*QueryResponse) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{11} } +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{11} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(dst, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo func (m *QueryResponse) GetErr() string { if m != nil { @@ -430,21 +779,52 @@ func (m *QueryResponse) GetColumnAttrSets() []*ColumnAttrSet { } type QueryResult struct { - Type uint32 `protobuf:"varint,6,opt,name=Type,proto3" json:"Type,omitempty"` - Row *Row `protobuf:"bytes,1,opt,name=Row" json:"Row,omitempty"` - N uint64 `protobuf:"varint,2,opt,name=N,proto3" json:"N,omitempty"` - Pairs []*Pair `protobuf:"bytes,3,rep,name=Pairs" json:"Pairs,omitempty"` - Changed bool `protobuf:"varint,4,opt,name=Changed,proto3" json:"Changed,omitempty"` - ValCount *ValCount `protobuf:"bytes,5,opt,name=ValCount" json:"ValCount,omitempty"` - RowIDs []uint64 `protobuf:"varint,7,rep,packed,name=RowIDs" json:"RowIDs,omitempty"` - GroupCounts []*GroupCount `protobuf:"bytes,8,rep,name=GroupCounts" json:"GroupCounts,omitempty"` - RowIdentifiers *RowIdentifiers `protobuf:"bytes,9,opt,name=RowIdentifiers" json:"RowIdentifiers,omitempty"` + Type uint32 `protobuf:"varint,6,opt,name=Type,proto3" json:"Type,omitempty"` + Row *Row `protobuf:"bytes,1,opt,name=Row" json:"Row,omitempty"` + N uint64 `protobuf:"varint,2,opt,name=N,proto3" json:"N,omitempty"` + Pairs []*Pair `protobuf:"bytes,3,rep,name=Pairs" json:"Pairs,omitempty"` + Changed bool `protobuf:"varint,4,opt,name=Changed,proto3" json:"Changed,omitempty"` + ValCount *ValCount `protobuf:"bytes,5,opt,name=ValCount" json:"ValCount,omitempty"` + RowIDs []uint64 `protobuf:"varint,7,rep,packed,name=RowIDs" json:"RowIDs,omitempty"` + GroupCounts []*GroupCount `protobuf:"bytes,8,rep,name=GroupCounts" json:"GroupCounts,omitempty"` + RowIdentifiers *RowIdentifiers `protobuf:"bytes,9,opt,name=RowIdentifiers" json:"RowIdentifiers,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *QueryResult) Reset() { *m = QueryResult{} } -func (m *QueryResult) String() string { return proto.CompactTextString(m) } -func (*QueryResult) ProtoMessage() {} -func (*QueryResult) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{12} } +func (m *QueryResult) Reset() { *m = QueryResult{} } +func (m *QueryResult) String() string { return proto.CompactTextString(m) } +func (*QueryResult) ProtoMessage() {} +func (*QueryResult) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{12} +} +func (m *QueryResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResult.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *QueryResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResult.Merge(dst, src) +} +func (m *QueryResult) XXX_Size() int { + return m.Size() +} +func (m *QueryResult) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResult.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResult proto.InternalMessageInfo func (m *QueryResult) GetType() uint32 { if m != nil { @@ -510,20 +890,51 @@ func (m *QueryResult) GetRowIdentifiers() *RowIdentifiers { } type ImportRequest struct { - Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` - Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` - Shard uint64 `protobuf:"varint,3,opt,name=Shard,proto3" json:"Shard,omitempty"` - RowIDs []uint64 `protobuf:"varint,4,rep,packed,name=RowIDs" json:"RowIDs,omitempty"` - ColumnIDs []uint64 `protobuf:"varint,5,rep,packed,name=ColumnIDs" json:"ColumnIDs,omitempty"` - RowKeys []string `protobuf:"bytes,7,rep,name=RowKeys" json:"RowKeys,omitempty"` - ColumnKeys []string `protobuf:"bytes,8,rep,name=ColumnKeys" json:"ColumnKeys,omitempty"` - Timestamps []int64 `protobuf:"varint,6,rep,packed,name=Timestamps" json:"Timestamps,omitempty"` + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + Shard uint64 `protobuf:"varint,3,opt,name=Shard,proto3" json:"Shard,omitempty"` + RowIDs []uint64 `protobuf:"varint,4,rep,packed,name=RowIDs" json:"RowIDs,omitempty"` + ColumnIDs []uint64 `protobuf:"varint,5,rep,packed,name=ColumnIDs" json:"ColumnIDs,omitempty"` + RowKeys []string `protobuf:"bytes,7,rep,name=RowKeys" json:"RowKeys,omitempty"` + ColumnKeys []string `protobuf:"bytes,8,rep,name=ColumnKeys" json:"ColumnKeys,omitempty"` + Timestamps []int64 `protobuf:"varint,6,rep,packed,name=Timestamps" json:"Timestamps,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ImportRequest) Reset() { *m = ImportRequest{} } -func (m *ImportRequest) String() string { return proto.CompactTextString(m) } -func (*ImportRequest) ProtoMessage() {} -func (*ImportRequest) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{13} } +func (m *ImportRequest) Reset() { *m = ImportRequest{} } +func (m *ImportRequest) String() string { return proto.CompactTextString(m) } +func (*ImportRequest) ProtoMessage() {} +func (*ImportRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{13} +} +func (m *ImportRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ImportRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ImportRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ImportRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImportRequest.Merge(dst, src) +} +func (m *ImportRequest) XXX_Size() int { + return m.Size() +} +func (m *ImportRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ImportRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ImportRequest proto.InternalMessageInfo func (m *ImportRequest) GetIndex() string { if m != nil { @@ -582,18 +993,49 @@ func (m *ImportRequest) GetTimestamps() []int64 { } type ImportValueRequest struct { - Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` - Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` - Shard uint64 `protobuf:"varint,3,opt,name=Shard,proto3" json:"Shard,omitempty"` - ColumnIDs []uint64 `protobuf:"varint,5,rep,packed,name=ColumnIDs" json:"ColumnIDs,omitempty"` - ColumnKeys []string `protobuf:"bytes,7,rep,name=ColumnKeys" json:"ColumnKeys,omitempty"` - Values []int64 `protobuf:"varint,6,rep,packed,name=Values" json:"Values,omitempty"` + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + Shard uint64 `protobuf:"varint,3,opt,name=Shard,proto3" json:"Shard,omitempty"` + ColumnIDs []uint64 `protobuf:"varint,5,rep,packed,name=ColumnIDs" json:"ColumnIDs,omitempty"` + ColumnKeys []string `protobuf:"bytes,7,rep,name=ColumnKeys" json:"ColumnKeys,omitempty"` + Values []int64 `protobuf:"varint,6,rep,packed,name=Values" json:"Values,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ImportValueRequest) Reset() { *m = ImportValueRequest{} } -func (m *ImportValueRequest) String() string { return proto.CompactTextString(m) } -func (*ImportValueRequest) ProtoMessage() {} -func (*ImportValueRequest) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{14} } +func (m *ImportValueRequest) Reset() { *m = ImportValueRequest{} } +func (m *ImportValueRequest) String() string { return proto.CompactTextString(m) } +func (*ImportValueRequest) ProtoMessage() {} +func (*ImportValueRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_public_fc5da89825239896, []int{14} +} +func (m *ImportValueRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ImportValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ImportValueRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ImportValueRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImportValueRequest.Merge(dst, src) +} +func (m *ImportValueRequest) XXX_Size() int { + return m.Size() +} +func (m *ImportValueRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ImportValueRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ImportValueRequest proto.InternalMessageInfo func (m *ImportValueRequest) GetIndex() string { if m != nil { @@ -713,6 +1155,9 @@ func (m *Row) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], s) } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -763,6 +1208,9 @@ func (m *RowIdentifiers) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], s) } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -797,6 +1245,9 @@ func (m *Pair) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPublic(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 } @@ -826,6 +1277,9 @@ func (m *FieldRow) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintPublic(dAtA, i, uint64(m.RowID)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -861,6 +1315,9 @@ func (m *GroupCount) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintPublic(dAtA, i, uint64(m.Count)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -889,6 +1346,9 @@ func (m *ValCount) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintPublic(dAtA, i, uint64(m.Count)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -922,6 +1382,9 @@ func (m *Bit) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintPublic(dAtA, i, uint64(m.Timestamp)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -963,6 +1426,9 @@ func (m *ColumnAttrSet) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPublic(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 } @@ -1016,9 +1482,12 @@ func (m *Attr) MarshalTo(dAtA []byte) (int, error) { if m.FloatValue != 0 { dAtA[i] = 0x31 i++ - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.FloatValue)))) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.FloatValue)))) i += 8 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1049,6 +1518,9 @@ func (m *AttrMap) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1130,6 +1602,9 @@ func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error) { } i++ } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1178,6 +1653,9 @@ func (m *QueryResponse) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1287,6 +1765,9 @@ func (m *QueryResult) MarshalTo(dAtA []byte) (int, error) { } i += n11 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1404,6 +1885,9 @@ func (m *ImportRequest) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], s) } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1489,6 +1973,9 @@ func (m *ImportValueRequest) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], s) } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -1502,6 +1989,9 @@ func encodeVarintPublic(dAtA []byte, offset int, v uint64) int { return offset + 1 } func (m *Row) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.Columns) > 0 { @@ -1523,10 +2013,16 @@ func (m *Row) Size() (n int) { n += 1 + l + sovPublic(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *RowIdentifiers) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.Rows) > 0 { @@ -1542,10 +2038,16 @@ func (m *RowIdentifiers) Size() (n int) { n += 1 + l + sovPublic(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Pair) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { @@ -1558,10 +2060,16 @@ func (m *Pair) Size() (n int) { if l > 0 { n += 1 + l + sovPublic(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *FieldRow) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Field) @@ -1571,10 +2079,16 @@ func (m *FieldRow) Size() (n int) { if m.RowID != 0 { n += 1 + sovPublic(uint64(m.RowID)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *GroupCount) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.Group) > 0 { @@ -1586,10 +2100,16 @@ func (m *GroupCount) Size() (n int) { if m.Count != 0 { n += 1 + sovPublic(uint64(m.Count)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ValCount) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Val != 0 { @@ -1598,10 +2118,16 @@ func (m *ValCount) Size() (n int) { if m.Count != 0 { n += 1 + sovPublic(uint64(m.Count)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Bit) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.RowID != 0 { @@ -1613,10 +2139,16 @@ func (m *Bit) Size() (n int) { if m.Timestamp != 0 { n += 1 + sovPublic(uint64(m.Timestamp)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ColumnAttrSet) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.ID != 0 { @@ -1632,10 +2164,16 @@ func (m *ColumnAttrSet) Size() (n int) { if l > 0 { n += 1 + l + sovPublic(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Attr) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Key) @@ -1658,10 +2196,16 @@ func (m *Attr) Size() (n int) { if m.FloatValue != 0 { n += 9 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *AttrMap) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.Attrs) > 0 { @@ -1670,10 +2214,16 @@ func (m *AttrMap) Size() (n int) { n += 1 + l + sovPublic(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Query) @@ -1699,10 +2249,16 @@ func (m *QueryRequest) Size() (n int) { if m.ExcludeColumns { n += 2 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Err) @@ -1721,10 +2277,16 @@ func (m *QueryResponse) Size() (n int) { n += 1 + l + sovPublic(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *QueryResult) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Row != nil { @@ -1767,10 +2329,16 @@ func (m *QueryResult) Size() (n int) { l = m.RowIdentifiers.Size() n += 1 + l + sovPublic(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ImportRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Index) @@ -1817,10 +2385,16 @@ func (m *ImportRequest) Size() (n int) { n += 1 + l + sovPublic(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ImportValueRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Index) @@ -1854,6 +2428,9 @@ func (m *ImportValueRequest) Size() (n int) { n += 1 + l + sovPublic(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -1940,6 +2517,17 @@ func (m *Row) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Columns) == 0 { + m.Columns = make([]uint64, 0, elementCount) + } for iNdEx < postIndex { var v uint64 for shift := uint(0); ; shift += 7 { @@ -2033,6 +2621,7 @@ func (m *Row) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2112,6 +2701,17 @@ func (m *RowIdentifiers) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Rows) == 0 { + m.Rows = make([]uint64, 0, elementCount) + } for iNdEx < postIndex { var v uint64 for shift := uint(0); ; shift += 7 { @@ -2174,6 +2774,7 @@ func (m *RowIdentifiers) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2291,6 +2892,7 @@ func (m *Pair) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2389,6 +2991,7 @@ func (m *FieldRow) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2489,6 +3092,7 @@ func (m *GroupCount) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2577,6 +3181,7 @@ func (m *ValCount) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2684,6 +3289,7 @@ func (m *Bit) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2813,6 +3419,7 @@ func (m *ColumnAttrSet) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2975,7 +3582,7 @@ func (m *Attr) Unmarshal(dAtA []byte) error { if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.FloatValue = float64(math.Float64frombits(v)) default: @@ -2990,6 +3597,7 @@ func (m *Attr) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -3071,6 +3679,7 @@ func (m *AttrMap) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -3179,6 +3788,17 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Shards) == 0 { + m.Shards = make([]uint64, 0, elementCount) + } for iNdEx < postIndex { var v uint64 for shift := uint(0); ; shift += 7 { @@ -3292,6 +3912,7 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -3433,6 +4054,7 @@ func (m *QueryResponse) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -3667,6 +4289,17 @@ func (m *QueryResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.RowIDs) == 0 { + m.RowIDs = make([]uint64, 0, elementCount) + } for iNdEx < postIndex { var v uint64 for shift := uint(0); ; shift += 7 { @@ -3764,6 +4397,7 @@ func (m *QueryResult) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -3920,6 +4554,17 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.RowIDs) == 0 { + m.RowIDs = make([]uint64, 0, elementCount) + } for iNdEx < postIndex { var v uint64 for shift := uint(0); ; shift += 7 { @@ -3982,6 +4627,17 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.ColumnIDs) == 0 { + m.ColumnIDs = make([]uint64, 0, elementCount) + } for iNdEx < postIndex { var v uint64 for shift := uint(0); ; shift += 7 { @@ -4044,6 +4700,17 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Timestamps) == 0 { + m.Timestamps = make([]int64, 0, elementCount) + } for iNdEx < postIndex { var v int64 for shift := uint(0); ; shift += 7 { @@ -4135,6 +4802,7 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -4291,6 +4959,17 @@ func (m *ImportValueRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.ColumnIDs) == 0 { + m.ColumnIDs = make([]uint64, 0, elementCount) + } for iNdEx < postIndex { var v uint64 for shift := uint(0); ; shift += 7 { @@ -4353,6 +5032,17 @@ func (m *ImportValueRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Values) == 0 { + m.Values = make([]int64, 0, elementCount) + } for iNdEx < postIndex { var v int64 for shift := uint(0); ; shift += 7 { @@ -4415,6 +5105,7 @@ func (m *ImportValueRequest) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -4529,9 +5220,9 @@ var ( ErrIntOverflowPublic = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("public.proto", fileDescriptorPublic) } +func init() { proto.RegisterFile("public.proto", fileDescriptor_public_fc5da89825239896) } -var fileDescriptorPublic = []byte{ +var fileDescriptor_public_fc5da89825239896 = []byte{ // 804 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcb, 0x6e, 0xdb, 0x46, 0x14, 0xed, 0x88, 0x94, 0x44, 0x5d, 0x59, 0xaa, 0x31, 0x70, 0x5d, 0xa2, 0x30, 0x54, 0x82, 0x28, From 5b30393bc9dae2bd189b91e27b24ec7da3ce50b1 Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Tue, 6 Nov 2018 14:09:33 -0600 Subject: [PATCH 13/18] upgrade peg at: github.com/pointlander/peg --- pql/pql.peg.go | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/pql/pql.peg.go b/pql/pql.peg.go index 2d5877fbb..9523aa2bb 100644 --- a/pql/pql.peg.go +++ b/pql/pql.peg.go @@ -4,7 +4,9 @@ package pql import ( "fmt" + "io" "math" + "os" "sort" "strconv" ) @@ -210,7 +212,7 @@ type node32 struct { up, next *node32 } -func (node *node32) print(pretty bool, buffer string) { +func (node *node32) print(w io.Writer, pretty bool, buffer string) { var print func(node *node32, depth int) print = func(node *node32, depth int) { for node != nil { @@ -220,9 +222,9 @@ func (node *node32) print(pretty bool, buffer string) { rule := rul3s[node.pegRule] quote := strconv.Quote(string(([]rune(buffer)[node.begin:node.end]))) if !pretty { - fmt.Printf("%v %v\n", rule, quote) + fmt.Fprintf(w, "%v %v\n", rule, quote) } else { - fmt.Printf("\x1B[34m%v\x1B[m %v\n", rule, quote) + fmt.Fprintf(w, "\x1B[34m%v\x1B[m %v\n", rule, quote) } if node.up != nil { print(node.up, depth+1) @@ -233,12 +235,12 @@ func (node *node32) print(pretty bool, buffer string) { print(node, 0) } -func (node *node32) Print(buffer string) { - node.print(false, buffer) +func (node *node32) Print(w io.Writer, buffer string) { + node.print(w, false, buffer) } -func (node *node32) PrettyPrint(buffer string) { - node.print(true, buffer) +func (node *node32) PrettyPrint(w io.Writer, buffer string) { + node.print(w, true, buffer) } type tokens32 struct { @@ -281,11 +283,15 @@ func (t *tokens32) AST() *node32 { } func (t *tokens32) PrintSyntaxTree(buffer string) { - t.AST().Print(buffer) + t.AST().Print(os.Stdout, buffer) +} + +func (t *tokens32) WriteSyntaxTree(w io.Writer, buffer string) { + t.AST().Print(w, buffer) } func (t *tokens32) PrettyPrintSyntaxTree(buffer string) { - t.AST().PrettyPrint(buffer) + t.AST().PrettyPrint(os.Stdout, buffer) } func (t *tokens32) Add(rule pegRule, begin, end, index uint32) { @@ -393,6 +399,10 @@ func (p *PQL) PrintSyntaxTree() { } } +func (p *PQL) WriteSyntaxTree(w io.Writer) { + p.tokens32.WriteSyntaxTree(w, p.Buffer) +} + func (p *PQL) Execute() { buffer, _buffer, text, begin, end := p.Buffer, p.buffer, "", 0, 0 for _, token := range p.Tokens() { From cad9d83c4077e0af38cf1cbb9241b4f8dee9085c Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 7 Nov 2018 01:10:58 +0300 Subject: [PATCH 14/18] fix double escapes --- pql/parser_test.go | 4 +- pql/pql.peg | 4 +- pql/pql.peg.go | 610 +++++++++++++++++++++++---------------------- 3 files changed, 315 insertions(+), 303 deletions(-) diff --git a/pql/parser_test.go b/pql/parser_test.go index e88244f70..416746691 100644 --- a/pql/parser_test.go +++ b/pql/parser_test.go @@ -75,7 +75,7 @@ func TestParser_Parse(t *testing.T) { // Parse with only arguments. t.Run("ArgumentsOnly", func(t *testing.T) { - q, err := pql.ParseString(`MyCall( key= value, foo='bar', age = 12 , bool0=true, bool1=false, x=null, escape="\" \\escape\n" )`) + q, err := pql.ParseString(`MyCall( key= value, foo='bar', age = 12 , bool0=true, bool1=false, x=null, escape="\" \\escape\n\\\\" )`) if err != nil { t.Fatal(err) } else if !reflect.DeepEqual(q.Calls[0], @@ -88,7 +88,7 @@ func TestParser_Parse(t *testing.T) { "bool0": true, "bool1": false, "x": nil, - "escape": "\" \\escape\n", + "escape": "\" \\escape\n\\\\", }, }, ) { diff --git a/pql/pql.peg b/pql/pql.peg index 3f151c334..f136ad764 100644 --- a/pql/pql.peg +++ b/pql/pql.peg @@ -49,8 +49,8 @@ item <- ( 'null' &(comma / sp close) { p.addVal(nil) } / '\'' < singlequotedstring > '\'' { p.addVal(buffer[begin:end]) } ) -doublequotedstring <- ( '\\\"' / [^"] )* -singlequotedstring <- ( '\\\'' / [^'] )* +doublequotedstring <- ( '\\"' / '\\\\' / [^"] )* +singlequotedstring <- ( '\\\'' / '\\\\' / [^'] )* fieldExpr <- [[A-Z]] ( [[A-Z]] / [0-9] / '_' / '-' )* field <- { p.addField(buffer[begin:end]) } diff --git a/pql/pql.peg.go b/pql/pql.peg.go index 402286c77..5577142bf 100644 --- a/pql/pql.peg.go +++ b/pql/pql.peg.go @@ -4,9 +4,7 @@ package pql import ( "fmt" - "io" "math" - "os" "sort" "strconv" ) @@ -212,7 +210,7 @@ type node32 struct { up, next *node32 } -func (node *node32) print(w io.Writer, pretty bool, buffer string) { +func (node *node32) print(pretty bool, buffer string) { var print func(node *node32, depth int) print = func(node *node32, depth int) { for node != nil { @@ -222,9 +220,9 @@ func (node *node32) print(w io.Writer, pretty bool, buffer string) { rule := rul3s[node.pegRule] quote := strconv.Quote(string(([]rune(buffer)[node.begin:node.end]))) if !pretty { - fmt.Fprintf(w, "%v %v\n", rule, quote) + fmt.Printf("%v %v\n", rule, quote) } else { - fmt.Fprintf(w, "\x1B[34m%v\x1B[m %v\n", rule, quote) + fmt.Printf("\x1B[34m%v\x1B[m %v\n", rule, quote) } if node.up != nil { print(node.up, depth+1) @@ -235,12 +233,12 @@ func (node *node32) print(w io.Writer, pretty bool, buffer string) { print(node, 0) } -func (node *node32) Print(w io.Writer, buffer string) { - node.print(w, false, buffer) +func (node *node32) Print(buffer string) { + node.print(false, buffer) } -func (node *node32) PrettyPrint(w io.Writer, buffer string) { - node.print(w, true, buffer) +func (node *node32) PrettyPrint(buffer string) { + node.print(true, buffer) } type tokens32 struct { @@ -283,15 +281,11 @@ func (t *tokens32) AST() *node32 { } func (t *tokens32) PrintSyntaxTree(buffer string) { - t.AST().Print(os.Stdout, buffer) -} - -func (t *tokens32) WriteSyntaxTree(w io.Writer, buffer string) { - t.AST().Print(w, buffer) + t.AST().Print(buffer) } func (t *tokens32) PrettyPrintSyntaxTree(buffer string) { - t.AST().PrettyPrint(os.Stdout, buffer) + t.AST().PrettyPrint(buffer) } func (t *tokens32) Add(rule pegRule, begin, end, index uint32) { @@ -399,10 +393,6 @@ func (p *PQL) PrintSyntaxTree() { } } -func (p *PQL) WriteSyntaxTree(w io.Writer) { - p.tokens32.WriteSyntaxTree(w, p.Buffer) -} - func (p *PQL) Execute() { buffer, _buffer, text, begin, end := p.Buffer, p.buffer, "", 0, 0 for _, token := range p.Tokens() { @@ -2118,7 +2108,7 @@ func (p *PQL) Init() { position, tokenIndex = position140, tokenIndex140 return false }, - /* 14 doublequotedstring <- <(('\\' '"') / (!'"' .))*> */ + /* 14 doublequotedstring <- <(('\\' '"') / ('\\' '\\') / (!'"' .))*> */ func() bool { { position199 := position @@ -2137,16 +2127,27 @@ func (p *PQL) Init() { position++ goto l202 l203: + position, tokenIndex = position202, tokenIndex202 + if buffer[position] != rune('\\') { + goto l204 + } + position++ + if buffer[position] != rune('\\') { + goto l204 + } + position++ + goto l202 + l204: position, tokenIndex = position202, tokenIndex202 { - position204, tokenIndex204 := position, tokenIndex + position205, tokenIndex205 := position, tokenIndex if buffer[position] != rune('"') { - goto l204 + goto l205 } position++ goto l201 - l204: - position, tokenIndex = position204, tokenIndex204 + l205: + position, tokenIndex = position205, tokenIndex205 } if !matchDot() { goto l201 @@ -2161,536 +2162,547 @@ func (p *PQL) Init() { } return true }, - /* 15 singlequotedstring <- <(('\\' '\'') / (!'\'' .))*> */ + /* 15 singlequotedstring <- <(('\\' '\'') / ('\\' '\\') / (!'\'' .))*> */ func() bool { { - position206 := position - l207: + position207 := position + l208: { - position208, tokenIndex208 := position, tokenIndex + position209, tokenIndex209 := position, tokenIndex { - position209, tokenIndex209 := position, tokenIndex + position210, tokenIndex210 := position, tokenIndex if buffer[position] != rune('\\') { - goto l210 + goto l211 } position++ if buffer[position] != rune('\'') { - goto l210 + goto l211 } position++ - goto l209 - l210: - position, tokenIndex = position209, tokenIndex209 + goto l210 + l211: + position, tokenIndex = position210, tokenIndex210 + if buffer[position] != rune('\\') { + goto l212 + } + position++ + if buffer[position] != rune('\\') { + goto l212 + } + position++ + goto l210 + l212: + position, tokenIndex = position210, tokenIndex210 { - position211, tokenIndex211 := position, tokenIndex + position213, tokenIndex213 := position, tokenIndex if buffer[position] != rune('\'') { - goto l211 + goto l213 } position++ - goto l208 - l211: - position, tokenIndex = position211, tokenIndex211 + goto l209 + l213: + position, tokenIndex = position213, tokenIndex213 } if !matchDot() { - goto l208 + goto l209 } } + l210: + goto l208 l209: - goto l207 - l208: - position, tokenIndex = position208, tokenIndex208 + position, tokenIndex = position209, tokenIndex209 } - add(rulesinglequotedstring, position206) + add(rulesinglequotedstring, position207) } return true }, /* 16 fieldExpr <- <(([a-z] / [A-Z]) ([a-z] / [A-Z] / [0-9] / '_' / '-')*)> */ func() bool { - position212, tokenIndex212 := position, tokenIndex + position214, tokenIndex214 := position, tokenIndex { - position213 := position + position215 := position { - position214, tokenIndex214 := position, tokenIndex + position216, tokenIndex216 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l215 + goto l217 } position++ - goto l214 - l215: - position, tokenIndex = position214, tokenIndex214 + goto l216 + l217: + position, tokenIndex = position216, tokenIndex216 if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l212 + goto l214 } position++ } - l214: l216: + l218: { - position217, tokenIndex217 := position, tokenIndex + position219, tokenIndex219 := position, tokenIndex { - position218, tokenIndex218 := position, tokenIndex + position220, tokenIndex220 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { - goto l219 - } - position++ - goto l218 - l219: - position, tokenIndex = position218, tokenIndex218 - if c := buffer[position]; c < rune('A') || c > rune('Z') { - goto l220 - } - position++ - goto l218 - l220: - position, tokenIndex = position218, tokenIndex218 - if c := buffer[position]; c < rune('0') || c > rune('9') { goto l221 } position++ - goto l218 + goto l220 l221: - position, tokenIndex = position218, tokenIndex218 - if buffer[position] != rune('_') { + position, tokenIndex = position220, tokenIndex220 + if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l222 } position++ - goto l218 + goto l220 l222: - position, tokenIndex = position218, tokenIndex218 + position, tokenIndex = position220, tokenIndex220 + if c := buffer[position]; c < rune('0') || c > rune('9') { + goto l223 + } + position++ + goto l220 + l223: + position, tokenIndex = position220, tokenIndex220 + if buffer[position] != rune('_') { + goto l224 + } + position++ + goto l220 + l224: + position, tokenIndex = position220, tokenIndex220 if buffer[position] != rune('-') { - goto l217 + goto l219 } position++ } - l218: - goto l216 - l217: - position, tokenIndex = position217, tokenIndex217 + l220: + goto l218 + l219: + position, tokenIndex = position219, tokenIndex219 } - add(rulefieldExpr, position213) + add(rulefieldExpr, position215) } return true - l212: - position, tokenIndex = position212, tokenIndex212 + l214: + position, tokenIndex = position214, tokenIndex214 return false }, /* 17 field <- <(<(fieldExpr / reserved)> Action42)> */ func() bool { - position223, tokenIndex223 := position, tokenIndex + position225, tokenIndex225 := position, tokenIndex { - position224 := position + position226 := position { - position225 := position + position227 := position { - position226, tokenIndex226 := position, tokenIndex + position228, tokenIndex228 := position, tokenIndex if !_rules[rulefieldExpr]() { - goto l227 + goto l229 } - goto l226 - l227: - position, tokenIndex = position226, tokenIndex226 + goto l228 + l229: + position, tokenIndex = position228, tokenIndex228 { - position228 := position + position230 := position { - position229, tokenIndex229 := position, tokenIndex + position231, tokenIndex231 := position, tokenIndex if buffer[position] != rune('_') { - goto l230 + goto l232 } position++ if buffer[position] != rune('r') { - goto l230 + goto l232 } position++ if buffer[position] != rune('o') { - goto l230 + goto l232 } position++ if buffer[position] != rune('w') { - goto l230 + goto l232 } position++ - goto l229 - l230: - position, tokenIndex = position229, tokenIndex229 + goto l231 + l232: + position, tokenIndex = position231, tokenIndex231 if buffer[position] != rune('_') { - goto l231 + goto l233 } position++ if buffer[position] != rune('c') { - goto l231 + goto l233 } position++ if buffer[position] != rune('o') { - goto l231 + goto l233 } position++ if buffer[position] != rune('l') { - goto l231 + goto l233 } position++ - goto l229 - l231: - position, tokenIndex = position229, tokenIndex229 + goto l231 + l233: + position, tokenIndex = position231, tokenIndex231 if buffer[position] != rune('_') { - goto l232 + goto l234 } position++ if buffer[position] != rune('s') { - goto l232 + goto l234 } position++ if buffer[position] != rune('t') { - goto l232 + goto l234 } position++ if buffer[position] != rune('a') { - goto l232 + goto l234 } position++ if buffer[position] != rune('r') { - goto l232 + goto l234 } position++ if buffer[position] != rune('t') { - goto l232 + goto l234 } position++ - goto l229 - l232: - position, tokenIndex = position229, tokenIndex229 + goto l231 + l234: + position, tokenIndex = position231, tokenIndex231 if buffer[position] != rune('_') { - goto l233 + goto l235 } position++ if buffer[position] != rune('e') { - goto l233 + goto l235 } position++ if buffer[position] != rune('n') { - goto l233 + goto l235 } position++ if buffer[position] != rune('d') { - goto l233 + goto l235 } position++ - goto l229 - l233: - position, tokenIndex = position229, tokenIndex229 + goto l231 + l235: + position, tokenIndex = position231, tokenIndex231 if buffer[position] != rune('_') { - goto l234 + goto l236 } position++ if buffer[position] != rune('t') { - goto l234 + goto l236 } position++ if buffer[position] != rune('i') { - goto l234 + goto l236 } position++ if buffer[position] != rune('m') { - goto l234 + goto l236 } position++ if buffer[position] != rune('e') { - goto l234 + goto l236 } position++ if buffer[position] != rune('s') { - goto l234 + goto l236 } position++ if buffer[position] != rune('t') { - goto l234 + goto l236 } position++ if buffer[position] != rune('a') { - goto l234 + goto l236 } position++ if buffer[position] != rune('m') { - goto l234 + goto l236 } position++ if buffer[position] != rune('p') { - goto l234 + goto l236 } position++ - goto l229 - l234: - position, tokenIndex = position229, tokenIndex229 + goto l231 + l236: + position, tokenIndex = position231, tokenIndex231 if buffer[position] != rune('_') { - goto l223 + goto l225 } position++ if buffer[position] != rune('f') { - goto l223 + goto l225 } position++ if buffer[position] != rune('i') { - goto l223 + goto l225 } position++ if buffer[position] != rune('e') { - goto l223 + goto l225 } position++ if buffer[position] != rune('l') { - goto l223 + goto l225 } position++ if buffer[position] != rune('d') { - goto l223 + goto l225 } position++ } - l229: - add(rulereserved, position228) + l231: + add(rulereserved, position230) } } - l226: - add(rulePegText, position225) + l228: + add(rulePegText, position227) } { add(ruleAction42, position) } - add(rulefield, position224) + add(rulefield, position226) } return true - l223: - position, tokenIndex = position223, tokenIndex223 + l225: + position, tokenIndex = position225, tokenIndex225 return false }, /* 18 reserved <- <(('_' 'r' 'o' 'w') / ('_' 'c' 'o' 'l') / ('_' 's' 't' 'a' 'r' 't') / ('_' 'e' 'n' 'd') / ('_' 't' 'i' 'm' 'e' 's' 't' 'a' 'm' 'p') / ('_' 'f' 'i' 'e' 'l' 'd'))> */ nil, /* 19 posfield <- <( Action43)> */ func() bool { - position237, tokenIndex237 := position, tokenIndex + position239, tokenIndex239 := position, tokenIndex { - position238 := position + position240 := position { - position239 := position + position241 := position if !_rules[rulefieldExpr]() { - goto l237 + goto l239 } - add(rulePegText, position239) + add(rulePegText, position241) } { add(ruleAction43, position) } - add(ruleposfield, position238) + add(ruleposfield, position240) } return true - l237: - position, tokenIndex = position237, tokenIndex237 + l239: + position, tokenIndex = position239, tokenIndex239 return false }, /* 20 uint <- <(([1-9] [0-9]*) / '0')> */ func() bool { - position241, tokenIndex241 := position, tokenIndex + position243, tokenIndex243 := position, tokenIndex { - position242 := position + position244 := position { - position243, tokenIndex243 := position, tokenIndex + position245, tokenIndex245 := position, tokenIndex if c := buffer[position]; c < rune('1') || c > rune('9') { - goto l244 + goto l246 } position++ - l245: + l247: { - position246, tokenIndex246 := position, tokenIndex + position248, tokenIndex248 := position, tokenIndex if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l246 + goto l248 } position++ - goto l245 - l246: - position, tokenIndex = position246, tokenIndex246 + goto l247 + l248: + position, tokenIndex = position248, tokenIndex248 } - goto l243 - l244: - position, tokenIndex = position243, tokenIndex243 + goto l245 + l246: + position, tokenIndex = position245, tokenIndex245 if buffer[position] != rune('0') { - goto l241 + goto l243 } position++ } - l243: - add(ruleuint, position242) + l245: + add(ruleuint, position244) } return true - l241: - position, tokenIndex = position241, tokenIndex241 + l243: + position, tokenIndex = position243, tokenIndex243 return false }, /* 21 uintrow <- <( Action44)> */ nil, /* 22 col <- <(( Action45) / ('\'' '\'' Action46) / ('"' '"' Action47))> */ func() bool { - position248, tokenIndex248 := position, tokenIndex + position250, tokenIndex250 := position, tokenIndex { - position249 := position + position251 := position { - position250, tokenIndex250 := position, tokenIndex + position252, tokenIndex252 := position, tokenIndex { - position252 := position + position254 := position if !_rules[ruleuint]() { - goto l251 + goto l253 } - add(rulePegText, position252) + add(rulePegText, position254) } { add(ruleAction45, position) } - goto l250 - l251: - position, tokenIndex = position250, tokenIndex250 + goto l252 + l253: + position, tokenIndex = position252, tokenIndex252 if buffer[position] != rune('\'') { - goto l254 + goto l256 } position++ { - position255 := position + position257 := position if !_rules[rulesinglequotedstring]() { - goto l254 + goto l256 } - add(rulePegText, position255) + add(rulePegText, position257) } if buffer[position] != rune('\'') { - goto l254 + goto l256 } position++ { add(ruleAction46, position) } - goto l250 - l254: - position, tokenIndex = position250, tokenIndex250 + goto l252 + l256: + position, tokenIndex = position252, tokenIndex252 if buffer[position] != rune('"') { - goto l248 + goto l250 } position++ { - position257 := position + position259 := position if !_rules[ruledoublequotedstring]() { - goto l248 + goto l250 } - add(rulePegText, position257) + add(rulePegText, position259) } if buffer[position] != rune('"') { - goto l248 + goto l250 } position++ { add(ruleAction47, position) } } - l250: - add(rulecol, position249) + l252: + add(rulecol, position251) } return true - l248: - position, tokenIndex = position248, tokenIndex248 + l250: + position, tokenIndex = position250, tokenIndex250 return false }, /* 23 row <- <(( Action48) / ('\'' '\'' Action49) / ('"' '"' Action50))> */ nil, /* 24 open <- <('(' sp)> */ - func() bool { - position260, tokenIndex260 := position, tokenIndex - { - position261 := position - if buffer[position] != rune('(') { - goto l260 - } - position++ - if !_rules[rulesp]() { - goto l260 - } - add(ruleopen, position261) - } - return true - l260: - position, tokenIndex = position260, tokenIndex260 - return false - }, - /* 25 close <- <(')' sp)> */ func() bool { position262, tokenIndex262 := position, tokenIndex { position263 := position - if buffer[position] != rune(')') { + if buffer[position] != rune('(') { goto l262 } position++ if !_rules[rulesp]() { goto l262 } - add(ruleclose, position263) + add(ruleopen, position263) } return true l262: position, tokenIndex = position262, tokenIndex262 return false }, + /* 25 close <- <(')' sp)> */ + func() bool { + position264, tokenIndex264 := position, tokenIndex + { + position265 := position + if buffer[position] != rune(')') { + goto l264 + } + position++ + if !_rules[rulesp]() { + goto l264 + } + add(ruleclose, position265) + } + return true + l264: + position, tokenIndex = position264, tokenIndex264 + return false + }, /* 26 sp <- <(' ' / '\t' / '\n')*> */ func() bool { { - position265 := position - l266: + position267 := position + l268: { - position267, tokenIndex267 := position, tokenIndex + position269, tokenIndex269 := position, tokenIndex { - position268, tokenIndex268 := position, tokenIndex + position270, tokenIndex270 := position, tokenIndex if buffer[position] != rune(' ') { + goto l271 + } + position++ + goto l270 + l271: + position, tokenIndex = position270, tokenIndex270 + if buffer[position] != rune('\t') { + goto l272 + } + position++ + goto l270 + l272: + position, tokenIndex = position270, tokenIndex270 + if buffer[position] != rune('\n') { goto l269 } position++ - goto l268 - l269: - position, tokenIndex = position268, tokenIndex268 - if buffer[position] != rune('\t') { - goto l270 - } - position++ - goto l268 - l270: - position, tokenIndex = position268, tokenIndex268 - if buffer[position] != rune('\n') { - goto l267 - } - position++ } - l268: - goto l266 - l267: - position, tokenIndex = position267, tokenIndex267 + l270: + goto l268 + l269: + position, tokenIndex = position269, tokenIndex269 } - add(rulesp, position265) + add(rulesp, position267) } return true }, /* 27 comma <- <(sp ',' sp)> */ func() bool { - position271, tokenIndex271 := position, tokenIndex + position273, tokenIndex273 := position, tokenIndex { - position272 := position + position274 := position if !_rules[rulesp]() { - goto l271 + goto l273 } if buffer[position] != rune(',') { - goto l271 + goto l273 } position++ if !_rules[rulesp]() { - goto l271 + goto l273 } - add(rulecomma, position272) + add(rulecomma, position274) } return true - l271: - position, tokenIndex = position271, tokenIndex271 + l273: + position, tokenIndex = position273, tokenIndex273 return false }, /* 28 lbrack <- <('[' sp)> */ @@ -2701,136 +2713,136 @@ func (p *PQL) Init() { nil, /* 31 timestampbasicfmt <- <([0-9] [0-9] [0-9] [0-9] '-' ('0' / '1') [0-9] '-' [0-3] [0-9] 'T' [0-9] [0-9] ':' [0-9] [0-9])> */ func() bool { - position276, tokenIndex276 := position, tokenIndex + position278, tokenIndex278 := position, tokenIndex { - position277 := position + position279 := position if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l276 + goto l278 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l276 + goto l278 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l276 + goto l278 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l276 + goto l278 } position++ if buffer[position] != rune('-') { - goto l276 + goto l278 } position++ { - position278, tokenIndex278 := position, tokenIndex + position280, tokenIndex280 := position, tokenIndex if buffer[position] != rune('0') { - goto l279 + goto l281 } position++ - goto l278 - l279: - position, tokenIndex = position278, tokenIndex278 + goto l280 + l281: + position, tokenIndex = position280, tokenIndex280 if buffer[position] != rune('1') { - goto l276 + goto l278 } position++ } - l278: + l280: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l276 + goto l278 } position++ if buffer[position] != rune('-') { - goto l276 + goto l278 } position++ if c := buffer[position]; c < rune('0') || c > rune('3') { - goto l276 + goto l278 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l276 + goto l278 } position++ if buffer[position] != rune('T') { - goto l276 + goto l278 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l276 + goto l278 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l276 + goto l278 } position++ if buffer[position] != rune(':') { - goto l276 + goto l278 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l276 + goto l278 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l276 + goto l278 } position++ - add(ruletimestampbasicfmt, position277) + add(ruletimestampbasicfmt, position279) } return true - l276: - position, tokenIndex = position276, tokenIndex276 + l278: + position, tokenIndex = position278, tokenIndex278 return false }, /* 32 timestampfmt <- <(('"' timestampbasicfmt '"') / ('\'' timestampbasicfmt '\'') / timestampbasicfmt)> */ func() bool { - position280, tokenIndex280 := position, tokenIndex + position282, tokenIndex282 := position, tokenIndex { - position281 := position + position283 := position { - position282, tokenIndex282 := position, tokenIndex + position284, tokenIndex284 := position, tokenIndex if buffer[position] != rune('"') { - goto l283 + goto l285 } position++ if !_rules[ruletimestampbasicfmt]() { - goto l283 + goto l285 } if buffer[position] != rune('"') { - goto l283 + goto l285 } position++ - goto l282 - l283: - position, tokenIndex = position282, tokenIndex282 + goto l284 + l285: + position, tokenIndex = position284, tokenIndex284 if buffer[position] != rune('\'') { - goto l284 + goto l286 } position++ if !_rules[ruletimestampbasicfmt]() { - goto l284 + goto l286 } if buffer[position] != rune('\'') { - goto l284 + goto l286 } position++ - goto l282 - l284: - position, tokenIndex = position282, tokenIndex282 + goto l284 + l286: + position, tokenIndex = position284, tokenIndex284 if !_rules[ruletimestampbasicfmt]() { - goto l280 + goto l282 } } - l282: - add(ruletimestampfmt, position281) + l284: + add(ruletimestampfmt, position283) } return true - l280: - position, tokenIndex = position280, tokenIndex280 + l282: + position, tokenIndex = position282, tokenIndex282 return false }, /* 33 timestamp <- <( Action51)> */ From 8d5f76d4f40fe95d5dad7a733d16be79d3e82e1f Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 7 Nov 2018 18:37:28 +0300 Subject: [PATCH 15/18] Fixes #1697 --- http/client.go | 227 ++++++++++++++++++------------------------------- 1 file changed, 81 insertions(+), 146 deletions(-) diff --git a/http/client.go b/http/client.go index 75d3c75c7..e7c94fe16 100644 --- a/http/client.go +++ b/http/client.go @@ -84,9 +84,9 @@ func (c *InternalClient) maxShardByIndex(ctx context.Context) (map[string]uint64 req.Header.Set("Accept", "application/json") // Execute request. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return nil, errors.Wrap(err, "executing request") + return nil, err } defer resp.Body.Close() @@ -115,16 +115,14 @@ func (c *InternalClient) Schema(ctx context.Context) ([]*pilosa.IndexInfo, error req.Header.Set("Accept", "application/json") // Execute request. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return nil, errors.Wrap(err, "executing request") + return nil, err } defer resp.Body.Close() var rsp getSchemaResponse - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("http: status=%d", resp.StatusCode) - } else if err := json.NewDecoder(resp.Body).Decode(&rsp); err != nil { + if err := json.NewDecoder(resp.Body).Decode(&rsp); err != nil { return nil, fmt.Errorf("json decode: %s", err) } return rsp.Indexes, nil @@ -152,27 +150,14 @@ func (c *InternalClient) CreateIndex(ctx context.Context, index string, opt pilo req.Header.Set("User-Agent", "pilosa/"+pilosa.Version) // Execute request against the host. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return errors.Wrap(err, "executing request") - } - defer resp.Body.Close() - - // Read body. - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return errors.Wrap(err, "reading") - } - - // Handle response based on status code. - switch resp.StatusCode { - case http.StatusOK: - return nil // ok - case http.StatusConflict: - return pilosa.ErrIndexExists - default: - return errors.New(string(body)) + if resp.StatusCode == http.StatusConflict { + return pilosa.ErrIndexExists + } + return err } + return nil } // FragmentNodes returns a list of nodes that own a shard. @@ -191,19 +176,16 @@ func (c *InternalClient) FragmentNodes(ctx context.Context, index string, shard req.Header.Set("Accept", "application/json") // Execute request. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return nil, errors.Wrap(err, "executing request") + return nil, err } defer resp.Body.Close() var a []*pilosa.Node - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("http: status=%d", resp.StatusCode) - } else if err := json.NewDecoder(resp.Body).Decode(&a); err != nil { + if err := json.NewDecoder(resp.Body).Decode(&a); err != nil { return nil, fmt.Errorf("json decode: %s", err) } - return a, nil } @@ -222,19 +204,16 @@ func (c *InternalClient) Nodes(ctx context.Context) ([]*pilosa.Node, error) { req.Header.Set("Accept", "application/json") // Execute request. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return nil, errors.Wrap(err, "executing request") + return nil, err } defer resp.Body.Close() var a []*pilosa.Node - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("http: status=%d", resp.StatusCode) - } else if err := json.NewDecoder(resp.Body).Decode(&a); err != nil { + if err := json.NewDecoder(resp.Body).Decode(&a); err != nil { return nil, fmt.Errorf("json decode: %s", err) } - return a, nil } @@ -269,9 +248,9 @@ func (c *InternalClient) QueryNode(ctx context.Context, uri *pilosa.URI, index s req.Header.Set("User-Agent", "pilosa/"+pilosa.Version) // Execute request against the host. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return nil, errors.Wrap(err, "executing request") + return nil, err } defer resp.Body.Close() @@ -452,9 +431,9 @@ func (c *InternalClient) importNode(ctx context.Context, node *pilosa.Node, inde req.Header.Set("User-Agent", "pilosa/"+pilosa.Version) // Execute request against the host. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return errors.Wrap(err, "executing request") + return err } defer resp.Body.Close() @@ -462,8 +441,6 @@ func (c *InternalClient) importNode(ctx context.Context, node *pilosa.Node, inde body, err := ioutil.ReadAll(resp.Body) if err != nil { return errors.Wrap(err, "reading") - } else if resp.StatusCode != http.StatusOK { - return errors.New(string(body)) } var isresp pilosa.ImportResponse @@ -608,17 +585,12 @@ func (c *InternalClient) ImportRoaring(ctx context.Context, uri *pilosa.URI, ind req.Header.Set("User-Agent", "pilosa/"+pilosa.Version) // Execute request against the host. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return errors.Wrap(err, "executing request") + return err } defer resp.Body.Close() - // Validate status code. - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("invalid status: %d", resp.StatusCode) - } - dec := json.NewDecoder(resp.Body) rbody := &pilosa.ImportResponse{} dec.Decode(rbody) @@ -677,17 +649,12 @@ func (c *InternalClient) exportNodeCSV(ctx context.Context, node *pilosa.Node, i req.Header.Set("User-Agent", "pilosa/"+pilosa.Version) // Execute request against the host. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return errors.Wrap(err, "executing request") + return err } defer resp.Body.Close() - // Validate status code. - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("invalid status: %d", resp.StatusCode) - } - // Copy body to writer. if _, err := io.Copy(w, resp.Body); err != nil { return errors.Wrap(err, "copying") @@ -720,18 +687,12 @@ func (c *InternalClient) backupShardNode(ctx context.Context, index, field strin req.Header.Set("User-Agent", "pilosa/"+pilosa.Version) // Execute request. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return nil, errors.Wrap(err, "executing request") - } - - // Return error if status is not OK. - if resp.StatusCode == http.StatusNotFound { - resp.Body.Close() - return nil, pilosa.ErrFragmentNotFound - } else if resp.StatusCode != http.StatusOK { - resp.Body.Close() - return nil, fmt.Errorf("unexpected backup status code: host=%s, code=%d", node.URI, resp.StatusCode) + if resp.StatusCode == http.StatusNotFound { + return nil, pilosa.ErrFragmentNotFound + } + return nil, err } return resp.Body, nil @@ -783,27 +744,15 @@ func (c *InternalClient) CreateFieldWithOptions(ctx context.Context, index, fiel req.Header.Set("User-Agent", "pilosa/"+pilosa.Version) // Execute request against the host. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return errors.Wrap(err, "executing request") - } - defer resp.Body.Close() - - // Read body. - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return errors.Wrap(err, "reading") + if resp.StatusCode == http.StatusConflict { + return pilosa.ErrFieldExists + } + return err } - // Handle response based on status code. - switch resp.StatusCode { - case http.StatusOK: - return nil // ok - case http.StatusConflict: - return pilosa.ErrFieldExists - default: - return errors.New(string(body)) - } + return nil } // FragmentBlocks returns a list of block checksums for a fragment on a host. @@ -830,21 +779,16 @@ func (c *InternalClient) FragmentBlocks(ctx context.Context, uri *pilosa.URI, in req.Header.Set("Accept", "application/json") // Execute request. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return nil, errors.Wrap(err, "executing request") + // Return the appropriate error. + if resp.StatusCode == http.StatusNotFound { + return nil, pilosa.ErrFragmentNotFound + } + return nil, err } defer resp.Body.Close() - // Return error if status is not OK. - switch resp.StatusCode { - case http.StatusOK: // ok - case http.StatusNotFound: - return nil, pilosa.ErrFragmentNotFound - default: - return nil, fmt.Errorf("unexpected status: code=%d", resp.StatusCode) - } - // Decode response object. var rsp getFragmentBlocksResponse if err := json.NewDecoder(resp.Body).Decode(&rsp); err != nil { @@ -879,21 +823,15 @@ func (c *InternalClient) BlockData(ctx context.Context, uri *pilosa.URI, index, req.Header.Set("Accept", "application/protobuf") req.Header.Set("User-Agent", "pilosa/"+pilosa.Version) - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return nil, nil, errors.Wrap(err, "executing request") + if resp.StatusCode == http.StatusNotFound { + return nil, nil, nil + } + return nil, nil, err } defer resp.Body.Close() - // Return error if status is not OK. - switch resp.StatusCode { - case http.StatusOK: // fallthrough - case http.StatusNotFound: - return nil, nil, nil - default: - return nil, nil, fmt.Errorf("unexpected status: code=%d", resp.StatusCode) - } - // Decode response object. var rsp pilosa.BlockDataResponse if body, err := ioutil.ReadAll(resp.Body); err != nil { @@ -927,19 +865,12 @@ func (c *InternalClient) ColumnAttrDiff(ctx context.Context, uri *pilosa.URI, in req.Header.Set("Accept", "application/json") // Execute request. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return nil, errors.Wrap(err, "executing request") + return nil, err } defer resp.Body.Close() - // Return error if status is not OK. - switch resp.StatusCode { - case http.StatusOK: // ok - default: - return nil, fmt.Errorf("unexpected status: code=%d", resp.StatusCode) - } - // Decode response object. var rsp postIndexAttrDiffResponse if err := json.NewDecoder(resp.Body).Decode(&rsp); err != nil { @@ -971,21 +902,15 @@ func (c *InternalClient) RowAttrDiff(ctx context.Context, uri *pilosa.URI, index req.Header.Set("Accept", "application/json") // Execute request. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + resp, err := c.executeRequest(req.WithContext(ctx)) if err != nil { - return nil, errors.Wrap(err, "executing request") + if resp.StatusCode == http.StatusNotFound { + return nil, pilosa.ErrFieldNotFound + } + return nil, err } defer resp.Body.Close() - // Return error if status is not OK. - switch resp.StatusCode { - case http.StatusOK: // ok - case http.StatusNotFound: - return nil, pilosa.ErrFieldNotFound - default: - return nil, fmt.Errorf("unexpected status: code=%d", resp.StatusCode) - } - // Decode response object. var rsp postFieldAttrDiffResponse if err := json.NewDecoder(resp.Body).Decode(&rsp); err != nil { @@ -1006,28 +931,38 @@ func (c *InternalClient) SendMessage(ctx context.Context, uri *pilosa.URI, msg [ req.Header.Set("Accept", "application/json") // Execute request. - resp, err := c.httpClient.Do(req.WithContext(ctx)) + _, err = c.executeRequest(req.WithContext(ctx)) if err != nil { - return fmt.Errorf("executing http request: %v", err) + return err } - defer resp.Body.Close() - - // Read body. - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return fmt.Errorf("reading response body: %v", err) - } - - // Return error if status is not OK. - switch resp.StatusCode { - case http.StatusOK: // ok - default: - return fmt.Errorf("unexpected response status code: %d: %s", resp.StatusCode, body) - } - return nil } +// executeRequest executes the given request and checks the Response +func (c *InternalClient) executeRequest(req *http.Request) (*http.Response, error) { + resp, err := c.httpClient.Do(req) + if err != nil { + return nil, errors.Wrap(err, "executing request") + } + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + defer resp.Body.Close() + buf, err := ioutil.ReadAll(resp.Body) + if err != nil { + return resp, errors.Wrapf(err, "bad status '%s' and err reading body", resp.Status) + } + var msg string + // try to decode a JSON response + var sr successResponse + if err = json.Unmarshal(buf, &sr); err == nil { + msg = sr.Error.Error() + } else { + msg = string(buf) + } + return resp, errors.Errorf("Server error %s: '%s'", resp.Status, msg) + } + return resp, nil +} + // Bits is a slice of Bit. type Bits []pilosa.Bit From 7b7e96bdee4001e2628c03853e8af0bcaf0e142d Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 7 Nov 2018 18:47:15 +0300 Subject: [PATCH 16/18] Trivial --- http/client.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/http/client.go b/http/client.go index e7c94fe16..5a2fdf453 100644 --- a/http/client.go +++ b/http/client.go @@ -932,10 +932,7 @@ func (c *InternalClient) SendMessage(ctx context.Context, uri *pilosa.URI, msg [ // Execute request. _, err = c.executeRequest(req.WithContext(ctx)) - if err != nil { - return err - } - return nil + return err } // executeRequest executes the given request and checks the Response From f2394f6d935f3070df01d4b58dd724796e6ab0dc Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 8 Nov 2018 08:25:43 +0300 Subject: [PATCH 17/18] lowercase error msg --- http/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/client.go b/http/client.go index 5a2fdf453..0d6df281f 100644 --- a/http/client.go +++ b/http/client.go @@ -955,7 +955,7 @@ func (c *InternalClient) executeRequest(req *http.Request) (*http.Response, erro } else { msg = string(buf) } - return resp, errors.Errorf("Server error %s: '%s'", resp.Status, msg) + return resp, errors.Errorf("server error %s: '%s'", resp.Status, msg) } return resp, nil } From 44e436f5718a13080f6011dfa57a0eafce732d2f Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Fri, 9 Nov 2018 08:08:43 +0300 Subject: [PATCH 18/18] removed unused rule from peg grammar --- pql/pql.peg | 1 - pql/pql.peg.go | 418 ++++++++++++++++++++++++------------------------- 2 files changed, 204 insertions(+), 215 deletions(-) diff --git a/pql/pql.peg b/pql/pql.peg index f136ad764..15d33ac65 100644 --- a/pql/pql.peg +++ b/pql/pql.peg @@ -57,7 +57,6 @@ field <- { p.addField(buffer[begin:end]) } reserved <- ('_row' / '_col' / '_start' / '_end' / '_timestamp' / '_field') posfield <- { p.addPosStr("_field", buffer[begin:end]) } uint <- [1-9] [0-9]* / '0' -uintrow <- {p.addPosNum("_row", buffer[begin:end])} col <- ( {p.addPosNum("_col", buffer[begin:end])} / '\'' '\'' {p.addPosStr("_col", buffer[begin:end])} / '"' '"' {p.addPosStr("_col", buffer[begin:end])} diff --git a/pql/pql.peg.go b/pql/pql.peg.go index 5577142bf..5c3fb9ee9 100644 --- a/pql/pql.peg.go +++ b/pql/pql.peg.go @@ -37,7 +37,6 @@ const ( rulereserved ruleposfield ruleuint - ruleuintrow rulecol rulerow ruleopen @@ -102,7 +101,6 @@ const ( ruleAction48 ruleAction49 ruleAction50 - ruleAction51 ) var rul3s = [...]string{ @@ -128,7 +126,6 @@ var rul3s = [...]string{ "reserved", "posfield", "uint", - "uintrow", "col", "row", "open", @@ -193,7 +190,6 @@ var rul3s = [...]string{ "Action48", "Action49", "Action50", - "Action51", } type token32 struct { @@ -310,7 +306,7 @@ type PQL struct { Buffer string buffer []rune - rules [88]func() bool + rules [86]func() bool parse func(rule ...int) error reset func() Pretty bool @@ -492,20 +488,18 @@ func (p *PQL) Execute() { case ruleAction43: p.addPosStr("_field", buffer[begin:end]) case ruleAction44: - p.addPosNum("_row", buffer[begin:end]) - case ruleAction45: p.addPosNum("_col", buffer[begin:end]) + case ruleAction45: + p.addPosStr("_col", buffer[begin:end]) case ruleAction46: p.addPosStr("_col", buffer[begin:end]) case ruleAction47: - p.addPosStr("_col", buffer[begin:end]) - case ruleAction48: p.addPosNum("_row", buffer[begin:end]) + case ruleAction48: + p.addPosStr("_row", buffer[begin:end]) case ruleAction49: p.addPosStr("_row", buffer[begin:end]) case ruleAction50: - p.addPosStr("_row", buffer[begin:end]) - case ruleAction51: p.addPosStr("_timestamp", buffer[begin:end]) } @@ -667,7 +661,7 @@ func (p *PQL) Init() { add(rulePegText, position13) } { - add(ruleAction51, position) + add(ruleAction50, position) } add(ruletimestamp, position12) } @@ -753,7 +747,7 @@ func (p *PQL) Init() { add(rulePegText, position21) } { - add(ruleAction48, position) + add(ruleAction47, position) } goto l19 l20: @@ -774,7 +768,7 @@ func (p *PQL) Init() { } position++ { - add(ruleAction49, position) + add(ruleAction48, position) } goto l19 l23: @@ -795,7 +789,7 @@ func (p *PQL) Init() { } position++ { - add(ruleAction50, position) + add(ruleAction49, position) } } l19: @@ -2536,421 +2530,417 @@ func (p *PQL) Init() { position, tokenIndex = position243, tokenIndex243 return false }, - /* 21 uintrow <- <( Action44)> */ - nil, - /* 22 col <- <(( Action45) / ('\'' '\'' Action46) / ('"' '"' Action47))> */ + /* 21 col <- <(( Action44) / ('\'' '\'' Action45) / ('"' '"' Action46))> */ func() bool { - position250, tokenIndex250 := position, tokenIndex + position249, tokenIndex249 := position, tokenIndex { - position251 := position + position250 := position { - position252, tokenIndex252 := position, tokenIndex + position251, tokenIndex251 := position, tokenIndex { - position254 := position + position253 := position if !_rules[ruleuint]() { - goto l253 + goto l252 } - add(rulePegText, position254) + add(rulePegText, position253) } { - add(ruleAction45, position) + add(ruleAction44, position) } - goto l252 - l253: - position, tokenIndex = position252, tokenIndex252 + goto l251 + l252: + position, tokenIndex = position251, tokenIndex251 if buffer[position] != rune('\'') { - goto l256 + goto l255 } position++ { - position257 := position + position256 := position if !_rules[rulesinglequotedstring]() { - goto l256 + goto l255 } - add(rulePegText, position257) + add(rulePegText, position256) } if buffer[position] != rune('\'') { - goto l256 + goto l255 + } + position++ + { + add(ruleAction45, position) + } + goto l251 + l255: + position, tokenIndex = position251, tokenIndex251 + if buffer[position] != rune('"') { + goto l249 + } + position++ + { + position258 := position + if !_rules[ruledoublequotedstring]() { + goto l249 + } + add(rulePegText, position258) + } + if buffer[position] != rune('"') { + goto l249 } position++ { add(ruleAction46, position) } - goto l252 - l256: - position, tokenIndex = position252, tokenIndex252 - if buffer[position] != rune('"') { - goto l250 - } - position++ - { - position259 := position - if !_rules[ruledoublequotedstring]() { - goto l250 - } - add(rulePegText, position259) - } - if buffer[position] != rune('"') { - goto l250 - } - position++ - { - add(ruleAction47, position) - } } - l252: - add(rulecol, position251) + l251: + add(rulecol, position250) } return true - l250: - position, tokenIndex = position250, tokenIndex250 + l249: + position, tokenIndex = position249, tokenIndex249 return false }, - /* 23 row <- <(( Action48) / ('\'' '\'' Action49) / ('"' '"' Action50))> */ + /* 22 row <- <(( Action47) / ('\'' '\'' Action48) / ('"' '"' Action49))> */ nil, - /* 24 open <- <('(' sp)> */ + /* 23 open <- <('(' sp)> */ func() bool { - position262, tokenIndex262 := position, tokenIndex + position261, tokenIndex261 := position, tokenIndex { - position263 := position + position262 := position if buffer[position] != rune('(') { - goto l262 + goto l261 } position++ if !_rules[rulesp]() { - goto l262 + goto l261 } - add(ruleopen, position263) + add(ruleopen, position262) } return true - l262: - position, tokenIndex = position262, tokenIndex262 + l261: + position, tokenIndex = position261, tokenIndex261 return false }, - /* 25 close <- <(')' sp)> */ + /* 24 close <- <(')' sp)> */ func() bool { - position264, tokenIndex264 := position, tokenIndex + position263, tokenIndex263 := position, tokenIndex { - position265 := position + position264 := position if buffer[position] != rune(')') { - goto l264 + goto l263 } position++ if !_rules[rulesp]() { - goto l264 + goto l263 } - add(ruleclose, position265) + add(ruleclose, position264) } return true - l264: - position, tokenIndex = position264, tokenIndex264 + l263: + position, tokenIndex = position263, tokenIndex263 return false }, - /* 26 sp <- <(' ' / '\t' / '\n')*> */ + /* 25 sp <- <(' ' / '\t' / '\n')*> */ func() bool { { - position267 := position - l268: + position266 := position + l267: { - position269, tokenIndex269 := position, tokenIndex + position268, tokenIndex268 := position, tokenIndex { - position270, tokenIndex270 := position, tokenIndex + position269, tokenIndex269 := position, tokenIndex if buffer[position] != rune(' ') { + goto l270 + } + position++ + goto l269 + l270: + position, tokenIndex = position269, tokenIndex269 + if buffer[position] != rune('\t') { goto l271 } position++ - goto l270 + goto l269 l271: - position, tokenIndex = position270, tokenIndex270 - if buffer[position] != rune('\t') { - goto l272 - } - position++ - goto l270 - l272: - position, tokenIndex = position270, tokenIndex270 + position, tokenIndex = position269, tokenIndex269 if buffer[position] != rune('\n') { - goto l269 + goto l268 } position++ } - l270: - goto l268 l269: - position, tokenIndex = position269, tokenIndex269 + goto l267 + l268: + position, tokenIndex = position268, tokenIndex268 } - add(rulesp, position267) + add(rulesp, position266) } return true }, - /* 27 comma <- <(sp ',' sp)> */ + /* 26 comma <- <(sp ',' sp)> */ func() bool { - position273, tokenIndex273 := position, tokenIndex + position272, tokenIndex272 := position, tokenIndex { - position274 := position + position273 := position if !_rules[rulesp]() { - goto l273 + goto l272 } if buffer[position] != rune(',') { - goto l273 + goto l272 } position++ if !_rules[rulesp]() { - goto l273 + goto l272 } - add(rulecomma, position274) + add(rulecomma, position273) } return true - l273: - position, tokenIndex = position273, tokenIndex273 + l272: + position, tokenIndex = position272, tokenIndex272 return false }, - /* 28 lbrack <- <('[' sp)> */ + /* 27 lbrack <- <('[' sp)> */ nil, - /* 29 rbrack <- <(sp ']' sp)> */ + /* 28 rbrack <- <(sp ']' sp)> */ nil, - /* 30 IDENT <- <(([a-z] / [A-Z]) ([a-z] / [A-Z] / [0-9])*)> */ + /* 29 IDENT <- <(([a-z] / [A-Z]) ([a-z] / [A-Z] / [0-9])*)> */ nil, - /* 31 timestampbasicfmt <- <([0-9] [0-9] [0-9] [0-9] '-' ('0' / '1') [0-9] '-' [0-3] [0-9] 'T' [0-9] [0-9] ':' [0-9] [0-9])> */ + /* 30 timestampbasicfmt <- <([0-9] [0-9] [0-9] [0-9] '-' ('0' / '1') [0-9] '-' [0-3] [0-9] 'T' [0-9] [0-9] ':' [0-9] [0-9])> */ func() bool { - position278, tokenIndex278 := position, tokenIndex + position277, tokenIndex277 := position, tokenIndex { - position279 := position + position278 := position if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l278 + goto l277 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l278 + goto l277 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l278 + goto l277 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l278 + goto l277 } position++ if buffer[position] != rune('-') { - goto l278 + goto l277 } position++ { - position280, tokenIndex280 := position, tokenIndex + position279, tokenIndex279 := position, tokenIndex if buffer[position] != rune('0') { - goto l281 + goto l280 } position++ - goto l280 - l281: - position, tokenIndex = position280, tokenIndex280 + goto l279 + l280: + position, tokenIndex = position279, tokenIndex279 if buffer[position] != rune('1') { - goto l278 + goto l277 } position++ } - l280: + l279: if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l278 + goto l277 } position++ if buffer[position] != rune('-') { - goto l278 + goto l277 } position++ if c := buffer[position]; c < rune('0') || c > rune('3') { - goto l278 + goto l277 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l278 + goto l277 } position++ if buffer[position] != rune('T') { - goto l278 + goto l277 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l278 + goto l277 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l278 + goto l277 } position++ if buffer[position] != rune(':') { - goto l278 + goto l277 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l278 + goto l277 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { - goto l278 + goto l277 } position++ - add(ruletimestampbasicfmt, position279) + add(ruletimestampbasicfmt, position278) } return true - l278: - position, tokenIndex = position278, tokenIndex278 + l277: + position, tokenIndex = position277, tokenIndex277 return false }, - /* 32 timestampfmt <- <(('"' timestampbasicfmt '"') / ('\'' timestampbasicfmt '\'') / timestampbasicfmt)> */ + /* 31 timestampfmt <- <(('"' timestampbasicfmt '"') / ('\'' timestampbasicfmt '\'') / timestampbasicfmt)> */ func() bool { - position282, tokenIndex282 := position, tokenIndex + position281, tokenIndex281 := position, tokenIndex { - position283 := position + position282 := position { - position284, tokenIndex284 := position, tokenIndex + position283, tokenIndex283 := position, tokenIndex if buffer[position] != rune('"') { + goto l284 + } + position++ + if !_rules[ruletimestampbasicfmt]() { + goto l284 + } + if buffer[position] != rune('"') { + goto l284 + } + position++ + goto l283 + l284: + position, tokenIndex = position283, tokenIndex283 + if buffer[position] != rune('\'') { goto l285 } position++ if !_rules[ruletimestampbasicfmt]() { goto l285 } - if buffer[position] != rune('"') { + if buffer[position] != rune('\'') { goto l285 } position++ - goto l284 + goto l283 l285: - position, tokenIndex = position284, tokenIndex284 - if buffer[position] != rune('\'') { - goto l286 - } - position++ + position, tokenIndex = position283, tokenIndex283 if !_rules[ruletimestampbasicfmt]() { - goto l286 - } - if buffer[position] != rune('\'') { - goto l286 - } - position++ - goto l284 - l286: - position, tokenIndex = position284, tokenIndex284 - if !_rules[ruletimestampbasicfmt]() { - goto l282 + goto l281 } } - l284: - add(ruletimestampfmt, position283) + l283: + add(ruletimestampfmt, position282) } return true - l282: - position, tokenIndex = position282, tokenIndex282 + l281: + position, tokenIndex = position281, tokenIndex281 return false }, - /* 33 timestamp <- <( Action51)> */ + /* 32 timestamp <- <( Action50)> */ nil, - /* 35 Action0 <- <{p.startCall("Set")}> */ + /* 34 Action0 <- <{p.startCall("Set")}> */ nil, - /* 36 Action1 <- <{p.endCall()}> */ + /* 35 Action1 <- <{p.endCall()}> */ nil, - /* 37 Action2 <- <{p.startCall("SetRowAttrs")}> */ + /* 36 Action2 <- <{p.startCall("SetRowAttrs")}> */ nil, - /* 38 Action3 <- <{p.endCall()}> */ + /* 37 Action3 <- <{p.endCall()}> */ nil, - /* 39 Action4 <- <{p.startCall("SetColumnAttrs")}> */ + /* 38 Action4 <- <{p.startCall("SetColumnAttrs")}> */ nil, - /* 40 Action5 <- <{p.endCall()}> */ + /* 39 Action5 <- <{p.endCall()}> */ nil, - /* 41 Action6 <- <{p.startCall("Clear")}> */ + /* 40 Action6 <- <{p.startCall("Clear")}> */ nil, - /* 42 Action7 <- <{p.endCall()}> */ + /* 41 Action7 <- <{p.endCall()}> */ nil, - /* 43 Action8 <- <{p.startCall("ClearRow")}> */ + /* 42 Action8 <- <{p.startCall("ClearRow")}> */ nil, - /* 44 Action9 <- <{p.endCall()}> */ + /* 43 Action9 <- <{p.endCall()}> */ nil, - /* 45 Action10 <- <{p.startCall("Store")}> */ + /* 44 Action10 <- <{p.startCall("Store")}> */ nil, - /* 46 Action11 <- <{p.endCall()}> */ + /* 45 Action11 <- <{p.endCall()}> */ nil, - /* 47 Action12 <- <{p.startCall("TopN")}> */ + /* 46 Action12 <- <{p.startCall("TopN")}> */ nil, - /* 48 Action13 <- <{p.endCall()}> */ + /* 47 Action13 <- <{p.endCall()}> */ nil, - /* 49 Action14 <- <{p.startCall("Range")}> */ + /* 48 Action14 <- <{p.startCall("Range")}> */ nil, - /* 50 Action15 <- <{p.endCall()}> */ + /* 49 Action15 <- <{p.endCall()}> */ nil, nil, - /* 52 Action16 <- <{ p.startCall(buffer[begin:end] ) }> */ + /* 51 Action16 <- <{ p.startCall(buffer[begin:end] ) }> */ nil, - /* 53 Action17 <- <{ p.endCall() }> */ + /* 52 Action17 <- <{ p.endCall() }> */ nil, - /* 54 Action18 <- <{ p.addBTWN() }> */ + /* 53 Action18 <- <{ p.addBTWN() }> */ nil, - /* 55 Action19 <- <{ p.addLTE() }> */ + /* 54 Action19 <- <{ p.addLTE() }> */ nil, - /* 56 Action20 <- <{ p.addGTE() }> */ + /* 55 Action20 <- <{ p.addGTE() }> */ nil, - /* 57 Action21 <- <{ p.addEQ() }> */ + /* 56 Action21 <- <{ p.addEQ() }> */ nil, - /* 58 Action22 <- <{ p.addNEQ() }> */ + /* 57 Action22 <- <{ p.addNEQ() }> */ nil, - /* 59 Action23 <- <{ p.addLT() }> */ + /* 58 Action23 <- <{ p.addLT() }> */ nil, - /* 60 Action24 <- <{ p.addGT() }> */ + /* 59 Action24 <- <{ p.addGT() }> */ nil, - /* 61 Action25 <- <{p.startConditional()}> */ + /* 60 Action25 <- <{p.startConditional()}> */ nil, - /* 62 Action26 <- <{p.endConditional()}> */ + /* 61 Action26 <- <{p.endConditional()}> */ nil, - /* 63 Action27 <- <{p.condAdd(buffer[begin:end])}> */ + /* 62 Action27 <- <{p.condAdd(buffer[begin:end])}> */ nil, - /* 64 Action28 <- <{p.condAdd(buffer[begin:end])}> */ + /* 63 Action28 <- <{p.condAdd(buffer[begin:end])}> */ nil, - /* 65 Action29 <- <{p.condAdd(buffer[begin:end])}> */ + /* 64 Action29 <- <{p.condAdd(buffer[begin:end])}> */ nil, - /* 66 Action30 <- <{p.addPosStr("_start", buffer[begin:end])}> */ + /* 65 Action30 <- <{p.addPosStr("_start", buffer[begin:end])}> */ nil, - /* 67 Action31 <- <{p.addPosStr("_end", buffer[begin:end])}> */ + /* 66 Action31 <- <{p.addPosStr("_end", buffer[begin:end])}> */ nil, - /* 68 Action32 <- <{ p.startList() }> */ + /* 67 Action32 <- <{ p.startList() }> */ nil, - /* 69 Action33 <- <{ p.endList() }> */ + /* 68 Action33 <- <{ p.endList() }> */ nil, - /* 70 Action34 <- <{ p.addVal(nil) }> */ + /* 69 Action34 <- <{ p.addVal(nil) }> */ nil, - /* 71 Action35 <- <{ p.addVal(true) }> */ + /* 70 Action35 <- <{ p.addVal(true) }> */ nil, - /* 72 Action36 <- <{ p.addVal(false) }> */ + /* 71 Action36 <- <{ p.addVal(false) }> */ nil, - /* 73 Action37 <- <{ p.addNumVal(buffer[begin:end]) }> */ + /* 72 Action37 <- <{ p.addNumVal(buffer[begin:end]) }> */ nil, - /* 74 Action38 <- <{ p.addNumVal(buffer[begin:end]) }> */ + /* 73 Action38 <- <{ p.addNumVal(buffer[begin:end]) }> */ nil, - /* 75 Action39 <- <{ p.addVal(buffer[begin:end]) }> */ + /* 74 Action39 <- <{ p.addVal(buffer[begin:end]) }> */ nil, - /* 76 Action40 <- <{ s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) }> */ + /* 75 Action40 <- <{ s, _ := strconv.Unquote(buffer[begin:end]); p.addVal(s) }> */ nil, - /* 77 Action41 <- <{ p.addVal(buffer[begin:end]) }> */ + /* 76 Action41 <- <{ p.addVal(buffer[begin:end]) }> */ nil, - /* 78 Action42 <- <{ p.addField(buffer[begin:end]) }> */ + /* 77 Action42 <- <{ p.addField(buffer[begin:end]) }> */ nil, - /* 79 Action43 <- <{ p.addPosStr("_field", buffer[begin:end]) }> */ + /* 78 Action43 <- <{ p.addPosStr("_field", buffer[begin:end]) }> */ nil, - /* 80 Action44 <- <{p.addPosNum("_row", buffer[begin:end])}> */ + /* 79 Action44 <- <{p.addPosNum("_col", buffer[begin:end])}> */ nil, - /* 81 Action45 <- <{p.addPosNum("_col", buffer[begin:end])}> */ + /* 80 Action45 <- <{p.addPosStr("_col", buffer[begin:end])}> */ nil, - /* 82 Action46 <- <{p.addPosStr("_col", buffer[begin:end])}> */ + /* 81 Action46 <- <{p.addPosStr("_col", buffer[begin:end])}> */ nil, - /* 83 Action47 <- <{p.addPosStr("_col", buffer[begin:end])}> */ + /* 82 Action47 <- <{p.addPosNum("_row", buffer[begin:end])}> */ nil, - /* 84 Action48 <- <{p.addPosNum("_row", buffer[begin:end])}> */ + /* 83 Action48 <- <{p.addPosStr("_row", buffer[begin:end])}> */ nil, - /* 85 Action49 <- <{p.addPosStr("_row", buffer[begin:end])}> */ + /* 84 Action49 <- <{p.addPosStr("_row", buffer[begin:end])}> */ nil, - /* 86 Action50 <- <{p.addPosStr("_row", buffer[begin:end])}> */ - nil, - /* 87 Action51 <- <{p.addPosStr("_timestamp", buffer[begin:end])}> */ + /* 85 Action50 <- <{p.addPosStr("_timestamp", buffer[begin:end])}> */ nil, } p.rules = _rules