-
Notifications
You must be signed in to change notification settings - Fork 0
added workflow export sample #2
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
base: main
Are you sure you want to change the base?
Conversation
core/src/main/java/io/temporal/samples/exporthistory/ExportCloudToProto.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/temporal/samples/exporthistory/ExportCloudToProto.java
Outdated
Show resolved
Hide resolved
alice-yin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering have you run the tool locally for testing? I haven't wrote java for a long time. So may not catch a lot of issue by reading.
|
|
||
| public final class Constants { | ||
|
|
||
| public static final String QUERY = "CloseTime<=\"2025-09-30T19:43:00.000Z\""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider this to be one of the input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also consider the query to be startTime, closeTime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider this to be one of the input?
@alice-yin what do you mean? Are you saying it should be a command line arg?
Also consider the query to be startTime, closeTime.
@alice-yin I thought the export was based on close time, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we allow startTime and closeTime as both in command line arg. On a second thought, how about we just allow QUERY as the whole input? As for query, user could directly get the input from the UI. That's probably easier for user as well.
| .addAllItems(allExecutions) | ||
| .build(); | ||
|
|
||
| byte[] binary = executions.toByteArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we serialize to JSON before writing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alice-yin I think the intent of this sample is to match what the cloud export feature exports... and its export is proto, not json, right?
|
|
||
| public final class Constants { | ||
|
|
||
| public static final String QUERY = "CloseTime<=\"2025-09-30T19:43:00.000Z\""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the query, should we also consider loading the workflow status to ExecutionStatus != Running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alice-yin if the query has a close time, wouldn't it already be not running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. It's just in our backend, we usually call it out more specifically
| child.clearSearchAttributes(); | ||
| eb.setStartChildWorkflowExecutionInitiatedEventAttributes(child); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is another case for Continue as new case.See https://github.com/temporalio/temporal/blob/main/service/history/api/get_history_util.go#L360
If this is what trying for.
Sample cloud workflow export