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

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

                Author: ASF GitHub Bot
            Created on: 05/Apr/22 23:09
            Start Date: 05/Apr/22 23:09
    Worklog Time Spent: 10m 
      Work Description: lostluck commented on code in PR #17265:
URL: https://github.com/apache/beam/pull/17265#discussion_r843337249


##########
sdks/go/pkg/beam/core/sdf/continuation.go:
##########
@@ -0,0 +1,62 @@
+// 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
+
+import "time"
+
+// ProcessContinuation is an interface used to signal that a splittable DoFn 
should be
+// split and resumed at a later time. The ProcessContinuation can be returned 
from
+// a DoFn when it returns, either complete or needing to be resumed.
+type ProcessContinuation interface {
+       // ShouldResume returns a boolean indicating whether the process should 
be
+       // resumed at a later time.
+       ShouldResume() bool
+
+       // ResumeDelay returns a suggested time.Duration to wait before 
resuming the
+       // process. The runner is not guaranteed to follow this suggestion.
+       ResumeDelay() time.Duration
+}
+
+// DefaultProcessContinuation is the SDK-default implementation of the 
ProcessContinuation
+// interface, encapsulating the basic behavior necessary to resume a process 
later.
+type DefaultProcessContinuation struct {

Review Comment:
   I don't see any reason to Export this, since the user surface is the 
interface, and this is the only package that could manipulate it. Both helper 
methods are also returning the interface.
   
   Consider unexporting it. Do keep the documentation though.





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

    Worklog Id:     (was: 753143)
    Time Spent: 3.5h  (was: 3h 20m)

> [Go SDK] DoFn Self Checkpointing
> --------------------------------
>
>                 Key: BEAM-11104
>                 URL: https://issues.apache.org/jira/browse/BEAM-11104
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-go
>            Reporter: Robert Burke
>            Priority: P3
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> Allow SplittableDoFns to self checkpoint.
> (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.1#820001)

Reply via email to