Interface ManagedDataSource<T>

All Known Subinterfaces:
DataPersister<T>, DataProvider<T>, ExternalDataSource<T>, ManagedDataSourceEntriesProvider, SQLDataProvider<T>
All Known Implementing Classes:
AbstractManagedDataSourceDelegator, AbstractManagedDataSourceSplitter, BulkDataPersisterExceptionHandler, BulkDataPersisterSplitter, DataProviderSplitter, DataStorage, SharedIteratorSQLDataProviderDecorator, SQLDataProviderExceptionHandler, SQLDataProviderSplitter

@Deprecated public interface ManagedDataSource<T>
Deprecated.
since 9.5 - use SpaceDataSource or SpaceSynchronizationEndpoint instead.
ManagedDataSource should be implemented when initialization and shutdown operations are needed by the data source.

Usually in case of external databases - init() will establish a JDBC connection and shutdown() will close it.

If the implementation requires configuration, it can be configured in external properties file.
The content of this file is passed to init() The location of the properties file should be defined in the space schema or property:

space-config.ExternalDataSource.init-properties-file
Since:
6.0
Author:
anna
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated.
    use this constant to get from the Properties the number of partitions
    static final String
    Deprecated.
    use this constant to get from the Properties the partition number
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated.
    Initialize and configure the data source using given properties.
    Called when space is started.
    The properties are loaded from a file that can be defined in the space schema or as a property named:

    space-config.ExternalDataSource.properties-file partitionId and number of partitions are also in the Properties - can be read with STATIC_PARTITION_NUMBER and NUMBER_OF_PARTITIONS
    Deprecated.
    Creates and returns an iterator over all the entries that should be loaded into space.
    void
    Deprecated.
    Close the data source and clean any used resources.
    Called before space shutdown.
  • Field Details

    • NUMBER_OF_PARTITIONS

      static final String NUMBER_OF_PARTITIONS
      Deprecated.
      use this constant to get from the Properties the number of partitions
      See Also:
    • STATIC_PARTITION_NUMBER

      static final String STATIC_PARTITION_NUMBER
      Deprecated.
      use this constant to get from the Properties the partition number
      See Also:
  • Method Details

    • init

      void init(Properties prop) throws DataSourceException
      Deprecated.
      Initialize and configure the data source using given properties.
      Called when space is started.
      The properties are loaded from a file that can be defined in the space schema or as a property named:

      space-config.ExternalDataSource.properties-file partitionId and number of partitions are also in the Properties - can be read with STATIC_PARTITION_NUMBER and NUMBER_OF_PARTITIONS
      Parameters:
      prop - - contains user defined param and Partition data
      Throws:
      DataSourceException
    • initialLoad

      DataIterator<T> initialLoad() throws DataSourceException
      Deprecated.
      Creates and returns an iterator over all the entries that should be loaded into space.
      Returns:
      a DataIterator or null if no data should be loaded into space
      Throws:
      DataSourceException
    • shutdown

      void shutdown() throws DataSourceException
      Deprecated.
      Close the data source and clean any used resources.
      Called before space shutdown.
      Throws:
      DataSourceException