Examples of VoldemortServer


Examples of voldemort.server.VoldemortServer

                                                                           { 1, 5, 9 },
                                                                           { 2, 6, 10 },
                                                                           { 3, 7, 11 } });

        // Create a new server
        VoldemortServer newServer = ServerTestUtils.startVoldemortServer(socketStoreFactory,
                                                                         ServerTestUtils.createServerConfig(useNio,
                                                                                                            3,
                                                                                                            TestUtils.createTempDir()
                                                                                                                     .getAbsolutePath(),
                                                                                                            null,
View Full Code Here

Examples of voldemort.server.VoldemortServer

                                                                        TestUtils.createTempDir()
                                                                                 .getAbsolutePath(),
                                                                        null,
                                                                        storeXmlFile,
                                                                        properties);
            VoldemortServer server = ServerTestUtils.startVoldemortServer(socketStoreFactory,
                                                                          config,
                                                                          cluster);
            serverMap.put(node, server);
        }
        return cluster;
View Full Code Here

Examples of voldemort.server.VoldemortServer

                        List<VoldemortServer> serverList = Lists.newArrayList(serverMap.get(3), serverMap.get(5),
                                                                              serverMap.get(9), serverMap.get(11));
                        while(!rebalancingComplete.get()) {
                            Iterator<VoldemortServer> serverIterator = serverList.iterator();
                            while(serverIterator.hasNext()) {
                                VoldemortServer server = serverIterator.next();
                                if(ByteUtils.getString(server.getMetadataStore()
                                                             .get(MetadataStore.SERVER_STATE_KEY, null)
                                                             .get(0)
                                                             .getValue(),
                                                       "UTF-8")
                                            .compareTo(VoldemortState.REBALANCING_MASTER_SERVER.toString()) == 0) {
                                    logger.info("Server " + server.getIdentityNode().getId()
                                                + " transitioned into REBALANCING MODE");
                                    serverIterator.remove();
                                }
                            }
                            if(serverList.size() == 0) {
View Full Code Here

Examples of voldemort.server.VoldemortServer

                                                                              serverMap.get(3),
                                                                              serverMap.get(5));
                        while(!rebalancingComplete.get()) {
                            Iterator<VoldemortServer> serverIterator = serverList.iterator();
                            while(serverIterator.hasNext()) {
                                VoldemortServer server = serverIterator.next();
                                if(ByteUtils.getString(server.getMetadataStore()
                                                             .get(MetadataStore.SERVER_STATE_KEY,
                                                                  null)
                                                             .get(0)
                                                             .getValue(),
                                                       "UTF-8")
                                            .compareTo(VoldemortState.REBALANCING_MASTER_SERVER.toString()) == 0) {
                                    logger.info("Server " + server.getIdentityNode().getId()
                                                + " transitioned into REBALANCING MODE");
                                    serverIterator.remove();
                                }
                            }
                            if(serverList.size() == 0) {
View Full Code Here

Examples of voldemort.server.VoldemortServer

                        List<VoldemortServer> serverList = Lists.newArrayList(serverMap.get(0),
                                                                              serverMap.get(2));
                        while(!rebalancingComplete.get()) {
                            Iterator<VoldemortServer> serverIterator = serverList.iterator();
                            while(serverIterator.hasNext()) {
                                VoldemortServer server = serverIterator.next();
                                if(ByteUtils.getString(server.getMetadataStore()
                                                             .get(MetadataStore.SERVER_STATE_KEY,
                                                                  null)
                                                             .get(0)
                                                             .getValue(),
                                                       "UTF-8")
                                            .compareTo(VoldemortState.REBALANCING_MASTER_SERVER.toString()) == 0) {
                                    logger.info("Server " + server.getIdentityNode().getId()
                                                + " transitioned into REBALANCING MODE");
                                    serverIterator.remove();
                                }
                            }
                            if(serverList.size() == 0) {
View Full Code Here

Examples of voldemort.server.VoldemortServer

    }

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        VoldemortServer server = (VoldemortServer) config.getServletContext()
                                                         .getAttribute(VoldemortServletContextListener.SERVER_KEY);

        initMetadataStore(server);
        initStores(server);
        initVelocity(config);
View Full Code Here

Examples of voldemort.server.VoldemortServer

        super.init();
        // if we don't already have a stores map, attempt to initialize from the
        // servlet context
        if(this.requestHandler == null) {
            ServletContext context = this.getServletContext();
            VoldemortServer server = (VoldemortServer) Utils.notNull(context.getAttribute(VoldemortServletContextListener.SERVER_KEY));
            HttpService httpService = (HttpService) server.getService(ServiceType.HTTP);
            this.requestHandler = httpService.getRequestHandler();
        }
    }
View Full Code Here

Examples of voldemort.server.VoldemortServer

    private static final Logger logger = Logger.getLogger(VoldemortServletContextListener.class.getName());

    public void contextDestroyed(ServletContextEvent event) {
        logger.info("Calling application shutdown...");
        VoldemortServer server = (VoldemortServer) event.getServletContext()
                                                        .getAttribute(SERVER_KEY);
        if(server != null)
            server.stop();
        logger.info("Destroying application...");
        event.getServletContext().removeAttribute(SERVER_KEY);
        event.getServletContext().removeAttribute(SERVER_CONFIG_KEY);
        event.getServletContext().removeAttribute(VELOCITY_ENGINE_KEY);
    }
View Full Code Here

Examples of voldemort.server.VoldemortServer

    }

    public void contextInitialized(ServletContextEvent event) {
        try {
            logger.info("Creating application...");
            VoldemortServer server = new VoldemortServer(VoldemortConfig.loadFromEnvironmentVariable());
            event.getServletContext().setAttribute(SERVER_KEY, server);
            event.getServletContext().setAttribute(SERVER_CONFIG_KEY, server.getVoldemortConfig());
            event.getServletContext().setAttribute(VELOCITY_ENGINE_KEY,
                                                   new VelocityEngine(VOLDEMORT_TEMPLATE_DIR));
            server.start();
            logger.info("Application created.");
        } catch(ConfigurationException e) {
            logger.info("Error loading voldemort server:", e);
            throw e;
        } catch(Exception e) {
View Full Code Here

Examples of voldemort.server.VoldemortServer

            VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true, node.getId(), tempFolderPath, cluster, storeDefs,new Properties());
            Assert.assertTrue(config.isSlopEnabled());
            Assert.assertTrue(config.isSlopPusherJobEnabled());
            Assert.assertTrue(config.getAutoPurgeDeadSlops());
            config.setSlopFrequencyMs(10000L);
            VoldemortServer vs = ServerTestUtils.startVoldemortServer(ssf,config,cluster);
            vservers.put(node.getId(), vs);
            socketStoreFactories.put(node.getId(), ssf);
            voldemortConfigs.put(node.getId(), config);
        }
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.