Example #1
0
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @file
 * @ingroup Maintenance
 * @see wfWaitForSlaves()
 */
require __DIR__ . '/../commandLine.inc';
if (count($args) < 1) {
    echo "Usage: php trackBlobs.php <cluster> [... <cluster>]\n";
    echo "Adds blobs from a given ES cluster to the blob_tracking table\n";
    echo "Automatically deletes the tracking table and starts from the start again when restarted.\n";
    exit(1);
}
$tracker = new TrackBlobs($args);
$tracker->run();
echo "All done.\n";
class TrackBlobs
{
    var $clusters, $textClause;
    var $doBlobOrphans;
    var $trackedBlobs = array();
    var $batchSize = 1000;
    var $reportingInterval = 10;
    function __construct($clusters)
    {
        $this->clusters = $clusters;
        if (extension_loaded('gmp')) {
            $this->doBlobOrphans = true;
            foreach ($clusters as $cluster) {
Example #2
0
<?php

require dirname(__FILE__) . '/../commandLine.inc';
if (count($args) < 1) {
    echo "Usage: php trackBlobs.php <cluster> [... <cluster>]\n";
    echo "Adds blobs from a given ES cluster to the blob_tracking table\n";
    echo "Automatically deletes the tracking table and starts from the start again when restarted.\n";
    exit(1);
}
$tracker = new TrackBlobs($args);
$tracker->trackBlobs();
class TrackBlobs
{
    var $clusters, $textClause;
    var $doBlobOrphans;
    var $trackedBlobs = array();
    var $batchSize = 1000;
    var $reportingInterval = 10;
    function __construct($clusters)
    {
        $this->clusters = $clusters;
        if (extension_loaded('gmp')) {
            $this->doBlobOrphans = true;
            foreach ($clusters as $cluster) {
                $this->trackedBlobs[$cluster] = gmp_init(0);
            }
        } else {
            echo "Warning: the gmp extension is needed to find orphan blobs\n";
        }
    }
    function trackBlobs()