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 2020/03/18 22:48:40 UTC

[beam] branch lostluck-env-pb-pointer created (now b5169ba)

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

lostluck pushed a change to branch lostluck-env-pb-pointer
in repository https://gitbox.apache.org/repos/asf/beam.git.


      at b5169ba  [GoSDK] Change CreateEnvironment to return pointer

This branch includes the following new commits:

     new b5169ba  [GoSDK] Change CreateEnvironment to return pointer

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[beam] 01/01: [GoSDK] Change CreateEnvironment to return pointer

Posted by lo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lostluck pushed a commit to branch lostluck-env-pb-pointer
in repository https://gitbox.apache.org/repos/asf/beam.git

commit b5169babe73b958ad90b9f7d0b18ce7c55e958ab
Author: Robert Burke <lo...@users.noreply.github.com>
AuthorDate: Wed Mar 18 15:48:24 2020 -0700

    [GoSDK] Change CreateEnvironment to return pointer
---
 sdks/go/pkg/beam/core/runtime/graphx/translate.go | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sdks/go/pkg/beam/core/runtime/graphx/translate.go b/sdks/go/pkg/beam/core/runtime/graphx/translate.go
index c143487..a2a7ae2 100644
--- a/sdks/go/pkg/beam/core/runtime/graphx/translate.go
+++ b/sdks/go/pkg/beam/core/runtime/graphx/translate.go
@@ -71,8 +71,7 @@ func goCapabilities() []string {
 	return append(capabilities, knownStandardCoders()...)
 }
 
-func CreateEnvironment(ctx context.Context, urn string, extractEnvironmentConfig func(context.Context) string) pb.Environment {
-	var environment pb.Environment
+func CreateEnvironment(ctx context.Context, urn string, extractEnvironmentConfig func(context.Context) string) *pb.Environment {
 	switch urn {
 	case "beam:env:process:v1":
 		// TODO Support process based SDK Harness.
@@ -87,13 +86,12 @@ func CreateEnvironment(ctx context.Context, urn string, extractEnvironmentConfig
 			panic(fmt.Sprintf(
 				"Failed to serialize Environment payload %v for config %v: %v", payload, config, err))
 		}
-		environment = pb.Environment{
+		return &pb.Environment{
 			Urn:          urn,
 			Payload:      serializedPayload,
 			Capabilities: goCapabilities(),
 		}
 	}
-	return environment
 }
 
 // TODO(herohde) 11/6/2017: move some of the configuration into the graph during construction.