[VOL-2831] - Multiple adapter support
This commit introduces the necessary APIs needed to support
multiple adapters. It uses the number of replicas of a given
adapter and consistent hashing to determine the target of a
given request.
The endpoint_manager.go provides two APIs that will be needed
by components communicating over kafka:
- GetEndPoint() : to be called before sending a request to kafka
- IsDeviceOwnedByService(): used during device reconciliation
A change is made to the adapter_proxy.go to use this new mechanism
when sending a request to an adapter from another adapter.
The mocks directory was refactored to get around circular package
dependencies. This implies any component using these mocks will
need to adjust to the new set of directories when using this
library version.
Change-Id: I470cd62fcfd04edc1fd4508400c9619cadaab25a
diff --git a/vendor/github.com/cespare/xxhash/rotate.go b/vendor/github.com/cespare/xxhash/rotate.go
new file mode 100644
index 0000000..f3eac5e
--- /dev/null
+++ b/vendor/github.com/cespare/xxhash/rotate.go
@@ -0,0 +1,14 @@
+// +build !go1.9
+
+package xxhash
+
+// TODO(caleb): After Go 1.10 comes out, remove this fallback code.
+
+func rol1(x uint64) uint64 { return (x << 1) | (x >> (64 - 1)) }
+func rol7(x uint64) uint64 { return (x << 7) | (x >> (64 - 7)) }
+func rol11(x uint64) uint64 { return (x << 11) | (x >> (64 - 11)) }
+func rol12(x uint64) uint64 { return (x << 12) | (x >> (64 - 12)) }
+func rol18(x uint64) uint64 { return (x << 18) | (x >> (64 - 18)) }
+func rol23(x uint64) uint64 { return (x << 23) | (x >> (64 - 23)) }
+func rol27(x uint64) uint64 { return (x << 27) | (x >> (64 - 27)) }
+func rol31(x uint64) uint64 { return (x << 31) | (x >> (64 - 31)) }