聊聊otter的NodeTask

编程

本文主要研究一下otter的NodeTask

NodeTask

otter/node/common/src/main/java/com/alibaba/otter/node/common/config/model/NodeTask.java

public class NodeTask implements Serializable {

private static final long serialVersionUID = 5442938515474956890L;

private Pipeline pipeline;

private List<StageType> stage = new ArrayList<StageType>(); // 任务类型

private List<TaskEvent> event = new ArrayList<TaskEvent>(); // 任务事件,新增/修改

private boolean shutdown = false;

public boolean isShutdown() {

return shutdown;

}

public void setShutdown(boolean shutdown) {

this.shutdown = shutdown;

}

/**

* 任务事件,新增/删除/修改

*/

public static enum TaskEvent {

CREATE, DELETE;

public boolean isCreate() {

return this.equals(TaskEvent.CREATE);

}

public boolean isDelete() {

return this.equals(TaskEvent.DELETE);

}

}

public Pipeline getPipeline() {

return pipeline;

}

public void setPipeline(Pipeline pipeline) {

this.pipeline = pipeline;

}

public List<StageType> getStage() {

return stage;

}

public void setStage(List<StageType> stage) {

this.stage = stage;

}

public List<TaskEvent> getEvent() {

return event;

}

public void setEvent(List<TaskEvent> event) {

this.event = event;

}

@Override

public String toString() {

return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);

}

}

  • NodeTask定义了pipeline、stage、event属性

Pipeline

otter/shared/common/src/main/java/com/alibaba/otter/shared/common/model/config/pipeline/Pipeline.java

public class Pipeline implements Serializable {

private static final long serialVersionUID = 5055655233043393285L;

private Long id;

private Long channelId; // 对应关联的channel唯一标示id

private String name;

private String description; // 描述信息

private List<Node> selectNodes;

private List<Node> extractNodes;

private List<Node> loadNodes;

private List<DataMediaPair> pairs;

private Date gmtCreate;

private Date gmtModified;

private PipelineParameter parameters = new PipelineParameter();

//......

}

  • Pipeline定义了id、channelId、name、description、selectNodes、extractNodes、loadNodes、pairs、parameters等属性

StageType

otter/shared/common/src/main/java/com/alibaba/otter/shared/common/model/config/enums/StageType.java

public enum StageType {

SELECT, EXTRACT, TRANSFORM, LOAD;

public boolean isSelect() {

return this.equals(StageType.SELECT);

}

public boolean isExtract() {

return this.equals(StageType.EXTRACT);

}

/**

* transform和load一定会同时出现

*/

public boolean isTransform() {

return this.equals(StageType.TRANSFORM);

}

/**

* transform和load一定会同时出现

*/

public boolean isLoad() {

return this.equals(StageType.LOAD);

}

}

  • StageType分SELECT, EXTRACT, TRANSFORM, LOAD这个类型

小结

NodeTask定义了pipeline、stage、event属性;Pipeline定义了id、channelId、name、description、selectNodes、extractNodes、loadNodes、pairs、parameters等属性;StageType分SELECT, EXTRACT, TRANSFORM, LOAD这个类型

doc

  • NodeTask

以上是 聊聊otter的NodeTask 的全部内容, 来源链接: utcz.com/z/517350.html

回到顶部