[VOL-4194] Add an Etcd Client Pool
This commit adds an Etcd client pool with a configurable
capacity as well as maximum concurrent requests per client. While
tests were done locally, it was not done with all components
due to dependencies that need to be merged first. Once the
dependencies are merged then this change can be fully tested.
Change-Id: I7e8c8953bd3871056a721de68990e3d85df8b688
diff --git a/pkg/db/kvstore/client.go b/pkg/db/kvstore/client.go
index b35f1f3..e4b1fff 100644
--- a/pkg/db/kvstore/client.go
+++ b/pkg/db/kvstore/client.go
@@ -79,14 +79,17 @@
Put(ctx context.Context, key string, value interface{}) error
Delete(ctx context.Context, key string) error
DeleteWithPrefix(ctx context.Context, prefixKey string) error
+ Watch(ctx context.Context, key string, withPrefix bool) chan *Event
+ IsConnectionUp(ctx context.Context) bool // timeout in second
+ CloseWatch(ctx context.Context, key string, ch chan *Event)
+ Close(ctx context.Context)
+
+ // These APIs are not used. They will be cleaned up in release Voltha 2.9.
+ // It's not cleaned now to limit changes in all components
Reserve(ctx context.Context, key string, value interface{}, ttl time.Duration) (interface{}, error)
ReleaseReservation(ctx context.Context, key string) error
ReleaseAllReservations(ctx context.Context) error
RenewReservation(ctx context.Context, key string) error
- Watch(ctx context.Context, key string, withPrefix bool) chan *Event
AcquireLock(ctx context.Context, lockName string, timeout time.Duration) error
ReleaseLock(lockName string) error
- IsConnectionUp(ctx context.Context) bool // timeout in second
- CloseWatch(ctx context.Context, key string, ch chan *Event)
- Close(ctx context.Context)
}