Package krati.io.serializer

Examples of krati.io.serializer.IntSerializer


        store.close();
    }
   
    public void testDynamicObjectStoreFactory() throws IOException {
        ObjectStoreFactory<Integer, String> storeFactory = new DynamicObjectStoreFactory<Integer, String>();
        ObjectStore<Integer, String> store = storeFactory.create(_config, new IntSerializer(), new StringSerializerUtf8());
        assertEquals(SerializableObjectStore.class, store.getClass());
        assertEquals(DynamicDataStore.class, ((SerializableObjectStore<Integer, String>)store).getStore().getClass());
        store.close();
    }
View Full Code Here


        store.close();
    }
   
    public void testIndexedObjectStoreFactory() throws IOException {
        ObjectStoreFactory<Integer, String> storeFactory = new IndexedObjectStoreFactory<Integer, String>();
        ObjectStore<Integer, String> store = storeFactory.create(_config, new IntSerializer(), new StringSerializerUtf8());
        assertEquals(SerializableObjectStore.class, store.getClass());
        assertEquals(IndexedDataStore.class, ((SerializableObjectStore<Integer, String>)store).getStore().getClass());
        store.close();
    }
View Full Code Here

     *
     * @param store           - the underlying array store for serializable objects.
     * @param valueSerializer - the object serializer
     */
    public SerializableObjectArray(ArrayStore store, Serializer<V> valueSerializer) {
        this(store, new IntSerializer(ByteOrder.BIG_ENDIAN), valueSerializer);
    }
View Full Code Here

        return memberId;
    }
   
    @Override
    protected Serializer<Integer> createKeySerializer() {
        return new IntSerializer(ByteOrder.BIG_ENDIAN);
    }
View Full Code Here

       
        // STEP-1
        // Create simple event retention
        RetentionConfig<Integer> config = new RetentionConfig<Integer>(0, new File(homeDir, "EventBus"));
        config.setBatchSize(3000);
        config.setEventValueSerializer(new IntSerializer());
        config.setEventClockSerializer(new ClockSerializer());
        Retention<Integer> eventRetention = new SimpleRetention<Integer>(config);
       
        // STEP-2
        // Create water marks based vector clock
        List<String> sources = new ArrayList<String>();
        sources.add("Person");
        sources.add("Address");
        SourceWaterMarks sourceWaterMarks = new SourceWaterMarks(new File(homeDir, "sourceWaterMarks.scn"));
        WaterMarksClock waterMarksClock = new SourceWaterMarksClock(sources, sourceWaterMarks);
       
        // STEP-3
        // Create store configuration template
        StoreConfig configTemplate = new StorePartitionConfig(homeDir, arrayStoreIndexStart, arrayStoreCapacity);
        configTemplate.setSegmentCompactFactor(0.68);
        configTemplate.setSegmentFactory(new MappedSegmentFactory());
        configTemplate.setSegmentFileSizeMB(32);
        configTemplate.setNumSyncBatches(2);
        configTemplate.setBatchSize(100);
       
        // Create multi-tenant store responder
        ArrayStoreFactory storeFactory = new StaticArrayStoreFactory();
        StoreResponderFactory responderFactory = new BasicArrayStoreResponderFactory(storeFactory);
        MultiTenantStoreResponder mtStoreResponder = new MultiTenantStoreResponder(homeDir, configTemplate, responderFactory);
       
        String source;
        StoreResponder responder;
        ArrayStore baseStore;
        Serializer<Integer> keySerializer = new IntSerializer();
        Map<String, AvroStore<Integer>> map = new HashMap<String, AvroStore<Integer>>();
       
        // Create "Person" AvroStore
        source = "Person";
        responder = mtStoreResponder.createTenant(source);
View Full Code Here

     *
     * @param store  - the array store
     * @param schema - the Avro schema
     */
    public SimpleAvroArray(ArrayStore store, Schema schema) {
        super(store, new IntSerializer(ByteOrder.BIG_ENDIAN), new AvroGenericRecordSerializer(schema));
        this._schema = schema;
    }
View Full Code Here

public class AvroStoreBus2HttpClient {
   
    public static void main(String[] args) throws Exception {
        String source = "JoinedSources";
        URL url = new URL("http://localhost:8080");
        AvroStoreBusClientHttp<Integer> client = new AvroStoreBusClientHttp<Integer>(url, source, new IntSerializer());
        System.out.println(client.getSchema().toString(true));
       
        // Change accordingly with the server
        int indexStart = 50000;
       
View Full Code Here

     *
     * @param store - the underlying store
     */
    public BasicArrayStoreProtocolHandler(ArrayStore store) {
        this._store = store;
        this._keySerializer = new IntSerializer(ByteOrder.BIG_ENDIAN);
    }
View Full Code Here

    private int _indexStart = _rand.nextInt(100) * 100000;
    private int _indexCount = 100000;
   
    @Override
    protected Serializer<Integer> createEventValueSerializer() {
        return new IntSerializer();
    }
View Full Code Here

        config.setSegmentFileSizeMB(16);
        config.setNumSyncBatches(10);
        config.setBatchSize(100);
       
        ObjectStoreFactory<Integer, String> factory = new StaticObjectArrayFactory<String>();
        return factory.create(config, new IntSerializer(), new StringSerializerUtf8());
    }
View Full Code Here

TOP

Related Classes of krati.io.serializer.IntSerializer

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.