protected function initialize()
    {
        if ($this->handle !== null) {
            return;
        }

        $this->handle = fopen($this->filename, 'w');
        fwrite($this->handle, "[\n");
        fwrite($this->handle, json_encode($this->metadata));
    }