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

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

                Author: ASF GitHub Bot
            Created on: 23/Mar/20 23:02
            Start Date: 23/Mar/20 23:02
    Worklog Time Spent: 10m 
      Work Description: lostluck commented on pull request #11188: [BEAM-3301] 
Adding restriction trackers and validation.
URL: https://github.com/apache/beam/pull/11188#discussion_r396804143
 
 

 ##########
 File path: sdks/go/pkg/beam/core/sdf/sdf.go
 ##########
 @@ -0,0 +1,74 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package sdf is experimental, incomplete, and not yet meant for general 
usage.
+package sdf
+
+// RTracker is an interface used to interact with restrictions while 
processing elements in
+// SplittableDoFns. Each implementation of RTracker is expected to be used for 
tracking a single
+// restriction type, which is the type that should be used to create the 
RTracker, and output by
+// TrySplit.
+type RTracker interface {
+       // TryClaim attempts to claim the block of work in the current 
restriction located at a given
+       // position. This method must be used in the ProcessElement method of 
Splittable DoFns to claim
+       // work before performing it. If no work is claimed, the ProcessElement 
is not allowed to perform
+       // work or emit outputs. If the claim is successful, the DoFn must 
process the entire block. If
+       // the claim is unsuccessful the ProcessElement method of the DoFn must 
return without performing
+       // any additional work or emitting any outputs.
+       //
+       // TryClaim accepts an arbitrary value that can be interpreted as the 
position of a block, and
+       // returns a boolean indicating whether the claim succeeded.
+       //
+       // If the claim fails due to an error, that error can be retrieved with 
GetError.
+       //
+       // For SDFs to work properly, claims must always be monotonically 
increasing in reference to the
+       // restriction's start and end points, and every block of work in a 
restriction must be claimed.
+       //
+       // This pseudocode example illustrates the typical usage of TryClaim:
+       //
+       //      pos = position of first block after restriction.start
+       //      for TryClaim(pos) == true {
+       //              // Do all work in the claimed block and emit outputs.
+       //              pos = position of next block
+       //      }
+       //      return
+       TryClaim(pos interface{}) (ok bool)
+
+       // GetError returns the error that made this RTracker stop executing, 
and it returns null if no
 
 Review comment:
   returns nil*
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 408380)
    Time Spent: 9h  (was: 8h 50m)

> Go SplittableDoFn support
> -------------------------
>
>                 Key: BEAM-3301
>                 URL: https://issues.apache.org/jira/browse/BEAM-3301
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-go
>            Reporter: Henning Rohde
>            Assignee: Daniel Oliveira
>            Priority: Major
>          Time Spent: 9h
>  Remaining Estimate: 0h
>
> SDFs will be the only way to add streaming and liquid sharded IO for Go.
> Design doc: https://s.apache.org/splittable-do-fn



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to