def __init__(self, binning_strategies=None, java_ref=None): if java_ref is None: j_binning_strategies = GeoWaveObject.to_java_array( geowave_pkg.core.store.api.StatisticBinningStrategy, binning_strategies) java_ref = geowave_pkg.core.store.statistics.binning.CompositeBinningStrategy( j_binning_strategies) super().__init__(java_ref)
def add_type(self, type_adapter, *initial_indices): """ Add this type to the data store. This only needs to be called one time per type. Args: type_adapter (pygw.base.data_type_adapter.DataTypeAdapter): The data type adapter to add to the data store. *initial_indices (pygw.index.index.Index): The initial indices for this type. """ assert isinstance(type_adapter, DataTypeAdapter) j_index_arr = GeoWaveObject.to_java_array( geowave_pkg.core.store.api.Index, initial_indices) self._java_ref.addType(type_adapter._java_ref, j_index_arr)
def add_index(self, type_name, *indices): """ Add new indices for the given type. If there is data in other indices for this type, for consistency it will need to copy all of the data into the new indices, which could be a long process for lots of data. Args: type_name (str): Name of data type to register indices to. *indices (pygw.index.index.Index): Index to add. """ assert isinstance(type_name, str) j_index_arr = GeoWaveObject.to_java_array( geowave_pkg.core.store.api.Index, indices) self._java_ref.addIndex(type_name, j_index_arr)
def ingest(self, url, *indices, ingest_options=None): """ Ingest from URL. If this is a directory, this method will recursively search for valid files to ingest in the directory. This will iterate through registered IngestFormatPlugins to find one that works for a given file. Args: url (str): The URL for data to read and ingest into this data store. *indices (pygw.index.index.Index): Index to ingest into. ingest_options: Options for ingest (Not yet supported). """ # TODO: Ingest Options if ingest_options: raise NotImplementedError() assert isinstance(url, str) j_index_arr = GeoWaveObject.to_java_array( geowave_pkg.core.store.api.Index, indices) java_url = java_gateway.jvm.java.net.URL(url) self._java_ref.ingest(java_url, ingest_options, j_index_arr)
def recalc_statistic(self, *statistic): j_stat_array = GeoWaveObject.to_java_array( geowave_pkg.core.store.api.Statistic, statistic) self._java_ref.recalcStatistic(j_stat_array)
def add_empty_statistic(self, *statistic): j_stat_array = GeoWaveObject.to_java_array( geowave_pkg.core.store.api.Statistic, statistic) self._java_ref.addEmptyStatistic(j_stat_array)