Skip to content

Commit

Permalink
[Cleanup] Update pre-v2 go package references (apache#17002)
Browse files Browse the repository at this point in the history
  • Loading branch information
lostluck authored and nancyxu123 committed Mar 9, 2022
1 parent 9ea0607 commit 53c61a2
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion sdks/go/pkg/beam/core/runtime/harness/datamgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ func (w *dataWriter) send(msg *fnpb.Elements) error {
for err == nil {
// Per GRPC stream documentation, if there's an EOF, we must call Recv
// until a non-nil error is returned, to ensure resources are cleaned up.
// https://godoc.org/google.golang.org/grpc#ClientConn.NewStream
// https://pkg.go.dev/google.golang.org/grpc#ClientConn.NewStream
_, err = w.ch.client.Recv()
}
}
Expand Down
2 changes: 1 addition & 1 deletion sdks/go/pkg/beam/core/runtime/harness/datamgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (f *fakeDataClient) Send(*fnpb.Elements) error {
// We skip errors on the first call to test that errors can be returned
// on the sentinel value send in dataWriter.Close
// Otherwise, we return an io.EOF similar to semantics documented
// in https://godoc.org/google.golang.org/grpc#ClientConn.NewStream
// in https://pkg.go.dev/google.golang.org/grpc#ClientConn.NewStream
if f.skipFirstError && f.err != nil {
f.skipFirstError = false
return nil
Expand Down
2 changes: 1 addition & 1 deletion sdks/go/pkg/beam/core/runtime/harness/statemgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func (c *StateChannel) write(ctx context.Context) {
for err == nil {
// Per GRPC stream documentation, if there's an EOF, we must call Recv
// until a non-nil error is returned, to ensure resources are cleaned up.
// https://godoc.org/google.golang.org/grpc#ClientConn.NewStream
// https://pkg.go.dev/google.golang.org/grpc#ClientConn.NewStream
_, err = c.client.Recv()
}
}
Expand Down
2 changes: 1 addition & 1 deletion sdks/go/pkg/beam/util/gcsx/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
)

// NewClient creates a new GCS client with default application credentials, and supplied
// OAuth scope. The OAuth scopes are defined in https://godoc.org/cloud.google.com/go/storage#pkg-constants.
// OAuth scope. The OAuth scopes are defined in https://pkg.go.dev/cloud.google.com/go/storage#pkg-constants.
func NewClient(ctx context.Context, scope string) (*storage.Client, error) {
return storage.NewClient(ctx, option.WithScopes(scope))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6982,7 +6982,7 @@ When an SDK-specific wrapper isn't available, you will have to access the cross-
#### 13.2.3. Using cross-language transforms in a Go pipeline
If a Go-specific wrapper for a cross-language is available, use that. Otherwise, you have to use the
lower-level [CrossLanguage](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam#CrossLanguage)
lower-level [CrossLanguage](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam#CrossLanguage)
function to access the transform.
**Expansion Services**
Expand Down Expand Up @@ -7021,10 +7021,10 @@ When an SDK-specific wrapper isn't available, you will have to access the cross-
Refer to [Creating cross-language transforms](#create-x-lang-transforms) for details.
3. Use the `beam.CrossLanguage` function in your pipeline as appropriate. Reference the URN, payload,
expansion service address, and define inputs and outputs. You can use the
[beam.CrossLanguagePayload](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam#CrossLanguagePayload)
[beam.CrossLanguagePayload](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam#CrossLanguagePayload)
function as a helper for encoding a payload. You can use the
[beam.UnnamedInput](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam#UnnamedInput) and
[beam.UnnamedOutput](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam#UnnamedOutput)
[beam.UnnamedInput](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam#UnnamedInput) and
[beam.UnnamedOutput](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam#UnnamedOutput)
functions as shortcuts for single, unnamed inputs/outputs or define a map for named ones.
```go
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ complexity. Beam Katas are available for both Java and Python SDKs.

* **[Java API Reference](https://beam.apache.org/documentation/sdks/javadoc/)** - Official API Reference for the Java SDK.
* **[Python API Reference](https://beam.apache.org/documentation/sdks/pydoc/)** - Official API Reference for the Python SDK.
* **[Go API Reference](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam)** - Official API Reference for the Go SDK.
* **[Go API Reference](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam)** - Official API Reference for the Go SDK.

## Feedback and Suggestions {#feedback-and-suggestions}

Expand Down
2 changes: 1 addition & 1 deletion website/www/site/content/en/documentation/sdks/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ It is based on the following [design](https://s.apache.org/beam-go-sdk-design-rf

Get started with the [Beam Go SDK quickstart](/get-started/quickstart-go) to set up your development environment and run an example pipeline. Then, read through the [Beam programming guide](/documentation/programming-guide) to learn the basic concepts that apply to all SDKs in Beam.

See the [godoc](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam) for more detailed information.
See the [godoc](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam) for more detailed information.

## Status

Expand Down
8 changes: 4 additions & 4 deletions website/www/site/content/en/get-started/quickstart-go.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ required arguments described in the examples.
For example, to run `wordcount`, run:

{{< runner direct >}}
$ go install github.com/apache/beam/sdks/go/examples/wordcount
$ go install github.com/apache/beam/sdks/v2/go/examples/wordcount
$ wordcount --input <PATH_TO_INPUT_FILE> --output counts
{{< /runner >}}

{{< runner dataflow >}}
$ go install github.com/apache/beam/sdks/go/examples/wordcount
$ go install github.com/apache/beam/sdks/v2/go/examples/wordcount
# As part of the initial setup, for non linux users - install package unix before run
$ go get -u golang.org/x/sys/unix
$ wordcount --input gs://dataflow-samples/shakespeare/kinglear.txt \
Expand All @@ -75,7 +75,7 @@ $ wordcount --input gs://dataflow-samples/shakespeare/kinglear.txt \
$ ./gradlew :runners:spark:3:job-server:runShadow -PsparkMasterUrl=spark://localhost:7077

# In a separate terminal, run:
$ go install github.com/apache/beam/sdks/go/examples/wordcount
$ go install github.com/apache/beam/sdks/v2/go/examples/wordcount
$ wordcount --input <PATH_TO_INPUT_FILE> \
--output counts \
--runner spark \
Expand All @@ -85,7 +85,7 @@ $ wordcount --input <PATH_TO_INPUT_FILE> \
## Next Steps

* Learn more about the [Beam SDK for Go](/documentation/sdks/go/)
and look through the [godoc](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam).
and look through the [godoc](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam).
* Walk through these WordCount examples in the [WordCount Example Walkthrough](/get-started/wordcount-example).
* Take a self-paced tour through our [Learning Resources](/documentation/resources/learning-resources).
* Dive in to some of our favorite [Videos and Podcasts](/documentation/resources/videos-and-podcasts).
Expand Down
10 changes: 5 additions & 5 deletions website/www/site/content/en/get-started/try-apache-beam.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ import (
"fmt"
"regexp"

"github.com/apache/beam/sdks/go/pkg/beam"
"github.com/apache/beam/sdks/go/pkg/beam/io/textio"
"github.com/apache/beam/sdks/go/pkg/beam/runners/direct"
"github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
"github.com/apache/beam/sdks/v2/go/pkg/beam"
"github.com/apache/beam/sdks/v2/go/pkg/beam/io/textio"
"github.com/apache/beam/sdks/v2/go/pkg/beam/runners/direct"
"github.com/apache/beam/sdks/v2/go/pkg/beam/transforms/stats"

_ "github.com/apache/beam/sdks/go/pkg/beam/io/filesystem/local"
_ "github.com/apache/beam/sdks/v2/go/pkg/beam/io/filesystem/local"
)

var (
Expand Down
14 changes: 7 additions & 7 deletions website/www/site/content/en/get-started/wordcount-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ python -m apache_beam.examples.wordcount_minimal --input YOUR_INPUT_FILE --outpu
{{< /highlight >}}

{{< highlight go >}}
$ go install github.com/apache/beam/sdks/go/examples/minimal_wordcount
$ go install github.com/apache/beam/sdks/v2/go/examples/minimal_wordcount
$ minimal_wordcount
{{< /highlight >}}

Expand Down Expand Up @@ -434,7 +434,7 @@ To view the full code in Python, see
**To run this example in Go:**

{{< runner direct >}}
$ go install github.com/apache/beam/sdks/go/examples/wordcount
$ go install github.com/apache/beam/sdks/v2/go/examples/wordcount
$ wordcount --input <PATH_TO_INPUT_FILE> --output counts
{{< /runner >}}

Expand All @@ -451,7 +451,7 @@ This runner is not yet available for the Go SDK.
{{< /runner >}}

{{< runner dataflow >}}
$ go install github.com/apache/beam/sdks/go/examples/wordcount
$ go install github.com/apache/beam/sdks/v2/go/examples/wordcount
# As part of the initial setup, for non linux users - install package unix before run
$ go get -u golang.org/x/sys/unix
$ wordcount --input gs://dataflow-samples/shakespeare/kinglear.txt \
Expand Down Expand Up @@ -760,7 +760,7 @@ To view the full code in Python, see
**To run this example in Go:**

{{< runner direct >}}
$ go install github.com/apache/beam/sdks/go/examples/debugging_wordcount
$ go install github.com/apache/beam/sdks/v2/go/examples/debugging_wordcount
$ debugging_wordcount --input <PATH_TO_INPUT_FILE> --output counts
{{< /runner >}}

Expand All @@ -777,7 +777,7 @@ This runner is not yet available for the Go SDK.
{{< /runner >}}

{{< runner dataflow >}}
$ go install github.com/apache/beam/sdks/go/examples/debugging_wordcount
$ go install github.com/apache/beam/sdks/v2/go/examples/debugging_wordcount
# As part of the initial setup, for non linux users - install package unix before run
$ go get -u golang.org/x/sys/unix
$ debugging_wordcount --input gs://dataflow-samples/shakespeare/kinglear.txt \
Expand Down Expand Up @@ -1088,7 +1088,7 @@ To view the full code in Python, see
**To run this example in Go:**

{{< runner direct >}}
$ go install github.com/apache/beam/sdks/go/examples/windowed_wordcount
$ go install github.com/apache/beam/sdks/v2/go/examples/windowed_wordcount
$ windowed_wordcount --input <PATH_TO_INPUT_FILE> --output counts
{{< /runner >}}

Expand All @@ -1105,7 +1105,7 @@ This runner is not yet available for the Go SDK.
{{< /runner >}}

{{< runner dataflow >}}
$ go install github.com/apache/beam/sdks/go/examples/windowed_wordcount
$ go install github.com/apache/beam/sdks/v2/go/examples/windowed_wordcount
# As part of the initial setup, for non linux users - install package unix before run
$ go get -u golang.org/x/sys/unix
$ windowed_wordcount --input gs://dataflow-samples/shakespeare/kinglear.txt \
Expand Down

0 comments on commit 53c61a2

Please sign in to comment.