Updates the throughput of the given global secondary indexes.

    CLI Example:
    .. code-block:: bash

        salt myminion boto_dynamodb.update_global_secondary_index table_name /
        indexes
353214
def update_global_secondary_index(table_name, global_indexes, region=None,
                                  key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    table = Table(table_name, connection=conn)
    return table.update_global_secondary_index(global_indexes)
327861
protected function _updateIndexes ($table_name) {
		$this->_indexes[$table_name] = [];
		foreach ($this->query(sprintf('SHOW INDEX FROM %s;', $table_name), \PDO::FETCH_ASSOC) as $index) {
			$this->_indexes[$table_name][$index['Key_name']][] = [
				'table_name'		=> $table_name,
				'temporary'			=> null,
				'unique'			=> !filter_var($index['Non_unique'], \FILTER_VALIDATE_BOOLEAN),
				'if_not_exists'		=> null,
				'key_name'			=> $index['Key_name'],
				'column_name'		=> $index['Column_name'],
				'seq_in_index'		=> $index['Seq_in_index'],
				'collation'			=> $index['Collation'],
				'cardinality'		=> $index['Cardinality'],
				'comment'			=> $index['Comment'],
				'index_comment'		=> $index['Index_comment'],
				'order'				=> null,
				'index_type'		=> $index['Index_type'],
				'sub_part'			=> $index['Sub_part'],
				'raw_data'			=> $index,
			];
		}
	}
536622
protected void buildIndexBlocking()
    {
        logger.info(String.format("Submitting index build of %s for data in %s",
                getIndexName(), StringUtils.join(baseCfs.getSSTables(), ", ")));

        try (Refs<SSTableReader> sstables = baseCfs.selectAndReference(ColumnFamilyStore.CANONICAL_SSTABLES).refs)
        {
            SecondaryIndexBuilder builder = new SecondaryIndexBuilder(baseCfs,
                                                                      Collections.singleton(getIndexName()),
                                                                      new ReducingKeyIterator(sstables));
            Future<?> future = CompactionManager.instance.submitIndexBuild(builder);
            FBUtilities.waitOnFuture(future);
            forceBlockingFlush();
            setIndexBuilt();
        }
        logger.info("Index build of {} complete", getIndexName());
    }
576636
def update_settings(self, index, newvalues):
        
        path = make_path(index, "_settings")
        return self.conn._send_request('PUT', path, newvalues)
913322
def total_read_throughput(self):
        
        total = self.read_throughput
        for index in itervalues(self.global_indexes):
            total += index.read_throughput
        return total
767236
def _alter(self, tree):
        
        if tree.throughput:
            [read, write] = tree.throughput
            index = None
            if tree.index:
                index = tree.index
            self._update_throughput(tree.table, read, write, index)
        elif tree.drop_index:
            updates = [IndexUpdate.delete(tree.drop_index[0])]
            try:
                self.connection.update_table(tree.table, index_updates=updates)
            except DynamoDBError as e:
                if tree.exists and e.kwargs["Code"] == "ResourceNotFoundException":
                    pass
                else:
                    raise
        elif tree.create_index:
            # GlobalIndex
            attrs = {}
            index = self._parse_global_index(tree.create_index, attrs)
            updates = [IndexUpdate.create(index)]
            try:
                self.connection.update_table(tree.table, index_updates=updates)
            except DynamoDBError as e:
                if (
                    tree.not_exists
                    and e.kwargs["Code"] == "ValidationException"
                    and "already exists" in e.kwargs["Message"]
                ):
                    pass
                else:
                    raise
        else:
            raise SyntaxError("No alter command found")
857333
def update(cls, resource, new_name, algorithm, ssl_enable, ssl_disable):
        
        params = {}
        if new_name:
            params['name'] = new_name
        if algorithm:
            params['lb'] = {'algorithm': algorithm}
        if ssl_enable:
            params['ssl_enable'] = ssl_enable
        if ssl_disable:
            params['ssl_enable'] = False

        result = cls.call('hosting.rproxy.update', cls.usable_id(resource),
                          params)
        cls.echo('Updating your webaccelerator')
        cls.display_progress(result)
        cls.echo('The webaccelerator have been udated')
        return result
491910
def UpdateSNMPObjs():
	

	global threadingString

	LogMsg("Beginning data update.")
	data = ""

	# Obtain the data by calling an external command. We don't use
	# subprocess.check_output() here for compatibility with Python versions
	# older than 2.7.
	LogMsg("Calling external command \"sleep 5; date\".")
	proc = subprocess.Popen(
		"sleep 5; date", shell=True, env={ "LANG": "C" },
		stdout=subprocess.PIPE, stderr=subprocess.STDOUT
	)
	output = proc.communicate()[0].splitlines()[0]
	rc = proc.poll()
	if rc != 0:
		LogMsg("An error occured executing the command: {0}".format(output))
		return

	msg = "Updating \"threadingString\" object with data \"{0}\"."
	LogMsg(msg.format(output))
	threadingString.update(output)

	LogMsg("Data update done, exiting thread.")
1225590
public void updateNodeIndex(EntityMetadata entityMetadata, GraphDatabaseService graphDb, Node node, MetamodelImpl metaModel)
    {
        if (!isNodeAutoIndexingEnabled(graphDb) && entityMetadata.isIndexable())
        {
            Index<Node> nodeIndex = graphDb.index().forNodes(entityMetadata.getIndexName());

            // Remove all exiting node entries from Index
            nodeIndex.remove(node);

            // Recreate fresh index on this node
            addNodeIndex(entityMetadata, node, nodeIndex, metaModel);
        }

    }
248055
def update_domain_queues(self):
        '''
        
        '''
        for key in self.domain_config:
            final_key = "{name}:{domain}:queue".format(
                    name=self.spider.name,
                    domain=key)
            # we already have a throttled queue for this domain, update it to new settings
            if final_key in self.queue_dict:
                self.queue_dict[final_key][0].window = float(self.domain_config[key]['window'])
                self.logger.debug("Updated queue {q} with new config"
                                  .format(q=final_key))
                # if scale is applied, scale back; otherwise use updated hits
                if 'scale' in self.domain_config[key]:
                    # round to int
                    hits = int(self.domain_config[key]['hits'] * self.fit_scale(
                               self.domain_config[key]['scale']))
                    self.queue_dict[final_key][0].limit = float(hits)
                else:
                    self.queue_dict[final_key][0].limit = float(self.domain_config[key]['hits'])
1017422
def update_indexes
      indexer = Gemirro::Indexer.new(Utils.configuration.destination)
      indexer.only_origin = true
      indexer.ui = ::Gem::SilentUI.new

      Utils.logger.info('Generating indexes')
      indexer.update_index
      indexer.updated_gems.each do |gem|
        Utils.cache.flush_key(File.basename(gem))
      end
    rescue SystemExit => e
      Utils.logger.info(e.message)
    end
1004087
def updateVersions(region="us-east-1", table="credential-store"):
    '''
    
    '''
    dynamodb = boto3.resource('dynamodb', region_name=region)
    secrets = dynamodb.Table(table)

    response = secrets.scan(ProjectionExpression="#N, version, #K, contents, hmac",
                            ExpressionAttributeNames={"#N": "name", "#K": "key"})

    items = response["Items"]

    for old_item in items:
        if isInt(old_item['version']):
            new_item = copy.copy(old_item)
            new_item['version'] = credstash.paddedInt(new_item['version'])
            if new_item['version'] != old_item['version']:
                secrets.put_item(Item=new_item)
                secrets.delete_item(Key={'name': old_item['name'], 'version': old_item['version']})
        else:
            print "Skipping item: %s, %s" % (old_item['name'], old_item['version'])
42812
def build_global_index_updates_array(current_global_indexes)
      indexes_to_update = []
      return indexes_to_update if current_global_indexes.empty?
      current_global_indexes.each do |current_index|
        @global_secondary_indexes.each do |target_index|
          # Find the same named index
          next unless target_index[:index_name] == current_index[:index_name]
          # Skip unless a different ProvisionedThroughput is specified
          break unless (target_index[:provisioned_throughput][:read_capacity_units] !=
                        current_index.provisioned_throughput.read_capacity_units) ||
                       (target_index[:provisioned_throughput][:write_capacity_units] !=
                        current_index.provisioned_throughput.write_capacity_units)
          indexes_to_update << { index_name: target_index[:index_name],
                                 provisioned_throughput: target_index[:provisioned_throughput] }
        end
      end
      puts indexes_to_update
      indexes_to_update
    end
351318
def get_provisioned_gsi_write_units(table_name, gsi_name):
    
    try:
        desc = DYNAMODB_CONNECTION.describe_table(table_name)
    except JSONResponseError:
        raise

    for gsi in desc[u'Table'][u'GlobalSecondaryIndexes']:
        if gsi[u'IndexName'] == gsi_name:
            write_units = int(
                gsi[u'ProvisionedThroughput'][u'WriteCapacityUnits'])
            break

    logger.debug(
        '{0} - GSI: {1} - Currently provisioned write units: {2:d}'.format(
            table_name, gsi_name, write_units))
    return write_units
395799
def update_index(self, name, value):
        
        kwargs = {}
        kwargs['index.' + name] = value if isinstance(value, basestring) else json.dumps(value)
        return self.post(**kwargs)
1152960
def update_item(cls, hash_key, range_key=None, attributes_to_set=None, attributes_to_add=None):
        """"""
        primary_key = cls._encode_key(hash_key, range_key)

        value_names = {}
        encoded_values = {}
        dynamizer = Dynamizer()

        set_expression = ''
        if attributes_to_set:
            for i, key in enumerate(attributes_to_set.keys()):
                value_name = ':s{0}'.format(i)
                value_names[key] = value_name
                encoded_values[value_name] = dynamizer.encode(attributes_to_set[key])

            set_expression = 'SET {0}'.format(
                ', '.join(
                    '{key}={value_name}'.format(key=key, value_name=value_names[key]) for key in attributes_to_set
                )
            )

        add_expression = ''
        if attributes_to_add:
            for i, key in enumerate(attributes_to_add.keys()):
                value_name = ':a{0}'.format(i)
                value_names[key] = value_name
                encoded_values[value_name] = dynamizer.encode(attributes_to_add[key])
            add_expression = 'ADD {0}'.format(
                ', '.join(
                    '{key} {value_name}'.format(key=key, value_name=value_names[key]) for key in attributes_to_add
                )
            )

        update_expression = ' '.join([set_expression, add_expression])

        cls._get_connection().update_item(
            cls.get_table_name(),
            primary_key,
            update_expression=update_expression, expression_attribute_values=encoded_values)
1135039
def alter_index(self, dbname, base_tbl_name, idx_name, new_idx):
    
    self.send_alter_index(dbname, base_tbl_name, idx_name, new_idx)
    self.recv_alter_index()