@@ -25,10 +25,10 @@ import com.ibm.etcd.client.{EtcdClient => Client}
25
25
import io .grpc .stub .StreamObserver
26
26
import java .util .concurrent .Executors
27
27
28
- // import org.apache.openwhisk.core.ConfigKeys
28
+ import org .apache .openwhisk .core .ConfigKeys
29
29
import org .apache .openwhisk .core .etcd .EtcdType ._
30
30
import org .apache .openwhisk .core .service .Lease
31
- // import pureconfig.loadConfigOrThrow
31
+ import pureconfig .loadConfigOrThrow
32
32
import spray .json .DefaultJsonProtocol
33
33
34
34
import scala .language .implicitConversions
@@ -49,10 +49,10 @@ object RichListenableFuture {
49
49
object EtcdClient {
50
50
// hostAndPorts format: {HOST}:{PORT}[,{HOST}:{PORT},{HOST}:{PORT}, ...]
51
51
def apply (config : EtcdConfig )(implicit ece : ExecutionContextExecutor ): EtcdClient = {
52
- // require(config.hosts != null)
52
+ require(config.hosts != null )
53
53
require(
54
54
(config.username.nonEmpty && config.password.nonEmpty) || (config.username.isEmpty && config.password.isEmpty))
55
- val clientBuilder = Client .forEndpoints(" testHosts " ).withPlainText()
55
+ val clientBuilder = Client .forEndpoints(config.hosts ).withPlainText()
56
56
if (config.username.nonEmpty && config.password.nonEmpty) {
57
57
new EtcdClient (clientBuilder.withCredentials(config.username.get, config.password.get).build())
58
58
} else {
@@ -183,7 +183,7 @@ trait EtcdLeaseApi {
183
183
}
184
184
185
185
trait EtcdWatchApi {
186
- val nThreads = 10
186
+ val nThreads = loadConfigOrThrow[ Int ]( ConfigKeys .etcdPoolThreads)
187
187
val threadpool = Executors .newFixedThreadPool(nThreads);
188
188
protected [etcd] val client : Client
189
189
0 commit comments