Package krati.core.segment

Examples of krati.core.segment.WriteBufferSegmentFactory


       */
      NetworkTypeaheadConfig<TypeaheadElement> config =
        TypeaheadConfigFactory.createNetworkTypeaheadConfig(properties);
      config.setElementStoreCached(false); // disable cache to bypass serialization
      config.setElementStoreSegmentFactory(new ChannelSegmentFactory());
      config.setConnectionsStoreSegmentFactory(new WriteBufferSegmentFactory(config.getConnectionsStoreSegmentMB()));
     
      WeightedNetworkTypeaheadInitializer<TypeaheadElement> initializer =
        new WeightedNetworkTypeaheadInitializer<TypeaheadElement>(config);
      WeightedNetworkTypeahead<TypeaheadElement> typeahead =
        (WeightedNetworkTypeahead<TypeaheadElement>) initializer.getTypeahead();
View Full Code Here


    // create elementStore
    ArrayStoreElement<E> elementStore = StoreFactory.createElementStorePartition(
        config.getElementStoreDir(),
        config.getElementStoreIndexStart(),
        config.getElementStoreCapacity(),
        new WriteBufferSegmentFactory(config.getElementStoreSegmentMB()),
        config.getElementStoreSegmentMB(),
        config.getElementSerializer());
   
    // load elementStore in memory
    if(config.isElementStoreCached()) {
View Full Code Here

     * Configure target NetworkTypeahead
     */
    config = TypeaheadConfigFactory.createNetworkTypeaheadConfig(targetProperties);
    config.setElementStoreCached(false); // disable cache to bypass serialization
    config.setElementStoreSegmentFactory(new MappedSegmentFactory());
    config.setConnectionsStoreSegmentFactory(new WriteBufferSegmentFactory(config.getConnectionsStoreSegmentMB()));
    initializer = new VanillaNetworkTypeaheadInitializer<TypeaheadElement>(config);
   
    VanillaNetworkTypeahead<TypeaheadElement> targetTypeahead =
      (VanillaNetworkTypeahead<TypeaheadElement>) initializer.getTypeahead();
    long targetLoadTime = c.tick();
View Full Code Here

     * Configure target NetworkTypeahead
     */
    config = TypeaheadConfigFactory.createNetworkTypeaheadConfig(targetProperties);
    config.setElementStoreCached(false); // disable cache to bypass serialization
    config.setElementStoreSegmentFactory(new MappedSegmentFactory());
    config.setConnectionsStoreSegmentFactory(new WriteBufferSegmentFactory(config.getConnectionsStoreSegmentMB()));
    initializer = new WeightedNetworkTypeaheadInitializer<TypeaheadElement>(config);
   
    WeightedNetworkTypeahead<TypeaheadElement> targetTypeahead =
      (WeightedNetworkTypeahead<TypeaheadElement>) initializer.getTypeahead();
    long targetLoadTime = c.tick();
View Full Code Here

 
  protected ConnectionsStore<String> createConnectionsStore() throws Exception {
    int indexSegmentFileSizeMB = 8;
    SegmentFactory indexSegmentFactory = new MemorySegmentFactory();
    int storeSegmentFileSizeMB = 32;
    SegmentFactory storeSegmentFactory = new WriteBufferSegmentFactory(storeSegmentFileSizeMB);
   
    return StoreFactory.createConnectionsStore(storeHome, getInitialCapacity(), indexSegmentFileSizeMB, indexSegmentFactory, storeSegmentFileSizeMB, storeSegmentFactory);
  }
View Full Code Here

       
        config.setBatchSize(10000);
        config.setNumSyncBatches(100);
       
        // Configure store segments
        config.setSegmentFactory(new WriteBufferSegmentFactory());
        config.setSegmentFileSizeMB(128);
        config.setSegmentCompactFactor(0.67);
       
        // Configure index segments
        config.setInt(StoreParams.PARAM_INDEX_SEGMENT_FILE_SIZE_MB, 32);
View Full Code Here

            File homeDir = FileUtils.getTestDir(getClass().getSimpleName());
            StoreConfig config = new StoreConfig(homeDir, getInitialCapacity());
            config.setBatchSize(1000);
            config.setNumSyncBatches(5);
            config.setSegmentFileSizeMB(32);
            config.setSegmentFactory(new WriteBufferSegmentFactory());
            _bytesDB = new BytesDB(config);
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

    public SimpleRetention(int id, File homeDir,
                           RetentionPolicy retentionPolicy,
                           EventBatchSerializer<T> batchSerializer, int batchSize) throws Exception {
        this(id, homeDir, 100000,
             retentionPolicy, batchSerializer, batchSize,
             new WriteBufferSegmentFactory(), 32 /* storeSegmentFileSizeMB */);
    }
View Full Code Here

        return _retentionSegmentFileSizeMB;
    }
   
    public void setRetentionSegmentFactory(SegmentFactory retentionSegmentFactory) {
        this._retentionSegmentFactory = retentionSegmentFactory == null ?
                new WriteBufferSegmentFactory() : retentionSegmentFactory;
    }
View Full Code Here

            File storeDir = DirUtils.getTestDir(getClass());
            StoreConfig config = new StoreConfig(storeDir, 100000);
            config.setBatchSize(getBatchSize());
            config.setNumSyncBatches(10);
            config.setSegmentFileSizeMB(32);
            config.setSegmentFactory(new WriteBufferSegmentFactory());
            config.setInt(StoreParams.PARAM_INDEX_SEGMENT_FILE_SIZE_MB, 8);
            config.setClass(StoreParams.PARAM_SEGMENT_FACTORY_CLASS, MemorySegmentFactory.class);
           
            _store = new IndexedDataStore(config);
        } catch(Exception e) {
View Full Code Here

TOP

Related Classes of krati.core.segment.WriteBufferSegmentFactory

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.