MarshalLogRestoreTableIDsBlocklistFile generates an Blocklist file and marshals it. It returns its filename and the marshaled data.
(restoreCommitTs, restoreStartTs, rewriteTs uint64, tableIds, dbIds []int64)
| 129 | |
| 130 | // MarshalLogRestoreTableIDsBlocklistFile generates an Blocklist file and marshals it. It returns its filename and the marshaled data. |
| 131 | func MarshalLogRestoreTableIDsBlocklistFile(restoreCommitTs, restoreStartTs, rewriteTs uint64, tableIds, dbIds []int64) (string, []byte, error) { |
| 132 | blocklistFile := &LogRestoreTableIDsBlocklistFile{ |
| 133 | RestoreCommitTs: restoreCommitTs, |
| 134 | RestoreStartTs: restoreStartTs, |
| 135 | RewriteTs: rewriteTs, |
| 136 | TableIds: tableIds, |
| 137 | DbIds: dbIds, |
| 138 | } |
| 139 | blocklistFile.setChecksumLogRestoreTableIDsBlocklistFile() |
| 140 | filename := blocklistFile.filename() |
| 141 | data, err := proto.Marshal(blocklistFile) |
| 142 | if err != nil { |
| 143 | return "", nil, errors.Trace(err) |
| 144 | } |
| 145 | return filename, data, nil |
| 146 | } |
| 147 | |
| 148 | // unmarshalLogRestoreTableIDsBlocklistFile unmarshals the given blocklist file. |
| 149 | func unmarshalLogRestoreTableIDsBlocklistFile(data []byte) (*LogRestoreTableIDsBlocklistFile, error) { |