Read BstoreContainer record (Blip Store Container)
502479
private function readBstoreContainer()
    {
        $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
        $recordData = substr($this->data, $this->pos + 8, $length);

        // move stream pointer to next record
        $this->pos += 8 + $length;

        // record is a container, read contents
        $bstoreContainer = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer();
        $this->object->setBstoreContainer($bstoreContainer);
        $reader = new PHPExcel_Reader_Excel5_Escher($bstoreContainer);
        $reader->load($recordData);
    }
198004
def _scan(self):
        
        utt_sizes = {}

        for dset_name in self.utt_ids:
            per_container = []

            for cnt in self.containers:
                dset = cnt._file[dset_name]
                dtype_size = dset.dtype.itemsize

                record_size = dtype_size * dset.size
                per_container.append(record_size)

            utt_size = sum(per_container)

            if utt_size > self.partition_size:
                raise ValueError('Records in "{0}" are larger than the partition size'.format(dset_name))

            utt_sizes[dset_name] = utt_size

        return utt_sizes
657732
public LocalFsBlobStoreFile read(String key) throws IOException {
        return new LocalFsBlobStoreFile(getKeyDir(key), BlobStoreFile.BLOBSTORE_DATA_FILE);
    }
743144
private function readDggContainer()
    {
        $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
        $recordData = substr($this->data, $this->pos + 8, $length);

        // move stream pointer to next record
        $this->pos += 8 + $length;

        // record is a container, read contents
        $dggContainer = new PHPExcel_Shared_Escher_DggContainer();
        $this->object->setDggContainer($dggContainer);
        $reader = new PHPExcel_Reader_Excel5_Escher($dggContainer);
        $reader->load($recordData);
    }
246277
private function _readDggContainer()
	{
		$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
		$recordData = substr($this->_data, $this->_pos + 8, $length);

		// move stream pointer to next record
		$this->_pos += 8 + $length;

		// record is a container, read contents
		$dggContainer = new PHPExcel_Shared_Escher_DggContainer();
		$this->_object->setDggContainer($dggContainer);
		$reader = new PHPExcel_Reader_Excel5_Escher($dggContainer);
		$reader->load($recordData);
	}
194704
function readBlobData(body, type, asBlob, callback) {
  if (asBlob) {
    if (!body) {
      callback(pouchdbBinaryUtils.blob([''], {type: type}));
    } else if (typeof body !== 'string') { // we have blob support
      callback(body);
    } else { // no blob support
      callback(pouchdbBinaryUtils.base64StringToBlobOrBuffer(body, type));
    }
  } else { // as base64 string
    if (!body) {
      callback('');
    } else if (typeof body !== 'string') { // we have blob support
      pouchdbBinaryUtils.readAsBinaryString(body, function (binary) {
        callback(pouchdbBinaryUtils.btoa(binary));
      });
    } else { // no blob support
      callback(body);
    }
  }
}
1341079
def get_blobstore(layout):
    
    if layout.is_s3:
        from wal_e.blobstore import s3
        blobstore = s3
    elif layout.is_wabs:
        from wal_e.blobstore import wabs
        blobstore = wabs
    elif layout.is_swift:
        from wal_e.blobstore import swift
        blobstore = swift
    elif layout.is_gs:
        from wal_e.blobstore import gs
        blobstore = gs
    elif layout.is_file:
        from wal_e.blobstore import file
        blobstore = file
    return blobstore
601679
def poke_assoc(store, objname, assoc, container, visited=None, _stack=None):
    
    try:
        sub_container = store.newContainer(objname, assoc, container)
    except (SystemExit, KeyboardInterrupt):
        raise
    except:
        raise ValueError('generic poke not supported by store')
    escape_keys = assoc and not all(isinstance(iobjname, strtypes) for iobjname,_ in assoc)
    reported_item_counter = 0
    escaped_key_counter = 0
    try:
        if escape_keys:
            store.setRecordAttr('key', 'escaped', sub_container)
            verbose = store.verbose # save state
            for obj in assoc:
                store.poke(str(escaped_key_counter), obj, sub_container, \
                    visited=visited, _stack=_stack)
                escaped_key_counter += 1
                if store.verbose:
                    reported_item_counter += 1
                    if reported_item_counter == 9:
                        store.verbose = False
                        print('...')
            store.verbose = verbose # restore state
        else:
            for iobjname, iobj in assoc:
                store.poke(iobjname, iobj, sub_container, visited=visited, \
                    _stack=_stack)
    except TypeError as e:
        msg = 'wrong type for keys in associative list'
        if e.args[0].startswith(msg):
            raise
        else:
            raise TypeError("{}:\n\t{}".format(msg, e.args[0]))
1366947
function(cid) {

    // Find a container.
    return findContainerThrows(cid)
    // Inspect container.
    .then(function(container) {
      // Make sure to retry call to inspect.
      return Promise.fromNode(function(cb) {
        container.inspect(cb);
      });
    })
    // Wrap errors.
    .catch(function(err) {
      throw new VError(err, 'Error inspecting container: %s.', cid);
    });
  }
818233
public final Value read_impl(AutoBuffer bb) {
    assert _key == null;        // Not set yet
    // Set persistence backend but... strip off saved-to-disk bit
    _persist = (byte)(bb.get1()&BACKEND_MASK);
    _type = (short) bb.get2();
    _mem = bb.getA1();
    _max = _mem.length;
    assert _max < MAX : "Value size=0x"+Integer.toHexString(_max)+" during read is larger than "+Integer.toHexString(MAX)+", type: "+TypeMap.className(_type);
    _pojo = null;
    // On remote nodes _rwlock is initialized to 1 (signaling a remote PUT is
    // in progress) flips to -1 when the remote PUT is done, or +2 if a notify
    // needs to happen.
    _rwlock = new AtomicInteger(-1); // Set as 'remote put is done'
    _replicas = null;
    touch();
    return this;
  }
887563
def get_blob(storage_conn=None, **kwargs):
    '''
    
    '''
    if not storage_conn:
        storage_conn = get_storage_conn(opts=kwargs)

    if 'container' not in kwargs:
        raise SaltSystemExit(code=42, msg='The blob container name must be specified as "container"')

    if 'name' not in kwargs:
        raise SaltSystemExit(code=42, msg='The blob name must be specified as "name"')

    if 'local_path' not in kwargs and 'return_content' not in kwargs:
        raise SaltSystemExit(
            code=42,
            msg='Either a local path needs to be passed in as "local_path", '
            'or "return_content" to return the blob contents directly'
        )

    blob_kwargs = {
        'container_name': kwargs['container'],
        'blob_name': kwargs['name'],
        'snapshot': kwargs.get('snapshot', None),
        'x_ms_lease_id': kwargs.get('lease_id', None),
        'progress_callback': kwargs.get('progress_callback', None),
        'max_connections': kwargs.get('max_connections', 1),
        'max_retries': kwargs.get('max_retries', 5),
        'retry_wait': kwargs.get('retry_wait', 1),
    }

    if 'local_path' in kwargs:
        data = storage_conn.get_blob_to_path(
            file_path=kwargs['local_path'],
            open_mode=kwargs.get('open_mode', 'wb'),
            **blob_kwargs
        )
    elif 'return_content' in kwargs:
        data = storage_conn.get_blob_to_bytes(
            **blob_kwargs
        )

    return data
75981
async def container_dump(self, container, container_type, params=None, obj=None):
        
        elem_type = x.container_elem_type(container_type, params)
        obj = [] if not x.has_elem(obj) else x.get_elem(obj)

        # todo: pod container, just concat blobs / serialized content together. loading = size / elem size...
        if container is None:  # todo: reconsider
            return NoSetSentinel()  # if not self.modelize else ArrayModel(obj, xmr_type_to_type(elem_type))

        for idx, elem in enumerate(container):
            try:
                self.tracker.push_index(idx)
                fvalue = await self._dump_field(elem, elem_type, params[1:] if params else None)
                self.tracker.pop()

            except Exception as e:
                raise helpers.ArchiveException(e, tracker=self.tracker) from e

            if not isinstance(fvalue, NoSetSentinel):
                obj.append(fvalue)

        return obj if not self.modelize else ArrayModel(obj, xmr_type_to_type(elem_type))
231095
private function _readSpgrContainer()
	{
		// context is either context DgContainer or SpgrContainer

		$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
		$recordData = substr($this->_data, $this->_pos + 8, $length);

		// move stream pointer to next record
		$this->_pos += 8 + $length;

		// record is a container, read contents
		$spgrContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer();

		if ($this->_object instanceof PHPExcel_Shared_Escher_DgContainer) {
			// DgContainer
			$this->_object->setSpgrContainer($spgrContainer);
		} else {
			// SpgrContainer
			$this->_object->addChild($spgrContainer);
		}

		$reader = new PHPExcel_Reader_Excel5_Escher($spgrContainer);
		$escher = $reader->load($recordData);
	}
100091
@Deprecated
  public static long readRecordCount (FileSystem fs, Path dir) throws IOException {
    State state = loadState(fs, dir);

    if (!state.contains(CompactionSlaEventHelper.RECORD_COUNT_TOTAL)) {
      if (fs.exists(new Path (dir, RECORD_COUNT_FILE))){
        try (BufferedReader br = new BufferedReader(new InputStreamReader(fs.open (new Path (dir, RECORD_COUNT_FILE)), Charsets.UTF_8))) {
          long count = Long.parseLong(br.readLine());
          return count;
        }
      } else {
        return 0;
      }
    } else {
      return Long.parseLong(state.getProp(CompactionSlaEventHelper.RECORD_COUNT_TOTAL));
    }
  }
619847
def blob_properties(self):
        
        if not self._blob_properties:
            self._blob_properties = self._blob_service.get_blob_properties(
                container_name=self._container_name,
                blob_name=self._blob_name)
        return self._blob_properties
964367
private void setupBlobstore() throws Exception {
        BlobStore blobStore = data.getBlobStore();
        StormClusterState clusterState = data.getStormClusterState();
        Set<String> localSetOfKeys = Sets.newHashSet(blobStore.listKeys());
        Set<String> allKeys = Sets.newHashSet(clusterState.active_keys());
        Set<String> localAvailableActiveKeys = Sets.intersection(localSetOfKeys, allKeys);
        // keys on local but not on zk, we will delete it
        Set<String> keysToDelete = Sets.difference(localSetOfKeys, allKeys);
        LOG.debug("deleting keys not on zookeeper {}", keysToDelete);
        for (String key : keysToDelete) {
            blobStore.deleteBlob(key);
        }
        LOG.debug("Creating list of key entries for blobstore inside zookeeper {} local {}",
                allKeys, localAvailableActiveKeys);
        for (String key : localAvailableActiveKeys) {
            int versionForKey = BlobStoreUtils.getVersionForKey(key, data.getNimbusHostPortInfo(), data.getConf());
            clusterState.setup_blobstore(key, data.getNimbusHostPortInfo(), versionForKey);
        }
    }
1154039
function(storeName, cb) {
    var result;
    var transaction = this.transaction(storeName, MODE.READ_ONLY, result, cb);
    var store = this.store(storeName, transaction, cb);
    var request;
    try {
      request = store.count();
    } catch (err) {
      if (isFunction(cb)) return cb(err);
    }
    request.onsuccess = function(event) {
      result = event.target.result;
    };
    request.onerror = function(event) {
      if (isFunction(cb)) return cb(event.target.error);
    };
  }