From a8e1e93c34aba5a7a2952156d1e820ae1ed5c9f0 Mon Sep 17 00:00:00 2001 From: Cody Soyland Date: Mon, 19 Feb 2018 10:34:47 -0600 Subject: [PATCH 1/7] Go 1.10 --- .travis.yml | 1 + Dockerfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2ddff4f4b..73ab4adf0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: go go: - 1.8 - 1.9 + - 1.10 - master env: global: # AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY diff --git a/Dockerfile b/Dockerfile index 6d86de974..50e88985c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.9.2 as builder +FROM golang:1.10 as builder ARG ldflags='' From cf7faa224146b3c381985bd17bdcc53332843a82 Mon Sep 17 00:00:00 2001 From: Cody Soyland Date: Mon, 19 Feb 2018 10:48:02 -0600 Subject: [PATCH 2/7] Use string instead of float for go 1.10 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 73ab4adf0..1e5ff0976 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: go go: - 1.8 - 1.9 - - 1.10 + - "1.10" # Use string, as 1.10==1.1 if interpreted as float. - master env: global: # AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY From 2d458b98a1018a51bb8e1ac36be19e7a8b061942 Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Tue, 20 Feb 2018 10:41:02 -0600 Subject: [PATCH 3/7] merge conflicts --- roaring/assembly.go | 68 ------------------ roaring/assembly_amd64.s | 122 ------------------------------- roaring/assembly_asm.go | 87 ---------------------- roaring/assembly_generic.go | 27 ------- roaring/assembly_test.go | 139 ------------------------------------ roaring/roaring.go | 129 ++++++++++++++++++--------------- 6 files changed, 73 insertions(+), 499 deletions(-) delete mode 100644 roaring/assembly.go delete mode 100644 roaring/assembly_amd64.s delete mode 100644 roaring/assembly_asm.go delete mode 100644 roaring/assembly_generic.go delete mode 100644 roaring/assembly_test.go diff --git a/roaring/assembly.go b/roaring/assembly.go deleted file mode 100644 index ea67cf66e..000000000 --- a/roaring/assembly.go +++ /dev/null @@ -1,68 +0,0 @@ -// 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 roaring - - -// bit population count, take from -// https://code.google.com/p/go/issues/detail?id=4988#c11 -// credit: https://code.google.com/u/arnehormann/ -func popcntGo(x uint64) (n uint64) { - x -= (x >> 1) & 0x5555555555555555 - x = (x>>2)&0x3333333333333333 + x&0x3333333333333333 - x += x >> 4 - x &= 0x0f0f0f0f0f0f0f0f - x *= 0x0101010101010101 - return x >> 56 -} - -func popcntSliceGo(s []uint64) uint64 { - cnt := uint64(0) - for _, x := range s { - cnt += popcntGo(x) - } - return cnt -} - -func popcntMaskSliceGo(s, m []uint64) uint64 { - cnt := uint64(0) - for i := range s { - cnt += popcntGo(s[i] &^ m[i]) - } - return cnt -} - -func popcntAndSliceGo(s, m []uint64) uint64 { - cnt := uint64(0) - for i := range s { - cnt += popcntGo(s[i] & m[i]) - } - return cnt -} - -func popcntOrSliceGo(s, m []uint64) uint64 { - cnt := uint64(0) - for i := range s { - cnt += popcntGo(s[i] | m[i]) - } - return cnt -} - -func popcntXorSliceGo(s, m []uint64) uint64 { - cnt := uint64(0) - for i := range s { - cnt += popcntGo(s[i] ^ m[i]) - } - return cnt -} diff --git a/roaring/assembly_amd64.s b/roaring/assembly_amd64.s deleted file mode 100644 index 5b65e0635..000000000 --- a/roaring/assembly_amd64.s +++ /dev/null @@ -1,122 +0,0 @@ -#include "textflag.h" - -TEXT ·hasAsm(SB),4,$0-1 - MOVQ $1, AX - CPUID - SHRQ $23, CX - ANDQ $1, CX - MOVB CX, ret+0(FP) - RET - -TEXT ·POPCNTQ(SB),NOSPLIT,$0-16 - MOVQ memory+0(FP), BP - POPCNTQ BP, BX - MOVQ BX, ret+8(FP) - RET - -TEXT ·BSFQ(SB),NOSPLIT,$0-16 - MOVQ memory+0(FP), BP - BSFQ BP, BX - MOVQ BX, ret+8(FP) - RET - -#define POPCNTQ_DX_DX BYTE $0xf3; BYTE $0x48; BYTE $0x0f; BYTE $0xb8; BYTE $0xd2 - -TEXT ·popcntSliceAsm(SB),4,$0-32 -XORQ AX, AX -MOVQ s_base+0(FP), SI -MOVQ s_len+8(FP), CX -TESTQ CX, CX -JZ popcntSliceEnd -popcntSliceLoop: -BYTE $0xf3; BYTE $0x48; BYTE $0x0f; BYTE $0xb8; BYTE $0x16 // POPCNTQ (SI), DX -ADDQ DX, AX -ADDQ $8, SI -LOOP popcntSliceLoop -popcntSliceEnd: -MOVQ AX, ret+24(FP) -RET - -TEXT ·popcntMaskSliceAsm(SB),4,$0-56 -XORQ AX, AX -MOVQ s_base+0(FP), SI -MOVQ s_len+8(FP), CX -TESTQ CX, CX -JZ popcntMaskSliceEnd -MOVQ m+24(FP), DI -popcntMaskSliceLoop: -MOVQ (DI), DX -NOTQ DX -ANDQ (SI), DX -POPCNTQ_DX_DX -ADDQ DX, AX -ADDQ $8, SI -ADDQ $8, DI -LOOP popcntMaskSliceLoop -popcntMaskSliceEnd: -MOVQ AX, ret+48(FP) -RET - -TEXT ·popcntAndSliceAsm(SB),4,$0-56 -XORQ AX, AX -MOVQ s_base+0(FP), SI -MOVQ s_len+8(FP), CX -TESTQ CX, CX -JZ popcntAndSliceEnd -MOVQ m+24(FP), DI -popcntAndSliceLoop: -MOVQ (DI), DX -ANDQ (SI), DX -POPCNTQ_DX_DX -ADDQ DX, AX -ADDQ $8, SI -ADDQ $8, DI -LOOP popcntAndSliceLoop -popcntAndSliceEnd: -MOVQ AX, ret+48(FP) -RET - -TEXT ·popcntOrSliceAsm(SB),4,$0-56 -XORQ AX, AX -MOVQ s_base+0(FP), SI -MOVQ s_len+8(FP), CX -TESTQ CX, CX -JZ popcntOrSliceEnd -MOVQ m+24(FP), DI -popcntOrSliceLoop: -MOVQ (DI), DX -ORQ (SI), DX -POPCNTQ_DX_DX -ADDQ DX, AX -ADDQ $8, SI -ADDQ $8, DI -LOOP popcntOrSliceLoop -popcntOrSliceEnd: -MOVQ AX, ret+48(FP) -RET - -TEXT ·popcntXorSliceAsm(SB),4,$0-56 -XORQ AX, AX -MOVQ s_base+0(FP), SI -MOVQ s_len+8(FP), CX -TESTQ CX, CX -JZ popcntXorSliceEnd -MOVQ m+24(FP), DI -popcntXorSliceLoop: -MOVQ (DI), DX -XORQ (SI), DX -POPCNTQ_DX_DX -ADDQ DX, AX -ADDQ $8, SI -ADDQ $8, DI -LOOP popcntXorSliceLoop -popcntXorSliceEnd: -MOVQ AX, ret+48(FP) -RET - - -TEXT ·popcntAsm(SB),4,$0-16 - MOVQ x+0(FP), DX - POPCNTQ_DX_DX - MOVQ DX, ret+8(FP) - RET diff --git a/roaring/assembly_asm.go b/roaring/assembly_asm.go deleted file mode 100644 index 3eb182cce..000000000 --- a/roaring/assembly_asm.go +++ /dev/null @@ -1,87 +0,0 @@ -// 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. - -// +build amd64 - -package roaring - -func hasAsm() bool - -func BSFQ(memory uint64) int - -func POPCNTQ(memory uint64) int - - -//go:noescape -var useAsm = hasAsm() - -//go:noescape -func popcntSliceAsm(s []uint64) uint64 - -//go:noescape -func popcntMaskSliceAsm(s, m []uint64) uint64 - -//go:noescape -func popcntAndSliceAsm(s, m []uint64) uint64 - -//go:noescape -func popcntOrSliceAsm(s, m []uint64) uint64 - -//go:noescape -func popcntXorSliceAsm(s, m []uint64) uint64 - -//go:noescape -func popcntAsm(x uint64) uint64 - -func popcntSlice(s []uint64) uint64 { - if useAsm { - return popcntSliceAsm(s) - } - return popcntSliceGo(s) -} - -func popcntMaskSlice(s, m []uint64) uint64 { - if useAsm { - return popcntMaskSliceAsm(s, m) - } - return popcntMaskSliceGo(s, m) -} - -func popcntAndSlice(s, m []uint64) uint64 { - if useAsm { - return popcntAndSliceAsm(s, m) - } - return popcntAndSliceGo(s, m) -} - -func popcntOrSlice(s, m []uint64) uint64 { - if useAsm { - return popcntOrSliceAsm(s, m) - } - return popcntOrSliceGo(s, m) -} - -func popcntXorSlice(s, m []uint64) uint64 { - if useAsm { - return popcntXorSliceAsm(s, m) - } - return popcntXorSliceGo(s, m) -} - -func popcnt(x uint64) uint64 { - if useAsm { - return popcntAsm(x) - } - return popcntGo(x) -} diff --git a/roaring/assembly_generic.go b/roaring/assembly_generic.go deleted file mode 100644 index 997bfdaa3..000000000 --- a/roaring/assembly_generic.go +++ /dev/null @@ -1,27 +0,0 @@ -// 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. - -// +build !amd64 - -package roaring - -func hasAsm() bool {return false} - - -func popcntSlice(s []uint64) uint64 { return popcntSliceGo(s) } -func popcntMaskSlice(s, m []uint64) uint64 { return popcntMaskSliceGo(s, m) } -func popcntAndSlice(s, m []uint64) uint64 { return popcntAndSliceGo(s, m) } -func popcntOrSlice(s, m []uint64) uint64 { return popcntOrSliceGo(s, m) } -func popcntXorSlice(s, m []uint64) uint64 { return popcntXorSliceGo(s, m) } -func popcnt(s uint64) uint64 { return popcntGo(s) } diff --git a/roaring/assembly_test.go b/roaring/assembly_test.go deleted file mode 100644 index f18aa65ec..000000000 --- a/roaring/assembly_test.go +++ /dev/null @@ -1,139 +0,0 @@ -// 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 roaring - -import "testing" - -func TestBSFQ(t *testing.T) { - result := BSFQ(2) - if result != 1 { - t.Fatalf("BSF INCORRECT: %d", result) - } -} - -func TestBSFQ_CompareGo(t *testing.T) { - v := uint64(1) - for i := 0; i < 64; i++ { - if BSFQ(v) != trailingZeroN(v) { - t.Fatalf("BSF INCORRECT: %d %d", BSFQ(v), trailingZeroN(v)) - } - if v == 0 { - v = 1 - } else { - v *= 2 - } - } - /* - if bsfq(0) != trailingZeroN(0) { - fmt.Println(bsfq(0)) - t.Fatalf("BSF INCORRECT") - } - */ -} -func BenchmarkBSF(b *testing.B) { - for i := 0; i < b.N; i++ { - BSFQ(uint64(i)) - } -} - -func BenchmarkTrailingZeroN(b *testing.B) { - for i := 0; i < b.N; i++ { - trailingZeroN(uint64(i)) - } -} - -func BenchmarkPOPCNTQ(b *testing.B) { - for i := 0; i < b.N; i++ { - POPCNTQ(uint64(i)) - } -} - -func BenchmarkPopcount(b *testing.B) { - for i := 0; i < b.N; i++ { - popcount(uint64(i)) - } -} - -func BenchmarkPopcntAsm(b *testing.B) { - // run the Fib function b.N times - for n := 0; n < b.N; n++ { - popcntAsm(0xdeadbeef) - } -} - -func BenchmarkPopcntGo(b *testing.B) { - // run the Fib function b.N times - for n := 0; n < b.N; n++ { - popcntGo(0xdeadbeef) - } -} - -func getData() []uint64 { - return []uint64{ - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - 0xdeadbeef, - } -} - -func BenchmarkPopcntSliceGo(b *testing.B) { - d := getData() - for n := 0; n < b.N; n++ { - popcntSliceGo(d) - } -} - -func BenchmarkPopcntSliceAsm(b *testing.B) { - d := getData() - for n := 0; n < b.N; n++ { - popcntSliceAsm(d) - } -} - -func BenchmarkPopcntSlice(b *testing.B) { - d := getData() - for n := 0; n < b.N; n++ { - popcntSlice(d) - } -} diff --git a/roaring/roaring.go b/roaring/roaring.go index 8d88b2088..8ea82af83 100644 --- a/roaring/roaring.go +++ b/roaring/roaring.go @@ -21,6 +21,7 @@ import ( "fmt" "hash/fnv" "io" + "math/bits" "sort" "unsafe" ) @@ -1274,10 +1275,10 @@ func (c *container) contains(v uint16) bool { func (c *container) bitmapCountRuns() (r int) { for i := 0; i < 1023; i++ { v, v1 := c.bitmap[i], c.bitmap[i+1] - r = r + int(popcnt((v<<1)&^v)+((v>>63)&^v1)) + r = r + int(popcount((v<<1)&^v)+((v>>63)&^v1)) } vl := c.bitmap[len(c.bitmap)-1] - r = r + int(popcnt((vl<<1)&^vl)+vl>>63) + r = r + int(popcount((vl<<1)&^vl)+vl>>63) return r } @@ -1918,7 +1919,7 @@ func intersectionCountArrayBitmap(a, b *container) (n int) { } func intersectionCountBitmapBitmap(a, b *container) (n int) { - return int(popcntAndSlice(a.bitmap, b.bitmap)) + return int(popcountAndSlice(a.bitmap, b.bitmap)) } func intersect(a, b *container) *container { @@ -2061,22 +2062,22 @@ func intersectBitmapRun(a, b *container) *container { for valast >= vb.start && vastart <= vb.last && i < bitmapN { if vastart >= vb.start && valast <= vb.last { // a within b output.bitmap[i] = a.bitmap[i] - output.n += int(popcnt(a.bitmap[i])) + output.n += int(popcount(a.bitmap[i])) } else if vb.start >= vastart && vb.last <= valast { // b within a var mask uint64 = ((1 << (vb.last - vb.start + 1)) - 1) << (vb.start - vastart) bits := a.bitmap[i] & mask output.bitmap[i] |= bits - output.n += int(popcnt(bits)) + output.n += int(popcount(bits)) } else if vastart < vb.start { // a overlaps front of b offset := 64 - (1 + valast - vb.start) bits := (a.bitmap[i] >> offset) << offset output.bitmap[i] |= bits - output.n += int(popcnt(bits)) + output.n += int(popcount(bits)) } else if vb.start < vastart { // b overlaps front of a offset := 64 - (1 + vb.last - vastart) bits := (a.bitmap[i] << offset) >> offset output.bitmap[i] |= bits - output.n += int(popcnt(bits)) + output.n += int(popcount(bits)) } // update loop vars i++ @@ -2293,19 +2294,19 @@ func (c *container) bitmapSetRange(i, j uint64) { y := (j - 1) >> 6 var X uint64 = maxBitmap << (i % 64) var Y uint64 = maxBitmap >> (63 - ((j - 1) % 64)) - xcnt := popcnt(X) - ycnt := popcnt(Y) + xcnt := popcount(X) + ycnt := popcount(Y) if x == y { - c.n += int((j - i) - popcnt(c.bitmap[x]&(X&Y))) + c.n += int((j - i) - popcount(c.bitmap[x]&(X&Y))) c.bitmap[x] |= (X & Y) } else { - c.n += int(xcnt - popcnt(c.bitmap[x]&X)) + c.n += int(xcnt - popcount(c.bitmap[x]&X)) c.bitmap[x] |= X for i := x + 1; i < y; i++ { - c.n += int(64 - popcnt(c.bitmap[i])) + c.n += int(64 - popcount(c.bitmap[i])) c.bitmap[i] = maxBitmap } - c.n += int(ycnt - popcnt(c.bitmap[y]&Y)) + c.n += int(ycnt - popcount(c.bitmap[y]&Y)) c.bitmap[y] |= Y } } @@ -2317,21 +2318,21 @@ func (c *container) bitmapXorRange(i, j uint64) { var X uint64 = maxBitmap << (i % 64) var Y uint64 = maxBitmap >> (63 - ((j - 1) % 64)) if x == y { - cnt := popcnt(c.bitmap[x]) + cnt := popcount(c.bitmap[x]) c.bitmap[x] ^= (X & Y) //// flip - c.n += int(popcnt(c.bitmap[x]) - cnt) + c.n += int(popcount(c.bitmap[x]) - cnt) } else { - cnt := popcnt(c.bitmap[x]) + cnt := popcount(c.bitmap[x]) c.bitmap[x] ^= X - c.n += int(popcnt(c.bitmap[x]) - cnt) + c.n += int(popcount(c.bitmap[x]) - cnt) for i := x + 1; i < y; i++ { - cnt = popcnt(c.bitmap[i]) + cnt = popcount(c.bitmap[i]) c.bitmap[i] ^= maxBitmap - c.n += int(popcnt(c.bitmap[i]) - cnt) + c.n += int(popcount(c.bitmap[i]) - cnt) } - cnt = popcnt(c.bitmap[y]) + cnt = popcount(c.bitmap[y]) c.bitmap[y] ^= Y - c.n += int(popcnt(c.bitmap[y]) - cnt) + c.n += int(popcount(c.bitmap[y]) - cnt) } } @@ -2342,16 +2343,16 @@ func (c *container) bitmapZeroRange(i, j uint64) { var X uint64 = maxBitmap << (i % 64) var Y uint64 = maxBitmap >> (63 - ((j - 1) % 64)) if x == y { - c.n -= int(popcnt(c.bitmap[x] & (X & Y))) + c.n -= int(popcount(c.bitmap[x] & (X & Y))) c.bitmap[x] &= ^(X & Y) } else { - c.n -= int(popcnt(c.bitmap[x] & X)) + c.n -= int(popcount(c.bitmap[x] & X)) c.bitmap[x] &= ^X for i := x + 1; i < y; i++ { - c.n -= int(popcnt(c.bitmap[i])) + c.n -= int(popcount(c.bitmap[i])) c.bitmap[i] = 0 } - c.n -= int(popcnt(c.bitmap[y] & Y)) + c.n -= int(popcount(c.bitmap[y] & Y)) c.bitmap[y] &= ^Y } } @@ -2376,7 +2377,7 @@ func unionBitmapBitmap(a, b *container) *container { for i := 0; i < bitmapN; i++ { v := a.bitmap[i] | b.bitmap[i] output.bitmap[i] = v - output.n += int(popcnt(v)) + output.n += int(popcount(v)) } return output @@ -2812,7 +2813,7 @@ func xorBitmapBitmap(a, b *container) *container { for i := 0; i < bitmapN; i++ { v := a.bitmap[i] ^ b.bitmap[i] output.bitmap[i] = v - output.n += int(popcnt(v)) + output.n += int(popcount(v)) } if output.count() < ArrayMaxSize { @@ -2975,35 +2976,7 @@ func search64(a []uint64, value uint64) int { // trailingZeroN returns the number of trailing zeros in v. // v must be greater than zero. func trailingZeroN(v uint64) int { - n := int64(63) - if y := v << 32; y != 0 { - n, v = n-32, y - } - if y := v << 16; y != 0 { - n, v = n-16, y - } - if y := v << 8; y != 0 { - n, v = n-8, y - } - if y := v << 4; y != 0 { - n, v = n-4, y - } - if y := v << 2; y != 0 { - n, v = n-2, y - } - return int(n - int64(v<<1>>63)) -} - -// bit population count, taken from -// https://code.google.com/p/go/issues/detail?id=4988#c11 -// credit: https://code.google.com/u/arnehormann/ -func popcount(x uint64) (n uint64) { - x -= (x >> 1) & 0x5555555555555555 - x = (x>>2)&0x3333333333333333 + x&0x3333333333333333 - x += x >> 4 - x &= 0x0f0f0f0f0f0f0f0f - x *= 0x0101010101010101 - return x >> 56 + return bits.TrailingZeros64(v) } // ErrorList represents a list of errors. @@ -3265,3 +3238,47 @@ func xorBitmapRun(a, b *container) *container { } return output } + +func popcount(x uint64) uint64 { + return uint64(bits.OnesCount64(x)) +} + +func popcountSlice(s []uint64) uint64 { + cnt := uint64(0) + for _, x := range s { + cnt += popcount(x) + } + return cnt +} + +func popcountMaskSlice(s, m []uint64) uint64 { + cnt := uint64(0) + for i := range s { + cnt += popcount(s[i] &^ m[i]) + } + return cnt +} + +func popcountAndSlice(s, m []uint64) uint64 { + cnt := uint64(0) + for i := range s { + cnt += popcount(s[i] & m[i]) + } + return cnt +} + +func popcountOrSlice(s, m []uint64) uint64 { + cnt := uint64(0) + for i := range s { + cnt += popcount(s[i] | m[i]) + } + return cnt +} + +func popcountXorSlice(s, m []uint64) uint64 { + cnt := uint64(0) + for i := range s { + cnt += popcount(s[i] ^ m[i]) + } + return cnt +} From e01edb7e859d3ce988470c7d824159af8eb5b23c Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Tue, 29 Aug 2017 15:38:49 -0500 Subject: [PATCH 4/7] removed 1.8 from support; bits require 1.9 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2ddff4f4b..16acb0803 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: go go: - - 1.8 - 1.9 - master env: From 82592adf64d141cbc73048a9151a20c6a7905849 Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Tue, 20 Feb 2018 11:50:06 -0600 Subject: [PATCH 5/7] add MustRunMainWithCluster test func to have api compatibility with cluster resize this will allow some pdk code which only works with cluster-resize to work against master (i think) --- test/pilosa.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/pilosa.go b/test/pilosa.go index e14b2d032..97c4321c9 100644 --- a/test/pilosa.go +++ b/test/pilosa.go @@ -101,6 +101,27 @@ func MustNewServerCluster(t *testing.T, size int) *Cluster { return cluster } +// **** below exists to have interface compatibility with cluster-resize, +// **** we can remove when cluster resize gets merged *****************// + +type M struct { + *server.Command + Stdin bytes.Buffer + Stdout bytes.Buffer + Stderr bytes.Buffer +} + +func MustRunMainWithCluster(t *testing.T, size int) []*M { + cluster := MustNewServerCluster(t, size) + mains := make([]*M, 0) + for _, s := range cluster.Servers { + mains = append(mains, &M{Command: s}) + } + return mains +} + +// ***********************************************************************************// + func NewServerCluster(size int) (cluster *Cluster, err error) { cluster = &Cluster{ Servers: make([]*server.Command, size), From 3e770a5eca9cd6794d40701e76b6f1bb491481c1 Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Wed, 21 Feb 2018 13:47:55 -0600 Subject: [PATCH 6/7] remove cluster type http from docs --- docs/configuration.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 2385f2494..33a78018e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -183,9 +183,8 @@ Any flag that has a value that is a comma separated list on the command line bec #### Cluster Type -* Description: Determine how the cluster handles membership and state sharing. Choose from [static, http, gossip]. +* Description: Determine how the cluster handles membership and state sharing. Choose from [static, gossip]. * static - Messaging between nodes is disabled. This is primarily used for testing. - * http - Messages are transmitted over HTTP. * gossip - Messages are transmitted over TCP. Cluster status and node state are kept in sync via internode gossip. * Flag: `cluster.type="gossip"` * Env: `PILOSA_CLUSTER_TYPE="gossip"` From da125e323c630b1fa2679fca36e02b24d2a5ee5e Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Wed, 21 Feb 2018 14:56:38 -0600 Subject: [PATCH 7/7] broadcast.SendSync field creation and deletion to all nodes --- broadcast.go | 10 + handler.go | 31 +- internal/private.pb.go | 634 +++++++++++++++++++++++++++++++++++------ internal/private.proto | 12 + server.go | 11 + 5 files changed, 607 insertions(+), 91 deletions(-) diff --git a/broadcast.go b/broadcast.go index 38eb53b96..bc3593a2c 100644 --- a/broadcast.go +++ b/broadcast.go @@ -132,6 +132,8 @@ const ( MessageTypeCreateInputDefinition = 6 MessageTypeDeleteInputDefinition = 7 MessageTypeDeleteView = 8 + MessageTypeCreateField = 9 + MessageTypeDeleteField = 10 ) // MarshalMessage encodes the protobuf message into a byte slice. @@ -148,6 +150,10 @@ func MarshalMessage(m proto.Message) ([]byte, error) { typ = MessageTypeCreateFrame case *internal.DeleteFrameMessage: typ = MessageTypeDeleteFrame + case *internal.CreateFieldMessage: + typ = MessageTypeCreateField + case *internal.DeleteFieldMessage: + typ = MessageTypeDeleteField case *internal.CreateInputDefinitionMessage: typ = MessageTypeCreateInputDefinition case *internal.DeleteInputDefinitionMessage: @@ -180,6 +186,10 @@ func UnmarshalMessage(buf []byte) (proto.Message, error) { m = &internal.CreateFrameMessage{} case MessageTypeDeleteFrame: m = &internal.DeleteFrameMessage{} + case MessageTypeCreateField: + m = &internal.CreateFieldMessage{} + case MessageTypeDeleteField: + m = &internal.DeleteFieldMessage{} case MessageTypeCreateInputDefinition: m = &internal.CreateInputDefinitionMessage{} case MessageTypeDeleteInputDefinition: diff --git a/handler.go b/handler.go index e5cce4648..1a67d79be 100644 --- a/handler.go +++ b/handler.go @@ -648,7 +648,6 @@ func (h *Handler) handlePostFrame(w http.ResponseWriter, r *http.Request) { } h.Holder.Stats.CountWithCustomTags("createFrame", 1, 1.0, []string{fmt.Sprintf("index:%s", indexName)}) - } type _postFrameRequest postFrameRequest @@ -800,17 +799,30 @@ func (h *Handler) handlePostFrameField(w http.ResponseWriter, r *http.Request) { return } - // Create new field. - if err := f.CreateField(&Field{ + field := &Field{ Name: fieldName, Type: req.Type, Min: req.Min, Max: req.Max, - }); err != nil { + } + + // Create new field. + if err := f.CreateField(field); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } + // Send the create field message to all nodes. + err := h.Broadcaster.SendSync( + &internal.CreateFieldMessage{ + Index: indexName, + Frame: frameName, + Field: encodeField(field), + }) + if err != nil { + h.logger().Printf("problem sending CreateField message: %s", err) + } + // Encode response. if err := json.NewEncoder(w).Encode(postFrameFieldResponse{}); err != nil { h.logger().Printf("response encoding error: %s", err) @@ -844,6 +856,17 @@ func (h *Handler) handleDeleteFrameField(w http.ResponseWriter, r *http.Request) return } + // Send the delete field message to all nodes. + err := h.Broadcaster.SendSync( + &internal.DeleteFieldMessage{ + Index: indexName, + Frame: frameName, + Field: fieldName, + }) + if err != nil { + h.logger().Printf("problem sending DeleteField message: %s", err) + } + // Encode response. if err := json.NewEncoder(w).Encode(deleteFrameFieldResponse{}); err != nil { h.logger().Printf("response encoding error: %s", err) diff --git a/internal/private.pb.go b/internal/private.pb.go index 1c26aa307..63f2ca581 100644 --- a/internal/private.pb.go +++ b/internal/private.pb.go @@ -21,6 +21,8 @@ CreateIndexMessage CreateFrameMessage DeleteFrameMessage + CreateFieldMessage + DeleteFieldMessage Frame Index InputDefinition @@ -389,6 +391,70 @@ func (m *DeleteFrameMessage) GetFrame() string { return "" } +type CreateFieldMessage struct { + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Frame string `protobuf:"bytes,2,opt,name=Frame,proto3" json:"Frame,omitempty"` + Field *Field `protobuf:"bytes,3,opt,name=Field" json:"Field,omitempty"` +} + +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{12} } + +func (m *CreateFieldMessage) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *CreateFieldMessage) GetFrame() string { + if m != nil { + return m.Frame + } + return "" +} + +func (m *CreateFieldMessage) GetField() *Field { + if m != nil { + return m.Field + } + return nil +} + +type DeleteFieldMessage struct { + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Frame string `protobuf:"bytes,2,opt,name=Frame,proto3" json:"Frame,omitempty"` + Field string `protobuf:"bytes,3,opt,name=Field,proto3" json:"Field,omitempty"` +} + +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{13} } + +func (m *DeleteFieldMessage) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *DeleteFieldMessage) GetFrame() string { + if m != nil { + return m.Frame + } + return "" +} + +func (m *DeleteFieldMessage) GetField() string { + if m != nil { + return m.Field + } + return "" +} + type Frame struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` Meta *FrameMeta `protobuf:"bytes,2,opt,name=Meta" json:"Meta,omitempty"` @@ -397,7 +463,7 @@ type Frame struct { func (m *Frame) Reset() { *m = Frame{} } func (m *Frame) String() string { return proto.CompactTextString(m) } func (*Frame) ProtoMessage() {} -func (*Frame) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{12} } +func (*Frame) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{14} } func (m *Frame) GetName() string { if m != nil { @@ -425,7 +491,7 @@ type Index struct { 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{13} } +func (*Index) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{15} } func (m *Index) GetName() string { if m != nil { @@ -478,7 +544,7 @@ type InputDefinition struct { func (m *InputDefinition) Reset() { *m = InputDefinition{} } func (m *InputDefinition) String() string { return proto.CompactTextString(m) } func (*InputDefinition) ProtoMessage() {} -func (*InputDefinition) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{14} } +func (*InputDefinition) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{16} } func (m *InputDefinition) GetName() string { if m != nil { @@ -510,7 +576,7 @@ type InputDefinitionField struct { func (m *InputDefinitionField) Reset() { *m = InputDefinitionField{} } func (m *InputDefinitionField) String() string { return proto.CompactTextString(m) } func (*InputDefinitionField) ProtoMessage() {} -func (*InputDefinitionField) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{15} } +func (*InputDefinitionField) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{17} } func (m *InputDefinitionField) GetName() string { if m != nil { @@ -543,7 +609,7 @@ type InputDefinitionAction struct { func (m *InputDefinitionAction) Reset() { *m = InputDefinitionAction{} } func (m *InputDefinitionAction) String() string { return proto.CompactTextString(m) } func (*InputDefinitionAction) ProtoMessage() {} -func (*InputDefinitionAction) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{16} } +func (*InputDefinitionAction) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{18} } func (m *InputDefinitionAction) GetFrame() string { if m != nil { @@ -582,7 +648,7 @@ func (m *CreateInputDefinitionMessage) Reset() { *m = CreateInputDefinit func (m *CreateInputDefinitionMessage) String() string { return proto.CompactTextString(m) } func (*CreateInputDefinitionMessage) ProtoMessage() {} func (*CreateInputDefinitionMessage) Descriptor() ([]byte, []int) { - return fileDescriptorPrivate, []int{17} + return fileDescriptorPrivate, []int{19} } func (m *CreateInputDefinitionMessage) GetIndex() string { @@ -608,7 +674,7 @@ func (m *DeleteInputDefinitionMessage) Reset() { *m = DeleteInputDefinit func (m *DeleteInputDefinitionMessage) String() string { return proto.CompactTextString(m) } func (*DeleteInputDefinitionMessage) ProtoMessage() {} func (*DeleteInputDefinitionMessage) Descriptor() ([]byte, []int) { - return fileDescriptorPrivate, []int{18} + return fileDescriptorPrivate, []int{20} } func (m *DeleteInputDefinitionMessage) GetIndex() string { @@ -635,7 +701,7 @@ type NodeStatus struct { 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{19} } +func (*NodeStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{21} } func (m *NodeStatus) GetHost() string { if m != nil { @@ -672,7 +738,7 @@ type ClusterStatus struct { 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{20} } +func (*ClusterStatus) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{22} } func (m *ClusterStatus) GetNodes() []*NodeStatus { if m != nil { @@ -688,7 +754,7 @@ type FrameSchema struct { func (m *FrameSchema) Reset() { *m = FrameSchema{} } func (m *FrameSchema) String() string { return proto.CompactTextString(m) } func (*FrameSchema) ProtoMessage() {} -func (*FrameSchema) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{21} } +func (*FrameSchema) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{23} } func (m *FrameSchema) GetFields() []*Field { if m != nil { @@ -707,7 +773,7 @@ type Field struct { 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{22} } +func (*Field) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{24} } func (m *Field) GetName() string { if m != nil { @@ -746,7 +812,7 @@ type DeleteViewMessage struct { 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{23} } +func (*DeleteViewMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{25} } func (m *DeleteViewMessage) GetIndex() string { if m != nil { @@ -782,6 +848,8 @@ func init() { proto.RegisterType((*CreateIndexMessage)(nil), "internal.CreateIndexMessage") proto.RegisterType((*CreateFrameMessage)(nil), "internal.CreateFrameMessage") proto.RegisterType((*DeleteFrameMessage)(nil), "internal.DeleteFrameMessage") + proto.RegisterType((*CreateFieldMessage)(nil), "internal.CreateFieldMessage") + proto.RegisterType((*DeleteFieldMessage)(nil), "internal.DeleteFieldMessage") proto.RegisterType((*Frame)(nil), "internal.Frame") proto.RegisterType((*Index)(nil), "internal.Index") proto.RegisterType((*InputDefinition)(nil), "internal.InputDefinition") @@ -1256,6 +1324,82 @@ func (m *DeleteFrameMessage) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *CreateFieldMessage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateFieldMessage) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Index) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintPrivate(dAtA, i, uint64(len(m.Index))) + i += copy(dAtA[i:], m.Index) + } + if len(m.Frame) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintPrivate(dAtA, i, uint64(len(m.Frame))) + i += copy(dAtA[i:], m.Frame) + } + if m.Field != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintPrivate(dAtA, i, uint64(m.Field.Size())) + n9, err := m.Field.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n9 + } + return i, nil +} + +func (m *DeleteFieldMessage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteFieldMessage) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Index) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintPrivate(dAtA, i, uint64(len(m.Index))) + i += copy(dAtA[i:], m.Index) + } + if len(m.Frame) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintPrivate(dAtA, i, uint64(len(m.Frame))) + i += copy(dAtA[i:], m.Frame) + } + if len(m.Field) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintPrivate(dAtA, i, uint64(len(m.Field))) + i += copy(dAtA[i:], m.Field) + } + return i, nil +} + func (m *Frame) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1281,11 +1425,11 @@ func (m *Frame) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintPrivate(dAtA, i, uint64(m.Meta.Size())) - n9, err := m.Meta.MarshalTo(dAtA[i:]) + n10, err := m.Meta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n10 } return i, nil } @@ -1315,11 +1459,11 @@ func (m *Index) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintPrivate(dAtA, i, uint64(m.Meta.Size())) - n10, err := m.Meta.MarshalTo(dAtA[i:]) + n11, err := m.Meta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n10 + i += n11 } if m.MaxSlice != 0 { dAtA[i] = 0x18 @@ -1339,21 +1483,21 @@ func (m *Index) MarshalTo(dAtA []byte) (int, error) { } } if len(m.Slices) > 0 { - dAtA12 := make([]byte, len(m.Slices)*10) - var j11 int + dAtA13 := make([]byte, len(m.Slices)*10) + var j12 int for _, num := range m.Slices { for num >= 1<<7 { - dAtA12[j11] = uint8(uint64(num)&0x7f | 0x80) + dAtA13[j12] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j11++ + j12++ } - dAtA12[j11] = uint8(num) - j11++ + dAtA13[j12] = uint8(num) + j12++ } dAtA[i] = 0x2a i++ - i = encodeVarintPrivate(dAtA, i, uint64(j11)) - i += copy(dAtA[i:], dAtA12[:j11]) + i = encodeVarintPrivate(dAtA, i, uint64(j12)) + i += copy(dAtA[i:], dAtA13[:j12]) } if len(m.InputDefinitions) > 0 { for _, msg := range m.InputDefinitions { @@ -1540,11 +1684,11 @@ func (m *CreateInputDefinitionMessage) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintPrivate(dAtA, i, uint64(m.Definition.Size())) - n13, err := m.Definition.MarshalTo(dAtA[i:]) + n14, err := m.Definition.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n13 + i += n14 } return i, nil } @@ -1990,6 +2134,42 @@ func (m *DeleteFrameMessage) Size() (n int) { return n } +func (m *CreateFieldMessage) Size() (n int) { + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovPrivate(uint64(l)) + } + l = len(m.Frame) + if l > 0 { + n += 1 + l + sovPrivate(uint64(l)) + } + if m.Field != nil { + l = m.Field.Size() + n += 1 + l + sovPrivate(uint64(l)) + } + return n +} + +func (m *DeleteFieldMessage) Size() (n int) { + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovPrivate(uint64(l)) + } + l = len(m.Frame) + if l > 0 { + n += 1 + l + sovPrivate(uint64(l)) + } + l = len(m.Field) + if l > 0 { + n += 1 + l + sovPrivate(uint64(l)) + } + return n +} + func (m *Frame) Size() (n int) { var l int _ = l @@ -3822,6 +4002,284 @@ func (m *DeleteFrameMessage) Unmarshal(dAtA []byte) error { } return nil } +func (m *CreateFieldMessage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateFieldMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateFieldMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrivate + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Frame", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrivate + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Frame = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPrivate + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Field == nil { + m.Field = &Field{} + } + if err := m.Field.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPrivate(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthPrivate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteFieldMessage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteFieldMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteFieldMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrivate + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Frame", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrivate + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Frame = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPrivate + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPrivate(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthPrivate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Frame) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5634,65 +6092,67 @@ var ( func init() { proto.RegisterFile("private.proto", fileDescriptorPrivate) } var fileDescriptorPrivate = []byte{ - // 948 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xc1, 0x6e, 0x23, 0x45, - 0x10, 0x65, 0x3c, 0x63, 0xaf, 0x5d, 0x26, 0x1b, 0xa7, 0x09, 0x2b, 0x6f, 0x14, 0x19, 0xab, 0x0f, - 0x6c, 0x88, 0x44, 0x0e, 0x41, 0x5a, 0x01, 0xcb, 0x01, 0x36, 0xce, 0x2a, 0x16, 0x78, 0x81, 0xf6, - 0x6a, 0xb9, 0x21, 0x75, 0x9c, 0x62, 0x77, 0x94, 0xf1, 0x8c, 0x99, 0x69, 0x27, 0x31, 0x07, 0x8e, - 0x7c, 0x03, 0x12, 0x47, 0x7e, 0x86, 0x23, 0x9f, 0x80, 0xc2, 0x85, 0x3f, 0x40, 0xe2, 0x84, 0xba, - 0xba, 0x7b, 0x66, 0x6c, 0xc7, 0x8e, 0xb2, 0xb7, 0xae, 0x57, 0xd5, 0x55, 0xaf, 0xab, 0xab, 0xaa, - 0x1b, 0x36, 0x26, 0x69, 0x78, 0x21, 0x15, 0x1e, 0x4c, 0xd2, 0x44, 0x25, 0xac, 0x1e, 0xc6, 0x0a, - 0xd3, 0x58, 0x46,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 0x64, 0x6d, 0x17, 0x1e, 0x0b, 0x8a, - 0xc2, 0x98, 0xf0, 0xc7, 0xd0, 0xa4, 0x2a, 0x22, 0x5f, 0xb2, 0xf4, 0x75, 0xf0, 0xd6, 0x7f, 0x1d, - 0x86, 0x50, 0x5d, 0xdd, 0x3a, 0x0c, 0x02, 0xfa, 0xfd, 0xd8, 0x04, 0xd1, 0xc7, 0xa7, 0x05, 0xfe, - 0x20, 0x34, 0xd7, 0xe3, 0x0b, 0xbd, 0x24, 0x44, 0x5e, 0xd1, 0x61, 0x34, 0x22, 0xf5, 0xdb, 0xb2, - 0x65, 0xae, 0x43, 0xbf, 0xfc, 0x6f, 0xf2, 0x0a, 0xb8, 0x0f, 0x84, 0x5f, 0x7c, 0x20, 0x9e, 0xb6, - 0xfe, 0xb8, 0xee, 0x78, 0x7f, 0x5e, 0x77, 0xbc, 0xbf, 0xae, 0x3b, 0xde, 0xaf, 0x7f, 0x77, 0xde, - 0x3a, 0xad, 0xd1, 0xaf, 0xf2, 0xa3, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x47, 0xdd, 0xdd, 0x8e, - 0x66, 0x0a, 0x00, 0x00, + // 978 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0x23, 0x45, + 0x10, 0x66, 0xfc, 0xb7, 0x76, 0x99, 0x24, 0x4e, 0x13, 0x56, 0xde, 0x28, 0x32, 0x56, 0x4b, 0xb0, + 0x21, 0x12, 0x39, 0x04, 0x69, 0x05, 0x2c, 0x07, 0xd8, 0x38, 0xab, 0x58, 0xe0, 0x05, 0xda, 0xab, + 0x70, 0x43, 0xea, 0x38, 0x45, 0x32, 0xca, 0x78, 0xc6, 0xcc, 0xb4, 0x93, 0x98, 0x03, 0x47, 0x9e, + 0x01, 0x89, 0x23, 0x2f, 0xc3, 0x91, 0x47, 0x40, 0xe1, 0xc2, 0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 0x42, 0x56, 0x2d, 0x7c, 0x02, 0xf0, 0x2a, 0x3a, 0xc3, 0xbe, 0x92, 0x6a, 0x9c, 0x68, + 0x8d, 0xe3, 0x28, 0x51, 0xae, 0x9e, 0xf4, 0x9a, 0x5e, 0x16, 0x25, 0x55, 0x3a, 0x62, 0x48, 0x60, + 0x1f, 0xc2, 0x23, 0x72, 0x8a, 0xae, 0x6c, 0x36, 0x66, 0x7a, 0x5d, 0xb8, 0x7d, 0xea, 0xd2, 0xc1, + 0x05, 0x0e, 0xcd, 0xab, 0x5f, 0x13, 0x56, 0xe2, 0xcf, 0x61, 0xed, 0x30, 0x18, 0x27, 0x0a, 0x63, + 0x1b, 0x7d, 0x0f, 0xca, 0x9a, 0x8b, 0x7b, 0x73, 0xb7, 0x32, 0x8f, 0x19, 0x45, 0x61, 0x54, 0xf8, + 0x33, 0xa8, 0x53, 0x15, 0x91, 0x2f, 0x99, 0xfb, 0xfb, 0x78, 0xab, 0xff, 0x3e, 0x7d, 0x3b, 0x1a, + 0x17, 0xb6, 0x0e, 0x83, 0x12, 0x7d, 0xdf, 0x6c, 0x82, 0xe8, 0xe7, 0xd6, 0x80, 0x62, 0xcf, 0x37, + 0xd7, 0x53, 0x14, 0x7a, 0x49, 0x88, 0xbc, 0xa1, 0xc3, 0x68, 0x44, 0xea, 0xc7, 0x71, 0xd3, 0x5c, + 0x87, 0xfe, 0xba, 0x3c, 0x64, 0x60, 0xbb, 0x1f, 0x50, 0x31, 0xfb, 0x01, 0xbd, 0x68, 0xfc, 0x79, + 0xdb, 0xf2, 0xfe, 0xba, 0x6d, 0x79, 0x7f, 0xdf, 0xb6, 0xbc, 0xdf, 0xfe, 0x69, 0xbd, 0x75, 0x5a, + 0xa1, 0x6f, 0xf1, 0xc7, 0x6f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x93, 0xbf, 0xbc, 0x1f, 0x27, 0x0b, + 0x00, 0x00, } diff --git a/internal/private.proto b/internal/private.proto index 083316ddd..ed664115a 100644 --- a/internal/private.proto +++ b/internal/private.proto @@ -68,6 +68,18 @@ message DeleteFrameMessage { string Frame = 2; } +message CreateFieldMessage { + string Index = 1; + string Frame = 2; + Field Field = 3; +} + +message DeleteFieldMessage { + string Index = 1; + string Frame = 2; + string Field = 3; +} + message Frame { string Name = 1; FrameMeta Meta = 2; diff --git a/server.go b/server.go index 83d417abd..95dff018d 100644 --- a/server.go +++ b/server.go @@ -404,6 +404,17 @@ func (s *Server) ReceiveMessage(pb proto.Message) error { if err := idx.DeleteFrame(obj.Frame); err != nil { return err } + case *internal.CreateFieldMessage: + f := s.Holder.Frame(obj.Index, obj.Frame) + field := decodeField(obj.Field) + if err := f.CreateField(field); err != nil { + return err + } + case *internal.DeleteFieldMessage: + f := s.Holder.Frame(obj.Index, obj.Frame) + if err := f.DeleteField(obj.Field); err != nil { + return err + } case *internal.CreateInputDefinitionMessage: idx := s.Holder.Index(obj.Index) if idx == nil {