Skip to content
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

Add unit test for cassandra workflow utils part-2 #5480

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions common/persistence/nosql/nosqlplugin/cassandra/workflow_cql.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const (
`}`

templateChildExecutionInfoType = `{` +
`version: ?,` +
`version: ?, ` +
`initiated_id: ?, ` +
`initiated_event_batch_id: ?, ` +
`initiated_event: ?, ` +
Expand All @@ -204,7 +204,7 @@ const (
`}`

templateSignalInfoType = `{` +
`version: ?,` +
`version: ?, ` +
`initiated_id: ?, ` +
`initiated_event_batch_id: ?, ` +
`signal_request_id: ?, ` +
Expand Down Expand Up @@ -373,7 +373,7 @@ workflow_state = ? ` +
`and task_id = ? `

templateUpdateChildExecutionInfoQuery = `UPDATE executions ` +
`SET child_executions_map[ ? ] =` + templateChildExecutionInfoType + ` ` +
`SET child_executions_map[ ? ] = ` + templateChildExecutionInfoType + ` ` +
`WHERE shard_id = ? ` +
`and type = ? ` +
`and domain_id = ? ` +
Expand All @@ -393,7 +393,7 @@ workflow_state = ? ` +
`and task_id = ? `

templateUpdateRequestCancelInfoQuery = `UPDATE executions ` +
`SET request_cancel_map[ ? ] =` + templateRequestCancelInfoType + ` ` +
`SET request_cancel_map[ ? ] = ` + templateRequestCancelInfoType + ` ` +
`WHERE shard_id = ? ` +
`and type = ? ` +
`and domain_id = ? ` +
Expand All @@ -413,7 +413,7 @@ workflow_state = ? ` +
`and task_id = ? `

templateUpdateSignalInfoQuery = `UPDATE executions ` +
`SET signal_map[ ? ] =` + templateSignalInfoType + ` ` +
`SET signal_map[ ? ] = ` + templateSignalInfoType + ` ` +
`WHERE shard_id = ? ` +
`and type = ? ` +
`and domain_id = ? ` +
Expand All @@ -423,7 +423,7 @@ workflow_state = ? ` +
`and task_id = ? `

templateResetSignalInfoQuery = `UPDATE executions ` +
`SET signal_map = ?` +
`SET signal_map = ? ` +
`WHERE shard_id = ? ` +
`and type = ? ` +
`and domain_id = ? ` +
Expand All @@ -443,7 +443,7 @@ workflow_state = ? ` +
`and task_id = ? `

templateResetSignalRequestedQuery = `UPDATE executions ` +
`SET signal_requested = ?` +
`SET signal_requested = ? ` +
`WHERE shard_id = ? ` +
`and type = ? ` +
`and domain_id = ? ` +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ func resetSignalInfoMap(signalInfos map[int64]*persistence.SignalInfo) map[int64
sInfo["signal_name"] = s.SignalName
sInfo["input"] = s.Input
sInfo["control"] = s.Control

sMap[s.InitiatedID] = sInfo
}

Expand Down Expand Up @@ -612,7 +611,6 @@ func resetRequestCancelInfoMap(requestCancelInfos map[int64]*persistence.Request
rcInfo["initiated_id"] = rc.InitiatedID
rcInfo["initiated_event_batch_id"] = rc.InitiatedEventBatchID
rcInfo["cancel_request_id"] = rc.CancelRequestID

rcMap[rc.InitiatedID] = rcInfo
}

Expand All @@ -628,7 +626,6 @@ func updateRequestCancelInfos(
requestCancelInfos map[int64]*persistence.RequestCancelInfo,
deleteInfos []int64,
) error {

for _, c := range requestCancelInfos {
batch.Query(templateUpdateRequestCancelInfoQuery,
c.InitiatedID,
Expand Down Expand Up @@ -722,7 +719,6 @@ func updateChildExecutionInfos(
childExecutionInfos map[int64]*persistence.InternalChildExecutionInfo,
deleteInfos []int64,
) error {

for _, c := range childExecutionInfos {
batch.Query(templateUpdateChildExecutionInfoQuery,
c.InitiatedID,
Expand Down
Loading