Class SourceTableMapFactory
public class SourceTableMapFactory extends Object
SourceTableMap
s.
When run from a standard query, you should use the forDatabase(OnDiskQueryDatabase)
method to create a
SourceTableMapFactory. When used from an in-worker DataImportServer, use the
forDataImportServer(DataImportServer)
method.
After creating the SourceTableMapFactory, you can use one of several overloads of the createTableMap(com.illumon.iris.db.v2.locations.TableKey, boolean, boolean, java.util.function.Predicate<com.illumon.iris.db.v2.locations.TableLocation>)
method.
The lowest level of these methods takes a TableKey
and predicate to match the available table locations.
You may also choose whether or not you would like to refresh the available locations (adding a new key to the result
SourceTableMap) and the sizes of the constituent tables tables (as new rows are added to a location).
The convenience methods createHistoricalTableMap(String, String, String)
and createIntradayTableMap(String, String, String)
are provided that mimic Database.getTable(String, String)
and Database.getIntradayTable(String, String)
followed by a where
filter on the partitioning column.
-
Method Summary
Modifier and Type Method Description TableMap
createHistoricalTableMap(String namespace, String tablename)
Create a newSourceTableMap
for the supplied parameters.TableMap
createHistoricalTableMap(String namespace, String tablename, String columnPartitionValue)
Create a newSourceTableMap
for the supplied parameters.TableMap
createIntradayTableMap(String namespace, String tablename, String columnPartitionValue)
Create a newSourceTableMap
for the supplied parameters.TableMap
createTableMap(TableKey tableKey, boolean refreshLocations, boolean refreshSizes)
Create a newSourceTableMap
for the supplied parameters.TableMap
createTableMap(TableKey tableKey, boolean refreshLocations, boolean refreshSizes, String columnPartitionValue)
Create a newSourceTableMap
for the supplied parameters.TableMap
createTableMap(TableKey tableKey, boolean refreshLocations, boolean refreshSizes, String internalPartitionValue, String columnPartitionValue)
Create a newSourceTableMap
for the supplied parameters.TableMap
createTableMap(TableKey tableKey, boolean refreshLocations, boolean refreshSizes, Predicate<TableLocation> locationMatcher)
Create a newSourceTableMap
for the supplied parameters.TableMap
createTableMap(TableKey tableKey, boolean refreshLocations, boolean refreshSizes, Predicate<CharSequence> internalPartitionMatcher, Predicate<CharSequence> columnPartitionMatcher)
Create a newSourceTableMap
for the supplied parameters.static SourceTableMapFactory
forDatabase(OnDiskQueryDatabase database)
Construct aSourceTableMapFactory
from the suppliedOnDiskQueryDatabase
.static SourceTableMapFactory
forDataImportServer(DataImportServer dataImportServer)
Construct aSourceTableMapFactory
from the suppliedDataImportServer
.
-
Method Details
-
forDataImportServer
public static SourceTableMapFactory forDataImportServer(@NotNull DataImportServer dataImportServer)Construct aSourceTableMapFactory
from the suppliedDataImportServer
.- Parameters:
dataImportServer
- The data import server to use for metadata and data- Returns:
- A new source table map factory backed by the data import server
-
forDatabase
Construct aSourceTableMapFactory
from the suppliedOnDiskQueryDatabase
.- Parameters:
database
- The database to use for metadata and data- Returns:
- A new source table map factory backed by the database
-
createTableMap
public TableMap createTableMap(@NotNull TableKey tableKey, boolean refreshLocations, boolean refreshSizes, @NotNull Predicate<TableLocation> locationMatcher)Create a newSourceTableMap
for the supplied parameters.- Parameters:
tableKey
- Identifier for the underlying tablerefreshLocations
- Whether locations should be refreshedrefreshSizes
- Whether location sizes should be refreshedlocationMatcher
- Filter function for locations to include- Returns:
- A new source table map
-
createTableMap
public TableMap createTableMap(@NotNull TableKey tableKey, boolean refreshLocations, boolean refreshSizes, @NotNull Predicate<CharSequence> internalPartitionMatcher, @NotNull Predicate<CharSequence> columnPartitionMatcher)Create a newSourceTableMap
for the supplied parameters.- Parameters:
tableKey
- Identifier for the underlying tablerefreshLocations
- Whether locations should be refreshedrefreshSizes
- Whether location sizes should be refreshedinternalPartitionMatcher
- Filter function for internal partitions to includecolumnPartitionMatcher
- Filter function for column partitions to include- Returns:
- A new source table map
-
createTableMap
public TableMap createTableMap(@NotNull TableKey tableKey, boolean refreshLocations, boolean refreshSizes, @NotNull String internalPartitionValue, @NotNull String columnPartitionValue)Create a newSourceTableMap
for the supplied parameters.- Parameters:
tableKey
- Identifier for the underlying tablerefreshLocations
- Whether locations should be refreshedrefreshSizes
- Whether location sizes should be refreshedinternalPartitionValue
- Specific internal partition to includecolumnPartitionValue
- Specific column partition to include- Returns:
- A new source table map
-
createTableMap
public TableMap createTableMap(@NotNull TableKey tableKey, boolean refreshLocations, boolean refreshSizes, @NotNull String columnPartitionValue)Create a newSourceTableMap
for the supplied parameters.- Parameters:
tableKey
- Identifier for the underlying tablerefreshLocations
- Whether locations should be refreshedrefreshSizes
- Whether location sizes should be refreshedcolumnPartitionValue
- Specific column partition to include- Returns:
- A new source table map
-
createTableMap
public TableMap createTableMap(@NotNull TableKey tableKey, boolean refreshLocations, boolean refreshSizes)Create a newSourceTableMap
for the supplied parameters.- Parameters:
tableKey
- Identifier for the underlying tablerefreshLocations
- Whether locations should be refreshedrefreshSizes
- Whether location sizes should be refreshed- Returns:
- A new source table map
-
createHistoricalTableMap
public TableMap createHistoricalTableMap(String namespace, String tablename, String columnPartitionValue)Create a newSourceTableMap
for the supplied parameters.Creates a static TableMap for the given historical system table.
- Parameters:
namespace
- The namespace of the source tabletablename
- The table name of the source tablecolumnPartitionValue
- Specific column partition to include- Returns:
- A new source table map
-
createHistoricalTableMap
Create a newSourceTableMap
for the supplied parameters.Creates a static TableMap for the given historical system table, all column partitions are included.
- Parameters:
namespace
- The namespace of the source tabletablename
- The table name of the source table- Returns:
- A new source table map
-
createIntradayTableMap
public TableMap createIntradayTableMap(String namespace, String tablename, String columnPartitionValue)Create a newSourceTableMap
for the supplied parameters.Creates a static TableMap for the given intraday system table.
- Parameters:
namespace
- The namespace of the tabletablename
- The table name to examine in the intraday data spacecolumnPartitionValue
- Specific column partition to include- Returns:
- A new source table map
-