Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions entity/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go_library(
name = "entity",
srcs = [
"batch.go",
"batch_dependent.go",
"change_provider.go",
"request.go",
],
Expand Down
20 changes: 20 additions & 0 deletions entity/batch_dependent.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package entity

// BatchDependent represents the downstream batches that depend on a given batch.
// The object is immutable after creation.
type BatchDependent struct {
// BatchID is the globally unique identifier representing a batch.
BatchID string
// Dependents is a list of batch IDs that are dependents for this
// batch.
//
// For e.g - Consider batches - queueA/batch/1, queueA/batch/2, queueA/batch/3
// such that - queueA/batch/2 and queueA/batch/3 depend on queueA/batch/1
//
// In this case, the Dependents field for -
// - queueA/batch/1 will be [queueA/batch/2, queueA/batch/3]
// - queueA/batch/2 will be empty
// - queueA/batch/3 will be empty
//
Dependents []string
}
5 changes: 5 additions & 0 deletions extension/storage/mysql/schema/batch_dependent.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE IF NOT EXISTS batch_dependent (
batch_id VARCHAR(255) NOT NULL,
dependents JSON NOT NULL,
PRIMARY KEY (batch_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;