Skip to content

Commit

Permalink
Remove backup interval seconds from PITR command outputs (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshitha-yb authored Sep 3, 2024
1 parent 8c77449 commit 6b054c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
14 changes: 7 additions & 7 deletions cmd/pitr_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ var _ = Describe("PITR Configs Test", func() {
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
Expect(err).NotTo(HaveOccurred())
session.Wait(2)
Expect(session.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days Backup Interval in Seconds State Earliest Recovery Time in Millis Latest Recovery Time in Millis
test_ycql_db YCQL 6 86400 ACTIVE 123456 123456789
test_ysql_db YSQL 5 86400 QUEUED 654321 987654321`))
Expect(session.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days State Earliest Recovery Time in Millis Latest Recovery Time in Millis
test_ycql_db YCQL 6 ACTIVE 123456 123456789
test_ysql_db YSQL 5 QUEUED 654321 987654321`))
session.Kill()
})

Expand Down Expand Up @@ -209,8 +209,8 @@ test_ysql_db YSQL 5 86400
ysqlSession, ysqlErr := gexec.Start(ysqlCmd, GinkgoWriter, GinkgoWriter)
Expect(ysqlErr).NotTo(HaveOccurred())
ysqlSession.Wait(2)
Expect(ysqlSession.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days Backup Interval in Seconds State Earliest Recovery Time in Millis Latest Recovery Time in Millis
test_ysql_db YSQL 5 86400 QUEUED 654321 987654321`))
Expect(ysqlSession.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days State Earliest Recovery Time in Millis Latest Recovery Time in Millis
test_ysql_db YSQL 5 QUEUED 654321 987654321`))
ysqlSession.Kill()
})

Expand All @@ -236,8 +236,8 @@ test_ysql_db YSQL 5 86400
ycqlSession, ycqlErr := gexec.Start(ycqlCmd, GinkgoWriter, GinkgoWriter)
Expect(ycqlErr).NotTo(HaveOccurred())
ycqlSession.Wait(2)
Expect(ycqlSession.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days Backup Interval in Seconds State Earliest Recovery Time in Millis Latest Recovery Time in Millis
test_ycql_db YCQL 6 86400 ACTIVE 123456 123456789`))
Expect(ycqlSession.Out).Should(gbytes.Say(`Namespace Table Type Retention Period in Days State Earliest Recovery Time in Millis Latest Recovery Time in Millis
test_ycql_db YCQL 6 ACTIVE 123456 123456789`))
ycqlSession.Kill()
})

Expand Down
8 changes: 1 addition & 7 deletions internal/formatter/pitr_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ import (
)

const (
defaultPitrConfigListing = "table {{.Namespace}}\t{{.TableType}}\t{{.RetentionPeriodInDays}}\t{{.BackupIntervalInSeconds}}\t{{.State}}\t{{.EarliestRecoveryTimeMillis}}\t{{.LatestRecoveryTimeMillis}}"
defaultPitrConfigListing = "table {{.Namespace}}\t{{.TableType}}\t{{.RetentionPeriodInDays}}\t{{.State}}\t{{.EarliestRecoveryTimeMillis}}\t{{.LatestRecoveryTimeMillis}}"
retentionPeriodInDaysHeader = "Retention Period in Days"
backupIntervalInSecondsHeader = "Backup Interval in Seconds"
earliestRecoveryTimeMillisHeader = "Earliest Recovery Time in Millis"
latestRecoveryTimeMillisHeader = "Latest Recovery Time in Millis"
)
Expand Down Expand Up @@ -85,7 +84,6 @@ func NewPitrConfigContext() *PitrConfigContext {
"Namespace": namespaceHeader,
"TableType": tableTypeHeader,
"RetentionPeriodInDays": retentionPeriodInDaysHeader,
"BackupIntervalInSeconds": backupIntervalInSecondsHeader,
"State": stateHeader,
"EarliestRecoveryTimeMillis": earliestRecoveryTimeMillisHeader,
"LatestRecoveryTimeMillis": latestRecoveryTimeMillisHeader,
Expand All @@ -105,10 +103,6 @@ func (d *PitrConfigContext) RetentionPeriodInDays() int32 {
return d.d.Spec.RetentionPeriod
}

func (d *PitrConfigContext) BackupIntervalInSeconds() int32 {
return d.d.Info.GetBackupInterval()
}

func (d *PitrConfigContext) State() string {
return string(d.d.Info.GetState())
}
Expand Down

0 comments on commit 6b054c9

Please sign in to comment.