Skip to content

Commit

Permalink
[INLONG-11400][Manager] Support Airflow schedule engine
Browse files Browse the repository at this point in the history
  • Loading branch information
ZKpLo committed Nov 9, 2024
1 parent 99dec05 commit 331ceb5
Show file tree
Hide file tree
Showing 43 changed files with 3,023 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.inlong.manager.pojo.schedule.airflow;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* Full representation of the connection.
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "Full representation of the connection.")
public class Connection {

public static final String SERIALIZED_NAME_CONNECTION_ID = "connection_id";
@SerializedName(SERIALIZED_NAME_CONNECTION_ID)
private String connectionId;

public static final String SERIALIZED_NAME_CONN_TYPE = "conn_type";
@SerializedName(SERIALIZED_NAME_CONN_TYPE)
private String connType;

public static final String SERIALIZED_DESCRIPTION = "description";
@SerializedName(SERIALIZED_DESCRIPTION)
private String description;

public static final String SERIALIZED_NAME_HOST = "host";
@SerializedName(SERIALIZED_NAME_HOST)
private String host;

public static final String SERIALIZED_NAME_LOGIN = "login";
@SerializedName(SERIALIZED_NAME_LOGIN)
private String login;

public static final String SERIALIZED_NAME_SCHEMA = "schema";
@SerializedName(SERIALIZED_NAME_SCHEMA)
private String schema;

public static final String SERIALIZED_NAME_PORT = "port";
@SerializedName(SERIALIZED_NAME_PORT)
private Integer port;

public static final String SERIALIZED_NAME_PASSWORD = "password";
@SerializedName(SERIALIZED_NAME_PASSWORD)
private String password;

public static final String SERIALIZED_NAME_EXTRA = "extra";
@SerializedName(SERIALIZED_NAME_EXTRA)
private String extra;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.inlong.manager.pojo.schedule.airflow;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.util.List;

/**
* Collection of connections.
*/
@Data
@ApiModel(description = "Collection of connections.")
public class ConnectionCollection {

public static final String SERIALIZED_NAME_CONNECTIONS = "connections";
@SerializedName(SERIALIZED_NAME_CONNECTIONS)
private List<Connection> connections;

public static final String SERIALIZED_NAME_TOTAL_ENTRIES = "total_entries";
@SerializedName(SERIALIZED_NAME_TOTAL_ENTRIES)
private Integer totalEntries;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.inlong.manager.pojo.schedule.airflow;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.util.List;

// todo 删除
@Data
@ApiModel(description = "DAG")
public class DAG {

public static final String SERIALIZED_NAME_DAG_ID = "dag_id";
@SerializedName(SERIALIZED_NAME_DAG_ID)
private String dagId;

public static final String SERIALIZED_NAME_ROOT_DAG_ID = "root_dag_id";
@SerializedName(SERIALIZED_NAME_ROOT_DAG_ID)
private String rootDagId;

public static final String SERIALIZED_NAME_IS_PAUSED = "is_paused";
@SerializedName(SERIALIZED_NAME_IS_PAUSED)
private Boolean isPaused;

public static final String SERIALIZED_NAME_IS_ACTIVE = "is_active";
@SerializedName(SERIALIZED_NAME_IS_ACTIVE)
private Boolean isActive;

public static final String SERIALIZED_NAME_IS_SUBDAG = "is_subdag";
@SerializedName(SERIALIZED_NAME_IS_SUBDAG)
private Boolean isSubdag;

public static final String SERIALIZED_NAME_OWNERS = "owners";
@SerializedName(SERIALIZED_NAME_OWNERS)
private List<String> owners = null;

public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
private String description;

public static final String SERIALIZED_NAME_SCHEDULE_INTERVAL = "schedule_interval";
@SerializedName(SERIALIZED_NAME_SCHEDULE_INTERVAL)
private ScheduleInterval scheduleInterval;

public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<Tag> tags;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.inlong.manager.pojo.schedule.airflow;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.util.List;

// todo 删除
/**
* Collection of DAGs.
*/
@Data
@ApiModel(description = "Collection of DAGs.")
public class DAGCollection {

public static final String SERIALIZED_NAME_DAGS = "dags";
@SerializedName(SERIALIZED_NAME_DAGS)
private List<DAG> dags = null;

public static final String SERIALIZED_NAME_TOTAL_ENTRIES = "total_entries";
@SerializedName(SERIALIZED_NAME_TOTAL_ENTRIES)
private Integer totalEntries;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.inlong.manager.pojo.schedule.airflow;

import com.google.gson.annotations.SerializedName;

/**
* DAGRun
*/
public class DAGRun {

@SerializedName("conf")
private Object conf;
@SerializedName("dag_id")
private String dagId;
@SerializedName("dag_run_id")
private String dagRunId;
@SerializedName("data_interval_end")
private String dataIntervalEnd;
@SerializedName("data_interval_start")
private String dataIntervalStart;
@SerializedName("end_date")
private String endDate;
@SerializedName("execution_date")
private String executionDate;

@SerializedName("external_trigger")
private Boolean externalTrigger = true;

@SerializedName("last_scheduling_decision")
private String lastSchedulingDecision;

@SerializedName("logical_date")
private String logicalDate;

@SerializedName("note")
private String note;

@SerializedName("run_type")
private String runType;

@SerializedName("start_date")
private String startDate;

@SerializedName("state")
private String state;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.inlong.manager.pojo.schedule.airflow;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DAGRunConf {

@SerializedName("inlong_group_id")
private String inlongGroupId;
@SerializedName("start_time")
private long startTime;
@SerializedName("end_time")
private long endTime;

@SerializedName("cron_expr")
private String cronExpr;
@SerializedName("seconds_interval")
private String secondsInterval;

@SerializedName("connection_id")
private String connectionId;
@SerializedName("timezone")
private String timezone;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.inlong.manager.pojo.schedule.airflow;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.math.BigDecimal;

@Data
@ApiModel(description = "[RFC7807](https://tools.ietf.org/html/rfc7807) compliant response. ")
public class Error {

public static final String SERIALIZED_NAME_DETAIL = "detail";
@SerializedName(SERIALIZED_NAME_DETAIL)
private String detail;
public static final String SERIALIZED_NAME_INSTANCE = "instance";
@SerializedName(SERIALIZED_NAME_INSTANCE)
private String instance;

public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private BigDecimal status;

public static final String SERIALIZED_NAME_TITLE = "title";
@SerializedName(SERIALIZED_NAME_TITLE)
private String title;

public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
private String type;
}
Loading

0 comments on commit 331ceb5

Please sign in to comment.