Package krati.core.segment

Examples of krati.core.segment.MemorySegmentFactory


    // elementSerializer
    ElementSerializer<E> elementSerializer = (ElementSerializer<E>)
    Class.forName(properties.getProperty("cleo.search.generic.typeahead.config.elementSerializer.class")).newInstance();
    config.setElementSerializer(elementSerializer);
   
    SegmentFactory elementStoreSegmentFactory = new MemorySegmentFactory();
   
    // elementStore
    config.setElementStoreDir(new File(properties.getProperty("cleo.search.generic.typeahead.config.elementStoreDir")));
    config.setElementStoreIndexStart(Integer.parseInt(properties.getProperty("cleo.search.generic.typeahead.config.elementStoreIndexStart")));
    config.setElementStoreCapacity(Integer.parseInt(properties.getProperty("cleo.search.generic.typeahead.config.elementStoreCapacity")));
    config.setElementStoreSegmentMB(Integer.parseInt(properties.getProperty("cleo.search.generic.typeahead.config.elementStoreSegmentMB")));
    config.setElementStoreSegmentFactory(elementStoreSegmentFactory);
   
    SegmentFactory connectionsStoreIndexSegmentFactory = new MemorySegmentFactory();
    SegmentFactory connectionsStoreSegmentFactory = new MemorySegmentFactory();
   
    // connectionsStore
    config.setConnectionsStoreDir(new File(properties.getProperty("cleo.search.generic.typeahead.config.connectionsStoreDir")));
    config.setConnectionsStoreCapacity(Integer.parseInt(properties.getProperty("cleo.search.generic.typeahead.config.connectionsStoreCapacity")));
    config.setConnectionsStoreSegmentFactory(connectionsStoreSegmentFactory);
View Full Code Here


    File elementScoreDir = (args.length > 7) ? new File(args[7]) : null;
   
    Chronos c = new Chronos();
   
    // Load elementStore
    SegmentFactory elementStoreSegFactory = new MemorySegmentFactory();
    ElementSerializer<TypeaheadElement> elementSerializer = new TypeaheadElementSerializer();
    ArrayStoreElement<TypeaheadElement> elementStore =
      StoreFactory.createElementStorePartition(elementStoreDir, idStart, idCount, elementStoreSegFactory, elementStoreSegMB, elementSerializer);
   
    // Load elementStore into memory
    elementStore = new MemoryArrayStoreElement<TypeaheadElement>(elementStore);
   
    // Load element scores
    if(elementStoreDir != null && elementScoreDir.exists()) {
      ElementScoreSetter<TypeaheadElement> handler = new ElementScoreSetter<TypeaheadElement>(elementStore);
      ElementScoreScanner scan = new ElementScoreScanner(elementScoreDir);
      scan.scan(handler);
    }
   
    // Create connectionsStore
    int indexSegmentFileSizeMB = 8;
    SegmentFactory indexSegmentFactory = new MemorySegmentFactory();
    SegmentFactory storeSegmentFactory = new MemorySegmentFactory();
    ConnectionsStore<String> connectionsStore =
      StoreFactory.createConnectionsStore(
          connectionsStoreDir, connectionsStoreCapacity,
          indexSegmentFileSizeMB, indexSegmentFactory,
          connectionsStoreSegmentMB, storeSegmentFactory);
View Full Code Here

    File line3Dir = new File(args[7]);
    File mediaDir = new File(args[8]);
   
    Chronos c = new Chronos();
   
    SegmentFactory elementStoreSegFactory = new MemorySegmentFactory();
    ElementFactory<TypeaheadElement> elementFactory = new SimpleTypeaheadElementFactory();
    ElementSerializer<TypeaheadElement> elementSerializer = new TypeaheadElementSerializer();
    ArrayStoreElement<TypeaheadElement> elementStore =
      StoreFactory.createElementStorePartition(elementStoreDir, idStart, idCount, elementStoreSegFactory, elementStoreSegMB, elementSerializer);
    TypeaheadElementStoreBootstrap elementStoreBootstrap =
View Full Code Here

    config.setElementStoreCapacity(getElementStoreCapacity());
    config.setElementStoreSegmentMB(32);
   
    int connectionsStoreCapacity = 500000;
    int connectionsStoreIndexSegmentMB = 8;
    SegmentFactory connectionsStoreIndexSegmentFactory = new MemorySegmentFactory();
    int connectionsStoreSegmentMB = 32;
    SegmentFactory connectionsStoreSegmentFactory = new MemorySegmentFactory();
   
    config.setConnectionsStoreCapacity(connectionsStoreCapacity);
    config.setConnectionsStoreDir(new File(getHomeDir(), "connections-store"));
    config.setConnectionsStoreIndexSegmentFactory(connectionsStoreIndexSegmentFactory);
    config.setConnectionsStoreIndexSegmentMB(connectionsStoreIndexSegmentMB);
View Full Code Here

    ArrayStoreElement<E> elementStore =
      StoreFactory.createElementStorePartition(
          elementStoreDir,
          getElementStoreIndexStart(),
          getElementStoreCapacity(),
          new MemorySegmentFactory(),
          elementStoreSegMB,
          createElementSerializer());
    return elementStore;
  }
View Full Code Here

  protected ConnectionsStore<String> createConnectionsStore() throws Exception {
    File connectionsStoreDir = new File(getHomeDir(), "connections-store");
       
    int initialCapacity = 500000;
    int indexSegmentFileSizeMB = 8;
    SegmentFactory indexSegmentFactory = new MemorySegmentFactory();
    int storeSegmentFileSizeMB = 32;
    SegmentFactory storeSegmentFactory = new MemorySegmentFactory();
   
    ConnectionsStore<String> connectionsStore =
      StoreFactory.createConnectionsStore(
          connectionsStoreDir,
          initialCapacity,
View Full Code Here

    ArrayStoreElement<E> elementStore =
      StoreFactory.createElementStorePartition(
          elementStoreDir,
          getElementStoreIndexStart(),
          getElementStoreCapacity(),
          new MemorySegmentFactory(),
          elementStoreSegMB,
          createElementSerializer());
    return elementStore;
  }
View Full Code Here

    ArrayStoreElement<E> elementStore =
      StoreFactory.createElementStorePartition(
          elementStoreDir,
          getElementStoreIndexStart(),
          getElementStoreCapacity(),
          new MemorySegmentFactory(),
          elementStoreSegMB,
          createElementSerializer());
    return elementStore;
  }
View Full Code Here

  }
 
  protected ArrayStoreWeights createWeightedConnectionsStore() throws Exception {
    File connectionsStoreDir = new File(getHomeDir(), "weighted-connections-store");
    int connectionsStoreSegMB = 32;
    SegmentFactory connectionsStoreSegFactory = new MemorySegmentFactory();
   
    ArrayStoreWeights connectionsStore =
      StoreFactory.createArrayStoreWeights(
          connectionsStoreDir,
          getConnectionsStoreCapacity(),
View Full Code Here

    return 100000;
  }
 
  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

TOP

Related Classes of krati.core.segment.MemorySegmentFactory

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.