Example usage for org.apache.lucene.spatial.prefix PointPrefixTreeFieldCacheProvider PointPrefixTreeFieldCacheProvider

List of usage examples for org.apache.lucene.spatial.prefix PointPrefixTreeFieldCacheProvider PointPrefixTreeFieldCacheProvider

Introduction

In this page you can find the example usage for org.apache.lucene.spatial.prefix PointPrefixTreeFieldCacheProvider PointPrefixTreeFieldCacheProvider.

Prototype

public PointPrefixTreeFieldCacheProvider(SpatialPrefixTree grid, String shapeField, int defaultSize) 

Source Link

Usage

From source file:org.apache.blur.analysis.type.spatial.lucene.PrefixTreeStrategy.java

License:Apache License

@Override
public ValueSource makeDistanceValueSource(Point queryPoint) {
    PointPrefixTreeFieldCacheProvider p = provider.get(getFieldName());
    if (p == null) {
        synchronized (this) {// double checked locking idiom is okay since
                             // provider is threadsafe
            p = provider.get(getFieldName());
            if (p == null) {
                p = new PointPrefixTreeFieldCacheProvider(grid, getFieldName(), defaultFieldValuesArrayLen);
                provider.put(getFieldName(), p);
            }//  w w w .  j a v a  2 s.  c om
        }
    }

    return new ShapeFieldCacheDistanceValueSource(ctx, p, queryPoint);
}