Package krati.store.avro.protocol

Examples of krati.store.avro.protocol.MultiTenantStoreResponder


        configTemplate.setBatchSize(100);
       
        // Create multi-tenant store responder
        DataStoreFactory storeFactory = new IndexedDataStoreFactory();
        StoreResponderFactory responderFactory = new BasicDataStoreResponderFactory(storeFactory);
        MultiTenantStoreResponder mtStoreResponder = new MultiTenantStoreResponder(homeDir, configTemplate, responderFactory);
       
        String source;
        StoreResponder responder;
        DataStore<byte[], byte[]> baseStore;
        Serializer<String> keySerializer = new StringSerializer();
        Map<String, AvroStore<String>> map = new HashMap<String, AvroStore<String>>();
       
        // Create "Person" AvroStore
        source = "Person";
        responder = mtStoreResponder.createTenant(source);
        baseStore = ((BasicDataStoreResponder)responder).getStore();
        AvroStore<String> personStore = new SimpleAvroStore<String>(baseStore, createPersonSchema(), keySerializer);
        map.put(source, personStore);
       
        // Create "Address" AvroStore
        source = "Address";
        responder = mtStoreResponder.createTenant(source);
        baseStore = ((BasicDataStoreResponder)responder).getStore();
        AvroStore<String> addressStore = new SimpleAvroStore<String>(baseStore, createAddressSchema(), keySerializer);
        map.put(source, addressStore);
       
        // Create Avro store joiner
View Full Code Here


        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);
        baseStore = ((BasicArrayStoreResponder)responder).getStore();
        AvroStore<Integer> personStore = new SimpleAvroArray(baseStore, createPersonSchema());
        map.put(source, personStore);
       
        // Create "Address" AvroStore
        source = "Address";
        responder = mtStoreResponder.createTenant(source);
        baseStore = ((BasicArrayStoreResponder)responder).getStore();
        AvroStore<Integer> addressStore = new SimpleAvroArray(baseStore, createAddressSchema());
        map.put(source, addressStore);
       
        // Create Avro store joiner
View Full Code Here

        configTemplate.setBatchSize(100);
       
        // Create multi-tenant store responder
        DataStoreFactory storeFactory = new IndexedDataStoreFactory();
        StoreResponderFactory responderFactory = new BasicDataStoreResponderFactory(storeFactory);
        MultiTenantStoreResponder mtStoreResponder = new MultiTenantStoreResponder(homeDir, configTemplate, responderFactory);
       
        String source;
        StoreResponder responder;
        DataStore<byte[], byte[]> baseStore;
        Serializer<String> keySerializer = new StringSerializer();
        Map<String, AvroStore<String>> map = new HashMap<String, AvroStore<String>>();
       
        // Create "Person" AvroStore
        source = "Person";
        responder = mtStoreResponder.createTenant(source);
        baseStore = ((BasicDataStoreResponder)responder).getStore();
        AvroStore<String> personStore = new SimpleAvroStore<String>(baseStore, createPersonSchema(), keySerializer);
        map.put(source, personStore);
       
        // Create "Address" AvroStore
        source = "Address";
        responder = mtStoreResponder.createTenant(source);
        baseStore = ((BasicDataStoreResponder)responder).getStore();
        AvroStore<String> addressStore = new SimpleAvroStore<String>(baseStore, createAddressSchema(), keySerializer);
        map.put(source, addressStore);
       
        // Create Avro store joiner
View Full Code Here

        configTemplate.setNumSyncBatches(2);
        configTemplate.setBatchSize(100);
       
        // Create store responder and server
        DataStoreFactory storeFactory = new IndexedDataStoreFactory();
        MultiTenantStoreResponder storeResponder = new MultiTenantStoreResponder(homeDir, configTemplate, new BasicDataStoreResponderFactory(storeFactory));
        HttpServer server = new HttpServer(storeResponder, 8080);
        server.start();
        server.join();
    }
View Full Code Here

TOP

Related Classes of krati.store.avro.protocol.MultiTenantStoreResponder

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.