Skip to content

HBASE-30252 hbase snapshot info display inaccurate snapshot TTL information messages#8403

Open
guluo2016 wants to merge 1 commit into
apache:masterfrom
guluo2016:hbase_HBASE-30252
Open

HBASE-30252 hbase snapshot info display inaccurate snapshot TTL information messages#8403
guluo2016 wants to merge 1 commit into
apache:masterfrom
guluo2016:hbase_HBASE-30252

Conversation

@guluo2016

Copy link
Copy Markdown
Member

Details see: HBASE-30252

In addition, I also added information about whether the snapshot has expired in the display. like PR #5947

for (SnapshotDescription desc : getSnapshotList(conf)) {
System.out.printf("%-20s | %20s | %20s | %s%n", desc.getName(),
df.format(new Date(desc.getCreationTime())), desc.getTtl(), desc.getTableNameAsString());
List<SnapshotDescription> snapshotDescriptions = getSnapshotList(conf);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I update the code here, moved this code before System.out.printf(...);
The reason is that getSnapshotList(conf) would print logs, breaking the display continuity of the snapshot list.

String ttlInfo =
desc.getTtl() == DEFAULT_SNAPSHOT_TTL ? TTL_FOREVER : String.valueOf(desc.getTtl());
String expired = SnapshotDescriptionUtils.isExpiredSnapshot(desc.getTtl(),
desc.getCreationTime(), System.currentTimeMillis()) ? EXPIRED_LABEL : NOT_EXPIRED_LABEL;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: do we need to move System.currentTimeMillis() outside the loop?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants