You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lo...@apache.org on 2022/11/05 16:55:55 UTC

[beam] 09/12: Add string methods to known hint types.

This is an automated email from the ASF dual-hosted git repository.

lostluck pushed a commit to branch beam23893pipelinehint
in repository https://gitbox.apache.org/repos/asf/beam.git

commit a655cc60b698bdcf3924688de678bd7f991a9d0b
Author: lostluck <13...@users.noreply.github.com>
AuthorDate: Fri Nov 4 16:17:44 2022 -0700

    Add string methods to known hint types.
---
 sdks/go/pkg/beam/options/resource/hint.go | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sdks/go/pkg/beam/options/resource/hint.go b/sdks/go/pkg/beam/options/resource/hint.go
index de78950b522..8cfd5a36b2e 100644
--- a/sdks/go/pkg/beam/options/resource/hint.go
+++ b/sdks/go/pkg/beam/options/resource/hint.go
@@ -143,6 +143,10 @@ func (h minRamHint) MergeWith(outer Hint) Hint {
 	return h
 }
 
+func (h minRamHint) String() string {
+	return fmt.Sprintf("min_ram=%v", humanize.Bytes(uint64(h.value)))
+}
+
 // Accelerator hints that this scope should be put in a machine with a given accelerator.
 //
 // Hints for accelerators will have formats that are runner specific.
@@ -176,3 +180,7 @@ func (h acceleratorHint) Payload() []byte {
 func (h acceleratorHint) MergeWith(outer Hint) Hint {
 	return h
 }
+
+func (h acceleratorHint) String() string {
+	return fmt.Sprintf("accelerator=%v", h.value)
+}