Package voldemort.store.serialized

Examples of voldemort.store.serialized.SerializingStore


            StorageConfiguration storageConfig = (StorageConfiguration) ReflectUtils.callConstructor(ReflectUtils.loadClass(storageEngineClass),
                                                                                                     new Object[] { config });
            StorageEngine<ByteArray, byte[], byte[]> engine = storageConfig.getStore(TestUtils.makeStoreDefinition("test"),
                                                                                     TestUtils.makeSingleNodeRoutingStrategy());
            @SuppressWarnings("unchecked")
            final Store<String, byte[], byte[]> store = new SerializingStore(engine,
                                                                             new StringSerializer(),
                                                                             new IdentitySerializer(),
                                                                             null);

            final byte[] value = new byte[valueSize];
            new Random().nextBytes(value);

            // initialize test data
            for(int i = 0; i < numValues; i++)
                store.put(Integer.toString(i), Versioned.value(value), null);

            // initialize cache lookback data
            int[] recents = new int[cacheWidth];

            System.out.println("Write test:");
            CachedPerformanceTest writeTest = new CachedPerformanceTest(new PerformanceTest() {

                @Override
                public void doOperation(int index) {
                    try {
                        String key = Integer.toString(index);
                        List<Versioned<byte[]>> vs = store.get(key, null);
                        VectorClock version;
                        if(vs.size() == 0)
                            version = new VectorClock();
                        else
                            version = (VectorClock) vs.get(0).getVersion();
                        version.incrementVersion(0, 847584375);
                        store.put(key, Versioned.value(value, version), null);
                    } catch(ObsoleteVersionException e) {
                        // do nothing
                    } catch(RuntimeException e) {
                        e.printStackTrace();
                        throw e;
                    }
                }
            }, recents, numValues, cacheHitRatio);
            writeTest.run(numRequests, numThreads);
            writeTest.printStats();
            System.out.println();

            System.out.println("Read test:");
            CachedPerformanceTest readTest = new CachedPerformanceTest(new PerformanceTest() {

                @Override
                public void doOperation(int index) {
                    store.get(Integer.toString(index), null);
                }
            }, recents, numValues, cacheHitRatio);
            readTest.run(numRequests, numThreads);
            readTest.printStats();
View Full Code Here


                             Serializer<?> targetValSerializer,
                             CompressionStrategy valueCompressionStrategy,
                             View<?, ?, ?, ?> valueTrans) {
        super(name);
        this.target = Utils.notNull(target);
        this.serializingStore = new SerializingStore(target,
                                                     targetKeySerializer,
                                                     targetValSerializer,
                                                     null);
        this.valSerializer = (Serializer<Object>) valSerializer;
        this.transformSerializer = (Serializer<Object>) transformSerializer;
View Full Code Here

        Store store = new VersionIncrementingStore(new InMemoryStorageEngine(storeName),
                                                   nodeId,
                                                   time);
        if(isSerialized())
            store = new SerializingStore(store,
                                         keySerializer,
                                         valueSerializer,
                                         transformsSerializer);

        Store<K1, V1, T1> consistentStore = new InconsistencyResolvingStore<K1, V1, T1>(store,
View Full Code Here

                                           ViewStorageConfiguration.loadTransformation(storeDef.getValueTransformation()));
        }

        Store store = new VersionIncrementingStore(engine, nodeId, time);

        store = new SerializingStore(store,
                                     this.keySerializer != null ? this.keySerializer
                                                               : keySerializer,
                                     this.valueSerializer != null ? this.valueSerializer
                                                                 : valueSerializer,
                                     this.transformsSerializer != null ? this.transformsSerializer
View Full Code Here

TOP

Related Classes of voldemort.store.serialized.SerializingStore

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.