1616package internal
1717
1818import (
19- "bytes"
2019 "context"
2120 "errors"
2221 "fmt"
@@ -27,7 +26,6 @@ import (
2726 "sync/atomic"
2827 "time"
2928
30- "github.com/apache/beam/sdks/v2/go/pkg/beam/core/graph/coder"
3129 "github.com/apache/beam/sdks/v2/go/pkg/beam/core/graph/mtime"
3230 "github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/exec"
3331 pipepb "github.com/apache/beam/sdks/v2/go/pkg/beam/model/pipeline_v1"
@@ -277,33 +275,14 @@ func executePipeline(ctx context.Context, wks map[string]*worker.W, j *jobservic
277275 }
278276
279277 // Ensure awareness of the coder used for the teststream.
280- cID , err := lpUnknownCoders (pyld .GetCoderId (), coders , comps .GetCoders ())
278+ _ , err := lpUnknownCoders (pyld .GetCoderId (), coders , comps .GetCoders ())
281279 if err != nil {
282280 panic (err )
283281 }
284282 mayLP := func (v []byte ) []byte {
285283 //slog.Warn("teststream bytes", "value", string(v), "bytes", v)
286284 return v
287285 }
288- // Hack for Java Strings in test stream, since it doesn't encode them correctly.
289- forceLP := cID == "StringUtf8Coder" || cID != pyld .GetCoderId ()
290- if forceLP {
291- // slog.Warn("recoding TestStreamValue", "cID", cID, "newUrn", coders[cID].GetSpec().GetUrn(), "payloadCoder", pyld.GetCoderId(), "oldUrn", coders[pyld.GetCoderId()].GetSpec().GetUrn())
292- // The coder needed length prefixing. For simplicity, add a length prefix to each
293- // encoded element, since we will be sending a length prefixed coder to consume
294- // this anyway. This is simpler than trying to find all the re-written coders after the fact.
295- mayLP = func (v []byte ) []byte {
296- var buf bytes.Buffer
297- if err := coder .EncodeVarInt ((int64 )(len (v )), & buf ); err != nil {
298- panic (err )
299- }
300- if _ , err := buf .Write (v ); err != nil {
301- panic (err )
302- }
303- //slog.Warn("teststream bytes - after LP", "value", string(v), "bytes", buf.Bytes())
304- return buf .Bytes ()
305- }
306- }
307286
308287 tsb := em .AddTestStream (stage .ID , t .Outputs )
309288 for _ , e := range pyld .GetEvents () {
0 commit comments