[ 
https://issues.apache.org/jira/browse/BEAM-11106?focusedWorklogId=762449&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-762449
 ]

ASF GitHub Bot logged work on BEAM-11106:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Apr/22 17:41
            Start Date: 26/Apr/22 17:41
    Worklog Time Spent: 10m 
      Work Description: riteshghorse commented on code in PR #17432:
URL: https://github.com/apache/beam/pull/17432#discussion_r858986882


##########
sdks/go/pkg/beam/core/runtime/exec/sdf_invokers.go:
##########
@@ -351,3 +352,84 @@ func (n *cweInvoker) Reset() {
                n.args[i] = nil
        }
 }
+
+// trInvoker is an invoker for TruncateRestriction.
+type trInvoker struct {
+       fn   *funcx.Fn
+       args []interface{}
+       call func(elms *FullValue, rest interface{}) (pair interface{})
+}
+
+var offsetrangeTracker = reflect.TypeOf((*offsetrange.Tracker)(nil)).Elem()
+
+// var growableOffsetRangeTracker = 
reflect.TypeOf((*growable_offsetrange.Tracker)(nil))
+
+func DefaultTruncateRestriction(restTracker interface{}) (newRest interface{}) 
{
+       switch restTracker.(type) {
+       case *offsetrange.Tracker:
+               return 
restTracker.(*offsetrange.Tracker).GetRestriction().(offsetrange.Restriction) 
// since offsetrange has a bounded restriction
+       default:
+               return nil

Review Comment:
   Yeah, it should be that generically. Since `offsetrange` has `IsBounded()` 
set to return `true` always, I wrote it that way. But it'll be changed to a 
generic way in the next commit.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 762449)
    Time Spent: 1h 40m  (was: 1.5h)

> [Go SDK] Truncating SDFs during drain
> -------------------------------------
>
>                 Key: BEAM-11106
>                 URL: https://issues.apache.org/jira/browse/BEAM-11106
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-go
>            Reporter: Robert Burke
>            Assignee: Ritesh Ghorse
>            Priority: P3
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Allow SDFs to specify a restriction truncation method to permit faster drains.
> (To be updated once [https://github.com/apache/beam/pull/13160] is merged and 
> the programming guide updated with SDF content.)



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to