-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
typescript: add McapWriter.InitializeForAppending() (#1060)
### Public-Facing Changes - Added `InitializeForAppending()` to `McapWriter`. - `McapIndexedReader` now exposes `dataEndOffset` and `dataSectionCrc`. ### Description Append mode works by using `McapIndexedReader` to read the summary section, loading all indexes, channels, etc. from the footer into memory, then chopping off everything from DataEnd onwards and continuing to write from there. This does not work if the `DataEnd` record contains extra data or padding. This seems to be a fundamental flaw with the spec; a separate PR will be raised to change the spec to disallow this. See also: https://github.com/foxglove/mcap/blob/4d62967abe95e755b91f16cce390f6560d18e07e/go/cli/mcap/utils/mcap_amendment.go Supersedes / closes #1016 Resolves FG-5821 --------- Co-authored-by: Alex Ernst <alex.m.ernst14@gmail.com>
- Loading branch information
Showing
8 changed files
with
701 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { IWritable } from "./IWritable"; | ||
|
||
/** | ||
* ISeekableWriter describes a writer interface with seek abilities. | ||
*/ | ||
export interface ISeekableWriter extends IWritable { | ||
/** Move the cursor to the given position */ | ||
seek(position: bigint): Promise<void>; | ||
/** Remove data after the current write position */ | ||
truncate(): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.