Examples of ZooKeeperClusterService


Examples of io.fabric8.api.ZooKeeperClusterService

     */
    protected void preCreateContainer(String name) throws IllegalArgumentException {
        FabricValidations.validateContainerName(name);
        if (!isEnsembleServer) {
            ServiceReference sr = getBundleContext().getServiceReference(ZooKeeperClusterService.class.getName());
            ZooKeeperClusterService zkcs = sr != null ? getService(ZooKeeperClusterService.class, sr) : null;
            if (zkcs == null) {
                throw new IllegalStateException("Unable to find ZooKeeperClusterService service");
            }
            if (zkcs.getEnsembleContainers().isEmpty()) {
                if (!isEnsembleServer) {
                    throw new IllegalStateException("The use of the --ensemble-server option is mandatory when creating an initial container");
                }
                return;
            }
View Full Code Here

Examples of io.fabric8.api.ZooKeeperClusterService

                    EnsembleSupport.addToEnsemble(fabricService, cnt1, cnt2);
                    System.err.println(CommandSupport.executeCommand("config:proplist --pid io.fabric8.zookeeper"));

                    System.err.println(CommandSupport.executeCommand("fabric:container-list"));
                    System.err.println(CommandSupport.executeCommand("fabric:ensemble-list"));
                    ZooKeeperClusterService zooKeeperClusterService = ServiceLocator.awaitService(ZooKeeperClusterService.class);
                    Assert.assertNotNull(zooKeeperClusterService);
                    List<String> ensembleContainersResult = zooKeeperClusterService.getEnsembleContainers();
                    Assert.assertTrue(ensembleContainersResult.contains(cnt1.getId()));
                    Assert.assertTrue(ensembleContainersResult.contains(cnt2.getId()));
                    ProvisionSupport.provisioningSuccess(Arrays.asList(fabricService.getContainers()), ProvisionSupport.PROVISION_TIMEOUT);
                }

                System.out.println(CommandSupport.executeCommand("fabric:version-create"));
                System.out.println(CommandSupport.executeCommand("fabric:container-upgrade --all 1.2"));

                for (int e = 0; e < 3 && addedContainers.size() >= 2 && addedContainers.size() % 2 == 0; e++) {
                    Container cnt1 = addedContainers.removeFirst();
                    Container cnt2 = addedContainers.removeFirst();
                    containerQueue.add(cnt1);
                    containerQueue.add(cnt2);
                    EnsembleSupport.removeFromEnsemble(fabricService, cnt1, cnt2);
                    System.err.println(CommandSupport.executeCommand("config:proplist --pid io.fabric8.zookeeper"));

                    System.err.println(CommandSupport.executeCommand("fabric:container-list"));
                    System.err.println(CommandSupport.executeCommand("fabric:ensemble-list"));
                    ZooKeeperClusterService zooKeeperClusterService = ServiceLocator.awaitService(ZooKeeperClusterService.class);
                    Assert.assertNotNull(zooKeeperClusterService);
                    List<String> ensembleContainersResult = zooKeeperClusterService.getEnsembleContainers();
                    Assert.assertFalse(ensembleContainersResult.contains(cnt1.getId()));
                    Assert.assertFalse(ensembleContainersResult.contains(cnt2.getId()));
                    ProvisionSupport.provisioningSuccess(Arrays.asList(fabricService.getContainers()), ProvisionSupport.PROVISION_TIMEOUT);
                }
            } finally {
View Full Code Here

Examples of io.fabric8.api.ZooKeeperClusterService

                        EnsembleSupport.addToEnsemble(fabricService, cnt1, cnt2);
                        System.out.println(CommandSupport.executeCommand("config:proplist --pid io.fabric8.zookeeper"));

                        System.out.println(CommandSupport.executeCommand("fabric:container-list"));
                        System.out.println(CommandSupport.executeCommand("fabric:ensemble-list"));
                        ZooKeeperClusterService zooKeeperClusterService = ServiceLocator.awaitService(ZooKeeperClusterService.class);
                        org.junit.Assert.assertNotNull(zooKeeperClusterService);
                        List<String> ensembleContainersResult = zooKeeperClusterService.getEnsembleContainers();
                        org.junit.Assert.assertTrue(ensembleContainersResult.contains(cnt1.getId()));
                        org.junit.Assert.assertTrue(ensembleContainersResult.contains(cnt2.getId()));
                        ProvisionSupport.provisioningSuccess(Arrays.asList(fabricService.getContainers()), ProvisionSupport.PROVISION_TIMEOUT);
                    }


                    int index = rand.nextInt(addedContainers.size());
                    String randomContainer = addedContainers.get(index).getId();
                    System.out.println(CommandSupport.executeCommand("fabric:version-create 1." + version));
                    System.out.println(CommandSupport.executeCommand("fabric:container-upgrade 1." + version + " " + randomContainer));

                    ProvisionSupport.provisioningSuccess(Arrays.asList(fabricService.getContainers()), ProvisionSupport.PROVISION_TIMEOUT);

                    for (int e = 0; e < 3 && addedContainers.size() >= 2 && addedContainers.size() % 2 == 0; e++) {
                        Container cnt1 = addedContainers.removeFirst();
                        Container cnt2 = addedContainers.removeFirst();
                        containerQueue.add(cnt1);
                        containerQueue.add(cnt2);
                        EnsembleSupport.removeFromEnsemble(fabricService, cnt1, cnt2);
                        System.out.println(CommandSupport.executeCommand("config:proplist --pid io.fabric8.zookeeper"));

                        System.out.println(CommandSupport.executeCommand("fabric:container-list"));
                        System.out.println(CommandSupport.executeCommand("fabric:ensemble-list"));
                        ZooKeeperClusterService zooKeeperClusterService = ServiceLocator.awaitService(ZooKeeperClusterService.class);
                        org.junit.Assert.assertNotNull(zooKeeperClusterService);
                        List<String> ensembleContainersResult = zooKeeperClusterService.getEnsembleContainers();
                        org.junit.Assert.assertFalse(ensembleContainersResult.contains(cnt1.getId()));
                        org.junit.Assert.assertFalse(ensembleContainersResult.contains(cnt2.getId()));
                        ProvisionSupport.provisioningSuccess(Arrays.asList(fabricService.getContainers()), ProvisionSupport.PROVISION_TIMEOUT);
                    }
                    System.out.println(CommandSupport.executeCommand("fabric:container-rollback 1." + (version - 1) + " " + randomContainer));
View Full Code Here

Examples of io.fabric8.api.ZooKeeperClusterService

                    EnsembleSupport.addToEnsemble(fabricService, cnt1, cnt2);
                    System.err.println(CommandSupport.executeCommand("config:proplist --pid io.fabric8.zookeeper"));

                    System.err.println(CommandSupport.executeCommand("fabric:container-list"));
                    System.err.println(CommandSupport.executeCommand("fabric:ensemble-list"));
                    ZooKeeperClusterService zooKeeperClusterService = ServiceLocator.awaitService(moduleContext, ZooKeeperClusterService.class);
                    Assert.assertNotNull(zooKeeperClusterService);
                    List<String> ensembleContainersResult = zooKeeperClusterService.getEnsembleContainers();
                    Assert.assertTrue(ensembleContainersResult.contains(cnt1.getId()));
                    Assert.assertTrue(ensembleContainersResult.contains(cnt2.getId()));
                    ProvisionSupport.provisioningSuccess(Arrays.asList(fabricService.getContainers()), ProvisionSupport.PROVISION_TIMEOUT);
                }

                for (int e = 0; e < 3 && addedContainers.size() >= 2 && addedContainers.size() % 2 == 0; e++) {
                    Container cnt1 = addedContainers.removeFirst();
                    Container cnt2 = addedContainers.removeFirst();
                    containerQueue.add(cnt1);
                    containerQueue.add(cnt2);
                    EnsembleSupport.removeFromEnsemble(fabricService, cnt1, cnt2);
                    System.err.println(CommandSupport.executeCommand("config:proplist --pid io.fabric8.zookeeper"));

                    System.err.println(CommandSupport.executeCommand("fabric:container-list"));
                    System.err.println(CommandSupport.executeCommand("fabric:ensemble-list"));
                    ZooKeeperClusterService zooKeeperClusterService = ServiceLocator.awaitService(moduleContext, ZooKeeperClusterService.class);
                    Assert.assertNotNull(zooKeeperClusterService);
                    List<String> ensembleContainersResult = zooKeeperClusterService.getEnsembleContainers();
                    Assert.assertFalse(ensembleContainersResult.contains(cnt1.getId()));
                    Assert.assertFalse(ensembleContainersResult.contains(cnt2.getId()));
                    ProvisionSupport.provisioningSuccess(Arrays.asList(fabricService.getContainers()), ProvisionSupport.PROVISION_TIMEOUT);
                }
            } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.