-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add outputs and ID to log shippers
- Loading branch information
1 parent
e09e216
commit a994120
Showing
2 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
21 changes: 19 additions & 2 deletions
21
core/src/main/java/io/kestra/core/models/tasks/logs/LogShipper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
package io.kestra.core.models.tasks.logs; | ||
|
||
import io.kestra.core.models.annotations.Plugin; | ||
import io.kestra.core.models.tasks.Output; | ||
import io.kestra.core.models.tasks.runners.TaskRunnerDetailResult; | ||
import io.kestra.core.runners.RunContext; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Pattern; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
import reactor.core.publisher.Flux; | ||
|
||
@Plugin | ||
public abstract class LogShipper implements io.kestra.core.models.Plugin { | ||
@SuperBuilder(toBuilder = true) | ||
@Getter | ||
@NoArgsConstructor | ||
public abstract class LogShipper<T extends Output> implements io.kestra.core.models.Plugin { | ||
@NotNull | ||
@NotBlank | ||
@Pattern(regexp="^[a-zA-Z0-9][a-zA-Z0-9_-]*") | ||
protected String id; | ||
|
||
@NotBlank | ||
@Pattern(regexp="\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*(\\.\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*)*") | ||
protected String type; | ||
|
||
public abstract void sendLogs(RunContext runContext, Flux<LogRecord> logRecord); | ||
public abstract T sendLogs(RunContext runContext, Flux<LogRecord> logRecord) throws Exception; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters