// PutMulti stores a set of contiguous items with stride size under key.
// PutMulti panics if len(page) is not a multiple of stride.  The cursor's
// database must be DupFixed and DupSort.
//
// See mdb_cursor_put.
481204
func (c *Cursor) PutMulti(key []byte, page []byte, stride int, flags uint) error {
	if len(key) == 0 {
		return c.putNilKey(flags)
	}
	if len(page) == 0 {
		page = []byte{0}
	}

	vn := WrapMulti(page, stride).Len()
	ret := C.lmdbgo_mdb_cursor_putmulti(
		c._c,
		(*C.char)(unsafe.Pointer(&key[0])), C.size_t(len(key)),
		(*C.char)(unsafe.Pointer(&page[0])), C.size_t(vn), C.size_t(stride),
		C.uint(flags|C.MDB_MULTIPLE),
	)
	return operrno("mdb_cursor_put", ret)
}
825342
func (s *OrderService) CancelMulti(orderIDS []int64) (string, error) {
	payload := map[string]interface{}{
		"order_ids": orderIDS,
	}

	req, err := s.client.newAuthenticatedRequest("POST", "order/cancel/multi", payload)

	if err != nil {
		return "", err
	}

	response := make(map[string]string)
	_, err = s.client.do(req, &response)

	return response["result"], err
}
13837
func (md *MDCacheStandard) Put(rmd ImmutableRootMetadata) error {
	md.lock.Lock()
	defer md.lock.Unlock()
	key := mdCacheKey{rmd.TlfID(), rmd.Revision(), rmd.BID()}
	if _, ok := md.lru.Get(key); ok {
		// Don't overwrite the cache.  In the case that `rmd` is
		// different from what's in the cache, we require that upper
		// layers manage the cache explicitly by deleting or replacing
		// it explicitly.
		return nil
	}
	md.lru.Add(key, rmd)
	return nil
}
1089717
func (c *Config) SnapshotMulti(snapshotID string, i ...interface{}) error {
	snapshotName := fmt.Sprintf("%s-%s", getNameOfCaller(), snapshotID)
	return c.snapshot(snapshotName, i...)
}
36764
func (u *URLQueryParameters) GetMulti(key string) []string {
	var multi []string
	for i := range u.params {
		if u.params[i].Key == key {
			multi = append(multi, u.params[i].Value)
		}
	}
	return multi
}
1366065
func (c *Cursor) PutReserve(key []byte, n int, flags uint) ([]byte, error) {
	if len(key) == 0 {
		return nil, c.putNilKey(flags)
	}

	c.txn.val.mv_size = C.size_t(n)
	ret := C.lmdbgo_mdb_cursor_put1(
		c._c,
		(*C.char)(unsafe.Pointer(&key[0])), C.size_t(len(key)),
		c.txn.val,
		C.uint(flags|C.MDB_RESERVE),
	)
	err := operrno("mdb_cursor_put", ret)
	if err != nil {
		*c.txn.val = C.MDB_val{}
		return nil, err
	}
	b := getBytes(c.txn.val)
	*c.txn.val = C.MDB_val{}
	return b, nil
}
589752
func (l *WAL) WriteMulti(ctx context.Context, values map[string][]value.Value) (int, error) {
	span, _ := tracing.StartSpanFromContext(ctx)
	defer span.Finish()

	if !l.enabled {
		return -1, nil
	}

	entry := &WriteWALEntry{
		Values: values,
	}

	id, err := l.writeToLog(entry)
	if err != nil {
		l.tracker.IncWritesErr()
		return -1, err
	}
	l.tracker.IncWritesOK()

	return id, nil
}
390078
func (b UpdateMap) Put(ns, coll, key string, value []byte, version *version.Height) {
	b.PutValAndMetadata(ns, coll, key, value, nil, version)
}
972551
func (c *MockClient) DeleteMulti(keys []string) []MutateResponse {
	res := make([]MutateResponse, len(keys))
	for i, key := range keys {
		res[i] = c.Delete(key)
	}
	return res
}
480584
func (m *Multi) PutPart(ctx context.Context, n int, r io.ReadSeeker) (Part, error) {
	partSize, _, md5b64, err := seekerInfo(r)
	if err != nil {
		return Part{}, err
	}
	return m.putPart(ctx, n, r, partSize, md5b64)
}
612302
func (b *Bucket) InitMulti(ctx context.Context, key string, contType string, perm ACL) (*Multi, error) {
	headers := map[string][]string{
		"Content-Type":   {contType},
		"Content-Length": {"0"},
		"x-amz-acl":      {string(perm)},
	}
	params := map[string][]string{
		"uploads": {""},
	}
	req := &request{
		method:  "POST",
		bucket:  b.Name,
		path:    key,
		headers: headers,
		params:  params,
	}
	var err error
	var resp struct {
		UploadID string `xml:"UploadId"`
	}
	for attempt := b.S3.AttemptStrategy.Start(); attempt.Next(); {
		err = b.S3.query(ctx, req, &resp)
		if !shouldRetry(err) {
			break
		}
	}
	if err != nil {
		return nil, err
	}
	return &Multi{Bucket: b, Key: key, UploadID: resp.UploadID}, nil
}
1004094
func (dds *Delayed) Put(key ds.Key, value []byte) (err error) {
	dds.delay.Wait()
	return dds.ds.Put(key, value)
}
128499
func (d *Datastore) Put(k ds.Key, val []byte) error {
	d.buffer[k] = op{value: val}
	if len(d.buffer) > d.maxBufferEntries {
		return d.Flush()
	}
	return nil
}
459949
func (c *ShardedClient) mutateMulti(
	shards map[int]*ShardMapping,
	mutateMultiFunc func(Client, *ShardMapping) []MutateResponse) []MutateResponse {

	numKeys := 0

	resultsChannel := make(chan []MutateResponse, len(shards))
	for shard, mapping := range shards {
		numKeys += len(mapping.Keys)
		go c.mutateMultiHelper(
			mutateMultiFunc,
			shard,
			mapping,
			resultsChannel)
	}

	results := make([]MutateResponse, 0, numKeys)
	for i := 0; i < len(shards); i++ {
		results = append(results, (<-resultsChannel)...)
	}
	return results
}
1181177
func (c *Client) PutAll() {
	for {
		select {
		case b := <-c.sent:
			c.p.ch <- b
		default:
			return
		}
	}
}
1295920
func Put(store string, key string, value []byte, oldVal []byte) int {

	existingVal, casIndex, ok := Get(store, key)

	if ok && !bytes.Equal(oldVal, existingVal) {
		return OUTDATED
	}

	url := CONSUL_KV_BASE_URL + store + "/" + key + "?cas=" + strconv.Itoa(casIndex)
	//glog.Infof("Updating KV pair for %s %s %s %d", url, key, value, casIndex)

	req, err := http.NewRequest("PUT", url, bytes.NewBuffer(value))

	client := &http.Client{}
	resp, err := client.Do(req)

	if err != nil {
		glog.Errorf("Error creating KV pair for %s", key)
		return ERROR
	}

	defer resp.Body.Close()

	body, _ := ioutil.ReadAll(resp.Body)

	if string(body) == "false" {
		return ERROR
	}

	return OK

}
494692
func (md *MDCacheStandard) PutNextMD(
	tlfID tlf.ID, rootSeqno keybase1.Seqno, nextKbfsRoot *kbfsmd.MerkleRoot,
	nextMerkleNodes [][]byte, nextRootSeqno keybase1.Seqno) error {
	key := mdcacheNextMDKey{tlfID, rootSeqno}
	val := mdcacheNextMDVal{nextKbfsRoot, nextMerkleNodes, nextRootSeqno}
	md.nextMDLRU.Add(key, val)
	return nil
}