Initialize disk threads
        :param Uploader self: this
775942
def _initialize_disk_threads(self):
        # type: (Uploader) -> None
        
        logger.debug('spawning {} disk threads'.format(
            self._general_options.concurrency.disk_threads))
        for _ in range(self._general_options.concurrency.disk_threads):
            thr = threading.Thread(target=self._worker_thread_upload)
            self._disk_threads.append(thr)
            thr.start()
539299
def _flush(self):
        
        # Initialize multipart upload
        if self._upload_id is None:
            with _handle_oss_error():
                self._upload_id = self._bucket.init_multipart_upload(
                    self._key).upload_id

        # Upload part with workers
        response = self._workers.submit(
            self._bucket.upload_part, key=self._key, upload_id=self._upload_id,
            part_number=self._seek, data=self._get_buffer().tobytes())

        # Save part information
        self._write_futures.append(
            dict(response=response, part_number=self._seek))
594551
def run(self):
        '''
        
        '''
        salt.utils.process.appendproctitle(self.__class__.__name__)
        # Clean out the fileserver backend cache
        salt.daemons.masterapi.clean_fsbackend(self.opts)

        for interval in self.buckets:
            self.update_threads[interval] = threading.Thread(
                target=self.update_fileserver,
                args=(interval, self.buckets[interval]),
            )
            self.update_threads[interval].start()

        # Keep the process alive
        while True:
            time.sleep(60)
976385
def initialize_check_thread(self, check_func):
        # type: (_MultiprocessOffload, function) -> None
        
        self._check_thread = threading.Thread(target=check_func)
        self._check_thread.start()
537958
def __init_chunked_upload(self):
        """"""

        # note: string conversion required here due to open encoding bug in requests-oauthlib.
        headers = {
            'x-ton-content-type': self.content_type,
            'x-ton-content-length': str(self._file_size),
            'x-ton-expires': http_time(self.options.get('x-ton-expires', self._DEFAULT_EXPIRE)),
            'content-length': str(0),
            'content-type': self.content_type
        }

        resource = "{0}{1}?resumable=true".format(self._DEFAULT_RESOURCE, self._DEFAULT_BUCKET)

        return Request(self._client, 'post', resource,
                       domain=self._DEFAULT_DOMAIN, headers=headers).perform()
862526
private static function init() {
		ob_start();
		set_time_limit(0);
		ini_set('memory_limit', '256M');

		ini_set('upload_max_filesize', '128M');
		ini_set('post_max_size', '256M');
		ini_set('max_input_time', '7200');
		ini_set('max_execution_time', '0');
		ini_set('expect.timeout', '7200');
		ini_set('default_socket_timeout', '7200');
		ob_end_clean();
	}
574729
public void init(IPersistentSubscriptionStore storageService) {
        Log.debug("init invoked");

        m_storageService = storageService;

        //reload any subscriptions persisted
        if (Log.DEBUG) {
            Log.debug("Reloading all stored subscriptions...subscription tree before {}", dumpTree());
        }
        
        for (Subscription subscription : m_storageService.retrieveAllSubscriptions()) {
            Log.debug("Re-subscribing {} to topic {}", subscription.getClientId(), subscription.getTopic());
            addDirect(subscription);
        }
        if (Log.DEBUG) {
            Log.debug("Finished loading. Subscription tree after {}", dumpTree());
        }
    }
987283
protected function initLoader()
    {
        $this->versionParser = new VersionParser();

        if (!$this->loader) {
            $this->loader = new ArrayLoader($this->versionParser);
        }
    }
917584
public void initialise(File[] files, ClassLoader loader) throws MalformedURLException {
        _loader= loader;
        
        // TODO: remove this debugging stuff
        _filters= new LinkedList<IFilter>();
        _filters.add(new IgnoreFilter());
        _filters.add(new ServiceFilter());
//        _filters.add(new AgentElementFilter());
//        _filters.add(new NodeFilter());
//        _filters.add(new AgentFilter());
        
        // initialise enumerators
        _classEnumerations= new LinkedList<Enumeration<Class<?>>>();
        for(File current : files) {
            if(current.isDirectory()) {
                _classEnumerations.add(new DirectoryClassEnumerator(current, _loader));
            } else {
                _classEnumerations.add(new ArchiveClassEnumerator(current, _loader));
            }
        }
    }
381692
def set_uploading(self, files_uploaded):
        
        self.files_uploaded = files_uploaded
        self.__record_progress(Status.UPLOADING_FILES)
255304
def _setup_async_flusher
      # stop and remove any existing async flusher instance
      if @async_flusher
        @async_flusher.stop
        @async_flusher = nil
        Thread.pass
      end

      # create a new async flusher if we have a valid flush period
      if @flush_period || async?
        @auto_flushing = DEFAULT_BUFFER_SIZE unless @auto_flushing > 1
        @async_flusher = AsyncFlusher.new(self, @flush_period)
        @async_flusher.start
        Thread.pass
      end

      nil
    end
672026
async def _init_writer(self):
        
        async with self._initialization_lock:
            if not self.initialized:
                self.stream = await aiofiles.open(
                    file=self.absolute_file_path,
                    mode=self.mode,
                    encoding=self.encoding,
                    loop=self.loop,
                )
779589
def Open(self):
    
    if self._is_open:
      raise IOError('Storage writer already opened.')

    self._is_open = True

    self._first_written_event_source_index = len(self._event_sources)
    self._written_event_source_index = self._first_written_event_source_index
239070
def initialize(self, timestamp=None, user=None, comment=None,
                   filename=None, source=None, size=None):

        self.timestamp = none_or(timestamp, Timestamp)
        

        self.user = none_or(user, User)
        """
        Contributing user metadata : :class:`~mwtypes.User`
        """

        self.comment = none_or(comment, str)
        """
        Comment left with upload : str | None
        """

        self.filename = none_or(filename, str)
        """
        File name without "File:" prefix and "_" instead of spaces : str | None
        """

        self.source = none_or(source, str)
        """
        A URI : str | None
        """

        self.size = none_or(size, int)
        """
        Number of bytes of content : int | None
        """
242362
def _worker_thread_transfer(self):
        # type: (Downloader) -> None
        
        max_set_len = self._general_options.concurrency.disk_threads << 2
        while not self.termination_check:
            try:
                if len(self._disk_set) > max_set_len:
                    time.sleep(0.1)
                    continue
                else:
                    dd = self._transfer_queue.get(block=False, timeout=0.1)
            except queue.Empty:
                continue
            try:
                self._process_download_descriptor(dd)
            except Exception as e:
                with self._transfer_lock:
                    self._exceptions.append(e)
127691
private void init() throws IOException {
        if (initialized.compareAndSet(false, true)) {
            log.debug("Init: {}", mode);
            // if the path is null, the consumer has been uninitialized
            if (path != null) {
                if (log.isDebugEnabled()) {
                    Path parent = path.getParent();
                    log.debug("Parent abs: {} dir: {}", parent.isAbsolute(), Files.isDirectory(parent));
                }
                if (IClientStream.MODE_APPEND.equals(mode)) {
                    if (Files.notExists(path)) {
                        throw new IOException("File to be appended doesnt exist, verify the record mode");
                    }
                    log.debug("Path: {}\nRead: {} write: {} size: {}", path, Files.isReadable(path), Files.isWritable(path), Files.size(path));
                    writer = new FLVWriter(path, true);
                } else if (IClientStream.MODE_RECORD.equals(mode)) {
                    try {
                        // delete existing file
                        if (Files.deleteIfExists(path)) {
                            log.debug("File deleted");
                        }
                        // ensure parent dirs exist
                        Files.createDirectories(path.getParent());
                        // create the file
                        path = Files.createFile(path);
                    } catch (IOException ioe) {
                        log.error("File creation error: {}", ioe);
                    }
                    if (!Files.isWritable(path)) {
                        throw new IOException("File is not writable");
                    }
                    log.debug("Path: {}\nRead: {} write: {}", path, Files.isReadable(path), Files.isWritable(path));
                    writer = new FLVWriter(path, false);
                } else {
                    try {
                        // delete existing file since we're not recording nor appending
                        if (Files.deleteIfExists(path)) {
                            log.debug("File deleted");
                        }
                    } catch (IOException ioe) {
                        log.error("File creation error: {}", ioe);
                    }
                }
            } else {
                log.warn("Consumer is uninitialized");
            }
            log.debug("Init - complete");
        }
    }
373369
def _create_worker(self, method, *args, **kwargs):
        """"""
        thread = QThread()
        worker = RequestsDownloadWorker(method, args, kwargs)
        worker.moveToThread(thread)
        worker.sig_finished.connect(self._start)
        self._sig_download_finished.connect(worker.sig_download_finished)
        self._sig_download_progress.connect(worker.sig_download_progress)
        worker.sig_finished.connect(thread.quit)
        thread.started.connect(worker.start)
        self._queue.append(thread)
        self._threads.append(thread)
        self._workers.append(worker)
        self._start()
        return worker