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
Original file line number Diff line number Diff line change
Expand Up @@ -740,10 +740,18 @@ message Elements {
bool is_last = 4;
}

message DrainMode {
enum Enum {
UNSPECIFIED = 0;
NOT_DRAINING = 1;
DRAINING = 2;
}
}

// Element metadata passed as part of WindowedValue to make WindowedValue
// extensible and backward compatible
message ElementMetadata {
// empty message - add drain, kind, tracing metadata in the future
optional DrainMode.Enum drain = 1;
}

// Represent the encoded user timer for a given instruction, transform and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,11 @@ public T getValue() {
return value;
}

@Override
public boolean causedByDrain() {
return false;
}

@Override
public Instant getTimestamp() {
return BoundedWindow.TIMESTAMP_MIN_VALUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public PaneInfo getPaneInfo() {
return null;
}

@Override
public boolean causedByDrain() {
return false;
}

@Override
public Iterable<WindowedValue<T>> explodeWindows() {
return Collections.emptyList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ public PaneInfo getPaneInfo() {
return null;
}

@Override
public boolean causedByDrain() {
return false;
}

@Override
public @Nullable Long getRecordOffset() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@ public interface OutputBuilder<T> extends WindowedValue<T> {

OutputBuilder<T> setRecordOffset(@Nullable Long recordOffset);

OutputBuilder<T> setCausedByDrain(boolean causedByDrain);

void output();
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public interface WindowedValue<T> {
@Nullable
Long getRecordOffset();

boolean causedByDrain();

/**
* A representation of each of the actual values represented by this compressed {@link
* WindowedValue}, one per window.
Expand Down
Loading
Loading