Flow PHP

FileCommit

FinalYes

Methods

__construct()  : mixed
abort()  : void
Closes every stream, then removes what this write produced: a task its own staged files, the job every staged file and what it created in place. The first close failure is rethrown after.
admit()  : bool
The save mode's decision over the whole destination; a write that is not admitted writes nothing.
admitted()  : self|null
The job commit of a write as $tasks tasks of run $run; null when the save mode does not admit the destination.
commit()  : void
Every file tasks $tasks staged moves to its place under the root in task-index order, then Overwrite removes the stale files the moved ones replace, and the temporary output goes. A move that fails leaves the old files in place: a failed commit duplicates, it never loses. A task whose result never arrived commits nothing.
open()  : DestinationStream
The stream to write $partitions to: under the temporary output for a task and for a write that replaces files, in place otherwise (an Append beside an existing file gets the run in its name).
task()  : Part

Methods

__construct()

public __construct(Filesystem $filesystem, Path $destination, SaveMode $saveMode, non-empty-string $run[, int<1, max> $tasks = 1 ][, null|Part $task = null ]) : mixed
Parameters
$filesystem : Filesystem
$destination : Path

the destination as given, {part} unfilled

$saveMode : SaveMode
$run : non-empty-string
$tasks : int<1, max> = 1
$task : null|Part = null

the task a shipped loader writes as; null for the job (a serial write, or the parent of a parallel one)

Tags
throws
RuntimeException

when the destination has no extension, or is a pattern without partition placeholders

abort()

Closes every stream, then removes what this write produced: a task its own staged files, the job every staged file and what it created in place. The first close failure is rethrown after.

public abort() : void
Tags
throws
Throwable

admit()

The save mode's decision over the whole destination; a write that is not admitted writes nothing.

public admit(bool $partitioned) : bool
Parameters
$partitioned : bool

the files sit in partition directories under the static root

Tags
throws
RuntimeException
Return values
bool

admitted()

The job commit of a write as $tasks tasks of run $run; null when the save mode does not admit the destination.

public static admitted(Filesystem $filesystem, Path $destination, SaveMode $saveMode, bool $partitioned, non-empty-string $run, int<1, max> $tasks) : self|null
Parameters
$filesystem : Filesystem
$destination : Path
$saveMode : SaveMode
$partitioned : bool

the files sit in partition directories under the static root

$run : non-empty-string
$tasks : int<1, max>
Tags
throws
RuntimeException
Return values
self|null

commit()

Every file tasks $tasks staged moves to its place under the root in task-index order, then Overwrite removes the stale files the moved ones replace, and the temporary output goes. A move that fails leaves the old files in place: a failed commit duplicates, it never loses. A task whose result never arrived commits nothing.

public commit(array<int, int> $tasks) : void
Parameters
$tasks : array<int, int>

the indices of the tasks whose results arrived

Tags
throws
Throwable

open()

The stream to write $partitions to: under the temporary output for a task and for a write that replaces files, in place otherwise (an Append beside an existing file gets the run in its name).

public open([array<string|int, Partition> $partitions = [] ]) : DestinationStream
Parameters
$partitions : array<string|int, Partition> = []
Tags
throws
RuntimeException
Return values
DestinationStream
On this page

Search results