Skip to content

Commit 7be16a0

Browse files
committed
Revert "chore: Introduce new task execution key"
This reverts commit 85e0cac. Signed-off-by: Javier Aliaga <[email protected]>
1 parent 4c71338 commit 7be16a0

File tree

3 files changed

+9
-27
lines changed

3 files changed

+9
-27
lines changed

client/src/main/java/io/dapr/durabletask/DurableTaskGrpcWorker.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,10 @@ public void startAndBlock() {
160160
String output = null;
161161
TaskFailureDetails failureDetails = null;
162162
try {
163-
String instanceId = activityRequest.getOrchestrationInstance().getInstanceId();
164-
String taskName = activityRequest.getName();
165-
String taskExecutionKey = instanceId + "-" + taskName;
166163
output = taskActivityExecutor.execute(
167164
activityRequest.getName(),
168165
activityRequest.getInput().getValue(),
169-
taskExecutionKey);
166+
activityRequest.getTaskId());
170167
} catch (Throwable e) {
171168
failureDetails = TaskFailureDetails.newBuilder()
172169
.setErrorType(e.getClass().getName())

client/src/main/java/io/dapr/durabletask/TaskActivityContext.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,11 @@
77
* its input.
88
*/
99
public interface TaskActivityContext {
10-
/**
11-
* Gets the name of the current task activity.
12-
* @return the name of the current task activity
13-
*/
14-
String getName();
15-
16-
/**
17-
* Gets the task execution key of the current task activity.
18-
* This key is used to identify the task execution and is unique for each task execution.
19-
* @return the task execution key of the current task activity
20-
*/
21-
String getTaskExecutionKey();
10+
/**
11+
* Gets the name of the current task activity.
12+
* @return the name of the current task activity
13+
*/
14+
String getName();
2215

2316
/**
2417
* Gets the deserialized activity input.

client/src/main/java/io/dapr/durabletask/TaskActivityExecutor.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public TaskActivityExecutor(
1919
this.logger = logger;
2020
}
2121

22-
public String execute(String taskName, String input, String taskExecutionKey) throws Throwable {
22+
public String execute(String taskName, String input, int taskId) throws Throwable {
2323
TaskActivityFactory factory = this.activityFactories.get(taskName);
2424
if (factory == null) {
2525
throw new IllegalStateException(
@@ -32,7 +32,7 @@ public String execute(String taskName, String input, String taskExecutionKey) th
3232
String.format("The task factory '%s' returned a null TaskActivity object.", taskName));
3333
}
3434

35-
TaskActivityContextImpl context = new TaskActivityContextImpl(taskName, input, taskExecutionKey);
35+
TaskActivityContextImpl context = new TaskActivityContextImpl(taskName, input);
3636

3737
// Unhandled exceptions are allowed to escape
3838
Object output = activity.run(context);
@@ -44,29 +44,21 @@ public String execute(String taskName, String input, String taskExecutionKey) th
4444
}
4545

4646
private class TaskActivityContextImpl implements TaskActivityContext {
47-
private final String taskExecutionKey;
4847
private final String name;
4948
private final String rawInput;
50-
5149

5250
private final DataConverter dataConverter = TaskActivityExecutor.this.dataConverter;
5351

54-
public TaskActivityContextImpl(String activityName, String rawInput, String taskExecutionKey) {
52+
public TaskActivityContextImpl(String activityName, String rawInput) {
5553
this.name = activityName;
5654
this.rawInput = rawInput;
57-
this.taskExecutionKey = taskExecutionKey;
5855
}
5956

6057
@Override
6158
public String getName() {
6259
return this.name;
6360
}
6461

65-
@Override
66-
public String getTaskExecutionKey() {
67-
return this.taskExecutionKey;
68-
}
69-
7062
@Override
7163
public <T> T getInput(Class<T> targetType) {
7264
if (this.rawInput == null) {

0 commit comments

Comments
 (0)