+ return $this->collectPledgeQuorum(
+ $bucket,
+ function ( $lockSrv ) use ( $pathsByType ) {
+ return $this->getLocksOnServer( $lockSrv, $pathsByType );
+ }
+ );
+ }
+
+ /**
+ * Attempt to release locks with the peers for a bucket
+ *
+ * @param int $bucket
+ * @param array $pathsByType Map of LockManager::LOCK_* constants to lists of paths
+ * @return StatusValue
+ */
+ final protected function doUnlockingRequestBucket( $bucket, array $pathsByType ) {
+ return $this->releasePledges(
+ $bucket,
+ function ( $lockSrv ) use ( $pathsByType ) {
+ return $this->freeLocksOnServer( $lockSrv, $pathsByType );
+ }
+ );
+ }
+
+ /**
+ * Attempt to acquire pledges with the peers for a bucket.
+ * This is all or nothing; if any key is already pledged then this totally fails.
+ *
+ * @param int $bucket
+ * @param callable $callback Pledge method taking a server name and yeilding a StatusValue
+ * @return StatusValue
+ */
+ final protected function collectPledgeQuorum( $bucket, callable $callback ) {