summaryrefslogtreecommitdiffstats
path: root/service-monitor
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-07-11 19:27:43 +0200
committerBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-07-13 14:35:25 +0200
commitebd47ebba08d9d8d06ddb1ee4de5fdeb5ab035bd (patch)
tree0305583a8cf1294aba5fec4b172cae263fa1db19 /service-monitor
parent8d13e14a7edad735e89887f1fabb5c919a8dbb2a (diff)
Remove use of deprecated JavaConversions API
Diffstat (limited to 'service-monitor')
-rw-r--r--service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/SlobrokAndConfigIntersector.scala7
-rw-r--r--service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/SlobrokMonitor.scala7
-rw-r--r--service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/config/InstancesObservables.scala17
3 files changed, 15 insertions, 16 deletions
diff --git a/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/SlobrokAndConfigIntersector.scala b/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/SlobrokAndConfigIntersector.scala
index 2c259d6f56e..958a9bc462c 100644
--- a/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/SlobrokAndConfigIntersector.scala
+++ b/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/SlobrokAndConfigIntersector.scala
@@ -1,8 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.service.monitor
-import java.util.{Collections, Optional}
import java.util.logging.Logger
+import java.util.{Collections, Optional}
import com.google.inject.Inject
import com.yahoo.cloud.config.ConfigserverConfig
@@ -15,10 +15,9 @@ import com.yahoo.vespa.service.monitor.SlobrokAndConfigIntersector._
import com.yahoo.vespa.service.monitor.SlobrokMonitor._
import com.yahoo.vespa.service.monitor.config.InstancesObservables
import com.yahoo.vespa.service.monitor.config.InstancesObservables._
-import rx.lang.scala.{Subscription, Observable}
+import rx.lang.scala.{Observable, Subscription}
-import scala.collection.convert.decorateAsJava._
-import scala.collection.convert.decorateAsScala._
+import scala.collection.JavaConverters._
import scala.collection.immutable.Set
import scala.concurrent.duration._
import scala.language.postfixOps
diff --git a/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/SlobrokMonitor.scala b/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/SlobrokMonitor.scala
index 03f47b7192c..f5ae2eeb510 100644
--- a/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/SlobrokMonitor.scala
+++ b/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/SlobrokMonitor.scala
@@ -3,9 +3,10 @@ package com.yahoo.vespa.service.monitor
import com.yahoo.jrt.slobrok.api.Mirror.Entry
import com.yahoo.jrt.slobrok.api.{Mirror, SlobrokList}
-import com.yahoo.jrt.{Transport, Supervisor}
+import com.yahoo.jrt.{Supervisor, Transport}
import com.yahoo.vespa.service.monitor.SlobrokMonitor._
-import scala.collection.convert.wrapAsJava._
+
+import scala.collection.JavaConverters._
/**
* @author bakksjo
@@ -16,7 +17,7 @@ class SlobrokMonitor {
private val mirror = new Mirror(supervisor, slobrokList)
def setSlobrokConnectionSpecs(slobrokConnectionSpecs: Traversable[String]): Unit = {
- val slobrokConnectionSpecsJavaList: java.util.List[String] = slobrokConnectionSpecs.toList
+ val slobrokConnectionSpecsJavaList: java.util.List[String] = slobrokConnectionSpecs.toList.asJava
slobrokList.setup(slobrokConnectionSpecsJavaList.toArray(new Array[java.lang.String](0)))
}
diff --git a/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/config/InstancesObservables.scala b/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/config/InstancesObservables.scala
index 9388549046f..ac9b8f5e5b0 100644
--- a/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/config/InstancesObservables.scala
+++ b/service-monitor/src/main/scala/com/yahoo/vespa/service/monitor/config/InstancesObservables.scala
@@ -8,14 +8,13 @@ import com.yahoo.cloud.config.LbServicesConfig
import com.yahoo.cloud.config.LbServicesConfig.Tenants.Applications.Hosts
import com.yahoo.cloud.config.LbServicesConfig.Tenants.Applications.Hosts.Services.Ports
import com.yahoo.config.subscription.ConfigSourceSet
-import com.yahoo.vespa.applicationmodel.{ApplicationInstanceId, TenantId, ServiceClusterKey, ServiceCluster, ServiceInstance, ApplicationInstance, ServiceType, HostName, ConfigId, ClusterId, ApplicationInstanceReference}
+import com.yahoo.vespa.applicationmodel.{ApplicationInstance, ApplicationInstanceId, ApplicationInstanceReference, ClusterId, ConfigId, HostName, ServiceCluster, ServiceClusterKey, ServiceInstance, ServiceType, TenantId}
import com.yahoo.vespa.service.monitor.config.InstancesObservables._
import rx.lang.scala.JavaConversions._
import rx.lang.scala.{Observable, Subscription}
import rx.schedulers.Schedulers
-import scala.collection.convert.decorateAsJava._
-import scala.collection.convert.wrapAsScala._
+import scala.collection.JavaConverters._
import scala.concurrent.duration._
/**
@@ -63,8 +62,8 @@ object InstancesObservables {
private def asInstanceReferenceToHostConfigMap(config: LbServicesConfig) = {
for {
- (tenantIdString, tenantConfig) <- config.tenants()
- (applicationIdString, applicationConfig) <- tenantConfig.applications()
+ (tenantIdString, tenantConfig) <- config.tenants().asScala
+ (applicationIdString, applicationConfig) <- tenantConfig.applications().asScala
} yield {
val applicationInstanceReference: ApplicationInstanceReference = new ApplicationInstanceReference(
new TenantId(tenantIdString),
@@ -80,19 +79,19 @@ object InstancesObservables {
}
for {
- (hostName, hostConfig) <- hostsConfigs
+ (hostName, hostConfig) <- hostsConfigs.asScala
slobrokService <- Option(hostConfig.services("slobrok"))
} yield SlobrokService(
hostName,
- rpcPort(slobrokService.ports()).getOrElse(throw new RuntimeException("Found slobrok without rpc port")))
+ rpcPort(slobrokService.ports().asScala).getOrElse(throw new RuntimeException("Found slobrok without rpc port")))
}
private def asServiceClusterSet(hostsConfigs: java.util.Map[String, Hosts])
: java.util.Set[ServiceCluster[Void]] = {
val serviceInstancesGroupedByCluster: Map[ServiceClusterKey, Iterable[ServiceInstance[Void]]] = (for {
- (hostName, hostConfig) <- hostsConfigs.view
- (serviceName, servicesConfig) <- hostConfig.services()
+ (hostName, hostConfig) <- hostsConfigs.asScala.view
+ (serviceName, servicesConfig) <- hostConfig.services().asScala
} yield {
(new ServiceClusterKey(new ClusterId(servicesConfig.clustername()), new ServiceType(servicesConfig.`type`())),
new ServiceInstance(new ConfigId(servicesConfig.configId()), new HostName(hostName), null.asInstanceOf[Void]))