Freeze SCUM log-source tailing run contract
This commit is contained in:
@@ -166,6 +166,44 @@ func DefaultSCUMGuardedMutationBounds() SCUMGuardedMutationBounds {
|
||||
return SCUMGuardedMutationBounds{MaxPayloadBytes: 4096, TimeoutMS: 5000, BusyTimeoutMS: 250, MaxReadbackBytes: 16 * 1024, MaxAffectedRows: 1}
|
||||
}
|
||||
|
||||
type SCUMParsedLogBatchBounds struct {
|
||||
MaxEvents int
|
||||
MaxPayloadBytes int
|
||||
MaxLineBytes int
|
||||
MaxResultBytes int
|
||||
}
|
||||
|
||||
func DefaultSCUMParsedLogBatchBounds() SCUMParsedLogBatchBounds {
|
||||
return SCUMParsedLogBatchBounds{MaxEvents: 256, MaxPayloadBytes: 16 * 1024, MaxLineBytes: 4096, MaxResultBytes: 256 * 1024}
|
||||
}
|
||||
|
||||
type SCUMLogTailState string
|
||||
|
||||
const (
|
||||
SCUMLogTailAdvanced SCUMLogTailState = "advanced"
|
||||
SCUMLogTailRotated SCUMLogTailState = "rotated"
|
||||
SCUMLogTailTruncated SCUMLogTailState = "truncated"
|
||||
SCUMLogTailRestarted SCUMLogTailState = "restarted"
|
||||
SCUMLogTailPartial SCUMLogTailState = "partial-buffered"
|
||||
SCUMLogTailReplayed SCUMLogTailState = "replayed"
|
||||
)
|
||||
|
||||
type SCUMParsedLogCursor struct {
|
||||
SourceIdentityDigest string
|
||||
StreamGeneration string
|
||||
Sequence uint64
|
||||
}
|
||||
|
||||
type SCUMParsedLogEvent struct {
|
||||
EventType string
|
||||
OccurredAt time.Time
|
||||
Cursor SCUMParsedLogCursor
|
||||
LogicalEventDigest string
|
||||
EventDigest string
|
||||
PayloadDigest string
|
||||
Payload map[string]any
|
||||
}
|
||||
|
||||
type SCUMSchemaProbeRequest struct {
|
||||
RequestID string
|
||||
JobID string
|
||||
@@ -384,6 +422,32 @@ type SCUMGuardedMutationResult struct {
|
||||
Limits SCUMGuardedMutationBounds
|
||||
}
|
||||
|
||||
type SCUMParsedLogBatchResult struct {
|
||||
RequestID string
|
||||
JobID string
|
||||
Binding SCUMBindingIdentity
|
||||
Status SCUMTerminalResultStatus
|
||||
SourceKey string
|
||||
StreamKey string
|
||||
ParserKey string
|
||||
ParserVersion string
|
||||
AdapterVersion string
|
||||
AssetDigest string
|
||||
ParserDigest string
|
||||
ObservedAt time.Time
|
||||
ResultDigest string
|
||||
FirstCursor SCUMParsedLogCursor
|
||||
LastCursor SCUMParsedLogCursor
|
||||
TailState SCUMLogTailState
|
||||
PartialLineBuffered bool
|
||||
Replay bool
|
||||
EventCount int
|
||||
Events []SCUMParsedLogEvent
|
||||
SafeSummary string
|
||||
SafeError SCUMSafeError
|
||||
Limits SCUMParsedLogBatchBounds
|
||||
}
|
||||
|
||||
type SCUMCapabilityRequirement struct {
|
||||
Capability SCUMDataCapability
|
||||
AdapterVersion string
|
||||
@@ -528,6 +592,27 @@ func CopySCUMGuardedMutationResultPtr(value *SCUMGuardedMutationResult) *SCUMGua
|
||||
return ©
|
||||
}
|
||||
|
||||
func CopySCUMParsedLogBatchResultPtr(value *SCUMParsedLogBatchResult) *SCUMParsedLogBatchResult {
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
copy := *value
|
||||
copy.Events = CopySCUMParsedLogEvents(value.Events)
|
||||
return ©
|
||||
}
|
||||
|
||||
func CopySCUMParsedLogEvents(events []SCUMParsedLogEvent) []SCUMParsedLogEvent {
|
||||
if events == nil {
|
||||
return nil
|
||||
}
|
||||
copy := make([]SCUMParsedLogEvent, len(events))
|
||||
for index, event := range events {
|
||||
copy[index] = event
|
||||
copy[index].Payload = CopySCUMValueMap(event.Payload)
|
||||
}
|
||||
return copy
|
||||
}
|
||||
|
||||
func CopySCUMValueMap(value map[string]any) map[string]any {
|
||||
if value == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user