[FileBackend] Removed obsolete "allowStale" parameter.
* This was obsoleted by doQuickOperations(). Change-Id: I9e1d9c1e1c910e4ce6de4317299424305b31469c
This commit is contained in:
parent
472f0ecaca
commit
69b24f9a63
3 changed files with 2 additions and 22 deletions
|
|
@ -279,9 +279,6 @@ abstract class FileBackend {
|
|||
* - nonLocking : No locks are acquired for the operations.
|
||||
* This can increase performance for non-critical writes.
|
||||
* This has no effect unless the 'force' flag is set.
|
||||
* - allowStale : Don't require the latest available data.
|
||||
* This can increase performance for non-critical writes.
|
||||
* This has no effect unless the 'force' flag is set.
|
||||
* - nonJournaled : Don't log this operation batch in the file journal.
|
||||
* This limits the ability of recovery scripts.
|
||||
* - parallelize : Try to do operations in parallel when possible.
|
||||
|
|
@ -315,7 +312,6 @@ abstract class FileBackend {
|
|||
}
|
||||
if ( empty( $opts['force'] ) ) { // sanity
|
||||
unset( $opts['nonLocking'] );
|
||||
unset( $opts['allowStale'] );
|
||||
}
|
||||
return $this->doOperationsInternal( $ops, $opts );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ abstract class FileOp {
|
|||
protected $state = self::STATE_NEW; // integer
|
||||
protected $failed = false; // boolean
|
||||
protected $async = false; // boolean
|
||||
protected $useLatest = true; // boolean
|
||||
protected $batchId; // string
|
||||
|
||||
protected $doOperation = true; // boolean; operation is not a no-op
|
||||
|
|
@ -124,16 +123,6 @@ abstract class FileOp {
|
|||
$this->batchId = $batchId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to allow stale data for file reads and stat checks
|
||||
*
|
||||
* @param $allowStale bool
|
||||
* @return void
|
||||
*/
|
||||
final public function allowStaleReads( $allowStale ) {
|
||||
$this->useLatest = !$allowStale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of the parameter with the given name
|
||||
*
|
||||
|
|
@ -411,7 +400,7 @@ abstract class FileOp {
|
|||
if ( isset( $predicates['exists'][$source] ) ) {
|
||||
return $predicates['exists'][$source]; // previous op assures this
|
||||
} else {
|
||||
$params = array( 'src' => $source, 'latest' => $this->useLatest );
|
||||
$params = array( 'src' => $source, 'latest' => true );
|
||||
return $this->backend->fileExists( $params );
|
||||
}
|
||||
}
|
||||
|
|
@ -429,7 +418,7 @@ abstract class FileOp {
|
|||
} elseif ( isset( $predicates['exists'][$source] ) && !$predicates['exists'][$source] ) {
|
||||
return false; // previous op assures this
|
||||
} else {
|
||||
$params = array( 'src' => $source, 'latest' => $this->useLatest );
|
||||
$params = array( 'src' => $source, 'latest' => true );
|
||||
return $this->backend->getFileSha1Base36( $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,9 +42,6 @@ class FileOpBatch {
|
|||
* $opts is an array of options, including:
|
||||
* - force : Errors that would normally cause a rollback do not.
|
||||
* The remaining operations are still attempted if any fail.
|
||||
* - allowStale : Don't require the latest available data.
|
||||
* This can increase performance for non-critical writes.
|
||||
* This has no effect unless the 'force' flag is set.
|
||||
* - nonJournaled : Don't log this operation batch in the file journal.
|
||||
* - concurrency : Try to do this many operations in parallel when possible.
|
||||
*
|
||||
|
|
@ -69,7 +66,6 @@ class FileOpBatch {
|
|||
}
|
||||
|
||||
$batchId = $journal->getTimestampedUUID();
|
||||
$allowStale = !empty( $opts['allowStale'] );
|
||||
$ignoreErrors = !empty( $opts['force'] );
|
||||
$journaled = empty( $opts['nonJournaled'] );
|
||||
$maxConcurrency = isset( $opts['concurrency'] ) ? $opts['concurrency'] : 1;
|
||||
|
|
@ -84,7 +80,6 @@ class FileOpBatch {
|
|||
foreach ( $performOps as $index => $fileOp ) {
|
||||
$backendName = $fileOp->getBackend()->getName();
|
||||
$fileOp->setBatchId( $batchId ); // transaction ID
|
||||
$fileOp->allowStaleReads( $allowStale ); // consistency level
|
||||
// Decide if this op can be done concurrently within this sub-batch
|
||||
// or if a new concurrent sub-batch must be started after this one...
|
||||
if ( $fileOp->dependsOn( $curBatchDeps )
|
||||
|
|
|
|||
Loading…
Reference in a new issue