beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From al...@apache.org
Subject [beam] branch master updated: Add string method to unit status
Date Wed, 06 Feb 2019 23:31:49 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 34d9762  Add string method to unit status
     new d0cb12b  Merge pull request #7760 from lostluck/statusStrings
34d9762 is described below

commit 34d976224268184b7f0b9141e1483b9ce7adcb4c
Author: Robert Burke <robert@frantil.com>
AuthorDate: Wed Feb 6 23:14:21 2019 +0000

    Add string method to unit status
---
 sdks/go/pkg/beam/core/runtime/exec/status.go     | 19 +++++++++++++++++++
 sdks/go/pkg/beam/core/runtime/harness/session.go |  8 --------
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/sdks/go/pkg/beam/core/runtime/exec/status.go b/sdks/go/pkg/beam/core/runtime/exec/status.go
index 46b2c32..43e6039 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/status.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/status.go
@@ -15,6 +15,8 @@
 
 package exec
 
+import "fmt"
+
 // Status is the status of a unit or plan.
 type Status int
 
@@ -25,3 +27,20 @@ const (
 	Broken
 	Down
 )
+
+func (s Status) String() string {
+	switch s {
+	case Initializing:
+		return "Initialzing"
+	case Up:
+		return "Up"
+	case Active:
+		return "Active"
+	case Broken:
+		return "Broken"
+	case Down:
+		return "Down"
+	default:
+		return fmt.Sprintf("UnknownStatus(%d)", int(s))
+	}
+}
diff --git a/sdks/go/pkg/beam/core/runtime/harness/session.go b/sdks/go/pkg/beam/core/runtime/harness/session.go
index 88807ba..7fecf9f 100644
--- a/sdks/go/pkg/beam/core/runtime/harness/session.go
+++ b/sdks/go/pkg/beam/core/runtime/harness/session.go
@@ -28,14 +28,6 @@ import (
 	"github.com/golang/protobuf/proto"
 )
 
-const (
-	unknown = iota
-	instructionRequest
-	instructionResponse
-	dataReceive
-	dataSend
-)
-
 // capture is set by the capture hook below.
 var capture io.WriteCloser
 


Mime
View raw message