Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dss-standard module, which is three kind of basic request protocol to integrate with upper-layer application systems. #384

Merged
merged 2 commits into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2019 WeBank
~ Licensed 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.
~
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dss</artifactId>
<groupId>com.webank.wedatasphere.dss</groupId>
<version>1.0.0</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>dss-development-process-standard-execution</artifactId>

<dependencies>
<dependency>
<groupId>com.webank.wedatasphere.dss</groupId>
<artifactId>dss-development-process-standard</artifactId>
<version>${dss.version}</version>
</dependency>
<dependency>
<groupId>com.webank.wedatasphere.dss</groupId>
<artifactId>dss-common</artifactId>
<version>${dss.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2019 WeBank
* Licensed 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 com.webank.wedatasphere.dss.standard.app.development.listener.async;


public interface RefExecutionListener {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2019 WeBank
* Licensed 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 com.webank.wedatasphere.dss.standard.app.development.listener.async;

import com.webank.wedatasphere.dss.standard.app.development.listener.common.CompletedExecutionResponseRef;


public interface RefExecutionResponseListener extends RefExecutionListener {

void onRefExecutionCompleted(CompletedExecutionResponseRef response);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright 2019 WeBank
* Licensed 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 com.webank.wedatasphere.dss.standard.app.development.listener.async;

import com.webank.wedatasphere.dss.standard.app.development.ref.ExecutionRequestRef;
import com.webank.wedatasphere.dss.standard.app.development.listener.common.AsyncExecutionResponseRef;
import com.webank.wedatasphere.dss.standard.app.development.listener.common.CompletedExecutionResponseRef;
import com.webank.wedatasphere.dss.standard.app.development.listener.common.RefExecutionAction;


public interface RefExecutionStatusListener extends RefExecutionListener {

void beforeSubmit(ExecutionRequestRef requestRef);

void afterSubmit(ExecutionRequestRef requestRef, RefExecutionAction action);

void afterAsyncResponseRef(AsyncExecutionResponseRef response);

void afterCompletedExecutionResponseRef(ExecutionRequestRef requestRef, RefExecutionAction action,
CompletedExecutionResponseRef response);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright 2019 WeBank
* Licensed 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 com.webank.wedatasphere.dss.standard.app.development.listener.common;

import com.webank.wedatasphere.dss.standard.app.development.listener.core.ExecutionRequestRefContext;


public abstract class AbstractRefExecutionAction implements RefExecutionAction {

private String id;
private ExecutionRequestRefContext executionRequestRefContext;

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public boolean isKilledFlag() {
return killedFlag;
}

public void setKilledFlag(boolean killedFlag) {
this.killedFlag = killedFlag;
}

private boolean killedFlag = false;

@Override
public ExecutionRequestRefContext getExecutionRequestRefContext() {
return executionRequestRefContext;
}

public void setExecutionRequestRefContext(ExecutionRequestRefContext executionRequestRefContext) {
this.executionRequestRefContext = executionRequestRefContext;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright 2019 WeBank
* Licensed 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 com.webank.wedatasphere.dss.standard.app.development.listener.common;

import com.webank.wedatasphere.dss.standard.app.development.ref.ExecutionRequestRef;
import com.webank.wedatasphere.dss.standard.app.development.listener.core.ExecutionRequestRefContext;
import java.util.Map;


public interface AsyncExecutionRequestRef extends ExecutionRequestRef {

ExecutionRequestRefContext getExecutionRequestRefContext();

void setExecutionRequestRefContext(ExecutionRequestRefContext executionRequestRefContext);

void setProjectName(String projectName);

void setOrchestratorName(String orchestratorName);

void setJobContent(Map<String, Object> jobContent);

void setName(String name);

void setType(String type);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2019 WeBank
* Licensed 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 com.webank.wedatasphere.dss.standard.app.development.listener.common;

import com.webank.wedatasphere.dss.standard.app.development.ref.ExecutionRequestRef;
import com.webank.wedatasphere.dss.standard.app.development.listener.async.RefExecutionResponseListener;
import com.webank.wedatasphere.dss.standard.app.development.listener.core.LongTermRefExecutionOperation;
import com.webank.wedatasphere.dss.standard.common.entity.ref.ResponseRef;


public interface AsyncExecutionResponseRef extends ResponseRef {

RefExecutionAction getAction();

void setAction(RefExecutionAction action);

void addListener(RefExecutionResponseListener listener);

void setExecutionRequestRef(ExecutionRequestRef requestRef);

ExecutionRequestRef getExecutionRequestRef();

LongTermRefExecutionOperation getRefExecution();

void setRefExecution(LongTermRefExecutionOperation refExecution);

long getAskStatePeriod();

void setAskStatePeriod(long askStatePeriod);

void setCompleted(CompletedExecutionResponseRef response);

boolean isCompleted();

long getStartTime();

long getMaxLoopTime();

void setMaxLoopTime(long maxLoopTime);

}
Loading