[ https://issues.apache.org/jira/browse/BEAM-11104?focusedWorklogId=753473&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-753473 ]
ASF GitHub Bot logged work on BEAM-11104: ----------------------------------------- Author: ASF GitHub Bot Created on: 06/Apr/22 15:48 Start Date: 06/Apr/22 15:48 Worklog Time Spent: 10m Work Description: jrmccluskey commented on code in PR #17265: URL: https://github.com/apache/beam/pull/17265#discussion_r844110032 ########## 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: Unexported structs being accessible through interfaces tripped me up here, no reason to have this exported. You're right. Fixed. Issue Time Tracking ------------------- Worklog Id: (was: 753473) Time Spent: 4h 10m (was: 4h) > [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: 4h 10m > 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)