(filename string)
| 84 | } |
| 85 | |
| 86 | func parseLogRestoreTableIDsBlocklistFileName(filename string) (restoreCommitTs, restoreStartTs uint64, parsed bool) { |
| 87 | filename = path.Base(filename) |
| 88 | if !strings.HasSuffix(filename, ".meta") { |
| 89 | return 0, 0, false |
| 90 | } |
| 91 | if filename[0] != 'R' { |
| 92 | return 0, 0, false |
| 93 | } |
| 94 | ts, err := strconv.ParseUint(filename[1:17], 16, 64) |
| 95 | if err != nil { |
| 96 | log.Warn("failed to parse log restore table IDs blocklist file name", zap.String("filename", filename), zap.Error(err)) |
| 97 | return 0, 0, false |
| 98 | } |
| 99 | restoreCommitTs = ts |
| 100 | if filename[17] != '_' || filename[18] != 'S' { |
| 101 | return 0, 0, false |
| 102 | } |
| 103 | ts, err = strconv.ParseUint(filename[19:35], 16, 64) |
| 104 | if err != nil { |
| 105 | log.Warn("failed to parse log restore table IDs blocklist file name", zap.String("filename", filename), zap.Error(err)) |
| 106 | return 0, 0, false |
| 107 | } |
| 108 | restoreStartTs = ts |
| 109 | return restoreCommitTs, restoreStartTs, true |
| 110 | } |
| 111 | |
| 112 | func (m *LogRestoreTableIDsBlocklistFile) checksumLogRestoreTableIDsBlocklistFile() []byte { |
| 113 | hasher := sha256.New() |
no test coverage detected