If configured to do so, update the cloud cachedir with the current list of
    nodes. Also fires configured events pertaining to the node list.

    .. versionadded:: 2014.7.0
341002
def cache_node_list(nodes, provider, opts):
    '''
    
    '''
    if 'update_cachedir' not in opts or not opts['update_cachedir']:
        return

    base = os.path.join(init_cachedir(), 'active')
    driver = next(six.iterkeys(opts['providers'][provider]))
    prov_dir = os.path.join(base, driver, provider)
    if not os.path.exists(prov_dir):
        os.makedirs(prov_dir)

    # Check to see if any nodes in the cache are not in the new list
    missing_node_cache(prov_dir, nodes, provider, opts)

    for node in nodes:
        diff_node_cache(prov_dir, node, nodes[node], opts)
        path = os.path.join(prov_dir, '{0}.p'.format(node))
        mode = 'wb' if six.PY3 else 'w'
        with salt.utils.files.fopen(path, mode) as fh_:
            salt.utils.msgpack.dump(nodes[node], fh_, encoding=MSGPACK_ENCODING)
592810
def add_elasticache_node(self, node, cluster, region):
        '''  '''

        # Only want available nodes unless all_elasticache_nodes is True
        if not self.all_elasticache_nodes and node['CacheNodeStatus'] != 'available':
            return

        # Select the best destination address
        dest = node['Endpoint']['Address']

        if not dest:
            # Skip nodes we cannot address (e.g. private VPC subnet)
            return

        node_id = self.to_safe(cluster['CacheClusterId'] + '_' + node['CacheNodeId'])

        # Add to index
        self.index[dest] = [region, node_id]

        # Inventory: Group by node ID (always a group of 1)
        if self.group_by_instance_id:
            self.inventory[node_id] = [dest]
            if self.nested_groups:
                self.push_group(self.inventory, 'instances', node_id)

        # Inventory: Group by region
        if self.group_by_region:
            self.push(self.inventory, region, dest)
            if self.nested_groups:
                self.push_group(self.inventory, 'regions', region)

        # Inventory: Group by availability zone
        if self.group_by_availability_zone:
            self.push(self.inventory, cluster['PreferredAvailabilityZone'], dest)
            if self.nested_groups:
                if self.group_by_region:
                    self.push_group(self.inventory, region, cluster['PreferredAvailabilityZone'])
                self.push_group(self.inventory, 'zones', cluster['PreferredAvailabilityZone'])

        # Inventory: Group by node type
        if self.group_by_instance_type:
            type_name = self.to_safe('type_' + cluster['CacheNodeType'])
            self.push(self.inventory, type_name, dest)
            if self.nested_groups:
                self.push_group(self.inventory, 'types', type_name)

        # Inventory: Group by VPC (information not available in the current
        # AWS API version for ElastiCache)

        # Inventory: Group by security group
        if self.group_by_security_group:

            # Check for the existence of the 'SecurityGroups' key and also if
            # this key has some value. When the cluster is not placed in a SG
            # the query can return None here and cause an error.
            if 'SecurityGroups' in cluster and cluster['SecurityGroups'] is not None:
                for security_group in cluster['SecurityGroups']:
                    key = self.to_safe("security_group_" + security_group['SecurityGroupId'])
                    self.push(self.inventory, key, dest)
                    if self.nested_groups:
                        self.push_group(self.inventory, 'security_groups', key)

        # Inventory: Group by engine
        if self.group_by_elasticache_engine:
            self.push(self.inventory, self.to_safe("elasticache_" + cluster['Engine']), dest)
            if self.nested_groups:
                self.push_group(self.inventory, 'elasticache_engines', self.to_safe("elasticache_" + cluster['Engine']))

        # Inventory: Group by parameter group (done at cluster level)

        # Inventory: Group by replication group (done at cluster level)

        # Inventory: Group by ElastiCache Cluster
        if self.group_by_elasticache_cluster:
            self.push(self.inventory, self.to_safe("elasticache_cluster_" + cluster['CacheClusterId']), dest)

        # Global Tag: all ElastiCache nodes
        self.push(self.inventory, 'elasticache_nodes', dest)

        host_info = self.get_host_info_dict_from_describe_dict(node)

        if dest in self.inventory["_meta"]["hostvars"]:
            self.inventory["_meta"]["hostvars"][dest].update(host_info)
        else:
            self.inventory["_meta"]["hostvars"][dest] = host_info
743553
def _update_events(self):
        """"""
        events = self._skybell.dev_cache(self, CONST.EVENT) or {}

        for activity in self._activities:
            event = activity.get(CONST.EVENT)
            created_at = activity.get(CONST.CREATED_AT)

            old_event = events.get(event)

            if old_event and created_at < old_event.get(CONST.CREATED_AT):
                continue
            else:
                events[event] = activity

        self._skybell.update_dev_cache(
            self,
            {
                CONST.EVENT: events
            })
300926
def _node_tag_update_loop(self):
        
        while True:
            self.tag_cache_update_event.wait()
            self.tag_cache_update_event.clear()

            batch_updates = defaultdict(list)

            with self.tag_cache_lock:
                for node_id, tags in self.tag_cache_pending.items():
                    for x in tags.items():
                        batch_updates[x].append(node_id)
                    self.tag_cache[node_id].update(tags)

                self.tag_cache_pending = {}

            for (k, v), node_ids in batch_updates.items():
                m = "Set tag {}={} on {}".format(k, v, node_ids)
                with LogTimer("AWSNodeProvider: {}".format(m)):
                    if k == TAG_RAY_NODE_NAME:
                        k = "Name"
                    self.ec2.meta.client.create_tags(
                        Resources=node_ids,
                        Tags=[{
                            "Key": k,
                            "Value": v
                        }],
                    )

            self.tag_cache_kill_event.wait(timeout=5)
            if self.tag_cache_kill_event.is_set():
                return
904135
private boolean doHandleTopologyUpdate(String cacheName, CacheTopology cacheTopology,
                                          AvailabilityMode availabilityMode, int viewId, Address sender,
                                          LocalCacheStatus cacheStatus) {
      try {
         waitForView(viewId, cacheStatus.getJoinInfo().getTimeout(), TimeUnit.MILLISECONDS);
      } catch (InterruptedException e) {
         // Shutting down, ignore the exception and the rebalance
         return false;
      }

      synchronized (cacheStatus) {
         if (cacheTopology == null) {
            // No topology yet: happens when a cache is being restarted from state.
            // Still, return true because we don't want to re-send the join request.
            return true;
         }
         // Register all persistent UUIDs locally
         registerPersistentUUID(cacheTopology);
         CacheTopology existingTopology = cacheStatus.getCurrentTopology();
         if (existingTopology != null && cacheTopology.getTopologyId() <= existingTopology.getTopologyId()) {
            log.debugf("Ignoring late consistent hash update for cache %s, current topology is %s: %s",
                  cacheName, existingTopology.getTopologyId(), cacheTopology);
            return false;
         }

         if (!updateCacheTopology(cacheName, cacheTopology, viewId, sender, cacheStatus))
            return false;

         CacheTopologyHandler handler = cacheStatus.getHandler();
         resetLocalTopologyBeforeRebalance(cacheName, cacheTopology, existingTopology, handler);

         ConsistentHash currentCH = cacheTopology.getCurrentCH();
         ConsistentHash pendingCH = cacheTopology.getPendingCH();
         ConsistentHash unionCH = null;
         if (pendingCH != null) {
            ConsistentHashFactory chf = cacheStatus.getJoinInfo().getConsistentHashFactory();
            switch (cacheTopology.getPhase()) {
               case READ_NEW_WRITE_ALL:
                  // When removing members from topology, we have to make sure that the unionCH has
                  // owners from pendingCH (which is used as the readCH in this phase) before
                  // owners from currentCH, as primary owners must match in readCH and writeCH.
                  unionCH = chf.union(pendingCH, currentCH);
                  break;
               default:
                  unionCH = chf.union(currentCH, pendingCH);
            }
         }

         CacheTopology unionTopology = new CacheTopology(cacheTopology.getTopologyId(), cacheTopology.getRebalanceId(),
               currentCH, pendingCH, unionCH, cacheTopology.getPhase(),
               cacheTopology.getActualMembers(), persistentUUIDManager.mapAddresses(cacheTopology.getActualMembers()));
         unionTopology.logRoutingTableInformation();

         boolean updateAvailabilityModeFirst = availabilityMode != AvailabilityMode.AVAILABLE;
         if (updateAvailabilityModeFirst && availabilityMode != null) {
            // TODO: handle this async?
            CompletionStages.join(cacheStatus.getPartitionHandlingManager().setAvailabilityMode(availabilityMode));
         }

         boolean startConflictResolution = cacheTopology.getPhase() == CacheTopology.Phase.CONFLICT_RESOLUTION;
         if (!startConflictResolution && (existingTopology == null || existingTopology.getRebalanceId() != cacheTopology.getRebalanceId())
               && unionCH != null) {
            // This CH_UPDATE command was sent after a REBALANCE_START command, but arrived first.
            // We will start the rebalance now and ignore the REBALANCE_START command when it arrives.
            log.tracef("This topology update has a pending CH, starting the rebalance now");
            handler.rebalance(unionTopology);
         } else {
            handler.updateConsistentHash(unionTopology);
         }

         if (!updateAvailabilityModeFirst) {
            // TODO: handle this async?
            CompletionStages.join(cacheStatus.getPartitionHandlingManager().setAvailabilityMode(availabilityMode));
         }
         return true;
      }
   }
1121003
public void rebuildNode(String fullPath) throws Exception
    {
        Preconditions.checkArgument(ZKPaths.getPathAndNode(fullPath).getPath().equals(path), "Node is not part of this cache: " + fullPath);
        Preconditions.checkState(!executorService.isShutdown(), "cache has been closed");

        ensurePath();
        internalRebuildNode(fullPath);

        // this is necessary so that any updates that occurred while rebuilding are taken
        // have to rebuild entire tree in case this node got deleted in the interim
        offerOperation(new RefreshOperation(this, RefreshMode.FORCE_GET_DATA_AND_STAT));
    }
1038799
def update(self, name, **kwargs):
        
        # These arguments are allowed
        self.allowed('update', kwargs, ['hostname', 'port', 'status',
                     'storage_hostname', 'volume_type_name', 'size'])
        # Remove parameters that are None
        kwargs = self.unused(kwargs)
        return self.http_post('/nodes/%s' % name, params=kwargs)
952436
def each
      Directory.each do |id|
        remote = NodeCache.register id
        next unless remote
        yield remote
      end
    end
804562
def refresh(self):
        
        try:
            self._private_to_public = self.cloud_discovery.discover_nodes()
        except Exception as ex:
            self.logger.warning("Failed to load addresses from Hazelcast.cloud: {}".format(ex.args[0]),
                                extra=self._logger_extras)
442359
function rebuild (dir, _callback) {
  var cwd     = process.cwd()
    , gypInst = gyp()

  var callback = function (err) {
    _callback(err)
  }

  gypInst.parseArgv([ null, null, 'rebuild', '--loglevel', 'silent' ])
  process.chdir(dir)
  gypInst.commands.clean([], function (err) {
    if (err)
      return callback(new Error('node-gyp clean: ' + err.message))
    gypInst.commands.configure([], function (err) {
      if (err)
        return callback(new Error('node-gyp configure: ' + err.message))
      gypInst.commands.build([], function (err) {
        if (err)
          return callback(new Error('node-gyp build: ' + err.message))

        process.chdir(cwd)
        return callback()
      })
    })
  })
}
1009108
@Override
    protected void update(List<TableInfo> tableInfos)
    {
        if (!clusterManager.hasBucket(databaseName))
        {
            addBucket(databaseName);
            createIdIndex(databaseName);
        }
    }
739575
synchronized void updateCloudAnchors(Collection<Anchor> updatedAnchors) {
        for (Anchor anchor : updatedAnchors) {
            if (pendingAnchors.containsKey(anchor)) {
                Anchor.CloudAnchorState cloudState = anchor.getCloudAnchorState();
                if (isReturnableState(cloudState)) {
                    CloudAnchorCallback cb = pendingAnchors.get(anchor);
                    pendingAnchors.remove(anchor);
                    GVRAnchor newAnchor = mArCoreHelper.createAnchor(anchor, AR2VR_SCALE);
                    cb.onCloudUpdate(newAnchor);
                }
            }
        }
    }
695677
public OperationFuture<LoadBalancerPool> update(
            LoadBalancerPool loadBalancerPool,
            List<LoadBalancerNodeMetadata> nodesList
    ) {
        LoadBalancerPoolMetadata loadBalancerPoolMetadata = loadBalancerPoolService.findByRef(
                loadBalancerPool
        );

        loadBalancerNodeClient.update(
                loadBalancerPoolMetadata.getDataCenterId(),
                loadBalancerPoolMetadata.getLoadBalancerId(),
                loadBalancerPoolMetadata.getId(),
                nodesList
        );

        return new OperationFuture<>(
                loadBalancerPool,
                new NoWaitingJobFuture()
        );
    }
638148
def list_cache_nodes_full(opts=None, provider=None, base=None):
    '''
    
    '''
    if opts is None:
        opts = __opts__
    if opts.get('update_cachedir', False) is False:
        return

    if base is None:
        base = os.path.join(opts['cachedir'], 'active')

    minions = {}
    # First, get a list of all drivers in use
    for driver in os.listdir(base):
        minions[driver] = {}
        prov_dir = os.path.join(base, driver)
        # Then, get a list of all providers per driver
        for prov in os.listdir(prov_dir):
            # If a specific provider is requested, filter out everyone else
            if provider and provider != prov:
                continue
            minions[driver][prov] = {}
            min_dir = os.path.join(prov_dir, prov)
            # Get a list of all nodes per provider
            for fname in os.listdir(min_dir):
                # Finally, get a list of full minion data
                fpath = os.path.join(min_dir, fname)
                minion_id = fname[:-2]  # strip '.p' from end of msgpack filename
                mode = 'rb' if six.PY3 else 'r'
                with salt.utils.files.fopen(fpath, mode) as fh_:
                    minions[driver][prov][minion_id] = salt.utils.data.decode(
                        salt.utils.msgpack.load(fh_, encoding=MSGPACK_ENCODING))

    return minions
492077
protected void fireIteratorUpdate() {
		if (this.listeningIterators != null) {
			for (final IClockwiseIterator iterator : this.listeningIterators) {
				if (iterator != null) {
					iterator.dataStructureUpdated();
				}
			}
		}
	}
777345
public synchronized void refreshNodes() throws IOException {
    hostsReader.refresh();
    LOG.info("After refresh Included hosts: " +
        hostsReader.getHostNames().size() +
        " Excluded hosts: " + hostsReader.getExcludedHosts().size());
    Set<String> newHosts = hostsReader.getHostNames();
    Set<String> newExcludes = hostsReader.getExcludedHosts();
    Set<ClusterNode> hostsToExclude = new HashSet<ClusterNode>();
    for (ClusterNode tmpNode : nameToNode.values()) {
      String host = tmpNode.getHost();
      // Check if not included or explicitly excluded.
      if (!newHosts.contains(host) || newExcludes.contains(host)) {
        hostsToExclude.add(tmpNode);
      }
    }
    for (ClusterNode node: hostsToExclude) {
      synchronized (node) {
        for (Map.Entry<ResourceType, RunnableIndices> entry :
          typeToIndices.entrySet()) {
          ResourceType type = entry.getKey();
          RunnableIndices r = entry.getValue();
          if (r.hasRunnable(node)) {
            LOG.info("Node " + node.getName() + " is no longer " +
              type + " runnable because it is excluded");
            r.deleteRunnable(node);
          }
        }
      }
    }
  }
426642
def refresh(self):
        

        if self.object_id is None:
            url = self.build_url(self._endpoints.get('default_drive'))
        else:
            url = self.build_url(
                self._endpoints.get('get_drive').format(id=self.object_id))

        response = self.con.get(url)
        if not response:
            return False

        drive = response.json()

        self._update_data({self._cloud_data_key: drive})
        return True