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

Examples of com.sun.sgs.impl.service.nodemap.affinity.dlpa.LabelPropagationServer


        // created outside this framework so we could easily extend the type.
        serverNode = new SgsTestNode("TestLPA", null, props);
        collector =
            serverNode.getSystemRegistry().getComponent(ProfileCollector.class);
        wdog = serverNode.getWatchdogService();
        lpaServer = new LabelPropagationServer(collector, wdog, props);
    }
View Full Code Here


    }

    @Test
    public void warmupDistZach() throws Exception {
        // setup
        LabelPropagationServer server = null;
        if (WARMUP_RUNS > 0) {
            Properties props = new Properties();
            int serverPort = SgsTestNode.getNextUniquePort();
            props.put("com.sun.sgs.impl.service.nodemap.affinity.server.port",
                       String.valueOf(serverPort));
            props.put("com.sun.sgs.impl.service.nodemap.affinity.numThreads",
                    String.valueOf(numThreads));
            server = new LabelPropagationServer(collector, wdog, props);

            LabelPropagation lp1 =
                new LabelPropagation(
                    new DistributedZachBuilder(DistributedZachBuilder.NODE1),
                        wdog, DistributedZachBuilder.NODE1, props);
            LabelPropagation lp2 =
                new LabelPropagation(
                    new DistributedZachBuilder(DistributedZachBuilder.NODE2),
                        wdog, DistributedZachBuilder.NODE2, props);
            LabelPropagation lp3 =
                new LabelPropagation(
                    new DistributedZachBuilder(DistributedZachBuilder.NODE3),
                        wdog, DistributedZachBuilder.NODE3, props);
        }

        for (int i = 0; i < WARMUP_RUNS; i++) {
            Set<RelocatingAffinityGroup> groups = server.findAffinityGroups();
        }
        if (server != null) {
            server.shutdown();
        }
    }
View Full Code Here

        // setup
        Properties props = new Properties();
        int serverPort = SgsTestNode.getNextUniquePort();
        props.put("com.sun.sgs.impl.service.nodemap.affinity.server.port",
                   String.valueOf(serverPort));
        LabelPropagationServer server =
                new LabelPropagationServer(collector, wdog, props);
        props.put("com.sun.sgs.impl.service.nodemap.affinity.numThreads",
                    String.valueOf(numThreads));
        props.put(LPADriver.GRAPH_CLASS_PROPERTY, builderName);

        LabelPropagation lp1 =
            new LabelPropagation(
                new DistributedZachBuilder(DistributedZachBuilder.NODE1),
                    wdog, DistributedZachBuilder.NODE1, props);
        LabelPropagation lp2 =
            new LabelPropagation(
                new DistributedZachBuilder(DistributedZachBuilder.NODE2),
                    wdog, DistributedZachBuilder.NODE2, props);
        LabelPropagation lp3 =
            new LabelPropagation(
                new DistributedZachBuilder(DistributedZachBuilder.NODE3),
                    wdog, DistributedZachBuilder.NODE3, props);

        AffinityGroupFinderMXBean bean = (AffinityGroupFinderMXBean)
            collector.getRegisteredMBean(AffinityGroupFinderMXBean.MXBEAN_NAME);
        assertNotNull(bean);
        bean.clear();
        // Be sure the consumer is turned on
        collector.getConsumer(AffinityGroupFinderStats.CONS_NAME).
                    setProfileLevel(ProfileLevel.MAX);
       
        double avgMod  = 0.0;
        double maxMod = 0.0;
        double minMod = 1.0;
        for (int i = 0; i < RUNS; i++) {
            Set<AffinityGroup> groups =
                    Objects.uncheckedCast(server.findAffinityGroups());
            double mod =
                AffinityGroupGoodness.calcModularity(
                                new ZachBuilder().getAffinityGraph(), groups);

            avgMod = avgMod + mod;
            maxMod = Math.max(maxMod, mod);
            minMod = Math.min(minMod, mod);
        }
        String name;
        if (WeightedGraphBuilder.class.getName().equals(builderName)) {
            name = "DIST weighted";
        } else {
            name = "DIST bipartite";
        }
        System.out.printf(name + " (%d runs, %d threads): " +
                  "avg time : %4.2f ms, " +
                  " time range [%d - %d ms] " +
                  " avg iters : %4.2f, avg modularity: %.4f, " +
                  " modularity range [%.4f - %.4f] %n",
                  RUNS, numThreads,
                  bean.getAvgRunTime(),
                  bean.getMinRunTime(),
                  bean.getMaxRunTime(),
                  bean.getAvgIterations(),
                  avgMod/(double) RUNS,
                  minMod, maxMod);
        server.shutdown();
    }
View Full Code Here

            NodeType.valueOf(
                properties.getProperty(StandardProperties.NODE_TYPE));
        ProfileCollector col =
            systemRegistry.getComponent(ProfileCollector.class);
        if (type == NodeType.coreServerNode) {
            lpaServer = new LabelPropagationServer(col, wdog, properties);
            lpa = null;
            pruneTask = null;
            stats = null;
        } else if (type == NodeType.appNode) {
            lpaServer = null;
View Full Code Here

                wrappedProps.getProperty(StandardProperties.NODE_TYPE));
        ProfileCollector col =
            systemRegistry.getComponent(ProfileCollector.class);
        WatchdogService wdog = txnProxy.getService(WatchdogService.class);
        if (type == NodeType.coreServerNode) {
            lpaServer = new LabelPropagationServer(col, wdog, properties);
            lpa = null;
            stats = null;
            pruneTask = null;
        } else if (type == NodeType.appNode) {
            lpaServer = null;
View Full Code Here

TOP

Related Classes of com.sun.sgs.impl.service.nodemap.affinity.dlpa.LabelPropagationServer

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.