MediaWiki
REL1_22
|
Helper class for representing batch file operations. More...
Static Public Member Functions | |
static | attempt (array $performOps, array $opts, FileJournal $journal) |
Attempt to perform a series of file operations. | |
Public Attributes | |
const | MAX_BATCH_SIZE = 1000 |
Static Protected Member Functions | |
static | runParallelBatches (array $pPerformOps, Status $status) |
Attempt a list of file operations sub-batches in series. |
Helper class for representing batch file operations.
Do not use this class from places outside FileBackend.
Methods should avoid throwing exceptions at all costs.
Definition at line 34 of file FileOpBatch.php.
static FileOpBatch::attempt | ( | array $ | performOps, |
array $ | opts, | ||
FileJournal $ | journal | ||
) | [static] |
Attempt to perform a series of file operations.
Callers are responsible for handling file locking.
$opts is an array of options, including:
The resulting Status will be "OK" unless:
array | $performOps | List of FileOp operations |
array | $opts | Batch operation options |
FileJournal | $journal | Journal to log operations to |
Definition at line 57 of file FileOpBatch.php.
References $n, array(), as, empty, FileJournal\getTimestampedUUID(), FileJournal\logChangeBatch(), FileOp\newDependencies(), Status\newGood(), FileOp\newPredicates(), runParallelBatches(), wfProfileIn(), and wfProfileOut().
static FileOpBatch::runParallelBatches | ( | array $ | pPerformOps, |
Status $ | status | ||
) | [static, protected] |
Attempt a list of file operations sub-batches in series.
The operations *in* each sub-batch will be done in parallel. The caller is responsible for making sure the operations within any given sub-batch do not depend on each other. This will abort remaining ops on failure.
Array | $pPerformOps | |
Status | $status |
Definition at line 152 of file FileOpBatch.php.
References array(), as, and Status\merge().
Referenced by attempt().
const FileOpBatch::MAX_BATCH_SIZE = 1000 |
Definition at line 36 of file FileOpBatch.php.