<commit_before><?php

namespace Maghead\Sharding;

use Maghead\Manager\DataSourceManager;

class Chunk
{

    /**
     * @var integer The default hash range 4294967296 = 2 ** 32
     */
    const MAX_KEY = 4294967296;

    const STATUS_OK = 1;

    /**
     * The chunk is current locked.
     */
    const STATUS_LOCKED = 1 << 1;

    /**
     * The chunk is currently migrating..
     */
    const STATUS_MIGRATING = 1 << 2;

    /**
     * The current is currently verifying..
     */
    const STATUS_VERIFYING = 1 << 3;

    /**
     * @var number The main index of the chunk. indexes below this index number
     *             should belongs to this Chunk.
     */
    public $index;

    /**
     * @var number The index where the chunk from
     */
    public $from;

    /**
     * @var string The ID of the shard
     */
    public $shardId;

    private $dataSourceManager;

    protected $status = self::STATUS_OK;

    /**
     * @param nubmer $index the chunk index
     * @param nubmer $from the index starts from. This number is less than $index.
     * @param string $shard the shard ID
     */
    public function __construct($index, $from, $shardId, DataSourceManager $dataSourceManager)
    {
        $this->index  = $index;
        $this->from   = $from;
        $this->shardId  = $shardId;
        $this->dataSourceManager = $dataSourceManager;
    }

    /**
     * Set status of the chunk.
     */
    public function setStatus($status)
    {
        $this->status = $status;
    }<commit_msg>let Chunk extend from ArrayObject<commit_after><?php

namespace Maghead\Sharding;

use Maghead\Manager\DataSourceManager;
use ArrayObject;

class Chunk extends ArrayObject
{
    /**
     * @var integer The default hash range 4294967296 = 2 ** 32
     */
    const MAX_KEY = 4294967296;

    const STATUS_OK = 1;

    /**
     * The chunk is current locked.
     */
    const STATUS_LOCKED = 1 << 1;

    /**
     * The chunk is currently migrating..
     */
    const STATUS_MIGRATING = 1 << 2;

    /**
     * The current is currently verifying..
     */
    const STATUS_VERIFYING = 1 << 3;

    /**
     * @var number The main index of the chunk. indexes below this index number
     *             should belongs to this Chunk.
     */
    // public $index;

    /**
     * @var number The index where the chunk from
     */
    // public $from;

    /**
     * @var string The ID of the shard
     */
    // public $shardId;


    private $dataSourceManager;

    /**
     * @param nubmer $index the chunk index
     * @param nubmer $from the index starts from. This number is less than $index.
     * @param string $shard the shard ID
     */
    public function __construct($index, $from, $shardId, DataSourceManager $dataSourceManager)
    {
        parent::__construct([
            'index' => $index,
            'from' => $from,
            'shardId' => $shardId,
            'status' => self::STATUS_OK,
        ], ArrayObject::ARRAY_AS_PROPS);
        $this->dataSourceManager = $dataSourceManager;
    }

    /**
     * Set status of the chunk.
     */
    public function setStatus($status)
    {
        $this->status = $status;
    }
{'fraction_non_alphanumeric': 0.1114971572962729, 'fraction_numerical': 0.018951358180669616, 'mean_word_length': 1.9933837429111532, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3790898', 'n_tokens_mistral': 1025, 'n_tokens_neox': 946, 'n_words': 295}