FileCommit
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
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
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
Return values
booladmitted()
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
Return values
self|nullcommit()
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
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
Return values
DestinationStreamtask()
public
task(int $index) : Part
Parameters
- $index : int