MCPcopy Create free account
hub / github.com/temporalio/temporal / AdminGetTaskQueueUserData

Function AdminGetTaskQueueUserData

tools/tdbg/task_queue_commands.go:186–227  ·  view source on GitHub ↗

AdminGetTaskQueueUserData returns the per-type user data for a task queue partition

(c *cli.Context, clientFactory ClientFactory)

Source from the content-addressed store, hash-verified

184
185// AdminGetTaskQueueUserData returns the per-type user data for a task queue partition
186func AdminGetTaskQueueUserData(c *cli.Context, clientFactory ClientFactory) error {
187 namespace, err := getRequiredOption(c, FlagNamespace)
188 if err != nil {
189 return err
190 }
191
192 tqName, err := getRequiredOption(c, FlagTaskQueue)
193 if err != nil {
194 return err
195 }
196
197 tlTypeInt, err := StringToEnum(c.String(FlagTaskQueueType), enumspb.TaskQueueType_value)
198 if err != nil {
199 return fmt.Errorf("invalid task queue type: %w", err)
200 }
201 tqType := enumspb.TaskQueueType(tlTypeInt)
202 if tqType == enumspb.TASK_QUEUE_TYPE_UNSPECIFIED {
203 tqType = enumspb.TASK_QUEUE_TYPE_WORKFLOW
204 }
205
206 partitionID := 0
207 if c.IsSet(FlagPartitionID) {
208 partitionID = c.Int(FlagPartitionID)
209 }
210
211 client := clientFactory.AdminClient(c)
212 req := &adminservice.GetTaskQueueUserDataRequest{
213 Namespace: namespace,
214 TaskQueue: tqName,
215 TaskQueueType: tqType,
216 PartitionId: int32(partitionID),
217 }
218
219 ctx, cancel := newContext(c)
220 defer cancel()
221 response, e := client.GetTaskQueueUserData(ctx, req)
222 if e != nil {
223 return fmt.Errorf("unable to get Task Queue User Data: %w", e)
224 }
225 prettyPrintJSONObject(c, response)
226 return nil
227}
228
229// AdminForceUnloadTaskQueuePartition forcefully unloads a task queue partition
230func AdminForceUnloadTaskQueuePartition(c *cli.Context, clientFactory ClientFactory) error {

Callers 1

Calls 9

getRequiredOptionFunction · 0.85
StringToEnumFunction · 0.85
prettyPrintJSONObjectFunction · 0.85
IntMethod · 0.80
newContextFunction · 0.70
StringMethod · 0.65
AdminClientMethod · 0.65
GetTaskQueueUserDataMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected