Documentation ¶
Index ¶
- Constants
- type CSINodeRow
- type DataAccess
- func (d *DataAccess) Close() error
- func (d *DataAccess) CountNodeInfoWithHash(name, hash string) (int, error)
- func (d *DataAccess) CountPCInfoWithSpecHash(uid, hash string) (int, error)
- func (d *DataAccess) CountPodInfoWithSpecHash(uid, hash string) (int, error)
- func (d *DataAccess) GetCADeploymentWithHash(Hash string) (caDeployment *gsc.CASettingsInfo, err error)
- func (d *DataAccess) GetInitialRecorderStartTime() (startTime time.Time, err error)
- func (d *DataAccess) GetLatestNodesBeforeAndNotDeleted(timestamp time.Time) ([]gsc.NodeInfo, error)
- func (d *DataAccess) GetLatestPodInfosBeforeSnapshotTimestamp(timeStamp time.Time) (pods []gsc.PodInfo, err error)
- func (d *DataAccess) GetLatestScheduledPodsBeforeTimestamp(timestamp time.Time) (pods []gsc.PodInfo, err error)
- func (d *DataAccess) GetLatestUnscheduledPodsBeforeTimestamp(timeStamp time.Time) (podInfos []gsc.PodInfo, err error)
- func (d *DataAccess) GetMachineClassInfoHash(name string) (string, error)
- func (d *DataAccess) GetMachineDeploymentInfoHash(name string) (string, error)
- func (d *DataAccess) Init() error
- func (d *DataAccess) InsertRecorderStartTime(startTime time.Time) error
- func (d *DataAccess) LoadAllEvents() (events []gsc.EventInfo, err error)
- func (d *DataAccess) LoadAllWorkerPoolInfoHashes() (map[string]string, error)
- func (d *DataAccess) LoadCASettingsBefore(timestamp time.Time) (caSettings gsc.CASettingsInfo, err error)
- func (d *DataAccess) LoadCSINodeRowsBefore(snapshotTimestamp time.Time) ([]CSINodeRow, error)
- func (d *DataAccess) LoadEventInfoWithUID(eventUID string) (eventInfo gsc.EventInfo, err error)
- func (d *DataAccess) LoadLatestCASettingsInfo() (gsc.CASettingsInfo, error)
- func (d *DataAccess) LoadLatestMachineClassInfo(name string) (mccInfo gsh.MachineClassInfo, err error)
- func (d *DataAccess) LoadLatestMachineDeploymentInfo(name string) (mcdInfo gsc.MachineDeploymentInfo, err error)
- func (d *DataAccess) LoadLatestPodInfoWithName(podName string) (podInfo gsc.PodInfo, err error)
- func (d *DataAccess) LoadLatestPriorityClassInfoBeforeSnapshotTime(snapshotTime time.Time) (pcInfos []gsc.PriorityClassInfo, err error)
- func (d *DataAccess) LoadMachineClassInfosBefore(snapshotTimestamp time.Time) ([]gsh.MachineClassInfo, error)
- func (d *DataAccess) LoadMachineDeploymentInfosBefore(snapshotTimestamp time.Time) ([]gsc.MachineDeploymentInfo, error)
- func (d *DataAccess) LoadNodeInfosBefore(snapshotTimestamp time.Time) ([]gsc.NodeInfo, error)
- func (d *DataAccess) LoadTriggeredScaleUpEvents() (events []gsc.EventInfo, err error)
- func (d *DataAccess) LoadWorkerPoolInfosBefore(snapshotTimestamp time.Time) ([]gsc.WorkerPoolInfo, error)
- func (d *DataAccess) StoreCASettingsInfo(caSettings gsc.CASettingsInfo) (int64, error)
- func (d *DataAccess) StoreCSINodeRow(cn CSINodeRow) (rowID int64, err error)
- func (d *DataAccess) StoreEventInfo(event gsc.EventInfo) error
- func (d *DataAccess) StoreMachineClassInfo(m gsh.MachineClassInfo) (rowID int64, err error)
- func (d *DataAccess) StoreMachineDeploymentInfo(m gsc.MachineDeploymentInfo) (rowID int64, err error)
- func (d *DataAccess) StoreNodeInfo(n gsc.NodeInfo) (rowID int64, err error)
- func (d *DataAccess) StorePodInfo(podInfo gsc.PodInfo) (int64, error)
- func (d *DataAccess) StorePriorityClassInfo(pcInfo gsc.PriorityClassInfo) (int64, error)
- func (d *DataAccess) StoreWorkerPoolInfo(w gsc.WorkerPoolInfo) (rowID int64, err error)
- func (d *DataAccess) UpdateCSINodeRowDeletionTimestamp(name string, deletionTimestamp time.Time) (updated int64, err error)
- func (d *DataAccess) UpdateMCCInfoDeletionTimestamp(name string, deletionTimestamp time.Time) (updated int64, err error)
- func (d *DataAccess) UpdateMCDInfoDeletionTimestamp(name string, deletionTimestamp time.Time) (updated int64, err error)
- func (d *DataAccess) UpdateNodeInfoDeletionTimestamp(name string, deletionTimestamp time.Time) (updated int64, err error)
- func (d *DataAccess) UpdatePodDeletionTimestamp(podUID types.UID, deletionTimestamp time.Time) (updated int64, err error)
Constants ¶
View Source
const CreateCASettingsInfoTable = `` /* 458-byte string literal not displayed */
View Source
const CreateCSINodeTable = `` /* 231-byte string literal not displayed */
View Source
const CreateEventInfoTable = `` /* 311-byte string literal not displayed */
View Source
const CreateMCCInfoTable = `` /* 301-byte string literal not displayed */
View Source
const CreateMCDInfoTable = `` /* 347-byte string literal not displayed */
View Source
const CreateNodeInfoTable = `` /* 324-byte string literal not displayed */
View Source
const CreatePodInfoTable = `` /* 351-byte string literal not displayed */
View Source
const CreatePriorityClassInfoTable = `` /* 305-byte string literal not displayed */
View Source
const CreateRecorderStateInfo = `CREATE TABLE IF NOT EXISTS recorder_state_info(
BeginTimestamp INT NOT NULL )`
View Source
const CreateWorkerPoolInfo = `` /* 390-byte string literal not displayed */
View Source
const InsertCASettingsInfo = `` /* 360-byte string literal not displayed */
View Source
const InsertCSINodeInfo = `` /* 136-byte string literal not displayed */
View Source
const InsertEvent = `` /* 232-byte string literal not displayed */
View Source
const InsertMCCInfo = `` /* 190-byte string literal not displayed */
View Source
const InsertMCDInfo = `` /* 228-byte string literal not displayed */
View Source
const InsertNodeInfo = `` /* 213-byte string literal not displayed */
View Source
const InsertPodInfo = `` /* 239-byte string literal not displayed */
View Source
const InsertPriorityClassInfo = `` /* 194-byte string literal not displayed */
View Source
const InsertRecorderStateInfo = `INSERT INTO recorder_state_info(
BeginTimestamp
) VALUES (?)`
View Source
const InsertWorkerPoolInfo = `` /* 249-byte string literal not displayed */
View Source
const SelectAllWorkerPoolInfoHashes = "SELECT RowID, Name, SnapshotTimestamp, Hash FROM worker_pool_info ORDER BY RowID desc"
View Source
const SelectCADeploymentByHash = `SELECT * FROM ca_settings_info WHERE Hash=?`
View Source
const SelectCSINodeInfoBefore = `` /* 197-byte string literal not displayed */
View Source
const SelectInitialRecorderStateInfo = `SELECT * FROM recorder_state_info ORDER BY BeginTimestamp LIMIT 1`
View Source
const SelectLatestCASettingsBefore = `SELECT * from ca_settings_info WHERE SnapshotTimestamp <= ? ORDER BY RowID DESC LIMIT 1`
View Source
const SelectLatestCASettingsInfo = `SELECT * FROM ca_settings_info ORDER BY RowID DESC LIMIT 1`
View Source
const SelectLatestMCCInfo = "SELECT * FROM mcc_info WHERE name=? ORDER BY RowID DESC LIMIT 1"
View Source
const SelectLatestMCCInfoBefore = `SELECT * FROM mcc_info where SnapshotTimestamp <= ? GROUP BY Name HAVING max(RowID) ORDER BY RowID ASC`
View Source
const SelectLatestMCDInfo = "SELECT * FROM mcd_info WHERE name=? ORDER BY RowID DESC LIMIT 1"
View Source
const SelectLatestMCDInfoBefore = `SELECT * FROM mcd_info where SnapshotTimestamp <= ? GROUP BY Name HAVING max(RowID) ORDER BY RowID ASC`
View Source
const SelectLatestNodesBeforeAndNotDeleted = `` /* 148-byte string literal not displayed */
View Source
const SelectLatestPodsBeforeSnapshotTimestamp = `` /* 177-byte string literal not displayed */
View Source
const SelectLatestPriorityClassInfoBeforeSnapshotTimestamp = `` /* 168-byte string literal not displayed */
View Source
const SelectLatestScheduledPodsBeforeSnapshotTimestamp = `` /* 234-byte string literal not displayed */
View Source
const SelectMCCInfoHash = "SELECT Hash FROM mcc_info WHERE name=? ORDER BY RowID desc LIMIT 1"
View Source
const SelectMCDInfoHash = "SELECT Hash FROM mcd_info WHERE name=? ORDER BY RowID desc LIMIT 1"
View Source
const SelectNodeCountWithNameAndHash = "SELECT COUNT(*) from node_info where Name=? and Hash=?"
View Source
const SelectNodeInfoBefore = `` /* 186-byte string literal not displayed */
View Source
const SelectPodCountWithUIDAndHash = "SELECT COUNT(*) from pod_info where UID=? and Hash=?"
View Source
const SelectPriorityClassInfoCountWithUIDAndHash = "SELECT COUNT(*) from pc_info where UID=? and Hash=?"
View Source
const SelectTriggerScaleUpEvents = `SELECT * FROM event_info where Reason = 'TriggeredScaleUp' order by EventTime asc`
View Source
const SelectUnscheduledPodsBeforeSnapshotTimestamp = `` /* 225-byte string literal not displayed */
View Source
const SelectWorkerPoolInfoBefore = `SELECT * FROM worker_pool_info where SnapshotTimestamp <= ? GROUP BY Name HAVING max(RowID)`
View Source
const UpdateCSINodeInfoDeletionTimestamp = `UPDATE csi_node_info SET DeletionTimestamp = ? where Name = ?`
View Source
const UpdateMCCInfoDeletionTimestamp = `UPDATE mcc_info SET DeletionTimestamp = ? where Name = ?`
View Source
const UpdateMCDInfoDeletionTimestamp = `UPDATE mcd_info SET DeletionTimestamp = ? where Name = ?`
View Source
const UpdateNodeInfoDeletionTimestamp = `UPDATE node_info SET DeletionTimestamp = ? where Name = ?`
View Source
const UpdatePodDeletionTimestamp = "UPDATE pod_info SET DeletionTimestamp=? WHERE UID=?"
View Source
const UpdatePriorityClassInfoDeletionTimestamp = "UPDATE pc_info SET DeletionTimestamp=? WHERE UID=?"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSINodeRow ¶
type CSINodeRow struct { RowID int64 `db:"RowID"` Name string Namespace string CreationTimestamp int64 `db:"CreationTimestamp"` SnapshotTimestamp int64 `db:"SnapshotTimestamp"` AllocatableVolumes int `db:"AllocatableVolumes"` DeletionTimeStamp sql.NullInt64 }
CSINodeRow represents the row information for a CSI Node Obj. TODO: should have made this a gsc.CSINodeInfo a bit dirty now.
type DataAccess ¶
func NewDataAccess ¶
func NewDataAccess(dataDBPath string) *DataAccess
func (*DataAccess) Close ¶
func (d *DataAccess) Close() error
func (*DataAccess) CountNodeInfoWithHash ¶
func (d *DataAccess) CountNodeInfoWithHash(name, hash string) (int, error)
func (*DataAccess) CountPCInfoWithSpecHash ¶
func (d *DataAccess) CountPCInfoWithSpecHash(uid, hash string) (int, error)
func (*DataAccess) CountPodInfoWithSpecHash ¶
func (d *DataAccess) CountPodInfoWithSpecHash(uid, hash string) (int, error)
func (*DataAccess) GetCADeploymentWithHash ¶
func (d *DataAccess) GetCADeploymentWithHash(Hash string) (caDeployment *gsc.CASettingsInfo, err error)
GetCADeploymentWithHash has a TODO: move me to generics
func (*DataAccess) GetInitialRecorderStartTime ¶
func (d *DataAccess) GetInitialRecorderStartTime() (startTime time.Time, err error)
func (*DataAccess) GetLatestNodesBeforeAndNotDeleted ¶
func (d *DataAccess) GetLatestNodesBeforeAndNotDeleted(timestamp time.Time) ([]gsc.NodeInfo, error)
func (*DataAccess) GetLatestPodInfosBeforeSnapshotTimestamp ¶
func (d *DataAccess) GetLatestPodInfosBeforeSnapshotTimestamp(timeStamp time.Time) (pods []gsc.PodInfo, err error)
func (*DataAccess) GetLatestScheduledPodsBeforeTimestamp ¶
func (d *DataAccess) GetLatestScheduledPodsBeforeTimestamp(timestamp time.Time) (pods []gsc.PodInfo, err error)
func (*DataAccess) GetLatestUnscheduledPodsBeforeTimestamp ¶
func (d *DataAccess) GetLatestUnscheduledPodsBeforeTimestamp(timeStamp time.Time) (podInfos []gsc.PodInfo, err error)
func (*DataAccess) GetMachineClassInfoHash ¶
func (d *DataAccess) GetMachineClassInfoHash(name string) (string, error)
func (*DataAccess) GetMachineDeploymentInfoHash ¶
func (d *DataAccess) GetMachineDeploymentInfoHash(name string) (string, error)
func (*DataAccess) Init ¶
func (d *DataAccess) Init() error
func (*DataAccess) InsertRecorderStartTime ¶
func (d *DataAccess) InsertRecorderStartTime(startTime time.Time) error
func (*DataAccess) LoadAllEvents ¶
func (d *DataAccess) LoadAllEvents() (events []gsc.EventInfo, err error)
LoadAllEvents TODO: move me to generics
func (*DataAccess) LoadAllWorkerPoolInfoHashes ¶
func (d *DataAccess) LoadAllWorkerPoolInfoHashes() (map[string]string, error)
func (*DataAccess) LoadCASettingsBefore ¶
func (d *DataAccess) LoadCASettingsBefore(timestamp time.Time) (caSettings gsc.CASettingsInfo, err error)
func (*DataAccess) LoadCSINodeRowsBefore ¶
func (d *DataAccess) LoadCSINodeRowsBefore(snapshotTimestamp time.Time) ([]CSINodeRow, error)
func (*DataAccess) LoadEventInfoWithUID ¶
func (d *DataAccess) LoadEventInfoWithUID(eventUID string) (eventInfo gsc.EventInfo, err error)
func (*DataAccess) LoadLatestCASettingsInfo ¶
func (d *DataAccess) LoadLatestCASettingsInfo() (gsc.CASettingsInfo, error)
func (*DataAccess) LoadLatestMachineClassInfo ¶
func (d *DataAccess) LoadLatestMachineClassInfo(name string) (mccInfo gsh.MachineClassInfo, err error)
func (*DataAccess) LoadLatestMachineDeploymentInfo ¶
func (d *DataAccess) LoadLatestMachineDeploymentInfo(name string) (mcdInfo gsc.MachineDeploymentInfo, err error)
func (*DataAccess) LoadLatestPodInfoWithName ¶
func (d *DataAccess) LoadLatestPodInfoWithName(podName string) (podInfo gsc.PodInfo, err error)
func (*DataAccess) LoadLatestPriorityClassInfoBeforeSnapshotTime ¶
func (d *DataAccess) LoadLatestPriorityClassInfoBeforeSnapshotTime(snapshotTime time.Time) (pcInfos []gsc.PriorityClassInfo, err error)
func (*DataAccess) LoadMachineClassInfosBefore ¶
func (d *DataAccess) LoadMachineClassInfosBefore(snapshotTimestamp time.Time) ([]gsh.MachineClassInfo, error)
func (*DataAccess) LoadMachineDeploymentInfosBefore ¶
func (d *DataAccess) LoadMachineDeploymentInfosBefore(snapshotTimestamp time.Time) ([]gsc.MachineDeploymentInfo, error)
func (*DataAccess) LoadNodeInfosBefore ¶
func (d *DataAccess) LoadNodeInfosBefore(snapshotTimestamp time.Time) ([]gsc.NodeInfo, error)
func (*DataAccess) LoadTriggeredScaleUpEvents ¶
func (d *DataAccess) LoadTriggeredScaleUpEvents() (events []gsc.EventInfo, err error)
func (*DataAccess) LoadWorkerPoolInfosBefore ¶
func (d *DataAccess) LoadWorkerPoolInfosBefore(snapshotTimestamp time.Time) ([]gsc.WorkerPoolInfo, error)
func (*DataAccess) StoreCASettingsInfo ¶
func (d *DataAccess) StoreCASettingsInfo(caSettings gsc.CASettingsInfo) (int64, error)
func (*DataAccess) StoreCSINodeRow ¶
func (d *DataAccess) StoreCSINodeRow(cn CSINodeRow) (rowID int64, err error)
func (*DataAccess) StoreEventInfo ¶
func (d *DataAccess) StoreEventInfo(event gsc.EventInfo) error
func (*DataAccess) StoreMachineClassInfo ¶
func (d *DataAccess) StoreMachineClassInfo(m gsh.MachineClassInfo) (rowID int64, err error)
func (*DataAccess) StoreMachineDeploymentInfo ¶
func (d *DataAccess) StoreMachineDeploymentInfo(m gsc.MachineDeploymentInfo) (rowID int64, err error)
func (*DataAccess) StoreNodeInfo ¶
func (d *DataAccess) StoreNodeInfo(n gsc.NodeInfo) (rowID int64, err error)
func (*DataAccess) StorePodInfo ¶
func (d *DataAccess) StorePodInfo(podInfo gsc.PodInfo) (int64, error)
func (*DataAccess) StorePriorityClassInfo ¶
func (d *DataAccess) StorePriorityClassInfo(pcInfo gsc.PriorityClassInfo) (int64, error)
func (*DataAccess) StoreWorkerPoolInfo ¶
func (d *DataAccess) StoreWorkerPoolInfo(w gsc.WorkerPoolInfo) (rowID int64, err error)
func (*DataAccess) UpdateCSINodeRowDeletionTimestamp ¶
func (*DataAccess) UpdateMCCInfoDeletionTimestamp ¶
func (*DataAccess) UpdateMCDInfoDeletionTimestamp ¶
func (*DataAccess) UpdateNodeInfoDeletionTimestamp ¶
func (*DataAccess) UpdatePodDeletionTimestamp ¶
Click to show internal directories.
Click to hide internal directories.