Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
remove deprecated fields and methods (#2158)
Browse files Browse the repository at this point in the history
remove deprecated fields and methods
  • Loading branch information
aravindanr authored Apr 6, 2021
1 parent 56e106f commit 92427e9
Show file tree
Hide file tree
Showing 22 changed files with 296 additions and 361 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
* Copyright 2020 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.
* Copyright 2021 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.netflix.conductor.cassandra.dao;

Expand All @@ -30,7 +30,6 @@
import com.netflix.conductor.common.run.Workflow;
import com.netflix.conductor.core.exception.ApplicationException;
import com.netflix.conductor.core.utils.IDGenerator;
import java.time.Duration;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
Expand All @@ -42,6 +41,7 @@
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -248,7 +248,11 @@ public void testValidateTasks() {
@Test
public void testWorkflowCRUD() {
String workflowId = IDGenerator.generate();
WorkflowDef workflowDef = new WorkflowDef();
workflowDef.setName("def1");
workflowDef.setVersion(1);
Workflow workflow = new Workflow();
workflow.setWorkflowDefinition(workflowDef);
workflow.setWorkflowId(workflowId);
workflow.setInput(new HashMap<>());
workflow.setStatus(Workflow.WorkflowStatus.RUNNING);
Expand Down Expand Up @@ -280,8 +284,12 @@ public void testWorkflowCRUD() {
@Test
public void testTasksCRUD() {
String workflowId = IDGenerator.generate();
WorkflowDef workflowDef = new WorkflowDef();
workflowDef.setName("def1");
workflowDef.setVersion(1);
// create a workflow
Workflow workflow = new Workflow();
workflow.setWorkflowDefinition(workflowDef);
workflow.setWorkflowId(workflowId);
workflow.setInput(new HashMap<>());
workflow.setStatus(Workflow.WorkflowStatus.RUNNING);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
* Copyright 2020 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.
* Copyright 2021 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.netflix.conductor.client.http;

Expand Down Expand Up @@ -305,15 +305,6 @@ public String rerunWorkflow(String workflowId, RerunWorkflowRequest rerunWorkflo
return postForEntity("workflow/{workflowId}/rerun", rerunWorkflowRequest, null, String.class, workflowId);
}

/**
* This API has been marked as deprecated and will be removed in a future release. Please use {@link
* #restart(String, boolean)} instead.
*/
@Deprecated
public void restart(String workflowId) {
restart(workflowId, false);
}

/**
* Restart a completed workflow
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
* Copyright 2020 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.
* Copyright 2021 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.netflix.conductor.client.worker;

Expand Down Expand Up @@ -40,14 +40,6 @@ public interface Worker {
*/
TaskResult execute(Task task);

/**
* This method has been marked as deprecated and will be removed in a future release.
*/
@Deprecated
default boolean preAck(Task task) {
return true;
}

/**
* Called when the task coordinator fails to update the task to the server. Client should store the task id (in a
* database) and retry the update later
Expand Down Expand Up @@ -87,14 +79,6 @@ default String getIdentity() {
return serverId;
}

/**
* This method has been marked as deprecated and will be removed in a future release.
*/
@Deprecated
default int getPollCount() {
return PropertyFactory.getInteger(getTaskDefName(), "pollCount", 1);
}

/**
* Override this method to change the interval between polls.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
* Copyright 2020 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.
* Copyright 2021 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.netflix.conductor.common.metadata.tasks;

Expand Down Expand Up @@ -168,9 +168,7 @@ public boolean isRetriable() {
@ProtoField(id = 30)
private Any outputMessage;

// This field is deprecated, do not reuse id 31.
// @ProtoField(id = 31)
// private int rateLimitPerSecond;
// id 31 is reserved

@ProtoField(id = 32)
private int rateLimitPerFrequency;
Expand Down Expand Up @@ -235,16 +233,6 @@ public void setStatus(Status status) {
this.status = status;
}

@Deprecated
public Status getTaskStatus() {
return status;
}

@Deprecated
public void setTaskStatus(Status taskStatus) {
this.status = taskStatus;
}

public Map<String, Object> getInputData() {
return inputData;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
* Copyright 2020 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.
* Copyright 2021 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.netflix.conductor.common.metadata.workflow;

Expand All @@ -28,20 +28,20 @@ public class DynamicForkJoinTask {
@ProtoField(id = 2)
private String workflowName;

@ProtoField(id = 3)
@ProtoField(id = 3)
private String referenceName;

@ProtoField(id = 4)
@ProtoField(id = 4)
private Map<String, Object> input = new HashMap<>();

@ProtoField(id = 5)
@ProtoField(id = 5)
private String type = TaskType.SIMPLE.name();

public DynamicForkJoinTask() {
}

public DynamicForkJoinTask(String taskName, String workflowName,
String referenceName, Map<String, Object> input) {
String referenceName, Map<String, Object> input) {
super();
this.taskName = taskName;
this.workflowName = workflowName;
Expand All @@ -50,7 +50,7 @@ public DynamicForkJoinTask(String taskName, String workflowName,
}

public DynamicForkJoinTask(String taskName, String workflowName,
String referenceName, String type, Map<String, Object> input) {
String referenceName, String type, Map<String, Object> input) {
super();
this.taskName = taskName;
this.workflowName = workflowName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
* Copyright 2020 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.
* Copyright 2021 Netflix, Inc.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.netflix.conductor.common.metadata.workflow;

Expand All @@ -22,14 +22,12 @@
import javax.validation.constraints.PositiveOrZero;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/**
* This is the task definition definied as part of the {@link WorkflowDef}. The tasks definied in the Workflow
Expand All @@ -38,32 +36,6 @@
@ProtoMessage
public class WorkflowTask {

/**
* This field is deprecated and will be removed in the next version. Please use {@link TaskType} instead.
*/
@Deprecated
public enum Type {
SIMPLE, DYNAMIC, FORK_JOIN, FORK_JOIN_DYNAMIC, DECISION, JOIN, SUB_WORKFLOW, EVENT, WAIT, USER_DEFINED;
private static final Set<String> systemTasks = new HashSet<>();

static {
systemTasks.add(Type.SIMPLE.name());
systemTasks.add(Type.DYNAMIC.name());
systemTasks.add(Type.FORK_JOIN.name());
systemTasks.add(Type.FORK_JOIN_DYNAMIC.name());
systemTasks.add(Type.DECISION.name());
systemTasks.add(Type.JOIN.name());
systemTasks.add(Type.SUB_WORKFLOW.name());
systemTasks.add(Type.EVENT.name());
systemTasks.add(Type.WAIT.name());
//Do NOT add USER_DEFINED here...
}

public static boolean isSystemTask(String name) {
return systemTasks.contains(name);
}
}

@ProtoField(id = 1)
@NotEmpty(message = "WorkflowTask name cannot be empty or null")
private String name;
Expand Down
Loading

0 comments on commit 92427e9

Please sign in to comment.