Skip to content

Commit

Permalink
Fix dolphinscheduler pojo
Browse files Browse the repository at this point in the history
  • Loading branch information
lsyldliu committed Jun 26, 2024
1 parent 81050b5 commit c14fd02
Show file tree
Hide file tree
Showing 5 changed files with 194 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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.flink.table.gateway.workflow.dolphinscheduler.entity;

/** data types in user define parameter. */
public enum DataType {
/**
* 0 string 1 integer 2 long 3 float 4 double 5 date, "YYYY-MM-DD" 6 time, "HH:MM:SS" 7 time
* stamp 8 Boolean 9 list.
*/
VARCHAR,
INTEGER,
LONG,
FLOAT,
DOUBLE,
DATE,
TIME,
TIMESTAMP,
BOOLEAN,
LIST,
FILE
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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.flink.table.gateway.workflow.dolphinscheduler.entity;

/** parameter of stored procedure. */
public enum Direct {

/** 0 in,1 out. */
IN,
OUT
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@

package org.apache.flink.table.gateway.workflow.dolphinscheduler.entity;

import java.util.ArrayList;
import java.util.List;

/** DS materialized table parameter. */
public class MaterializedTableParameters {

private List<Property> localParams = new ArrayList<>();

private String identifier;
private String gatewayEndpoint;
private boolean isPeriodic;
Expand All @@ -30,6 +35,14 @@ public class MaterializedTableParameters {
private String initConfig;
private String statementDescription;

public List<Property> getLocalParams() {
return localParams;
}

public void setLocalParams(List<Property> localParams) {
this.localParams = localParams;
}

public String getIdentifier() {
return identifier;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
* 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.flink.table.gateway.workflow.dolphinscheduler.entity;

import java.io.Serializable;
import java.util.Objects;

/** Property info. */
public class Property implements Serializable {

private static final long serialVersionUID = -4045513703397452451L;
/** key */
private String prop;

/** input/output */
private Direct direct;

/** data type */
private DataType type;

/** value */
private String value;

public Property() {}

public Property(String prop, Direct direct, DataType type, String value) {
this.prop = prop;
this.direct = direct;
this.type = type;
this.value = value;
}

public String getProp() {
return prop;
}

public void setProp(String prop) {
this.prop = prop;
}

public Direct getDirect() {
return direct;
}

public void setDirect(Direct direct) {
this.direct = direct;
}

public DataType getType() {
return type;
}

public void setType(DataType type) {
this.type = type;
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Property property = (Property) o;
return Objects.equals(prop, property.prop) && Objects.equals(value, property.value);
}

@Override
public int hashCode() {
return Objects.hash(prop, value);
}

@Override
public String toString() {
return "Property{"
+ "prop='"
+ prop
+ '\''
+ ", direct="
+ direct
+ ", type="
+ type
+ ", value='"
+ value
+ '\''
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class DolphinSchedulerRestAPITest {

private static String sessionId;
private static Map<String, String> headers = new HashMap<>();
private static long projectCode = 111869896098176L;
private static long projectCode = 111969609116064L;

@BeforeAll
static void setUp() throws Exception {
Expand Down Expand Up @@ -404,7 +404,7 @@ void resumeMaterializedTableWorkflowWithOptions() throws Exception {

// 1. get task info
String taskInfoUrl =
String.format("/projects/%s/task-definition/%s", projectCode, 111869964373376L);
String.format("/projects/%s/task-definition/%s", projectCode, 111983532362144L);
HttpResponseBody taskInfoRespBody =
requestClient.get(taskInfoUrl, headers, new HashMap<>()).getBody();
if (!taskInfoRespBody.getSuccess()) {
Expand All @@ -429,7 +429,7 @@ void resumeMaterializedTableWorkflowWithOptions() throws Exception {
String offlineWorkflowUrl =
String.format(
"/projects/%s/process-definition/%s/release",
projectCode, 111869964719488L);
projectCode, 111983532554656L);
Map<String, Object> offlineWorkflowParams = new HashMap<>();
offlineWorkflowParams.put("releaseState", ReleaseState.OFFLINE);

Expand Down

0 comments on commit c14fd02

Please sign in to comment.