Examples of ClusterMonitor


Examples of co.paralleluniverse.galaxy.core.ClusterMonitor

                        //beanFactory.registerSingleton(name, object);
                    }
                });
        this.cluster = context.getBean("cluster", Cluster.class);
        this.clusterMonitor = new ClusterMonitor(cluster);

        this.backup = context.getBean("backup", Backup.class);

        this.cache = context.getBean("cache", Cache.class);
        this.store = new StoreImpl(cache);
View Full Code Here

Examples of co.paralleluniverse.galaxy.core.ClusterMonitor

                        //beanFactory.registerSingleton(name, object);
                    }
                });
        this.cluster = context.getBean("cluster", Cluster.class);
        this.clusterMonitor = new ClusterMonitor(cluster);

        this.backup = context.getBean("backup", Backup.class);

        this.cache = context.getBean("cache", Cache.class);
        this.store = new StoreImpl(cache);
View Full Code Here

Examples of co.paralleluniverse.galaxy.core.ClusterMonitor

                        //beanFactory.registerSingleton(name, object);
                    }

                });
        this.cluster = context.getBean("cluster", Cluster.class);
        this.clusterMonitor = new ClusterMonitor(cluster);

        this.backup = context.getBean("backup", Backup.class);

        this.cache = context.getBean("cache", Cache.class);
        this.store = new StoreImpl(cache);
View Full Code Here

Examples of org.apache.stratos.autoscaler.monitor.ClusterMonitor

        public ClusterMonitorAdder(Cluster cluster) {
            this.cluster = cluster;
        }

        public void run() {
            ClusterMonitor monitor = null;
            int retries = 5;
            boolean success = false;
            do {
                try {
                    Thread.sleep(5000);
View Full Code Here

Examples of org.apache.stratos.autoscaler.monitor.ClusterMonitor

            throw new PolicyValidationException(msg);
        }

        CloudControllerClient.getInstance().validateDeploymentPolicy(cluster.getServiceName(), deploymentPolicy);

        ClusterMonitor clusterMonitor =
                                        new ClusterMonitor(cluster.getClusterId(),
                                                           cluster.getServiceName(),
                                                           deploymentPolicy, policy);
       
        for (PartitionGroup partitionGroup: deploymentPolicy.getPartitionGroups()){

            NetworkPartitionContext networkPartitionContext = new NetworkPartitionContext(partitionGroup.getId(),
                    partitionGroup.getPartitionAlgo(), partitionGroup.getPartitions());

            for(Partition partition: partitionGroup.getPartitions()){
                PartitionContext partitionContext = new PartitionContext(partition);
                partitionContext.setServiceName(cluster.getServiceName());
                partitionContext.setProperties(cluster.getProperties());
                partitionContext.setNetworkPartitionId(partitionGroup.getId());
               
                for (Member member: cluster.getMembers()){
                    String memberId = member.getMemberId();
                    if(member.getPartitionId().equalsIgnoreCase(partition.getId())){
                        MemberContext memberContext = new MemberContext();
                        memberContext.setClusterId(member.getClusterId());
                        memberContext.setMemberId(memberId);
                        memberContext.setPartition(partition);

                        if(MemberStatus.Activated.equals(member.getStatus())){
                            partitionContext.addActiveMember(memberContext);
//                            networkPartitionContext.increaseMemberCountOfPartition(partition.getNetworkPartitionId(), 1);
//                            partitionContext.incrementCurrentActiveMemberCount(1);

                        } else if(MemberStatus.Created.equals(member.getStatus()) || MemberStatus.Starting.equals(member.getStatus())){
                            partitionContext.addPendingMember(memberContext);

//                            networkPartitionContext.increaseMemberCountOfPartition(partition.getNetworkPartitionId(), 1);
                        } else if(MemberStatus.Suspended.equals(member.getStatus())){
//                            partitionContext.addFaultyMember(memberId);
                        }
                        partitionContext.addMemberStatsContext(new MemberStatsContext(memberId));
                        if(log.isInfoEnabled()){
                            log.info(String.format("Member stat context has been added: [member] %s", memberId));
                        }
                    }

                }
                networkPartitionContext.addPartitionContext(partitionContext);
                if(log.isInfoEnabled()){
                    log.info(String.format("Partition context has been added: [partition] %s",
                            partitionContext.getPartitionId()));
                }
            }

            clusterMonitor.addNetworkPartitionCtxt(networkPartitionContext);
            if(log.isInfoEnabled()){
                log.info(String.format("Network partition context has been added: [network partition] %s",
                            networkPartitionContext.getId()));
            }
        }
       
       
        // find lb reference type
        java.util.Properties props = cluster.getProperties();
       
        if(props.containsKey(Constants.LOAD_BALANCER_REF)) {
            String value = props.getProperty(Constants.LOAD_BALANCER_REF);
            clusterMonitor.setLbReferenceType(value);
            if(log.isDebugEnabled()) {
                log.debug("Set the lb reference type: "+value);
            }
        }

        log.info("Cluster monitor created: "+clusterMonitor.toString());
        return clusterMonitor;
    }
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.