@@ -506,6 +506,16 @@ workflow_state = ? ` +
506506 `and visibility_ts = ? ` +
507507 `and task_id = ? `
508508
509+ templateGetTransferTaskQuery = `SELECT transfer, transfer_encoding ` +
510+ `FROM executions ` +
511+ `WHERE shard_id = ? ` +
512+ `and type = ? ` +
513+ `and namespace_id = ? ` +
514+ `and workflow_id = ? ` +
515+ `and run_id = ? ` +
516+ `and visibility_ts = ? ` +
517+ `and task_id = ? `
518+
509519 templateGetTransferTasksQuery = `SELECT transfer, transfer_encoding ` +
510520 `FROM executions ` +
511521 `WHERE shard_id = ? ` +
@@ -1932,6 +1942,33 @@ func (d *cassandraPersistence) ListConcreteExecutions(
19321942 return response , nil
19331943}
19341944
1945+ func (d * cassandraPersistence ) GetTransferTask (request * p.GetTransferTaskRequest ) (* p.GetTransferTaskResponse , error ) {
1946+ shardID := d .shardID
1947+ taskID := request .TaskID
1948+ query := d .session .Query (templateGetTransferTaskQuery ,
1949+ shardID ,
1950+ rowTypeTransferTask ,
1951+ rowTypeTransferNamespaceID ,
1952+ rowTypeTransferWorkflowID ,
1953+ rowTypeTransferRunID ,
1954+ defaultVisibilityTimestamp ,
1955+ taskID )
1956+
1957+ var data []byte
1958+ var encoding string
1959+ if err := query .Scan (& data , & encoding ); err != nil {
1960+ return nil , convertCommonErrors ("GetTransferTask" , err )
1961+ }
1962+
1963+ info , err := serialization .TransferTaskInfoFromBlob (data , encoding )
1964+
1965+ if err != nil {
1966+ return nil , convertCommonErrors ("GetTransferTask" , err )
1967+ }
1968+
1969+ return & p.GetTransferTaskResponse {TransferTaskInfo : info }, nil
1970+ }
1971+
19351972func (d * cassandraPersistence ) GetTransferTasks (request * p.GetTransferTasksRequest ) (* p.GetTransferTasksResponse , error ) {
19361973
19371974 // Reading transfer tasks need to be quorum level consistent, otherwise we could loose task
0 commit comments