MoonBit-native MCAP message-log codec, indexed queries and file transformations
git clone https://github.com/LilaLola67/moonmcap.git
cd moonmcap
moon update
moon check
moon build
moon test
moon run cmd/mainmoon add LilaLola67/moonmcap@0.15.32let recorder = @mcap.new_builder()
let channel = recorder.register_channel("/events", "json")
recorder.append(channel, 100UL, b"{\"value\":1}")
let bytes = recorder.finish(compression=@mcap.Zstd, messages_per_chunk=256)
let log = @mcap.read_log(bytes)
let query = { ..@mcap.all_query(), topics: ["/events"], start_time: 100UL, end_time: 200UL }
let messages = @mcap.query_file(bytes, query).messages
let sliced = @mcap.slice_log(log, query)
let output = @mcap.write_indexed(sliced, compression=@mcap.Lz4)let cursor = @mcap.build_query_index(log).cursor(query)
let first_page = cursor.next_page(32)
let second_page = cursor.next_page(32)
cursor.seek(150UL) // 包含时间边界;不重新应用 offset
let progress = cursor.progress()
cursor.cancel()| 功能 | 行为与边界 |
|---|---|
| 磁盘游标 | 逐页按需加载、处理时间重叠块、seek/取消;候选负载超预算显式失败 |
| 流式变换 | 临时文件支持大文件排序、采样、分页及对齐;NDJSON 逐条导出 |
| 跨文件数据集 | 冲突 ID 重映射、全局分页与跳转、来源编号;不生成合并文件 |
| 侧车索引 | 为无索引文件建立持久定位表,SHA-256 过期检查、显式快速身份模式、跨文件接入 |
| 异步读写与轮转 | 实际异步宿主 I/O、等待输出接纳、任务取消;每个完成段独立可读 |
| HTTP 查询 | Range + 强 ETag + If-Match,超时、有限重试、活动请求中止;拒绝整文件回退 |
| 外部排序合并 | 乱序输入写临时排序段,多轮归并、稳定重复次序、声明重映射、临时空间预算及清理 |
| 独立块恢复 | 显式跳过坏块、校验后续索引块并输出范围清单;始终标为部分提取 |
moon run cmd/interop --target js -- input.mcap output.mcap zstd rewritepython -m pip install mcap==1.3.0 lz4==4.4.5 zstandard==0.25.0
python tools/interop.py
python tools/conformance.py
python tools/count_source.pypython tools/range_benchmark.py
python tools/stream_workflows.py
python tools/cli_workflows.py
python tools/batch_workflows.py
python tools/repair_workflows.py
python tools/async_workflows.py
python tools/http_workflows.py
python tools/external_workflows.py
python tools/block_workflows.py
python tools/transform_stream_workflows.py
python tools/dataset_workflows.py
python tools/sidecar_workflows.py
python tools/json_workflows.py
python tools/checkpoint_workflows.py
python tools/input_checkpoint_workflows.py
python tools/io_workflows.py
python tools/aggregate_workflows.py
python tools/diff_workflows.py
python tools/replay_workflows.py
python tools/async_dataset_workflows.py
python tools/source_diagnostic_workflows.py
python tools/large_source_workflows.py
python tools/fuzz_workflows.py
python tools/memory_benchmark.py
python tools/corpus_workflows.py
python tools/disk_index_workflows.py
python tools/disk_index_scale.py
python tools/aggregate_external_workflows.py
python tools/chunk_checkpoint_workflows.py
python tools/protobuf_workflows.py
python tools/cached_http_workflows.py
python tools/protojson_workflows.py
python tools/cdr_workflows.py
python tools/async_paged_workflows.py
python tools/field_index_workflows.py
python tools/chunk_pipeline_workflows.py
python tools/worker_workflows.py
python tools/worker_benchmark.py
python tools/package_audit.pymoon run cmd/mcap --target js -- query examples/files/zstd-summary.mcap --topic /imu --start 20000000000 --end 30000000000
moon run cmd/mcap --target js -- validate examples/files/zstd-summary.mcap
moon run cmd/mcap --target js -- reindex broken-summary.mcap --output rebuilt.mcap --compression zstdpub(all) struct AggregateOptions {
value_path : String
group_paths : Array[String]
by_topic : Bool
window : UInt64
origin : UInt64
max_groups : Int
group_bytes : Int
invalid : JsonInvalidPolicy
}pub(all) struct AttachmentIndex {
offset : UInt64
length : UInt64
log_time : UInt64
create_time : UInt64
data_size : UInt64
name : String
media_type : String
}pub(all) struct BlockRecoveryEvidence {
start : UInt64
end : UInt64
recovered : Bool
messages : Int
actual_start : UInt64?
actual_end : UInt64?
advertised_start : UInt64
advertised_end : UInt64
reason : String?
}pub(all) struct BlockRecoveryReport {
recovered : Array[RecoveredBlock]
skipped : Array[SkippedBlock]
messages : Int
output_bytes : UInt64
source_complete : Bool
}pub struct CdrDecoder {
name : String
definitions : Map[String, Array[CdrField]]
options : CdrOptions
field_count : Int
ros1 : Bool
}fn CdrDecoder::view(self : CdrDecoder, bytes : Bytes, selection? : DecodeSelection) -> PayloadView raise McapErrorpub(all) struct CdrOptions {
schema_bytes : Int
message_bytes : Int
string_bytes : Int
items : Int
fields : Int
depth : Int
int64_as_string : Bool
}pub(all) struct ChunkIndex {
start_time : UInt64
end_time : UInt64
chunk_start : UInt64
chunk_length : UInt64
message_index_offsets : Array[(Int, UInt64)]
message_index_length : UInt64
compression : String
compressed_size : UInt64
uncompressed_size : UInt64
}pub(all) struct ChunkReadRequest {
span : ReadSpan
chunk_bytes : Int
expanded_bytes : Int
compression : String
}pub(all) struct CommandOptions {
command : String
inputs : Array[String]
output : String
query : Query
compression : Compression
format : String
max_file_bytes : Int
cache_bytes : Int
chunk_messages : Int
full : Bool
transform : TransformOptions
external : ExternalOptions
temp_dir : String
indexes : Array[String]
fast_index : Bool
index_bytes : Int
content : JsonFilter?
job_dir : String
resume_job : Bool
aggregate : AggregateOptions
diff : DiffOptions
}pub(all) struct ContextRule {
topic : String
depth : Int
max_age : UInt64
required : Bool
}fn Dataset::cursor(self : Dataset, query : Query, pending_bytes? : Int) -> DatasetCursor raise McapErrorpub struct DatasetCursor {
dataset : Dataset
original : Query
budget : Int
streams : Array[MessageStream]
heap : Array[DatasetMessage]
query : Query
state : FileCursorState
initialized : Bool
loaded : Int
advance : Int?
remaining : Int
offset_left : Int
emitted : Int
skipped : Int
peak : Int
}fn DatasetCursor::next_page(self : DatasetCursor, size : Int) -> Array[DatasetMessage] raise McapErrorpub(all) struct DatasetProgress {
state : FileCursorState
sources : Int
materialized_sources : Int
loaded_sources : Int
emitted_messages : Int
skipped_messages : Int
pending_bytes : Int
peak_pending_bytes : Int
} derive(Eq, Debug)pub(all) struct Diagnostic {
code : DiagnosticCode
offset : UInt64?
opcode : Byte?
message : String
expected : UInt64?
actual : UInt64?
} derive(Eq, Debug)pub(all) struct DiffOptions {
json_payloads : Bool
bucket_bytes : Int
auxiliary_bytes : Int
max_details : Int
detail_bytes : Int
fallback_bytes : Int
limits : Limits
}pub struct DiskSidecarAudit {
reader : DiskSidecarReader
page : Int
previous : DiskIndexEntry?
failed : Bool
}pub struct DiskSidecarCursor {
reader : DiskSidecarReader
original : Query
allowed : Map[Int, Bool]
query : Query
position : Int
offset : Int
remaining : Int
state : FileCursorState
}fn DiskSidecarCursor::next_page(self : DiskSidecarCursor, size : Int) -> Array[Message] raise McapErrorpub struct DiskSidecarPollCursor {
reader : DiskSidecarReader
original : Query
allowed : Map[Int, Bool]
query : Query
low : Int
high : Int
searching : Bool
position : Int
offset : Int
remaining : Int
state : FileCursorState
current : (Int, Array[DiskIndexEntry])?
waiting_page : Int?
waiting_entry : SidecarEntry?
ready : Message?
}fn DiskSidecarPollCursor::feed_index(self : DiskSidecarPollCursor, bytes : Bytes) -> Unit raise McapErrorfn DiskSidecarPollCursor::feed_source(self : DiskSidecarPollCursor, bytes : Bytes, expanded? : Bytes) -> Unit raise McapErrorpub struct DiskSidecarReader {
index : ReadSource
base : SidecarReader
count : Int
width : Int
start : UInt64
cache_limit : Int
pages : Array[(Int, Array[DiskIndexEntry])]
page_reads : Int
cache_hits : Int
peak_pages : Int
}fn DiskSidecarReader::cursor(self : DiskSidecarReader, query : Query) -> DiskSidecarCursor raise McapErrorfn DiskSidecarReader::poll_cursor(self : DiskSidecarReader, query : Query) -> DiskSidecarPollCursor raise McapErrorpub struct EventDetector {
rule : EventRule
enter : JsonFilter
leave : JsonFilter?
previous : UInt64?
candidate : UInt64?
confirmed : UInt64?
ended : UInt64?
finished : Bool
}fn EventDetector::feed(self : EventDetector, message : Message) -> Array[EventSignal] raise McapErrorpub(all) struct EventRule {
topic : String
enter : String
leave : String?
duration : UInt64
max_gap : UInt64
cooldown : UInt64
pre : UInt64
post : UInt64
}pub(all) struct ExternalOptions {
run_bytes : Int
merge_bytes : Int
fan_in : Int
spool_bytes : UInt64
run_limit : Int
declaration_bytes : Int
limits : Limits
output : StreamOptions
}pub(all) struct ExternalReport {
input_files : Int
messages : UInt64
runs_created : Int
merge_passes : Int
peak_run_bytes : Int
peak_merge_bytes : Int
peak_spool_bytes : UInt64
output_bytes : UInt64
}fn FieldIndex::location_filter(self : FieldIndex, filter : JsonFilter) -> ((UInt64, Int) -> Bool raise McapError) raise McapErrorpub struct FieldPage {
index : FieldIndex
blooms : Map[UInt64, Array[Bytes]]
first : UInt64
end : UInt64
}fn FieldPage::may_match(self : FieldPage, offset : UInt64, span : Int, filter : JsonFilter) -> Bool raise McapErrorpub struct FieldQueryPlan {
reader : RangeReader
filter : JsonFilter
decoder : PayloadDecoder
all_skipped : Bool
total : Int
skipped : Int
start_bytes : UInt64
}pub struct FileCursor {
reader : RangeReader
original : Query
candidates : Array[ChunkIndex]
heap : Array[FileItem]
allowed : Map[Int, Bool]
pending_budget : Int
span_budget : Int
active : Query
fallback : QueryCursor?
state : FileCursorState
loaded : Int
visited : Int
emitted : Int
skipped : Int
offset_left : Int
remaining : Int
pending_bytes : Int
peak_pending : Int
}fn FileCursor::feed_expanded(self : FileCursor, original : Bytes, expanded : Bytes) -> Unit raise McapErrorfn FileCursor::upcoming_reads(self : FileCursor, maximum : Int) -> Array[ChunkReadRequest] raise McapErrorpub(all) struct FileDiagnosis {
valid : Bool
data_valid : Bool
data_crc_verified : Bool
messages : Int
chunks : Int
data_end : UInt64?
issues : Array[Diagnostic]
} derive(Eq, Debug)pub(all) struct FileProgress {
state : FileCursorState
candidate_chunks : Int
loaded_chunks : Int
emitted_messages : Int
skipped_messages : Int
pending_messages : Int
pending_bytes : Int
peak_pending_bytes : Int
used_fallback : Bool
} derive(Eq, Debug)pub(all) enum IndexVerification {
VerifyContent((ReadSource) -> String raise McapError)
TrustIdentity(String)
}pub(all) struct JoinOptions {
mode : JoinMode
tolerance : UInt64
missing : MissingMatch
buffer_bytes : Int
buffer_messages : Int
} derive(Eq, Debug)pub struct JsonFilter {
condition : JsonCondition
projections : Array[(String, Array[String])]
policy : JsonInvalidPolicy
maximum : Int
depth : Int
}fn LogBuilder::append(self : LogBuilder, channel_id : Int, log_time : UInt64, data : Bytes, publish_time? : UInt64) -> Unit raise McapErrorfn LogBuilder::finish(self : LogBuilder, indexed? : Bool, messages_per_chunk? : Int, compression? : Compression) -> Bytes raise McapErrorfn LogBuilder::register_channel(self : LogBuilder, topic : String, message_encoding : String, schema_id? : Int, metadata? : Array[(String, String)]) -> Int raise McapErrorfn LogBuilder::register_schema(self : LogBuilder, name : String, encoding : String, data : Bytes) -> Int raise McapErrorpub(all) struct LogStats {
schema_count : Int
channel_count : Int
message_count : Int
payload_bytes : UInt64
topics : Array[TopicStats]
}fn PagedFieldHeader::decode_page(self : PagedFieldHeader, bytes : Bytes) -> FieldPage raise McapErrorfn PayloadDecoder::decode_message(self : PayloadDecoder, message : Message, declarations : Log, max_bytes? : Int) -> Message raise McapErrorfn PayloadDecoder::require_filter_fields(self : PayloadDecoder, filter : JsonFilter) -> PayloadDecoder raise McapErrorpub struct PayloadView {
source : Bytes
value : Json
binary : Map[String, BinaryField]
visited : Int
}fn PayloadView::read_binary(self : PayloadView, path : String, offset : Int, length : Int, max_bytes? : Int) -> Bytes raise McapErrorfn PayloadView::read_elements(self : PayloadView, path : String, start : Int, count : Int, max_elements? : Int) -> Json raise McapErrorfn PayloadView::write_binary(self : PayloadView, path : String, sink : WriteSink, block_bytes? : Int, cancelled? : () -> Bool) -> UInt64 raise McapErrorpub struct ProtobufDecoder {
messages : Map[String, ProtoMessage]
enums : Map[String, ProtoEnum]
options : ProtobufOptions
field_count : Array[Int]
}fn ProtobufDecoder::decode(self : ProtobufDecoder, name : String, payload : Bytes) -> Json raise McapErrorfn ProtobufDecoder::decode_selected(self : ProtobufDecoder, name : String, payload : Bytes, selection : DecodeSelection) -> Json raise McapErrorpub(all) struct ProtobufOptions {
descriptor_bytes : Int
message_bytes : Int
depth : Int
items : Int
fields : Int
int64_as_string : Bool
protojson : Bool
emit_defaults : Bool
}pub(all) struct QualityRule {
topic : String
minimum_messages : Int
max_gap : UInt64?
check_sequence : Bool
condition : String?
warning : Bool
}pub(all) struct Query {
topics : Array[String]
start_time : UInt64
end_time : UInt64
descending : Bool
offset : Int
limit : Int
}pub struct QueryCursor {
index : QueryIndex
query : Query
heap : Array[CursorRun]
state : QueryCursorState
matching : Int
skipped : Int
emitted : Int
remaining : Int
}pub(all) struct QueryDiagnostics {
total_chunks : Int
candidate_chunks : Int
matching_messages : Int
used_file_indexes : Bool
}pub(all) struct QueryProgress {
state : QueryCursorState
matching_messages : Int
skipped_messages : Int
emitted_messages : Int
remaining_messages : Int
buffered_heads : Int
} derive(Eq, Debug)pub struct QuerySource {
declarations : Log
open : (Query, Int) -> MessageStream raise McapError
materialized : Bool
}fn QuerySource::calibrate_time(self : QuerySource, mapping : ClockMap, same_publish_clock? : Bool) -> QuerySource raise McapErrorfn QuerySource::decode_payload(self : QuerySource, decoder : PayloadDecoder, max_bytes? : Int) -> QuerySource raise McapErrorfn QuerySource::stream(self : QuerySource, query? : Query, pending_bytes? : Int) -> MessageStream raise McapErrorpub struct RangeReader {
source : ReadSource
limits : Limits
declarations : Log
indexes : Array[ChunkIndex]
cache : Array[CachedChunk]
cache_budget : Int
fallback_budget : Int
data_end : UInt64
cache_bytes : Int
peak_cache_bytes : Int
decoded_chunks : Int
cache_hits : Int
full_validation : Bool
}fn RangeReader::cursor(self : RangeReader, query : Query, pending_bytes? : Int, span_bytes? : Int) -> FileCursor raise McapErrorfn RangeReader::plan_field_query(self : RangeReader, index : FieldIndex, filter : JsonFilter, fingerprint : (ReadSource) -> String raise McapError, decoder_identity : String, decoder? : PayloadDecoder) -> FieldQueryPlan raise McapErrorpub struct ReadSource {
size : UInt64
read_at : (UInt64, Int) -> Bytes raise McapError
calls : Int
bytes_read : UInt64
}fn ReadSource::read_exact(self : ReadSource, offset : UInt64, length : Int) -> Bytes raise McapErrorpub(all) struct RecordingOptions {
stream : StreamOptions
segment_messages : Int
segment_bytes_target : UInt64
segment_span : UInt64
segment_limit : Int
sequences : SequencePolicy
source_identity : String
} derive(Eq, Debug)pub struct RecordingSession {
template : Log
config : Json
options : RecordingOptions
storage : RecordingStorage
completed : Array[Json]
next_ordinal : Int
active : Int?
writer : StreamWriter?
next_sequence : Map[Int, UInt64]
committed_next : Map[Int, UInt64]
total : UInt64
start_time : UInt64
end_time : UInt64
state : WriterState
adopted : Int
quarantined : Int
}pub struct RecordingStorage {
create : (Int) -> WriteSink raise McapError
open : (Int) -> ReadSource raise McapError
exists : (Int) -> Bool raise McapError
seal : (Int) -> Unit raise McapError
save : (Bytes) -> Unit raise McapError
quarantine : (Int) -> Unit raise McapError
list : () -> Array[Int] raise McapError
fingerprint : (ReadSource) -> String raise McapError
}pub(all) struct RecoveryReport {
log : Log
recovered_records : Int
stop_offset : Int
complete : Bool
reason : String
}pub struct Replay {
source : QuerySource
query : Query
budget : Int
stream : MessageStream
pending : Message?
state : ReplayState
position : UInt64
wall : UInt64
last_clock : UInt64?
numerator : Int
denominator : Int
emitted : Int
generation : Int
previous : UInt64?
}pub(all) struct ReplayProgress {
state : ReplayState
position : UInt64
emitted : Int
rate_numerator : Int
rate_denominator : Int
generation : Int
}fn Ros1Decoder::view(self : Ros1Decoder, bytes : Bytes, selection? : DecodeSelection) -> PayloadView raise McapErrorpub struct SidecarCursor {
reader : SidecarReader
original : Query
allowed : Map[Int, Bool]
query : Query
state : FileCursorState
position : Int
remaining : Int
offset_left : Int
emitted : Int
skipped : Int
waiting : ReadSpan?
ready : Message?
}pub struct SidecarReader {
source : ReadSource
declarations : Log
entries : Array[SidecarEntry]
positions : Array[Int]
limits : Limits
digest : String
content_verified : Bool
index_bytes : Int
cache_budget : Int
cached_offset : UInt64?
cached_span : Int
cached : Chunk?
cached_bytes : Int
}pub(all) enum SourceScanEvent {
RecordStart(UInt64)
RecordRead(UInt64, Byte, Int)
RecordAccepted(UInt64, Byte, Int)
DataChecksum(UInt64, UInt, UInt)
DataValidated(UInt64, Bool)
SummaryStart(UInt64)
}pub(all) struct StreamOptions {
compression : Compression
chunk_bytes : Int
chunk_messages : Int
chunk_span : UInt64
summary_bytes : Int
} derive(Eq, Debug)pub struct StreamWriter {
sink : WriteSink
options : StreamOptions
limits : Limits
declarations : Log
pending : Array[Record]
summary : Array[(Byte, Bytes)]
counts : Map[Int, UInt64]
state : WriterState
crc : UInt
records : Int
buffered : Int
peak_buffered : Int
retained : Int
messages : UInt64
chunks : UInt
attachments : UInt
metadata : UInt
start_time : UInt64
end_time : UInt64
chunk_start : UInt64
chunk_end : UInt64
}pub struct TemporalJoinCursor {
options : JoinOptions
left : Message?
before : Message?
after : Message?
left_done : Bool
right_done : Bool
waiting : Int
last_left : UInt64?
last_right : UInt64?
state : FileCursorState
left_read : UInt64
right_read : UInt64
matched : UInt64
unmatched : UInt64
peak_bytes : Int
}fn TemporalJoinCursor::feed_left(self : TemporalJoinCursor, message : Message?) -> Unit raise McapErrorfn TemporalJoinCursor::feed_right(self : TemporalJoinCursor, message : Message?) -> Unit raise McapErrorpub struct TemporalJoinStream {
cursor : TemporalJoinCursor
left : MessageStream
right : MessageStream
closed : Bool
}pub(all) struct TopicStats {
channel_id : Int
topic : String
message_count : Int
payload_bytes : UInt64
first_time : UInt64?
last_time : UInt64?
maximum_gap : UInt64
median_gap : UInt64
p95_gap : UInt64
arrival_regressions : Int
sequence_discontinuities : Int
publish_after_log : Int
frequency_hz : Double
}pub(all) struct TransformOptions {
query : Query
topic_map : Array[(String, String)]
sample_period : UInt64
sample_origin : UInt64
align_start : UInt64?
attachment_names : Array[String]
attachment_media_types : Array[String]
attachment_start : UInt64
attachment_end : UInt64
metadata_names : Array[String]
metadata_entries : Array[(String, String)]
}pub(all) struct TransformReport {
input_messages : UInt64
sampled_messages : Int
output_messages : Int
output_bytes : UInt64
peak_temporary_bytes : UInt64
}pub(all) struct TriggerOptions {
pre : UInt64
post : UInt64
buffer_bytes : Int
buffer_messages : Int
clip_bytes : Int
clip_messages : Int
event_limit : Int
}pub struct TriggerRecorder {
template : Log
options : TriggerOptions
emit : (Log, Json) -> Unit raise McapError
ring : Array[Message?]
head : Int
buffered_bytes : Int
first : UInt64?
last : UInt64?
capacity_evicted_through : UInt64?
evicted : UInt64
active : Array[Message]?
active_bytes : Int
start : UInt64
deadline : UInt64
pre_complete : Bool
labels : Array[String]
completed : Int
state : WriterState
delivering : Bool
}pub(all) struct WriteProgress {
state : WriterState
bytes_written : UInt64
messages : UInt64
chunks : UInt
buffered_bytes : Int
peak_buffered_bytes : Int
retained_summary_bytes : Int
} derive(Eq, Debug)fn aggregate_external(cursor : DatasetCursor, channels : Array[Channel], storage : SortStorage, output : WriteSink, aggregate? : AggregateOptions, external? : ExternalOptions, cancelled? : () -> Bool) -> Json raise McapErrorfn aggregate_json(cursor : DatasetCursor, channels : Array[Channel], options? : AggregateOptions) -> Json raise McapErrorfn build_disk_sidecar(source : ReadSource, storage : SortStorage, output : WriteSink, fingerprint : (ReadSource) -> String raise McapError, identity? : String, page_entries? : Int, options? : ExternalOptions, cancelled? : () -> Bool) -> Json raise McapErrorfn build_field_index(source : ReadSource, paths : Array[String], fingerprint : (ReadSource) -> String raise McapError, decoder_identity : String, decoder? : PayloadDecoder, limits? : Limits, max_zones? : Int, state_bytes? : Int, cancelled? : () -> Bool) -> FieldIndex raise McapErrorfn build_paged_field_index(source : ReadSource, sink : WriteSink, paths : Array[String], fingerprint : (ReadSource) -> String raise McapError, decoder_identity : String, page_bytes? : Int, page_zones? : Int, bloom? : Bool, limits? : Limits, cancelled? : () -> Bool) -> Json raise McapErrorfn build_sidecar(source : ReadSource, fingerprint : (ReadSource) -> String raise McapError, identity? : String, limits? : Limits, index_bytes? : Int, declaration_bytes? : Int, cancelled? : () -> Bool) -> Bytes raise McapErrorfn cdr_decoder(name : String, definition : Bytes, options? : CdrOptions) -> CdrDecoder raise McapErrorfn check_match_quality(left : MessageStream, right : MessageStream, tolerance : UInt64, minimum_basis_points : Int) -> Json raise McapErrorfn check_quality(source : QuerySource, rules : Array[QualityRule], start : UInt64, end : UInt64, detail_limit? : Int, pending_bytes? : Int, cancelled? : () -> Bool) -> Json raise McapErrorfn codec_worker_handler(input_bytes? : Int, output_bytes? : Int, context_bytes? : Int) -> ((String) -> String) raise McapErrorfn crc32(bytes : Bytes) -> UIntfn crc32_extend(previous : UInt, bytes : Bytes) -> UIntfn detect_events(source : QuerySource, rule : EventRule, start? : UInt64, end? : UInt64, event_limit? : Int, pending_bytes? : Int, cancelled? : () -> Bool) -> Array[EventSpan] raise McapErrorfn diagnose_source(source : ReadSource, limits? : Limits, summary_bytes? : Int, read_bytes? : Int, cancelled? : () -> Bool) -> Json raise McapErrorfn diff_sources(left : ReadSource, right : ReadSource, options? : DiffOptions) -> Json raise McapErrorfn encode_chunk(records : Array[Record], start_time : UInt64, end_time : UInt64, checksums? : Bool, compression? : Compression) -> Bytes raise McapErrorfn encode_hex(bytes : Bytes) -> Stringfn event_windows(events : Array[EventSpan], pre : UInt64, post : UInt64, merge_gap? : UInt64) -> Array[EventWindow] raise McapErrorfn external_merge(sources : Array[ReadSource], storage : SortStorage, output : WriteSink, options? : ExternalOptions, cancelled? : () -> Bool, preserve_ids? : Bool) -> ExternalReport raise McapErrorfn extract_context_clip(source : QuerySource, start : UInt64, end : UInt64, topics? : Array[String], context? : Array[ContextRule], message_limit? : Int, byte_limit? : Int, pending_bytes? : Int, cancelled? : () -> Bool) -> ContextClip raise McapErrorfn json_filter(expression : String, select? : Array[String], invalid? : JsonInvalidPolicy, max_bytes? : Int, max_depth? : Int) -> JsonFilter raise McapErrorfn json_query_record(record : DatasetMessage, channels : Array[Channel], filter : JsonFilter) -> Json raise McapErrorfn message_stream(next : () -> Message? raise McapError, cancel : () -> Unit, pending_bytes? : () -> Int) -> MessageStreamfn new_stream_writer(sink : WriteSink, profile? : String, options? : StreamOptions, limits? : Limits) -> StreamWriter raise McapErrorfn open_dataset(sources : Array[QuerySource], limits? : Limits, declaration_bytes? : Int, max_sources? : Int) -> Dataset raise McapErrorfn open_disk_sidecar(source : ReadSource, index : ReadSource, verification : IndexVerification, limits? : Limits, declaration_bytes? : Int, cache_pages? : Int, chunk_cache_bytes? : Int, index_bytes? : UInt64) -> DiskSidecarReader raise McapErrorfn open_field_index(source : ReadSource, bytes : Bytes, fingerprint : (ReadSource) -> String raise McapError, decoder_identity : String, max_bytes? : Int, max_zones? : Int) -> FieldIndex raise McapErrorfn open_paged_field_header(source_size : UInt64, index_size : UInt64, bytes : Bytes, digest : String, decoder_identity : String) -> PagedFieldHeader raise McapErrorfn open_reader(source : ReadSource, limits? : Limits, cache_bytes? : Int, summary_bytes? : Int, fallback_bytes? : Int) -> RangeReader raise McapErrorfn open_recording_session(template : Log, storage : RecordingStorage, manifest? : Bytes, options? : RecordingOptions) -> RecordingSession raise McapErrorfn open_sidecar(source : ReadSource, bytes : Bytes, verification : IndexVerification, limits? : Limits, index_bytes? : Int, cache_bytes? : Int) -> SidecarReader raise McapErrorfn protobuf_decoder(descriptor_set : Bytes, options? : ProtobufOptions) -> ProtobufDecoder raise McapErrorfn query_source(declarations : Log, open : (Query, Int) -> MessageStream raise McapError, materialized? : Bool) -> QuerySource raise McapErrorfn rebuild_indexes(bytes : Bytes, compression? : Compression, messages_per_chunk? : Int, limits? : Limits) -> IndexRepair raise McapErrorfn recording_storage(create : (Int) -> WriteSink raise McapError, open : (Int) -> ReadSource raise McapError, exists : (Int) -> Bool raise McapError, seal : (Int) -> Unit raise McapError, save : (Bytes) -> Unit raise McapError, quarantine : (Int) -> Unit raise McapError, list : () -> Array[Int] raise McapError, fingerprint : (ReadSource) -> String raise McapError) -> RecordingStoragefn recover_blocks(source : ReadSource, sink : WriteSink, limits? : Limits, options? : StreamOptions, summary_bytes? : Int, on_block? : (BlockRecoveryEvidence) -> Unit raise McapError) -> BlockRecoveryReport raise McapErrorfn recover_blocks_detailed(source : ReadSource, sink : WriteSink, limits? : Limits, options? : StreamOptions, summary_bytes? : Int, max_ranges? : Int) -> Json raise McapErrorfn replay(source : QuerySource, query? : Query, rate_numerator? : Int, rate_denominator? : Int, pending_bytes? : Int) -> Replay raise McapErrorfn resumable_chunk_merge(sources : Array[ReadSource], parts_storage : SortStorage, merge_storage : SortStorage, output : WriteSink, fingerprint : (ReadSource) -> String raise McapError, save : (Bytes) -> Unit raise McapError, checkpoint? : Bytes, options? : ExternalOptions, max_parts? : Int, cancelled? : () -> Bool) -> Json raise McapErrorfn resumable_chunk_pipeline(sources : Array[ReadSource], storage : SortStorage, output : WriteSink, fingerprint : (ReadSource) -> String raise McapError, save : (Bytes) -> Unit raise McapError, checkpoint? : Bytes, options? : ExternalOptions, max_parts? : Int, cancelled? : () -> Bool) -> Json raise McapErrorfn resumable_merge(sources : Array[ReadSource], storage : SortStorage, output : WriteSink, fingerprint : (ReadSource) -> String raise McapError, save : (Bytes) -> Unit raise McapError, checkpoint? : Bytes, options? : ExternalOptions, cancelled? : () -> Bool) -> ExternalReport raise McapErrorfn ros1_decoder(name : String, definition : Bytes, options? : CdrOptions) -> Ros1Decoder raise McapErrorfn scan_source(source : ReadSource, visitor : SourceVisitor, limits? : Limits, declaration_bytes? : Int, cancelled? : () -> Bool, trace? : (SourceScanEvent) -> Unit) -> UInt64 raise McapErrorfn sort_storage(create : (Int) -> WriteSink raise McapError, open : (Int) -> ReadSource raise McapError, remove : (Int) -> Unit raise McapError, finish? : () -> Unit raise McapError) -> SortStoragefn source_visitor(schema? : (Schema) -> Unit raise McapError, channel? : (Channel) -> Unit raise McapError, message? : (Message, MessageLocation) -> Unit raise McapError, attachment? : (Attachment) -> Unit raise McapError, metadata? : (Metadata) -> Unit raise McapError) -> SourceVisitorfn standard_payload_decoder(options? : ProtobufOptions, cdr? : CdrOptions, cache_bytes? : Int, max_schemas? : Int, selection? : DecodeSelection) -> PayloadDecoder raise McapErrorfn start_disk_sidecar_audit(source : ReadSource, index : ReadSource, verification : IndexVerification, limits? : Limits, declaration_bytes? : Int, cache_pages? : Int, chunk_cache_bytes? : Int, index_bytes? : UInt64) -> DiskSidecarAudit raise McapErrorfn stream_transform(source : ReadSource, storage : SortStorage, output : WriteSink, options : TransformOptions, external? : ExternalOptions, content? : JsonFilter, cancelled? : () -> Bool) -> TransformReport raise McapErrorfn temporal_join(left : MessageStream, right : MessageStream, options? : JoinOptions) -> TemporalJoinStream raise McapErrorfn trigger_recorder(template : Log, emit : (Log, Json) -> Unit raise McapError, options? : TriggerOptions) -> TriggerRecorder raise McapErrorfn validate_file_statistics(log : Log, value : FileStatistics, chunk_count : UInt) -> Unit raise McapErrorfn write_chunked(log : Log, messages_per_chunk? : Int, checksums? : Bool, compression? : Compression, limits? : Limits) -> Bytes raise McapErrorfn write_indexed(log : Log, messages_per_chunk? : Int, compression? : Compression, limits? : Limits) -> Bytes raise McapErrorInstall
Download zipMoonBit-native MCAP message-log codec, indexed queries and file transformations