Package proj.zoie.impl.indexing

Examples of proj.zoie.impl.indexing.ZoieConfig


        // Similarity from configuration:
        Similarity similarity = pluginRegistry.getBeanByFullPrefix(SENSEI_INDEX_SIMILARITY, Similarity.class);
        if (similarity == null) {
            similarity = new DefaultSimilarity();
        }
        ZoieConfig zoieConfig;
        if (_gateway != null) {
            zoieConfig = new ZoieConfig(_gateway.getVersionComparator());
        } else {
            zoieConfig = new ZoieConfig();
        }

        zoieConfig.setAnalyzer(analyzer);
        zoieConfig.setSimilarity(similarity);
        zoieConfig.setBatchSize(_senseiConf.getInt(SENSEI_INDEX_BATCH_SIZE, ZoieConfig.DEFAULT_SETTING_BATCHSIZE));
        zoieConfig.setBatchDelay(_senseiConf.getLong(SENSEI_INDEX_BATCH_DELAY, ZoieConfig.DEFAULT_SETTING_BATCHDELAY));
        zoieConfig.setMaxBatchSize(_senseiConf.getInt(SENSEI_INDEX_BATCH_MAXSIZE, ZoieConfig.DEFAULT_MAX_BATCH_SIZE));
        zoieConfig.setRamSizeInBytes(_senseiConf.getInt(SENSEI_INDEX_MAX_RAM_SEGMENT_SIZE, ZoieConfig.DEFAULT_RAM_SIZE_IN_BYTES));
        zoieConfig.setMaxTotalWeight(_senseiConf.getInt(SENSEI_INDEX_MAX_TOTAL_WEIGHT, ZoieConfig.DEFAULT_MAX_TOTAL_WEIGHT));
        zoieConfig.setRtIndexing(_senseiConf.getBoolean(SENSEI_INDEX_REALTIME, ZoieConfig.DEFAULT_SETTING_REALTIME));
        zoieConfig.setSkipBadRecord(_senseiConf.getBoolean(SENSEI_SKIP_BAD_RECORDS, false));
        int delay = _senseiConf.getInt(SENSEI_INDEX_FRESHNESS, 10);
        ReaderCacheFactory readercachefactory;
        if (delay > 0) {
            readercachefactory = DefaultReaderCache.FACTORY;
            zoieConfig.setFreshness(delay * 1000);
        } else {
            readercachefactory = SimpleReaderCache.FACTORY;
        }
        zoieConfig.setReadercachefactory(readercachefactory);
        ShardingStrategy strategy = pluginRegistry.getBeanByFullPrefix(SENSEI_SHARDING_STRATEGY, ShardingStrategy.class);
        if (strategy == null) {
            strategy = new ShardingStrategy.FieldModShardingStrategy(_senseiSchema.getUidField());
        }

        Filter retentionFilter =
                pluginRegistry.getBeanByFullPrefix(SENSEI_ZOIE_RETENTION_FILTER, Filter.class);

        int deletionsBeforeOptimize = _senseiConf.getInt(SENSEI_ZOIE_RETENTION_DELETIONS_BEFORE_OPTIMIZE,
                ZoieConfig.DEFAULT_NUM_DELETIONS_BEFORE_OPTIMIZE);

        long purgePeriodMillis = _senseiConf.getLong(SENSEI_ZOIE_RETENTION_PURGE_PERIOD, ZoieConfig.DEFAULT_PURGE_PERIOD);

        zoieConfig.setPurgeFilter(retentionFilter);
        zoieConfig.setNumDeletionsBeforeOptimize(deletionsBeforeOptimize);
        zoieConfig.setPurgePeriod(purgePeriodMillis);

        pluggableSearchEngineManager = new PluggableSearchEngineManager();
        pluggableSearchEngineManager.init(_senseiConf.getString(SENSEI_INDEX_DIR), nodeid, _senseiSchema, zoieConfig.getVersionComparator(), pluginRegistry, strategy);

        List<FacetHandler<?>> facetHandlers = new LinkedList<FacetHandler<?>>();
        List<RuntimeFacetHandlerFactory<?, ?>> runtimeFacetHandlerFactories = new LinkedList<RuntimeFacetHandlerFactory<?, ?>>();

        int invertedIndexPenalty = _senseiConf.getInt(SENSEI_SEARCH_INVERTED_INDEX_PENALTY,
View Full Code Here


public class LocalQueryOnlySenseiServiceImpl implements SenseiService {

  private CoreSenseiServiceImpl _coreService;
  private final SenseiCore _core;
  public LocalQueryOnlySenseiServiceImpl(File idxDir) throws Exception{
    ZoieConfig zoieConfig = new ZoieConfig();
    zoieConfig.setReadercachefactory(SimpleReaderCache.FACTORY);
    DemoZoieSystemFactory zoieFactory = new DemoZoieSystemFactory(idxDir,new AbstractZoieIndexableInterpreter<JSONObject>(){
      @Override
      public ZoieIndexable convertAndInterpret(JSONObject src) {
        return null;
      }
View Full Code Here

    }

    File idxDir = getIdxDir();

    ZoieConfig zConfig = new ZoieConfig();

    ZoieSystem<?, DataDoc> zoie = ZoieSystem.buildDefaultInstance(idxDir, new DefaultInterpreter(),
      zConfig);
    zoie.start();
View Full Code Here

   * @return
   */
  protected static ZoieSystem<IndexReader, String> createZoie(File idxDir, boolean realtime,
      long delay, Analyzer analyzer, DocIDMapperFactory docidMapperFactory,
      Comparator<String> versionComparator, boolean immediateRefresh) {
    ZoieConfig config = new ZoieConfig();
    config.setDocidMapperFactory(docidMapperFactory);
    config.setBatchSize(50);
    config.setBatchDelay(2000);
    config.setRtIndexing(realtime);
    config.setVersionComparator(versionComparator);
    config.setSimilarity(null);
    config.setAnalyzer(null);
    if (immediateRefresh) {
      config.setReadercachefactory(SimpleReaderCache.FACTORY);
    }
    ZoieSystem<IndexReader, String> idxSystem = new ZoieSystem<IndexReader, String>(idxDir,
        new DataInterpreterForTests(delay, analyzer), new TestIndexReaderDecorator(), config);
    return idxSystem;
  }
View Full Code Here

  }

  static PerfTestHandler buildZoieHandler(File idxDir, Configuration topConf, Configuration conf)
      throws Exception {

    ZoieConfig zoieConfig = new ZoieConfig();
    zoieConfig.setAnalyzer(new StandardAnalyzer(Version.LUCENE_43));
    zoieConfig.setBatchSize(100000);
    zoieConfig.setBatchDelay(10000);
    zoieConfig.setMaxBatchSize(100000);
    zoieConfig.setRtIndexing(true);
    zoieConfig.setVersionComparator(ZoiePerfVersion.COMPARATOR);
    zoieConfig.setReadercachefactory(SimpleReaderCache.FACTORY);

    String modeConf = topConf.getString("perf.directory.type", "file");
    DIRECTORY_MODE mode = modeMap.get(modeConf);
    if (mode == null) mode = DIRECTORY_MODE.SIMPLE;
    DirectoryManager dirMgr = new DefaultDirectoryManager(idxDir, mode);
View Full Code Here

  }

  private void modifyTest(File idxDir, String schedule) throws IOException, InterruptedException {
    HourglassDirectoryManagerFactory factory = new HourglassDirectoryManagerFactory(idxDir,
        new HourGlassScheduler(HourGlassScheduler.FREQUENCY.MINUTELY, schedule, false, 100));
    ZoieConfig zConfig = new ZoieConfig();
    zConfig.setBatchSize(100000);
    zConfig.setMaxBatchSize(100000);
    zConfig.setBatchDelay(30000);
    zConfig.setFreshness(100);
    zConfig.setRtIndexing(true);
    Hourglass<IndexReader, String> hourglass = new Hourglass<IndexReader, String>(factory,
        new HourglassTestInterpreter(), new IndexReaderDecorator<IndexReader>() {

          @Override
          public IndexReader decorate(ZoieSegmentReader<IndexReader> indexReader)
View Full Code Here

  private void oneTest(File idxDir, String schedule, long numTestContent, boolean appendOnly)
      throws IOException, InterruptedException {
    HourglassDirectoryManagerFactory factory = new HourglassDirectoryManagerFactory(idxDir,
        new HourGlassScheduler(HourGlassScheduler.FREQUENCY.MINUTELY, schedule, appendOnly, 100));
    ZoieConfig zConfig = new ZoieConfig();
    zConfig.setBatchSize(100000);
    zConfig.setMaxBatchSize(100000);
    zConfig.setBatchDelay(30000);
    zConfig.setFreshness(100);
    zConfig.setRtIndexing(true);
    Hourglass<IndexReader, String> hourglass = new Hourglass<IndexReader, String>(factory,
        new HourglassTestInterpreter(), new IndexReaderDecorator<IndexReader>() {

          @Override
          public IndexReader decorate(ZoieSegmentReader<IndexReader> indexReader)
View Full Code Here

            Calendar ret = Calendar.getInstance();
            ret.setTimeInMillis(now.getTimeInMillis() + 60L * 60 * 1000 * 48);
            return ret;
          }
        });
    ZoieConfig zConfig = new ZoieConfig();
    zConfig.setBatchSize(1);
    zConfig.setBatchDelay(10);
    zConfig.setFreshness(10);
    Hourglass<IndexReader, String> hourglass = new Hourglass<IndexReader, String>(factory,
        new HourglassTestInterpreter(), new IndexReaderDecorator<IndexReader>() {

          @Override
          public IndexReader decorate(ZoieSegmentReader<IndexReader> indexReader)
View Full Code Here

TOP

Related Classes of proj.zoie.impl.indexing.ZoieConfig

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.