aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject aries-containers git commit: Implement getActualInstanceCount for service.
Date Thu, 25 May 2017 16:17:32 GMT
Repository: aries-containers
Updated Branches:
  refs/heads/master 3efdf0794 -> cef77e6c5


Implement getActualInstanceCount for service.


Project: http://git-wip-us.apache.org/repos/asf/aries-containers/repo
Commit: http://git-wip-us.apache.org/repos/asf/aries-containers/commit/cef77e6c
Tree: http://git-wip-us.apache.org/repos/asf/aries-containers/tree/cef77e6c
Diff: http://git-wip-us.apache.org/repos/asf/aries-containers/diff/cef77e6c

Branch: refs/heads/master
Commit: cef77e6c5c2e8ecd3971fbb79563ec34637592cc
Parents: 3efdf07
Author: David Bosschaert <davidb@apache.org>
Authored: Thu May 25 17:17:12 2017 +0100
Committer: David Bosschaert <davidb@apache.org>
Committed: Thu May 25 17:17:12 2017 +0100

----------------------------------------------------------------------
 .../docker/local/impl/LocalDockerContainerFactory.java         | 6 +++++-
 .../apache/aries/containers/docker/local/impl/ServiceImpl.java | 3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aries-containers/blob/cef77e6c/containers-docker-local/src/main/java/org/apache/aries/containers/docker/local/impl/LocalDockerContainerFactory.java
----------------------------------------------------------------------
diff --git a/containers-docker-local/src/main/java/org/apache/aries/containers/docker/local/impl/LocalDockerContainerFactory.java
b/containers-docker-local/src/main/java/org/apache/aries/containers/docker/local/impl/LocalDockerContainerFactory.java
index 93b9464..11ad192 100644
--- a/containers-docker-local/src/main/java/org/apache/aries/containers/docker/local/impl/LocalDockerContainerFactory.java
+++ b/containers-docker-local/src/main/java/org/apache/aries/containers/docker/local/impl/LocalDockerContainerFactory.java
@@ -72,6 +72,10 @@ public class LocalDockerContainerFactory implements ContainerFactory {
             docker = new LocalDockerController();
     }
 
+    List<String> getDockerIDs(ServiceConfig config) {
+        return docker.ps(SERVICE_NAME + "=" + config.getServiceName());
+    }
+
     @Override
     public Service getService(ServiceConfig config) throws Exception {
         init();
@@ -155,7 +159,7 @@ public class LocalDockerContainerFactory implements ContainerFactory {
     @SuppressWarnings({ "rawtypes", "unchecked" })
     private List<ContainerImpl> discoverContainers(ServiceConfig config) {
         List<ContainerImpl> res = new ArrayList<>();
-        List<String> ids = docker.ps(SERVICE_NAME + "=" + config.getServiceName());
+        List<String> ids = getDockerIDs(config);
         if (ids.size() == 0)
             return Collections.emptyList();
 

http://git-wip-us.apache.org/repos/asf/aries-containers/blob/cef77e6c/containers-docker-local/src/main/java/org/apache/aries/containers/docker/local/impl/ServiceImpl.java
----------------------------------------------------------------------
diff --git a/containers-docker-local/src/main/java/org/apache/aries/containers/docker/local/impl/ServiceImpl.java
b/containers-docker-local/src/main/java/org/apache/aries/containers/docker/local/impl/ServiceImpl.java
index 4577f70..76484f0 100644
--- a/containers-docker-local/src/main/java/org/apache/aries/containers/docker/local/impl/ServiceImpl.java
+++ b/containers-docker-local/src/main/java/org/apache/aries/containers/docker/local/impl/ServiceImpl.java
@@ -44,7 +44,8 @@ public class ServiceImpl implements Service {
 
     @Override
     public int getActualInstanceCount() {
-        return containers.size(); // TODO obtain live
+        return factory.getDockerIDs(config).size();
+        // TODO test
     }
 
     @Override


Mime
View raw message