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

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

commit ffd804e3b2cb0f27e5ff73f4109f605bf31e3759
Author: Robert Burke <[email protected]>
AuthorDate: Sat Jan 7 00:21:14 2023 -0800

    improve debugging printouts for built in restriction
---
 sdks/go/pkg/beam/core/sdf/lock.go                        | 9 ++++++++-
 sdks/go/pkg/beam/io/rtrackers/offsetrange/offsetrange.go | 4 ++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/sdks/go/pkg/beam/core/sdf/lock.go 
b/sdks/go/pkg/beam/core/sdf/lock.go
index ea26129d34c..eecae0ef4fd 100644
--- a/sdks/go/pkg/beam/core/sdf/lock.go
+++ b/sdks/go/pkg/beam/core/sdf/lock.go
@@ -15,7 +15,10 @@
 
 package sdf
 
-import "sync"
+import (
+       "fmt"
+       "sync"
+)
 
 // NewLockRTracker creates a LockRTracker initialized with the specified
 // restriction tracker as its underlying restriction tracker.
@@ -92,3 +95,7 @@ func (rt *LockRTracker) IsBounded() bool {
        }
        return true
 }
+
+func (rt *LockRTracker) String() string {
+       return fmt.Sprintf("LockRTracker(%v)", rt.Rt)
+}
diff --git a/sdks/go/pkg/beam/io/rtrackers/offsetrange/offsetrange.go 
b/sdks/go/pkg/beam/io/rtrackers/offsetrange/offsetrange.go
index 3aaf48bc0af..ad8da0fa90b 100644
--- a/sdks/go/pkg/beam/io/rtrackers/offsetrange/offsetrange.go
+++ b/sdks/go/pkg/beam/io/rtrackers/offsetrange/offsetrange.go
@@ -131,6 +131,10 @@ type Tracker struct {
        err       error
 }
 
+func (tracker *Tracker) String() string {
+       return fmt.Sprintf("[%v,%v) c: %v, a.: %v, stopped: %v, err: %v", 
tracker.rest.Start, tracker.rest.End, tracker.claimed, tracker.attempted, 
tracker.stopped, tracker.err)
+}
+
 // NewTracker is a constructor for an Tracker given a start and end range.
 func NewTracker(rest Restriction) *Tracker {
        return &Tracker{

Reply via email to