External Storage Integration: Activity worker, client - #3020
Conversation
| public ListWorkflowExecutionsResponse listWorkflowExecutions( | ||
| ListWorkflowExecutionsRequest listRequest) { | ||
| return next.listWorkflowExecutions(listRequest); | ||
| } |
There was a problem hiding this comment.
Addressed the previous concern of eagerly fetching external payloads #2978 (comment). They are now loaded lazily.
37ae3c7 to
7069249
Compare
|
|
||
| try { | ||
| sendReply(taskToken, result, metricsScope); | ||
| sendReply(taskToken, result, metricsScope, activityStorageTarget(pollResponse)); |
There was a problem hiding this comment.
Previous comment about pivoting this target based on standalone vs workflow activity has been addressed #2978 (comment)
activityStorageTarget delegates to storageTargetForActivityTask (which can be seen above)
460bfbf to
b3804da
Compare
7069249 to
550e4f2
Compare
b3804da to
ca09b50
Compare
ffafefa to
69a8a3a
Compare
fad5ed3 to
8d1399c
Compare
| * <p>This This is an internal class that is not exposed to users or workflow code. The intent is to | ||
| * use this data converter to consolidate extstore usage within the SDK. | ||
| */ | ||
| public final class ExternalStorageDataConverter implements DataConverter { |
There was a problem hiding this comment.
This is the new abstraction that replaces the previous External Storage client decorator. It wraps the data converter supplied to the WorkflowClient in RootWorkflowClientInvoker
| public RootWorkflowClientInvoker( | ||
| GenericWorkflowClient genericClient, | ||
| WorkflowClientOptions clientOptions, | ||
| WorkerFactoryRegistry workerFactoryRegistry, | ||
| @Nullable ExternalStorageRunner externalStorage) { | ||
| this.externalStorage = externalStorage; |
There was a problem hiding this comment.
This class inherits the external storage runner from WorkflowClientInternalImpl and then uses it to create the new ExternalStorageDataConverter
| Stream<HistoryEvent> streamHistory(WorkflowExecution execution) { | ||
| Preconditions.checkNotNull(execution, "execution is required"); | ||
|
|
||
| GetWorkflowExecutionHistoryIterator iterator = | ||
| new GetWorkflowExecutionHistoryIterator( | ||
| options.getNamespace(), execution, null, genericClient); | ||
| iterator.init(); |
There was a problem hiding this comment.
This no longer runs through external storage as it was previously being handled by the client decorator. The worker still uses extstore when replaying it's own history (see https://github.com/temporalio/sdk-java/pull/3017/changes#diff-4928a50c4af33d91cd6b57a121d20ed2594cd314e118beb01c259d5e7427728c).
Is this just used for offline replay? Do we need to use extstore here?
…TestActivityEnvironment
…rator, address some feedback points.
8d1399c to
0c7b308
Compare
What was changed
WorkflowClientInternalImpl,HeartbeatContextImpl, andActivityWorker.Why?
Checklist