Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
Signed-off-by: Sidhant Kohli <[email protected]>
  • Loading branch information
Sidhant Kohli committed Jul 2, 2024
1 parent db01722 commit f3cc8d6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/batchmapper/examples/batchmap-flatmap/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module flatmap

go 1.20
go 1.22

replace github.com/numaproj/numaflow-go => ../../../..

require github.com/numaproj/numaflow-go v0.7.0-rc2
require github.com/numaproj/numaflow-go v0.8.0

require (
github.com/golang/protobuf v1.5.3 // indirect
Expand Down
2 changes: 0 additions & 2 deletions pkg/batchmapper/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ type server struct {
}

// NewServer creates a new batch map server.
// TODO(map-batch): as this would be a streaming server should we see if there are some options (like maxMessageSize)
// which are different than unary server which are optimal for this use case.
func NewServer(m BatchMapper, inputOptions ...Option) numaflow.Server {
opts := defaultOptions()
for _, inputOption := range inputOptions {
Expand Down
5 changes: 1 addition & 4 deletions pkg/batchmapper/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package batchmapper

import (
"context"
"fmt"
"io"
"log"

Expand Down Expand Up @@ -58,11 +57,9 @@ func (fs *Service) BatchMapFn(stream batchmappb.BatchMap_BatchMapFnServer) error
// If the number of responses received does not align with the request batch size,
// we will not be able to process the data correctly.
// This should be marked as an error and shown to the user.
// TODO(map-batch): We could potentially panic here as well
if len(responses.Items()) != len(datums) {
errMsg := "batchMapFn: mismatch between length of batch requests and responses"
log.Println(errMsg)
return fmt.Errorf(errMsg)
log.Panic(errMsg)
}

// iterate over the responses received and covert to the required proto format
Expand Down

0 comments on commit f3cc8d6

Please sign in to comment.