Package org.sdnplatform.sync.internal.config

Examples of org.sdnplatform.sync.internal.config.Node


            waitForValue(unsyncStore, "localNodeId", null,
                         3000, "unsyncStore" + i);
            short nodeId =
                    Short.parseShort(unsyncStore.getValue("localNodeId"));
            Node node = nodeStore.getValue(nodeId);
            nodeIds.add(nodeId);
            nodes.add(node);

            while (syncManager.getClusterConfig().
                    getNode().getNodeId() != nodeId) {
View Full Code Here


        CryptoUtil.writeSharedSecret(keyStoreFile.getAbsolutePath(),
                                     keyStorePassword,
                                     CryptoUtil.secureRandom(16));
       
        nodes = new ArrayList<Node>();
        nodes.add(new Node("localhost", 40101, (short)1, (short)1));
        nodeString = mapper.writeValueAsString(nodes);
       
        tp = new ThreadPool();
        syncManager = new SyncManager();
       
View Full Code Here

                                    "because local node not found in system " +
                                    "node store");
                        System.exit(4);
                    }
                   
                    Node o = localNode.getValue();
                    localNode.setValue(new Node(o.getHostname(),
                                                o.getPort(),
                                                o.getNodeId(),
                                                bSettings.domainId));
                    nodeStoreClient.put(localNodeId, localNode);
                    break;
                } catch (ObsoleteVersionException e) { };
            }
View Full Code Here

       
        syncManagers = new SyncManager[4];
        moduleContexts = new FloodlightModuleContext[4];

        nodes = new ArrayList<Node>();
        nodes.add(new Node("localhost", 40101, (short)1, (short)1));
        nodes.add(new Node("localhost", 40102, (short)2, (short)2));
        nodes.add(new Node("localhost", 40103, (short)3, (short)1));
        nodes.add(new Node("localhost", 40104, (short)4, (short)2));
        nodeString = mapper.writeValueAsString(nodes);

        for(int i = 0; i < 4; i++) {
            moduleContexts[i] = new FloodlightModuleContext();
            syncManagers[i] = new SyncManager();
View Full Code Here

                syncManagers[1].getStoreClient("global",
                                               String.class, String.class);
        client0.put("key", "value");
        waitForValue(client1, "key", "value", 2000, "client1");
       
        nodes.add(new Node("localhost", 40105, (short)5, (short)5));
        SyncManager[] sms = Arrays.copyOf(syncManagers,
                                          syncManagers.length + 1);
        FloodlightModuleContext[] fmcs =
                Arrays.copyOf(moduleContexts,
                              moduleContexts.length + 1);
View Full Code Here

                syncManagers[2].getStoreClient("global",
                                               String.class, String.class);
        client0.put("key", "value");
        waitForValue(client2, "key", "value", 2000, "client2");

        nodes.set(2, new Node("localhost", 50103, (short)3, (short)1));
        nodeString = mapper.writeValueAsString(nodes);

        for(int i = 0; i < syncManagers.length; i++) {
            moduleContexts[i].addConfigParam(syncManagers[i],
                                             "nodes", nodeString);
View Full Code Here

        tearDown();
        tp = new ThreadPool();
        tp.init(null);
        tp.startUp(null);
        nodes = new ArrayList<Node>();
        nodes.add(new Node("localhost", 40101, (short)1, (short)1));
        nodeString = mapper.writeValueAsString(nodes);
        SyncManager sm = new SyncManager();
        FloodlightModuleContext fmc = new FloodlightModuleContext();
        setupSyncManager(fmc, sm, nodes.get(0));
        fmc.addService(ISyncService.class, sm);
View Full Code Here

        return getRawStore(storeName);
    }

    @Override
    public short getLocalNodeId() {
        Node l = clusterConfig.getNode();
        if (l == null) return Short.MAX_VALUE;
        return l.getNodeId();
    }
View Full Code Here

                shutdown();
                startUp(null);
            }

            for (Node n : clusterConfig.getNodes()) {
                Node existing = oldConfig.getNode(n.getNodeId());
                if (existing != null && !n.equals(existing)) {
                    // we already had this node's configuration, but it's
                    // changed.  Disconnect from the node and let it
                    // reinitialize
                    logger.debug("[{}->{}] Configuration for node has changed",
                                 getLocalNodeId(), n.getNodeId());
                    rpcService.disconnectNode(n.getNodeId());
                }
            }
            for (Node n : oldConfig.getNodes()) {
                Node nn = clusterConfig.getNode(n.getNodeId());
                if (nn == null) {
                    // n is a node that doesn't appear in the new config
                    logger.debug("[{}->{}] Disconnecting deconfigured node",
                                 getLocalNodeId(), n.getNodeId());
                    rpcService.disconnectNode(n.getNodeId());
View Full Code Here

                                               Short.class, Node.class);
            while (true) {
                try {
                    Versioned<Node> node =
                            nodeStoreClient.get(tnode.getNodeId());
                    node.setValue(new Node(tnode.getHostname(),
                                           tnode.getPort(),
                                           tnode.getNodeId(),
                                           tnode.getDomainId()));
                    nodeStoreClient.put(tnode.getNodeId(), node);
                    break;
View Full Code Here

TOP

Related Classes of org.sdnplatform.sync.internal.config.Node

Copyright © 2018 www.massapicom. 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.