Package voldemort.server.storage

Examples of voldemort.server.storage.StorageService


    @Test
    public void testMetadataStore() throws Exception {
        for(Node node: cluster.getNodes()) {
            VoldemortServer voldemortServer = serverMap.get(node.getId());
            StorageService ss = (StorageService) voldemortServer.getService(ServiceType.STORAGE);
            ServerStoreVerifier ssv = new ServerStoreVerifier(ss.getSocketStoreFactory(),
                                                              voldemortServer.getMetadataStore(),
                                                              voldemortServer.getVoldemortConfig());

            for(Node siblingNodes: cluster.getNodes())
                ssv.verifyStore(siblingNodes);
View Full Code Here


                                                                                new Properties());
            config.setNioAdminConnectorSelectors(1);
            config.setNioConnectorSelectors(2);
            VoldemortServer vs = ServerTestUtils.startVoldemortServer(socketStoreFactory, config);
            VoldemortService vsrv = vs.getService(ServiceType.STORAGE);
            StorageService ss = (StorageService) vsrv;
            voldemortServers.put(nodeId, vs);

            slopStorageEngines.put(nodeId, ss.getStoreRepository().getSlopStore());
            slopStores.put(nodeId, SerializingStore.wrap(ss.getStoreRepository().getSlopStore(),
                                                         new ByteArraySerializer(),
                                                         new SlopSerializer(),
                                                         new IdentitySerializer()));
            // wrap original store with force fail store
            Store<ByteArray, byte[], byte[]> store = ss.getStoreRepository()
                                                       .removeLocalStore(STORE_NAME);
            UnreachableStoreException exception = new UnreachableStoreException("Force failed");
            ForceFailStore<ByteArray, byte[], byte[]> forceFailStore = new ForceFailStore<ByteArray, byte[], byte[]>(store,
                                                                                                                     exception);
            forceFailStores.put(nodeId, forceFailStore);
            ss.getStoreRepository().addLocalStore(forceFailStore);
        }

        strategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef, cluster);

        // create client socket stores and slop stores
View Full Code Here

            }
        }
    }

    private List<ReadOnlyStorageEngine> getReadOnlyStores(VoldemortServer server) {
        StorageService storage = (StorageService) Utils.notNull(server)
                                                       .getService(ServiceType.STORAGE);
        List<ReadOnlyStorageEngine> l = Lists.newArrayList();
        for(StorageEngine<ByteArray, byte[], byte[]> engine: storage.getStoreRepository()
                                                                    .getStorageEnginesByClass(ReadOnlyStorageEngine.class)) {
            l.add((ReadOnlyStorageEngine) engine);
        }
        return l;
    }
View Full Code Here

        /* Services are given in the order they must be started */
        List<VoldemortService> services = new ArrayList<VoldemortService>();
        SchedulerService scheduler = new SchedulerService(voldemortConfig.getSchedulerThreads(),
                                                          SystemTime.INSTANCE,
                                                          voldemortConfig.canInterruptService());
        storageService = new StorageService(storeRepository, metadata, scheduler, voldemortConfig);
        asyncService = new AsyncOperationService(scheduler, ASYNC_REQUEST_CACHE_SIZE);
        jmxService = null;

        services.add(storageService);
        services.add(scheduler);
View Full Code Here

TOP

Related Classes of voldemort.server.storage.StorageService

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.