Package com.sun.sgs.impl.service.nodemap.affinity

Examples of com.sun.sgs.impl.service.nodemap.affinity.LPADriver


                logger.logThrow(Level.CONFIG, e, "Could not register MBean");
            }

            // Create and start our affinity group finder subsystem.
            // TEMP -- this code to move to coordinator
            finder = new LPADriver(properties, systemRegistry, txnProxy);
            finder.enable();

            logger.log(Level.CONFIG,
                       "Created NodeMappingServiceImpl with properties:" +
                       "\n  " + CLIENT_PORT_PROPERTY + "=" + clientPort +
View Full Code Here


        SgsTestNode newNode = null;
        try {
            Properties p = getProps(serverNode);
            p.remove(LPADriver.GRAPH_CLASS_PROPERTY);
            newNode =  new SgsTestNode(serverNode, null, p);
            LPADriver newDriver = (LPADriver)
                finderField.get(newNode.getNodeMappingService());
            Assert.assertNull(newDriver.getGraphBuilder());
            Assert.assertNull(newDriver.getGraphListener());
        } finally {
            if (newNode != null) {
                newNode.shutdown(false);
            }
        }
View Full Code Here

        try {
            Properties p = getProps(serverNode);
            p.setProperty(LPADriver.GRAPH_CLASS_PROPERTY,
                          LPADriver.GRAPH_CLASS_NONE);
            newNode =  new SgsTestNode(serverNode, null, p);
            LPADriver newDriver = (LPADriver)
                finderField.get(newNode.getNodeMappingService());
            Assert.assertNull(newDriver.getGraphBuilder());
            Assert.assertNull(newDriver.getGraphListener());
        } finally {
            if (newNode != null) {
                newNode.shutdown(false);
            }
        }
View Full Code Here

    }

    @Test
    public void warmupZach() throws Exception {
        for (int i = 0; i < WARMUP_RUNS; i++) {
            LPADriver driver = (LPADriver)
                finderField.get(
                            serverNode.getNodeMappingService());
            Set<RelocatingAffinityGroup> groups =
                driver.getGraphBuilder().
                    getAffinityGroupFinder().findAffinityGroups();
        }

        // There's no graph, so we expect an exception to be thrown
    }
View Full Code Here

            node1 = createNode();
            node2 = createNode();
            node3 = createNode();

            // Send updates to each of the node's graph listeners
            LPADriver driver1 = (LPADriver)
                finderField.get(node1.getNodeMappingService());
            LPADriver driver2 = (LPADriver)
                finderField.get(node2.getNodeMappingService());
            LPADriver driver3 = (LPADriver)
                finderField.get(node3.getNodeMappingService());

            DummyIdentity[] idents = new DummyIdentity[35];
            // Create identities for zach karate club
            // location of identities for the accesses below
            // node1: 1,4,7,10,13,16,19,22,25,28,31,34
            // node2: 2,5,8,11,14,17,20,23,26,29,32
            // node3: 3,6,9,12,15,18,21,24,27,30,33
            // Actual round robin policy might assign these differently...
            NodeMappingService nms = node1.getNodeMappingService();
            for (int i = 1; i < 35; i++) {
                idents[i] = new DummyIdentity(String.valueOf(i));
                nms.assignNode(this.getClass(), idents[i]);
            }
           
            // Node 1 uses.
            AffinityGraphBuilder builder1 = driver1.getGraphBuilder();
            AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o1"));
            detail.addAccess(new String("o2"));
            detail.addAccess(new String("o3"));
            detail.addAccess(new String("o5"));
            detail.addAccess(new String("o8"));
            detail.addAccess(new String("o11"));
            detail.addAccess(new String("o12"));
            detail.addAccess(new String("o16"));
            detail.addAccess(new String("o18"));
            detail.addAccess(new String("o20"));
            detail.addAccess(new String("o32"));
            detail.addAccess(new String("o84"));
            builder1.updateGraph(idents[1], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o1"));
            detail.addAccess(new String("o13"));
            detail.addAccess(new String("o87"));
            builder1.updateGraph(idents[4], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o2"));
            detail.addAccess(new String("o4"));
            detail.addAccess(new String("o15"));
            builder1.updateGraph(idents[7], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o7"));
            detail.addAccess(new String("o40"));
            builder1.updateGraph(idents[10], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o12"));
            detail.addAccess(new String("o13"));
            builder1.updateGraph(idents[13], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o35"));
            detail.addAccess(new String("o43"));
            builder1.updateGraph(idents[16], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o36"));
            detail.addAccess(new String("o44"));
            builder1.updateGraph(idents[19], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o20"));
            detail.addAccess(new String("o21"));
            builder1.updateGraph(idents[22], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o23"));
            detail.addAccess(new String("o26"));
            builder1.updateGraph(idents[25], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o24"));
            detail.addAccess(new String("o25"));
            detail.addAccess(new String("o26"));
            detail.addAccess(new String("o50"));
            builder1.updateGraph(idents[28], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o30"));
            detail.addAccess(new String("o31"));
            builder1.updateGraph(idents[31], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o31"));
            detail.addAccess(new String("o40"));
            detail.addAccess(new String("o41"));
            detail.addAccess(new String("o42"));
            detail.addAccess(new String("o43"));
            detail.addAccess(new String("o44"));
            detail.addAccess(new String("o45"));
            detail.addAccess(new String("o46"));
            detail.addAccess(new String("o47"));
            detail.addAccess(new String("o48"));
            detail.addAccess(new String("o49"));
            detail.addAccess(new String("o50"));
            detail.addAccess(new String("o51"));
            detail.addAccess(new String("o52"));
            detail.addAccess(new String("o53"));
            builder1.updateGraph(idents[34], detail);

            // Node 2
            AffinityGraphBuilder builder2 = driver2.getGraphBuilder();
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o1"));
            detail.addAccess(new String("o17"));
            detail.addAccess(new String("o19"));
            detail.addAccess(new String("o21"));
            detail.addAccess(new String("o30"));
            detail.addAccess(new String("o85"));
            builder2.updateGraph(idents[2], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o2"));
            detail.addAccess(new String("o9"));
            builder2.updateGraph(idents[5], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o1"));
            builder2.updateGraph(idents[8], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o8"));
            detail.addAccess(new String("o9"));
            detail.addAccess(new String("o10"));
            builder2.updateGraph(idents[11], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o84"));
            detail.addAccess(new String("o85"));
            detail.addAccess(new String("o86"));
            detail.addAccess(new String("o87"));
            detail.addAccess(new String("o41"));
            builder2.updateGraph(idents[14], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o14"));
            detail.addAccess(new String("o15"));
            builder2.updateGraph(idents[17], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o18"));
            detail.addAccess(new String("o19"));
            detail.addAccess(new String("o45"));
            builder2.updateGraph(idents[20], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o38"));
            detail.addAccess(new String("o47"));
            builder2.updateGraph(idents[23], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o22"));
            detail.addAccess(new String("o23"));
            builder2.updateGraph(idents[26], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o27"));
            detail.addAccess(new String("o51"));
            detail.addAccess(new String("o66"));
            builder2.updateGraph(idents[29], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o23"));
            detail.addAccess(new String("o66"));
            detail.addAccess(new String("o32"));
            detail.addAccess(new String("o39"));
            detail.addAccess(new String("o53"));
            builder2.updateGraph(idents[32], detail);

            // Node 3
            AffinityGraphBuilder builder3 = driver3.getGraphBuilder();
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o1"));
            detail.addAccess(new String("o6"));
            detail.addAccess(new String("o7"));
            detail.addAccess(new String("o24"));
            detail.addAccess(new String("o27"));
            detail.addAccess(new String("o33"));
            detail.addAccess(new String("o86"));
            builder3.updateGraph(idents[3], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o3"));
            detail.addAccess(new String("o4"));
            detail.addAccess(new String("o10"));
            detail.addAccess(new String("o14"));
            builder3.updateGraph(idents[6], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o5"));
            detail.addAccess(new String("o6"));
            detail.addAccess(new String("o31"));
            builder3.updateGraph(idents[9], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o11"));
            builder3.updateGraph(idents[12], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o34"));
            detail.addAccess(new String("o42"));
            builder3.updateGraph(idents[15], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o16"));
            detail.addAccess(new String("o17"));
            builder3.updateGraph(idents[18], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o37"));
            detail.addAccess(new String("o46"));
            builder3.updateGraph(idents[21], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o22"));
            detail.addAccess(new String("o25"));
            detail.addAccess(new String("o28"));
            detail.addAccess(new String("o48"));
            builder3.updateGraph(idents[24], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o29"));
            detail.addAccess(new String("o49"));
            builder3.updateGraph(idents[27], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o28"));
            detail.addAccess(new String("o29"));
            detail.addAccess(new String("o52"));
            builder3.updateGraph(idents[30], detail);
            detail = new AccessedObjectsDetailTest();
            detail.addAccess(new String("o28"));
            detail.addAccess(new String("o31"));
            detail.addAccess(new String("o33"));
            detail.addAccess(new String("o34"));
            detail.addAccess(new String("o35"));
            detail.addAccess(new String("o36"));
            detail.addAccess(new String("o37"));
            detail.addAccess(new String("o38"));
            detail.addAccess(new String("o39"));
            builder3.updateGraph(idents[33], detail);

            UndirectedGraph<LabelVertex, WeightedEdge> graphModel =
                    new ZachBuilder().getAffinityGraph();
            System.out.println("MODEL GRAPH IS " + graphModel);
            LPADriver driver = (LPADriver)
                finderField.get(serverNode.getNodeMappingService());
            GraphListener serverListener = driver.getGraphListener();
            AffinityGraphBuilder builder = driver.getGraphBuilder();
            // The graph can only be found on the server side.  Let's make
            // sure it looks like the expected Zachary graph.
            // The core server graph listener builds a DistGraphBuilder,
            // which (on the core node) creates the DistGraphBuilderServerImpl.
            // We can find it if we look for the group finder.
View Full Code Here

                logger.logThrow(Level.CONFIG, e, "Could not register MBean");
            }

            // Create and start our affinity group finder subsystem.
            // TEMP -- this code to move to coordinator
            finder = new LPADriver(properties, systemRegistry, txnProxy);
            finder.enable();

            logger.log(Level.CONFIG,
                       "Created NodeMappingServiceImpl with properties:" +
                       "\n  " + CLIENT_PORT_PROPERTY + "=" + clientPort +
View Full Code Here

TOP

Related Classes of com.sun.sgs.impl.service.nodemap.affinity.LPADriver

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.