sets up blobstore state for all current keys
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);
        }
    }
1164666
function( blob ) {
            var owner = this.owner;

            owner.info() && this.flashExec( 'Image', 'info', owner.info() );
            owner.meta() && this.flashExec( 'Image', 'meta', owner.meta() );

            this.flashExec( 'Image', 'loadFromBlob', blob.uid );
        }
63309
public Blob update() {
    // [START update]
    Map<String, String> newMetadata = new HashMap<>();
    newMetadata.put("key", "value");
    blob.toBuilder().setMetadata(null).build().update();
    Blob updatedBlob = blob.toBuilder().setMetadata(newMetadata).build().update();
    // [END update]
    return updatedBlob;
  }
579406
function buildLoadKey (blueprintMeta, originalKey, json) {
  const keyParts = [
    blueprintMeta.namespace,
    originalKey
  ]

  if (json.version) {
    keyParts.push(json.version.replace('.', '_'))
  }

  return keyParts.join('_')
}
242851
function(cb) {
    var self = this;
    var request;
    try {
      request = IndexedDB.open(self.setup.database, self.setup.version);
    } catch (err) {
      if (isFunction(cb)) return cb(err);
    }
    request.onsuccess = function(event) {
      self.idb = event.target.result;
      if (isFunction(cb)) return cb(null);
    };
    request.onerror = function(event) {
      if (isFunction(cb)) return cb(event.target.error);
    };
    request.onblocked = function(event) {
      if (isFunction(cb)) return cb(event.target.error);
    };
    request.onupgradeneeded = function(event) {
      try {
        var idb = event.target.result;
        for (var storeName in self.setup.stores) {
          var store = self.setup.stores[storeName];
          var objectStore = idb.createObjectStore(storeName,
            { keyPath: store.keyPath, autoIncrement: store.autoIncrement });
          for (var indexNo in store.indexes) {
            var index = store.indexes[indexNo];
            objectStore.createIndex(index.name, index.keyPath,
              { unique: index.unique, multiEntry: index.multiEntry });
          }
        }
      } catch (err) {
        if (isFunction(cb)) return cb(err);
      }
    };
  }
705589
public static void cleanup_key(String blobKey, BlobStore blobStore, StormClusterState clusterState) {
        // we skip to clean up the non-exist keys
        if (blobKey.startsWith(JStormMetrics.NIMBUS_METRIC_KEY)
                || blobKey.startsWith(JStormMetrics.CLUSTER_METRIC_KEY)
                || blobKey.startsWith(JStormMetrics.SUPERVISOR_METRIC_KEY)) {
            return;
        }
        try {
            blobStore.deleteBlob(blobKey);
        } catch (Exception e) {
            LOG.warn("cleanup blob key {} error {}", blobKey, e);
        }

        try {
            if (blobStore instanceof LocalFsBlobStore) {
                clusterState.remove_blobstore_key(blobKey);
                clusterState.remove_key_version(blobKey);
            }
        } catch (Exception e) {
            LOG.warn("cleanup blob key {} error {}", blobKey, e);
        }
    }
1364769
function (key) {
        var a = this.all()
        a.push(key)
        storage.setItem(this.key, JSON.stringify(a))
      }
872000
function MemcachedStore(options) {
    options = options || {};
    Store.call(this, options);

    this.prefix = options.prefix || "";
    this.ttl = options.ttl;
    if (!options.client) {
      if (!options.hosts) {
        options.hosts = "127.0.0.1:11211";
      }
      if (options.secret) {
        (this.crypto = require("crypto")), (this.secret = options.secret);
      }
      if (options.algorithm) {
        this.algorithm = options.algorithm;
      }

      options.client = new Memcached(options.hosts, options);
    }

    this.client = options.client;
  }
86741
function LocalStore(prefix) {
  prefix = prefix || 'openpgp-';
  this.publicKeysItem = prefix + this.publicKeysItem;
  this.privateKeysItem = prefix + this.privateKeysItem;
  if (typeof window !== 'undefined' && window.localStorage) {
    this.storage = window.localStorage;
  } else {
    this.storage = new (require('node-localstorage').LocalStorage)(config.node_store);
  }
}
746673
def put(self, store, obj):
        
        spec = self._get_store_spec(store)
        blob = pack(obj)
        blob_hash = long_hash(blob) + store[len('external-'):]
        if spec['protocol'] == 'file':
            folder = os.path.join(spec['location'], self.database)
            full_path = os.path.join(folder, blob_hash)
            if not os.path.isfile(full_path):
                try:
                    safe_write(full_path, blob)
                except FileNotFoundError:
                    os.makedirs(folder)
                    safe_write(full_path, blob)
        elif spec['protocol'] == 's3':
            S3Folder(database=self.database, **spec).put(blob_hash, blob)
        else:
            raise DataJointError('Unknown external storage protocol {protocol} for {store}'.format(
                store=store, protocol=spec['protocol']))

        # insert tracking info
        self.connection.query(
            "INSERT INTO {tab} (hash, size) VALUES ('{hash}', {size}) "
            "ON DUPLICATE KEY UPDATE timestamp=CURRENT_TIMESTAMP".format(
                tab=self.full_table_name,
                hash=blob_hash,
                size=len(blob)))
        return blob_hash
466548
def get(self, blob_hash):
        
        if blob_hash is None:
            return None
        store = blob_hash[STORE_HASH_LENGTH:]
        store = 'external' + ('-' if store else '') + store

        cache_folder = config.get('cache', None)

        blob = None
        if cache_folder:
            try:
                with open(os.path.join(cache_folder, blob_hash), 'rb') as f:
                    blob = f.read()
            except FileNotFoundError:
                pass

        if blob is None:
            spec = self._get_store_spec(store)
            if spec['protocol'] == 'file':
                full_path = os.path.join(spec['location'], self.database, blob_hash)
                try:
                    with open(full_path, 'rb') as f:
                        blob = f.read()
                except FileNotFoundError:
                    raise DataJointError('Lost access to external blob %s.' % full_path) from None
            elif spec['protocol'] == 's3':
                try:
                    blob = S3Folder(database=self.database, **spec).get(blob_hash)
                except TypeError:
                    raise DataJointError('External store {store} configuration is incomplete.'.format(store=store))
            else:
                raise DataJointError('Unknown external storage protocol "%s"' % spec['protocol'])

            if cache_folder:
                if not os.path.exists(cache_folder):
                    os.makedirs(cache_folder)
                safe_write(os.path.join(cache_folder, blob_hash), blob)

        return unpack(blob)
699089
private function setStates()
    {
        $appID = App::getCurrentID();
        $complementID = self::getCurrentID();

        if (! is_null($this->states)) {
            $states = $this->getStatesFromFile();

            if ($this->stateChanged($states)) {
                $file = $this->getStatesFilePath();
                $states[$appID][$complementID] = $this->states;
                Json::arrayToFile($states, $file);
                Hook::doAction('Eliasis/Complement/after_set_states', $states);
            }
        }
    }
24167
function(collection, options, cb) {
    this.store().setItem(
      options.indexKey,
      JSON.stringify([]),
      function(err, res) {
        cb(err, [], res);
      }
    );
  }
483009
def store(key, value, options = {})
      @stack.each {|s| s.store(key, value, options) }
      value
    end
721805
function updateStore(styleId, style, pseudoClass, disabled) {
  styleStorage[styleId] = styleStorage[styleId] || {};
  if (disabled) {
    styleStorage[styleId].disabledPseudoClasses = styleStorage[styleId].disabledPseudoClasses || {};
    styleStorage[styleId].disabledPseudoClasses[pseudoClass] = style;
  } else {
    styleStorage[styleId].pseudoClasses = styleStorage[styleId].pseudoClasses || {};
    styleStorage[styleId].pseudoClasses[pseudoClass] = style;
  }
}
1191746
function() {
    const changed_keys = store._changed_keys
    if (changed_keys.length === 0) {
      console.error('no keys were changed, yet we are trying to publish a store change')
      return
    }

    // make sure _changed_keys is reset before executing callbacks
    // (if callbacks modify state, the list of keys the callback changed would be wiped out)
    store._changed_keys = []
    store._clearDebounceTimeout()
    store._callback_objs.forEach(obj => obj.callback(changed_keys))
  }
1046225
function () {
    var options = { publicAccessLevel: BlobUtilities.BlobContainerPublicAccessType.CONTAINER };
    blobService.setContainerAcl(container, signedIdentifiers, options, function(error) {
      if (error) {
        console.log(error);
      } else {
        console.log('Uploaded the permissions for the container ' + container);
        callback();
      }
    });
  }