Class VectorMosaicFeatureSource

    • Constructor Detail

      • VectorMosaicFeatureSource

        public VectorMosaicFeatureSource​(ContentEntry contentEntry,
                                         VectorMosaicStore store)
        VectorMosaicFeatureSource constructor.
        Parameters:
        contentEntry - The content entry for the feature source.
        store - The data store for the feature source.
    • Method Detail

      • getStore

        public VectorMosaicStore getStore()
        Get the FeatureStore for the feature source.
        Returns:
        The FeatureStore for the feature source.
      • getSplitFilter

        protected Filter getSplitFilter​(Query query,
                                        DataStore dataStore,
                                        String typeName,
                                        boolean isDelegate)
      • getCountInternal

        protected int getCountInternal​(Query query)
                                throws IOException
        Counts the matching granules by delegating to the underlying granule stores. The stores could potentially return a mix of "-1" and actual counts, the current implementation assumes that the it's convenient to grab the count forcefully when it's not available from the fast count, should still be better than counting all features after they got merged with the delegate ones.

        A take that a single "-1" would make this method also return "-1" could also be reasoable, we might want to make the behavior configurable in the future. Currently most code really wants the actual count, not an estimate, hence the current implementation.

        Specified by:
        getCountInternal in class ContentFeatureSource
        Throws:
        IOException
      • buildFeatureType

        protected SimpleFeatureType buildFeatureType()
                                              throws IOException
        Uses first granule to build a schema for the target feature type
        Specified by:
        buildFeatureType in class ContentFeatureSource
        Returns:
        the schema
        Throws:
        IOException - If feature type can't be built or found
      • getGranuleType

        protected SimpleFeatureType getGranuleType()
                                            throws IOException
        Get the feature type for the granules.
        Returns:
        the feature type for the granules.
        Throws:
        IOException - if the feature type can't be found.
      • getFeatureType

        protected SimpleFeatureType getFeatureType​(SimpleFeatureType indexFeatureType,
                                                   SimpleFeatureType granuleFeatureType)
                                            throws IOException
        Builds a feature type for the target feature source by merging the index feature type with the granule feature type
        Parameters:
        indexFeatureType - the index feature type
        granuleFeatureType - the granule feature type
        Returns:
        the merged feature type
        Throws:
        IOException - if feature type can't be built
      • isNotMandatoryIndexType

        protected boolean isNotMandatoryIndexType​(AttributeDescriptor descriptor)
        Checks if the attribute descriptor is not a mandatory index type
        Parameters:
        descriptor - the attribute descriptor
        Returns:
        true if not mandatory index type
      • initGranule

        public DataStore initGranule​(VectorMosaicGranule granule,
                                     boolean isSampleForType)
                              throws IOException
        Initializes the granule by setting the data store and granule type name
        Parameters:
        granule - the granule
        Throws:
        IOException - if data store can't be found
      • getAttributeNamesForType

        public static Set<String> getAttributeNamesForType​(SimpleFeatureType featureType)
                                                    throws IOException
        Throws:
        IOException
      • handleVisitor

        protected boolean handleVisitor​(Query query,
                                        FeatureVisitor visitor)
                                 throws IOException
        Description copied from class: ContentFeatureSource
        Subclass method which allows subclasses to natively handle a visitor.

        Subclasses would override this method and return true in cases where the specific visitor could be handled without iterating over the entire result set of query. An example would be handling visitors that calculate aggregate values.

        Overrides:
        handleVisitor in class ContentFeatureSource
        Parameters:
        query - The query being made.
        visitor - The visitor to
        Returns:
        true if the visitor can be handled natively, otherwise false.
        Throws:
        IOException
      • populateGranuleTypeName

        protected void populateGranuleTypeName​(VectorMosaicGranule granule,
                                               DataStore dataStore)
                                        throws IOException
        Validates and loads the connection string properties
        Parameters:
        granule - the granule
        Throws:
        IOException - if connection string properties can't be loaded
      • canRetype

        protected boolean canRetype​(Query query)
        Description copied from class: ContentFeatureSource
        Determines if the datastore can natively perform "retyping" which includes limiting the number of attributes returned and reordering of those attributes

        If the subclass can handle retyping natively it should override this method to return true. In this case it must do the retyping or throw an exception.

        Not overriding this method or returning false will cause the feature reader created by the subclass to be wrapped in a retyping feature reader when the query specifies a retype.

        Overrides:
        canRetype in class ContentFeatureSource
        See Also:
        ReTypeFeatureReader
      • canFilter

        protected boolean canFilter​(Query query)
        Description copied from class: ContentFeatureSource
        Determines if the datastore can natively perform a filtering.

        If the subclass can handle filtering natively it should override this method to return true. In this case it must do the filtering or throw an exception. This includes the case of partial native filtering where the datastore can only handle part of the filter natively. In these cases it is up to the subclass to apply a decorator to the reader it returns which will handle any part of the filter can was not applied natively. See FilteringFeatureReader.

        Not overriding this method or returning false will cause the feature reader created by the subclass to be wrapped in a filtering feature reader when the query specifies a filter. See FilteringFeatureReader.

        Overrides:
        canFilter in class ContentFeatureSource