-
Notifications
You must be signed in to change notification settings - Fork 33
Kafka Messages
Bill Katz edited this page Nov 10, 2019
·
7 revisions
If kafka logging is configured (see config-full.toml example in /scripts/distro-files), a number of JSON messages are produced to kafka when mutations are made to a subset of datatypes. This page documents the JSON messages using the Go types they represent. Many mutations generate two messages (not counting any changes in synced data instances): the main mutation event and a final "complete" message that is produced when the mutation finishes without error.
{
"Action": "merge",
"Target": uint64,
"Labels": []uint64,
"UUID": string(versionuuid),
"MutationID": uint64,
"Timestamp": time.Now().String()
}
{
"Action": "merge-complete",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String()
}
{
"Action": "cleave",
"OrigLabel": uint64,
"CleavedLabel": uint64,
"CleavedSupervoxels": []uint64,
"MutationID": uint64,,
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
}
{
"Action": "cleave-complete",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
}
{
"Action": "split-supervoxel",
"Supervoxel": uint64,
"SplitSupervoxel": uint64,
"RemainSupervoxel": uint64,
"Split": string, // reference to data in blob store
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String()
}
{
"Action": "split-supervoxel-complete",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String()
}
{
"Action": "split",
"Target": uint64,
"NewLabel": uint64,
"Split": string,
"MutationID": uint64,
"UUID": string(versionuuid),
"SVSplits": map[uint64]SVSplit,
"Timestamp": time.Now().String()
}
SVSplit above is the following:
{
"Split": uint64,
"Remain": uint64
}
{
"Action": "split-complete",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
}
{
"Action": "post-maxlabel",
"MaxLabel": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String()
}
{
"Action": "post-nextlabel",
"Start Label": uint64,
"End Label": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
}
{
"Action": "merge",
"Target": uint64,
"Labels": []uint64,
"UUID": string(versionuuid),
"MutationID": uint64,
"Timestamp": time.Now().String()
}
{
"Action": "merge-complete",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String()
}
{
"Action": "split",
"Target": uint64,
"NewLabel": uint64,
"Split": string,
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String()
}
{
"Action": "split-complete",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
}
{
"Action": "splitcoarse",
"Target": uint64,
"NewLabel": uint64,
"Split": string,
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String()
}
{
"Action": "splitcoarse-complete",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
}
{
"Action": "postkv",
"Key": string,
"Bytes": len(data),
"UUID": string(uuid),
"Timestamp": time.Now().String()
}
Delta JSON structures correspond to the DeltaModifyElements type in Go:
// DeltaModifyElements is a change in the elements assigned to a label.
// Need positions of elements because subscribers may have ROI filtering.
type DeltaModifyElements struct {
Add []ElementPos
Del []ElementPos
}
// ElementPos describes the label and kind of an annotation, useful for synchronizing
// changes in data to other data types like labelsz.
type ElementPos struct {
Label uint64
Kind uint8
Pos [3]uint32
}
If the "Delta" field is too large for a Kafka message, a "DataRef" with string value is written. The DataRef is the key for the full data in the DVID blobstore API.
{
"Action": "merge",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
"Delta": DeltaModifyElements,
}
{
"Action": "cleave",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
"Delta": DeltaModifyElements,
}
{
"Action": "split-coarse",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
"Delta": DeltaModifyElements,
}
{
"Action": "split",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
"Delta": DeltaModifyElements,
}
{
"Action": "ingest-block",
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
"Delta": DeltaModifyElements,
}
{
"Action": "mutate-block",
"MutationID": uint64,
"UUID": string(versionuuid),
"Timestamp": time.Now().String(),
"Delta": DeltaModifyElements,
}
Table of Contents
- DVID Overview
- Features
- Philosophy
- DVID Flexibility and Comparisons
- External Use of DVID
- Installation
- User's Guide
- Developer's Guide