Package com.ibm.fhir.database.utils.db2
Class Db2PartitionControl
- java.lang.Object
-
- com.ibm.fhir.database.utils.db2.Db2PartitionControl
-
public class Db2PartitionControl extends java.lang.Object
Business logic to add new partitions to the given table
-
-
Constructor Summary
Constructors Constructor Description Db2PartitionControl(ICatalogAccess ica, java.util.Date today)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Date
getHighValueDate(PartitionInfo pi)
Get the highValue as a Date from the PartitionInfoprotected java.util.Date
getLowValueDate(PartitionInfo pi)
Get the lowValue as a Date from the PartitionInfovoid
pushAhead(java.lang.String schema, java.lang.String table, int future, PartitionUnit pu, int unitsToKeep, int partMaintBatchSize)
Make sure the named table has at least N future partitionsvoid
rollOff(java.lang.String schema, java.lang.String table, int unitsToKeep, PartitionUnit pu, int partMaintBatchSize)
Drop old partitions we no longer need.
-
-
-
Constructor Detail
-
Db2PartitionControl
public Db2PartitionControl(ICatalogAccess ica, java.util.Date today)
Public constructor- Parameters:
ica
-today
-
-
-
Method Detail
-
pushAhead
public void pushAhead(java.lang.String schema, java.lang.String table, int future, PartitionUnit pu, int unitsToKeep, int partMaintBatchSize)
Make sure the named table has at least N future partitions- Parameters:
schema
-table
-future
-pu
-unitsToKeep
-partMaintBatchSize
-
-
getHighValueDate
protected java.util.Date getHighValueDate(PartitionInfo pi)
Get the highValue as a Date from the PartitionInfo- Parameters:
pi
-- Returns:
-
getLowValueDate
protected java.util.Date getLowValueDate(PartitionInfo pi)
Get the lowValue as a Date from the PartitionInfo- Parameters:
pi
-- Returns:
-
rollOff
public void rollOff(java.lang.String schema, java.lang.String table, int unitsToKeep, PartitionUnit pu, int partMaintBatchSize)
Drop old partitions we no longer need. In DB2 this process is a little more work than it ought to be. You can't simply drop the partition; instead you have to detach it into a standalone table, and then an asynchronous process makes that standalone table available at some later point in time. So we can't drop the table right away, we have to wait for it to become available- Parameters:
schema
-table
-unitsToKeep
-pu
-partMaintBatchSize
-
-
-