Class AbstractDirectorPartitionManager
- java.lang.Object
-
- com.inductiveautomation.gateway.tags.history.partitions.BasicDatasourcePartitionManager
-
- com.inductiveautomation.gateway.tags.history.partitions.AbstractDirectorPartitionManager
-
- All Implemented Interfaces:
PartitionManager
- Direct Known Subclasses:
FixedSpanPartitionManager
,MonthlyParitionManager
public abstract class AbstractDirectorPartitionManager extends BasicDatasourcePartitionManager
A base for partition managers that "direct" partitions- that is, actually manage (create) them.TODO (1) Finish the idea of the "next" partition being created ahead of time asynchronously, so that we don't have to wait
-
-
Constructor Summary
Constructors Constructor Description AbstractDirectorPartitionManager(GatewayContext context, java.lang.String dsName, int driverId)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Partition
createNewPartition(long startTime, long windowSize)
Instantiate a new partition object.protected void
createPartitionTable(java.lang.String name, SRConnection conn, boolean includeVType)
protected Partition
getNextPartition(SRConnection conn, long time, long windowSize)
Partition
getPartition(long time, long windowSize)
Gets the name of the partition (and creates the partition, if necessary).protected abstract boolean
isValid(Partition parition)
Returns whether the given partition, which is the one loaded from the db, fits our expectations.protected Partition
queryOrCreatePartition(long time, long windowSize)
-
Methods inherited from class com.inductiveautomation.gateway.tags.history.partitions.BasicDatasourcePartitionManager
deleteOldPartitions, getDatasource, getDriverId, getLogger, getMostRecentPartitions, getOlderPartitions, getPartitions, getQueryCache, initialize, loadPartitionFromDS, loadPartitionsFromDS, partitionExists, runPartitionQuery, shutdown
-
-
-
-
Constructor Detail
-
AbstractDirectorPartitionManager
public AbstractDirectorPartitionManager(GatewayContext context, java.lang.String dsName, int driverId)
-
-
Method Detail
-
isValid
protected abstract boolean isValid(Partition parition)
Returns whether the given partition, which is the one loaded from the db, fits our expectations. If false, it was probably a partition created by a different type of partition manager.
-
createNewPartition
protected abstract Partition createNewPartition(long startTime, long windowSize)
Instantiate a new partition object. Doesn't do any actual work, just defines the partition (name, span, resolution).
-
getPartition
public Partition getPartition(long time, long windowSize) throws java.lang.Exception
Gets the name of the partition (and creates the partition, if necessary). Optimized for moving forward, but supports backfill data as well.- Specified by:
getPartition
in interfacePartitionManager
- Overrides:
getPartition
in classBasicDatasourcePartitionManager
- Throws:
java.lang.Exception
-
queryOrCreatePartition
protected Partition queryOrCreatePartition(long time, long windowSize) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getNextPartition
protected Partition getNextPartition(SRConnection conn, long time, long windowSize) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createPartitionTable
protected void createPartitionTable(java.lang.String name, SRConnection conn, boolean includeVType) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-