Skip to content

Commit de6c42a

Browse files
committed
chore: Fix checkstyle issues
Signed-off-by: Javier Aliaga <javier@diagrid.io>
1 parent 57e5e68 commit de6c42a

File tree

10 files changed

+41
-21
lines changed

10 files changed

+41
-21
lines changed

durabletask-client/src/main/java/io/dapr/durabletask/DurableTaskClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public void raiseEvent(String instanceId, String eventName) {
145145
* Waits for an orchestration to start running and returns an {@link OrchestrationMetadata} object that contains
146146
* metadata about the started instance.
147147
*
148-
* <p> A "started" orchestration instance is any instance not in the <code>Pending</code> state. </p>
148+
* <p>A "started" orchestration instance is any instance not in the <code>Pending</code> state. </p>
149149
*
150150
* <p>If an orchestration instance is already running when this method is called, the method will return immediately.
151151
*</p>

durabletask-client/src/main/java/io/dapr/durabletask/DurableTaskGrpcWorkerBuilder.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public DurableTaskGrpcWorkerBuilder addOrchestration(TaskOrchestrationFactory fa
4646
return this;
4747
}
4848

49-
5049
/**
5150
* Adds an activity factory to be used by the constructed {@link DurableTaskGrpcWorker}.
5251
*
@@ -154,6 +153,4 @@ public DurableTaskGrpcWorkerBuilder appId(String appId) {
154153
public DurableTaskGrpcWorker build() {
155154
return new DurableTaskGrpcWorker(this);
156155
}
157-
158-
159156
}

durabletask-client/src/main/java/io/dapr/durabletask/OrchestrationMetadata.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public boolean isCustomStatusFetched() {
226226
private <T> T readPayloadAs(Class<T> type, String payload) {
227227
if (!this.requestedInputsAndOutputs) {
228228
throw new IllegalStateException("This method can only be used when instance metadata is fetched with the option "
229-
+ "to include input and output data.");
229+
+ "to include input and output data.");
230230
}
231231

232232
// Note that the Java gRPC implementation converts null protobuf strings into empty Java strings

durabletask-client/src/main/java/io/dapr/durabletask/Task.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
* <pre>
2828
* Task{@literal <}int{@literal >} activityTask = ctx.callActivity("MyActivity", someInput, int.class);
2929
* </pre>
30+
*
3031
* <p>Orchestrator code uses the {@link #await()} method to block on the completion of the task and retrieve the result.
3132
* If the task is not yet complete, the {@code await()} method will throw an {@link OrchestratorBlockedException}, which
3233
* pauses the orchestrator's execution so that it can save its progress into durable storage and schedule any
3334
* outstanding work. When the task is complete, the orchestrator will run again from the beginning and the next time
3435
* the task's {@code await()} method is called, the result will be returned, or a {@link TaskFailedException} will be
3536
* thrown if the result of the task was an unhandled exception.</p>
37+
*
3638
* <p>Note that orchestrator code must never catch {@code OrchestratorBlockedException} because doing so can cause the
3739
* orchestration instance to get permanently stuck.</p>
3840
*

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public interface TaskActivityContext {
3434
*/
3535
<T> T getInput(Class<T> targetType);
3636

37-
3837
/**
3938
* Gets the execution id of the current task activity.
4039
*

durabletask-client/src/main/java/io/dapr/durabletask/TaskFailedException.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/**
1717
* Exception that gets thrown when awaiting a {@link Task} for an activity or sub-orchestration that fails with an
1818
* unhandled exception.
19+
*
1920
* <p>Detailed information associated with a particular task failure can be retrieved
2021
* using the {@link #getErrorDetails()} method.</p>
2122
*/

durabletask-client/src/main/java/io/dapr/durabletask/TaskOrchestrationContext.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -326,15 +326,6 @@ default void continueAsNew(Object input) {
326326
this.continueAsNew(input, true);
327327
}
328328

329-
/**
330-
* Check if the given patch name can be applied to the orchestration.
331-
*
332-
* @param patchName The name of the patch to check.
333-
* @return True if the given patch name can be applied to the orchestration, False otherwise.
334-
*/
335-
336-
boolean isPatched(String patchName);
337-
338329
/**
339330
* Restarts the orchestration with a new input and clears its history.
340331
*
@@ -361,6 +352,15 @@ default void continueAsNew(Object input) {
361352
*/
362353
void continueAsNew(Object input, boolean preserveUnprocessedEvents);
363354

355+
/**
356+
* Check if the given patch name can be applied to the orchestration.
357+
*
358+
* @param patchName The name of the patch to check.
359+
* @return True if the given patch name can be applied to the orchestration, False otherwise.
360+
*/
361+
362+
boolean isPatched(String patchName);
363+
364364
/**
365365
* Create a new Uuid that is safe for replay within an orchestration or operation.
366366
*

durabletask-client/src/main/java/io/dapr/durabletask/TaskOrchestrationExecutor.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ private void setName(String name) {
160160
this.orchestratorName = name;
161161
}
162162

163-
164163
private void setInput(String rawInput) {
165164
this.rawInput = rawInput;
166165
}
@@ -483,7 +482,7 @@ public <V> Task<V> callSubOrchestrator(
483482

484483
if (input instanceof TaskOptions) {
485484
throw new IllegalArgumentException("TaskOptions cannot be used as an input. "
486-
+ "Did you call the wrong method overload?");
485+
+ "Did you call the wrong method overload?");
487486
}
488487

489488
String serializedInput = this.dataConverter.serialize(input);
@@ -992,16 +991,19 @@ private void processEvent(OrchestratorService.HistoryEvent e) {
992991
}
993992

994993
var versionName = "";
995-
if (this.orchestratorStartedVersion != null && !StringUtils.isNullOrEmpty(this.orchestratorStartedVersion.getName())) {
994+
if (this.orchestratorStartedVersion != null
995+
&& !StringUtils.isNullOrEmpty(this.orchestratorStartedVersion.getName())) {
996996
versionName = this.orchestratorStartedVersion.getName();
997997
}
998998

999999
// Create and invoke the workflow orchestrator
1000-
TaskOrchestrationFactory factory = TaskOrchestrationExecutor.this.orchestrationFactories.getOrchestrationFactory(executionStarted.getName(), versionName);
1000+
TaskOrchestrationFactory factory = TaskOrchestrationExecutor.this.orchestrationFactories
1001+
.getOrchestrationFactory(executionStarted.getName(), versionName);
10011002

10021003
if (factory == null) {
10031004
// Try getting the default orchestrator
1004-
factory = TaskOrchestrationExecutor.this.orchestrationFactories.getOrchestrationFactory("*");
1005+
factory = TaskOrchestrationExecutor.this.orchestrationFactories
1006+
.getOrchestrationFactory("*");
10051007
}
10061008
// TODO: Throw if the factory is null (orchestration by that name doesn't exist)
10071009
if (factory == null) {

durabletask-client/src/main/java/io/dapr/durabletask/TaskOrchestratorResult.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ final class TaskOrchestratorResult {
2929

3030
private final List<String> patches;
3131

32-
public TaskOrchestratorResult(Collection<OrchestratorService.OrchestratorAction> actions, String customStatus, String version, List<String> patches) {
32+
public TaskOrchestratorResult(Collection<OrchestratorService.OrchestratorAction> actions,
33+
String customStatus, String version, List<String> patches) {
3334
this.actions = Collections.unmodifiableCollection(actions);
3435
this.customStatus = customStatus;
3536
this.version = version;

durabletask-client/src/main/java/io/dapr/durabletask/orchestration/TaskOrchestrationFactories.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ public class TaskOrchestrationFactories {
99
final HashMap<String, HashMap<String, TaskOrchestrationFactory>> versionedOrchestrationFactories = new HashMap<>();
1010
final HashMap<String, String> latestVersionOrchestrationFactories = new HashMap<>();
1111

12+
/**
13+
* Adds a new orchestration factory to the registry.
14+
*
15+
* @param factory the factory to add
16+
*/
1217
public void addOrchestration(TaskOrchestrationFactory factory) {
1318
String key = factory.getName();
1419
if (this.emptyString(key)) {
@@ -39,6 +44,12 @@ public void addOrchestration(TaskOrchestrationFactory factory) {
3944
}
4045
}
4146

47+
/**
48+
* Gets the orchestration factory for the specified orchestration name.
49+
*
50+
* @param orchestrationName the orchestration name
51+
* @return the orchestration factory
52+
*/
4253
public TaskOrchestrationFactory getOrchestrationFactory(String orchestrationName) {
4354
if (this.orchestrationFactories.containsKey(orchestrationName)) {
4455
return this.orchestrationFactories.get(orchestrationName);
@@ -47,6 +58,13 @@ public TaskOrchestrationFactory getOrchestrationFactory(String orchestrationName
4758
return this.getOrchestrationFactory(orchestrationName, "");
4859
}
4960

61+
/**
62+
* Gets the orchestration factory for the specified orchestration name and version.
63+
*
64+
* @param orchestrationName the orchestration name
65+
* @param versionName the version name
66+
* @return the orchestration factory
67+
*/
5068
public TaskOrchestrationFactory getOrchestrationFactory(String orchestrationName, String versionName) {
5169
if (!this.versionedOrchestrationFactories.containsKey(orchestrationName)) {
5270
return null;

0 commit comments

Comments
 (0)