(metadataRow *sqlplugin.QueueV2MetadataRow)
| 348 | } |
| 349 | |
| 350 | func (q queueV2) extractQueueMetadata(metadataRow *sqlplugin.QueueV2MetadataRow) (*persistencespb.Queue, error) { |
| 351 | if metadataRow.MetadataEncoding != enumspb.ENCODING_TYPE_PROTO3.String() { |
| 352 | return nil, fmt.Errorf( |
| 353 | "queue with type %v and name %v has invalid encoding: %w", |
| 354 | metadataRow.QueueType, |
| 355 | metadataRow.QueueName, |
| 356 | serialization.NewUnknownEncodingTypeError(metadataRow.MetadataEncoding, enumspb.ENCODING_TYPE_PROTO3), |
| 357 | ) |
| 358 | } |
| 359 | qm := &persistencespb.Queue{} |
| 360 | err := qm.Unmarshal(metadataRow.MetadataPayload) |
| 361 | if err != nil { |
| 362 | return nil, serialization.NewDeserializationError( |
| 363 | enumspb.ENCODING_TYPE_PROTO3, |
| 364 | fmt.Errorf("unmarshal payload for queue with type %v and name %v failed: %w", |
| 365 | metadataRow.QueueType, |
| 366 | metadataRow.QueueName, |
| 367 | err), |
| 368 | ) |
| 369 | } |
| 370 | return qm, nil |
| 371 | } |
| 372 | |
| 373 | func (q *queueV2) getMaxMessageID(ctx context.Context, queueType persistence.QueueV2Type, queueName string, tc sqlplugin.TableCRUD) (int64, bool, error) { |
| 374 | lastMessageID, err := tc.GetLastEnqueuedMessageIDForUpdateV2(ctx, sqlplugin.QueueV2Filter{ |
no test coverage detected