Examples of Partition


Examples of org.apache.stratos.cloud.controller.deployment.partition.Partition

        @Override
        public void run() {


            String clusterId = memberContext.getClusterId();
            Partition partition = memberContext.getPartition();
            String publicIp = null;

            try{

                String autoAssignIpProp =
                                          iaasProvider.getProperty(CloudControllerConstants.AUTO_ASSIGN_IP_PROPERTY);
               
                String pre_defined_ip =
                        iaasProvider.getProperty(CloudControllerConstants.FLOATING_IP_PROPERTY);
                   
                  // reset ip
                  String ip = "";
                   
                    // default behavior is autoIpAssign=false
                    if (autoAssignIpProp == null ||
                        (autoAssignIpProp != null && autoAssignIpProp.equals("false"))) {
                     
                      // check if floating ip is well defined in cartridge definition
                      if (pre_defined_ip != null) {
                        if (isValidIpAddress(pre_defined_ip)) {
                          if(log.isDebugEnabled()) {
                            log.debug("CloudControllerServiceImpl:IpAllocator:pre_defined_ip: invoking associatePredefinedAddress" + pre_defined_ip);
                          }
                          Iaas iaas = iaasProvider.getIaas();
                          ip = iaas.associatePredefinedAddress(node, pre_defined_ip);
              
                          if (ip == null || "".equals(ip) || !pre_defined_ip.equals(ip)) {
                            // throw exception and stop instance creation
                               String msg = "Error occurred while allocating predefined floating ip address: " + pre_defined_ip +
                                      " / allocated ip:" + ip +
                                        " - terminating node:"  + memberContext.toString();
                                log.error(msg);
                            // terminate instance
                                terminate(iaasProvider,
                                  node.getId(), memberContext);
                                throw new CloudControllerException(msg);
                          }
                        } else {
                          String msg = "Invalid floating ip address configured: " + pre_defined_ip + 
                                 " - terminating node:"  + memberContext.toString();
                          log.error(msg);
                          // terminate instance
                          terminate(iaasProvider,
                            node.getId(), memberContext);
                          throw new CloudControllerException(msg);
                        }
                         
                        } else {
                          if(log.isDebugEnabled()) {
                            log.debug("CloudControllerServiceImpl:IpAllocator:no (valid) predefined floating ip configured, " + pre_defined_ip
                              + ", selecting available one from pool");
                          }
                          Iaas iaas = iaasProvider.getIaas();
                            // allocate an IP address - manual IP assigning mode
                            ip = iaas.associateAddress(node);
                           
                if (ip != null) {
                  memberContext.setAllocatedIpAddress(ip);
                  log.info("Allocated an ip address: "
                      + memberContext.toString());
                }
                        }      
                     
                      // build the node with the new ip
                      node = NodeMetadataBuilder.fromNodeMetadata(node)
                        .publicAddresses(ImmutableSet.of(ip)).build();
                    }
                   

                    // public ip
                    if (node.getPublicAddresses() != null &&
                        node.getPublicAddresses().iterator().hasNext()) {
                        ip = node.getPublicAddresses().iterator().next();
                        publicIp = ip;
                        memberContext.setPublicIpAddress(ip);
                        log.info("Retrieving Public IP Address : " + memberContext.toString());
                    }

                    // private IP
                    if (node.getPrivateAddresses() != null &&
                        node.getPrivateAddresses().iterator().hasNext()) {
                        ip = node.getPrivateAddresses().iterator().next();
                        memberContext.setPrivateIpAddress(ip);
                        log.info("Retrieving Private IP Address. " + memberContext.toString());
                    }

                    dataHolder.addMemberContext(memberContext);

                    // persist in registry
                    persist();

                    String memberID = memberContext.getMemberId();

                    // trigger topology
                    TopologyBuilder.handleMemberSpawned(memberID, cartridgeType, clusterId, memberContext.getNetworkPartitionId(),
                            partition.getId(), ip, memberContext.getLbClusterId(),publicIp);

                    // update the topology with the newly spawned member
                    // publish data
                    CartridgeInstanceDataPublisher.publish(memberID,
                                                        memberContext.getPartition().getId(),
View Full Code Here

Examples of org.apache.stratos.cloud.controller.stub.deployment.partition.Partition

      List<OMNode> partitionXMLNodes = getMatchingNodes(partitionXpath);
      Iterator<OMNode> itr = partitionXMLNodes.iterator();
      List<Partition> partitonList = new ArrayList<Partition>();
        while (itr.hasNext()) {
            OMNode node = itr.next();
            Partition partition = this.getPartition(node);
            if (partition != null) {
                partitonList.add(partition);
            }
        }
    return partitonList;
View Full Code Here

Examples of org.apache.stratos.rest.endpoint.bean.autoscaler.partition.Partition

    }

    public static Partition populatePartitionPojo (org.apache.stratos.cloud.controller.stub.deployment.partition.Partition
                                                             partition) {

        Partition partitionBeans = new Partition();
        if(partition == null) {
            return partitionBeans;
        }

        partitionBeans.id = partition.getId();
View Full Code Here

Examples of org.gephi.partition.api.Partition

        createPopup();
    }

    public void setup(final PartitionFilter filter) {
        this.filter = filter;
        final Partition partition = filter.getCurrentPartition();
        if (partition != null) {
            refresh(partition, filter.getParts());
        }
    }
View Full Code Here

Examples of org.gephi.partition.api.Partition

        }
    }

    public void setNodePartition(Partition nodePartition) {
        if (nodePartition != this.nodePartition) {
            Partition oldValue = this.nodePartition;
            this.nodePartition = nodePartition;
            firePropertyChangeEvent(NODE_PARTITION, oldValue, nodePartition);
        }
    }
View Full Code Here

Examples of org.gephi.partition.api.Partition

        }
    }

    public void setEdgePartition(Partition edgePartition) {
        if (edgePartition != this.edgePartition) {
            Partition oldValue = this.edgePartition;
            this.edgePartition = edgePartition;
            firePropertyChangeEvent(EDGE_PARTITION, oldValue, edgePartition);
        }
    }
View Full Code Here

Examples of org.jamesii.core.distributed.partition.Partition

      SimSystem.report(Level.WARNING, "Failure by setting the host name.");
    } else {
      if (simulation == null) {
        SimSystem.report(Level.WARNING, "No simulation given.");
      } else {
        Partition partition = null;
        try {
          partition = server.getPartition(simulation);
        } catch (RemoteException e1) {
          SimSystem.report(e1);
        }
        if (partition != null) {
          try {
            if (partition.getHost().getName().equalsIgnoreCase(hostname)) {

              partitionToHostname = partition;
              partitionFound = true;

              if (setModelAndStateAndChildren(partitionToHostname)) {
                result = true;
              }

              // partition is not the correct one
            } else {
              if (!partition.hasSubPartitions()) {
                SimSystem
                    .report(Level.WARNING,
                        "Correct partition not found (no partitions available at all).");
              } else {
                // go through all subpartitions /subsubpartitions... and find
View Full Code Here

Examples of org.jberet.job.Partition

        }
        batchContext.setBatchStatus(consolidatedBatchStatus);
    }

    private void initPartitionConfig() {
        Partition partition = step.getPartition();
        if (partition != null) {
            isPartitioned = true;
            org.jberet.job.PartitionReducer reducerConfig = partition.getReducer();
            if (reducerConfig != null) {
                reducer = jobContext.createArtifact(reducerConfig.getRef(), null, reducerConfig.getProperties(), batchContext);
            }
            org.jberet.job.PartitionMapper mapperConfig = partition.getMapper();
            if (mapperConfig != null) {
                mapper = jobContext.createArtifact(mapperConfig.getRef(), null, mapperConfig.getProperties(), batchContext);
            }
            Analyzer analyzerConfig = partition.getAnalyzer();
            if (analyzerConfig != null) {
                analyzer = jobContext.createArtifact(analyzerConfig.getRef(), null, analyzerConfig.getProperties(), batchContext);
            }
            collectorConfig = partition.getCollector();
            plan = partition.getPlan();
        }
    }
View Full Code Here

Examples of org.jberet.job.model.Partition

        }
        batchContext.setBatchStatus(consolidatedBatchStatus);
    }

    private void initPartitionConfig() {
        final Partition partition = step.getPartition();
        if (partition != null) {
            isPartitioned = true;
            final RefArtifact reducerConfig = partition.getReducer();
            if (reducerConfig != null) {
                reducer = jobContext.createArtifact(reducerConfig.getRef(), null, reducerConfig.getProperties(), batchContext);
            }
            final RefArtifact mapperConfig = partition.getMapper();
            if (mapperConfig != null) {
                mapper = jobContext.createArtifact(mapperConfig.getRef(), null, mapperConfig.getProperties(), batchContext);
            }
            final RefArtifact analyzerConfig = partition.getAnalyzer();
            if (analyzerConfig != null) {
                analyzer = jobContext.createArtifact(analyzerConfig.getRef(), null, analyzerConfig.getProperties(), batchContext);
            }
            collectorConfig = partition.getCollector();
            plan = partition.getPlan();
        }
    }
View Full Code Here

Examples of org.jgroups.protocols.PARTITION

*/
public class PrimaryPartitionTest {

    public static void main(String[] args) throws Exception {
        final JChannel ch=new JChannel("/home/bela/udp.xml");
        ch.getProtocolStack().insertProtocol(new PARTITION(), ProtocolStack.ABOVE, "UDP");
        ch.setReceiver(new ExtendedReceiverAdapter() {
            public void viewAccepted(View new_view) {
                handleView(ch, new_view);
            }
        });
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.