Package org.apache.lucene.spatial

Examples of org.apache.lucene.spatial.SpatialStrategy


   * Looks up the SpatialStrategy from the given round --
   * {@link org.apache.lucene.benchmark.byTask.utils.Config#getRoundNumber()}. It's an error
   * if it wasn't created already for this round -- when SpatialDocMaker is initialized.
   */
  public static SpatialStrategy getSpatialStrategy(int roundNumber) {
    SpatialStrategy result = spatialStrategyCache.get(roundNumber);
    if (result == null) {
      throw new IllegalStateException("Strategy should have been init'ed by SpatialDocMaker by now");
    }
    return result;
  }
View Full Code Here


  }

  @Override
  public void setConfig(Config config, ContentSource source) {
    super.setConfig(config, source);
    SpatialStrategy existing = spatialStrategyCache.get(config.getRoundNumber());
    if (existing == null) {
      //new round; we need to re-initialize
      strategy = makeSpatialStrategy(config);
      spatialStrategyCache.put(config.getRoundNumber(), strategy);
      //TODO remove previous round config?
View Full Code Here

   * Looks up the SpatialStrategy from the given round --
   * {@link org.apache.lucene.benchmark.byTask.utils.Config#getRoundNumber()}. It's an error
   * if it wasn't created already for this round -- when SpatialDocMaker is initialized.
   */
  public static SpatialStrategy getSpatialStrategy(int roundNumber) {
    SpatialStrategy result = spatialStrategyCache.get(roundNumber);
    if (result == null) {
      throw new IllegalStateException("Strategy should have been init'ed by SpatialDocMaker by now");
    }
    return result;
  }
View Full Code Here

  }

  @Override
  public void setConfig(Config config, ContentSource source) {
    super.setConfig(config, source);
    SpatialStrategy existing = spatialStrategyCache.get(config.getRoundNumber());
    if (existing == null) {
      //new round; we need to re-initialize
      strategy = makeSpatialStrategy(config);
      spatialStrategyCache.put(config.getRoundNumber(), strategy);
      //TODO remove previous round config?
View Full Code Here

   * Looks up the SpatialStrategy from the given round --
   * {@link org.apache.lucene.benchmark.byTask.utils.Config#getRoundNumber()}. It's an error
   * if it wasn't created already for this round -- when SpatialDocMaker is initialized.
   */
  public static SpatialStrategy getSpatialStrategy(int roundNumber) {
    SpatialStrategy result = spatialStrategyCache.get(roundNumber);
    if (result == null) {
      throw new IllegalStateException("Strategy should have been init'ed by SpatialDocMaker by now");
    }
    return result;
  }
View Full Code Here

  }

  @Override
  public void setConfig(Config config, ContentSource source) {
    super.setConfig(config, source);
    SpatialStrategy existing = spatialStrategyCache.get(config.getRoundNumber());
    if (existing == null) {
      //new round; we need to re-initialize
      strategy = makeSpatialStrategy(config);
      spatialStrategyCache.put(config.getRoundNumber(), strategy);
      //TODO remove previous round config?
View Full Code Here

        }
        return writer;
    }

    private SpatialStrategy getSpatialStrategy(String key) {
        SpatialStrategy strategy = spatial.get(key);
        if (strategy == null) {
            synchronized (spatial) {
                if (!spatial.containsKey(key)) {
//                    SpatialPrefixTree grid = new GeohashPrefixTree(ctx, GEO_MAX_LEVELS);
//                    strategy = new RecursivePrefixTreeStrategy(grid, key);
View Full Code Here

        if (path.exists()) IOUtils.deleteDirectory(path,false);
        if (!path.exists() && path.isDirectory()) path.mkdirs();
    }

    private SpatialStrategy getSpatialStrategy(String key) {
        SpatialStrategy strategy = spatial.get(key);
        if (strategy==null) {
            final int maxLevels = 11;
            SpatialPrefixTree grid = new GeohashPrefixTree(ctx, maxLevels);
            strategy = new RecursivePrefixTreeStrategy(grid, key);
            spatial.put(key,strategy);
View Full Code Here

TOP

Related Classes of org.apache.lucene.spatial.SpatialStrategy

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.