// Append appends the SQLNode to the buffer.
507892
func Append(buf *strings.Builder, node SQLNode) {
	tbuf := &TrackedBuffer{
		Builder: buf,
	}
	node.Format(tbuf)
}
449516
func (db *DB) Append(key []byte, value []byte) (int64, error) {
	if len(value) == 0 {
		return 0, nil
	}

	if err := checkKeySize(key); err != nil {
		return 0, err
	}
	key = db.encodeKVKey(key)

	t := db.kvBatch

	t.Lock()
	defer t.Unlock()

	oldValue, err := db.bucket.Get(key)
	if err != nil {
		return 0, err
	}

	if len(oldValue)+len(value) > MaxValueSize {
		return 0, errValueSize
	}

	oldValue = append(oldValue, value...)

	t.Put(key, oldValue)

	if err := t.Commit(); err != nil {
		return 0, nil
	}

	return int64(len(oldValue)), nil
}
9712
func (c *Client) Append(name string) (*FileWriter, error) {
	_, err := c.getFileInfo(name)
	if err != nil {
		return nil, &os.PathError{"append", name, interpretException(err)}
	}

	appendReq := &hdfs.AppendRequestProto{
		Src:        proto.String(name),
		ClientName: proto.String(c.namenode.ClientName),
	}
	appendResp := &hdfs.AppendResponseProto{}

	err = c.namenode.Execute("append", appendReq, appendResp)
	if err != nil {
		return nil, &os.PathError{"append", name, interpretException(err)}
	}

	f := &FileWriter{
		client:      c,
		name:        name,
		replication: int(appendResp.Stat.GetBlockReplication()),
		blockSize:   int64(appendResp.Stat.GetBlocksize()),
	}

	// This returns nil if there are no blocks (it's an empty file) or if the
	// last block is full (so we have to start a fresh block).
	block := appendResp.GetBlock()
	if block == nil {
		return f, nil
	}

	f.blockWriter = &rpc.BlockWriter{
		ClientName:          f.client.namenode.ClientName,
		Block:               block,
		BlockSize:           f.blockSize,
		Offset:              int64(block.B.GetNumBytes()),
		Append:              true,
		UseDatanodeHostname: f.client.options.UseDatanodeHostname,
		DialFunc:            f.client.options.DatanodeDialFunc,
	}

	err = f.blockWriter.SetDeadline(f.deadline)
	if err != nil {
		return nil, err
	}

	return f, nil
}
1144160
func (s *Schema) Append(col *Column) {
	s.Columns = append(s.Columns, col)
}
689817
func (session *SafeSession) Append(shardSession *vtgatepb.Session_ShardSession, txMode vtgatepb.TransactionMode) error {
	session.mu.Lock()
	defer session.mu.Unlock()

	if session.autocommitState == autocommitted {
		panic("BUG: SafeSession.Append: unexpected autocommit state")
	}

	// Always append, in order for rollback to succeed.
	session.ShardSessions = append(session.ShardSessions, shardSession)
	if session.isSingleDB(txMode) && len(session.ShardSessions) > 1 {
		session.mustRollback = true
		return vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "multi-db transaction attempted: %v", session.ShardSessions)
	}
	return nil
}
1247488
func (ldr *AEDatastoreAdminOperationListLoader) Append(v interface{}) error {
	if entity, ok := v.(*AEDatastoreAdminOperation); ok {
		ldr.List = append(ldr.List, entity)
	} else {
		return fmt.Errorf("v is not *AEDatastoreAdminOperation, actual: %#v", v)
	}

	return nil
}
1067515
func (c *Client) Append(cmd string, args ...interface{}) {
	c.pending = append(c.pending, &request{cmd, args})
}
261873
func (l *List) Append(n int64) {
	i := len(l.tree)
	l.tree = append(l.tree, 0)
	l.tree[i] = n - l.Get(i)
}
1125373
func (r *RootFS) Append(id layer.DiffID) {
	r.DiffIDs = append(r.DiffIDs, id)
}
6904
func (list *List) Append(value Value) {
	list.values = append(list.values, value)
}
909645
func (sf64 *SliceFloat64) Append(num float64) {
	sf64.Elements = append(sf64.Elements, num)
}
1239151
func (s *Stdout) Append(log Log) {
	msg := fmt.Sprintf(" {cyan}%s {default}%s {%s}%s[%s] ▶ %s",
		log.Logger.Name,
		log.Time.Format(s.DateFormat),
		log.Level.color,
		log.Level.icon,
		log.Level.Name[:4],
		log.Message)

	color.Print(msg).InFormat()
}
1172280
func (w *Writer) Append(key, value []byte) error {
	if w.err != nil {
		return w.err
	}
	if w.nEntries > 0 && w.cmp.Compare(w.dataBlock.prevKey, key) >= 0 {
		w.err = fmt.Errorf("leveldb/table: Writer: keys are not in increasing order: %q, %q", w.dataBlock.prevKey, key)
		return w.err
	}

	w.flushPendingBH(key)
	// Append key/value pair to the data block.
	w.dataBlock.append(key, value)
	// Add key to the filter block.
	w.filterBlock.add(key)

	// Finish the data block if block size target reached.
	if w.dataBlock.bytesLen() >= w.blockSize {
		if err := w.finishBlock(); err != nil {
			w.err = err
			return w.err
		}
	}
	w.nEntries++
	return nil
}
55825
func (pq *ParsedQuery) Append(buf *strings.Builder, bindVariables map[string]*querypb.BindVariable, extras map[string]Encodable) error {
	current := 0
	for _, loc := range pq.bindLocations {
		buf.WriteString(pq.Query[current:loc.offset])
		name := pq.Query[loc.offset : loc.offset+loc.length]
		if encodable, ok := extras[name[1:]]; ok {
			encodable.EncodeSQL(buf)
		} else {
			supplied, _, err := FetchBindVar(name, bindVariables)
			if err != nil {
				return err
			}
			EncodeValue(buf, supplied)
		}
		current = loc.offset + loc.length
	}
	buf.WriteString(pq.Query[current:])
	return nil
}
1294115
func (s *scc) append(components [][]int, v int) [][]int {
	// A vertex remains on this stack after it has been visited iff
	// there is a path from it to some vertex earlier on the stack.
	s.stack = append(s.stack, v)

	// lowLink[v] is the smallest vertex known to be reachable from v.
	s.lowLink[v] = s.time
	s.time++

	newComponent := true
	s.visited[v] = true
	s.graph.Visit(v, func(w int, _ int64) (skip bool) {
		if !s.visited[w] {
			components = s.append(components, w)
		}
		if s.lowLink[v] > s.lowLink[w] {
			s.lowLink[v] = s.lowLink[w]
			newComponent = false
		}
		return
	})
	if !newComponent {
		return components
	}
	var comp []int
	for {
		n := len(s.stack) - 1
		w := s.stack[n]
		s.stack = s.stack[:n]
		s.lowLink[w] = int(^uint(0) >> 1) // maxint
		comp = append(comp, w)
		if v == w {
			return append(components, comp)
		}
	}
}
48367
func (e Error) Append(format string, a ...interface{}) Error {
	// eCp := *e
	if NewLine {
		format += "\n"
	}
	e.message += fmt.Sprintf(format, a...)
	e.appended = true
	return e
}
429306
func (s *Block) AppendNode(n Node) {
	s.Nodes = append(s.Nodes, n)
}