// Get implements the BlockOps interface for BlockOpsStandard.
556402
func (b *BlockOpsStandard) Get(ctx context.Context, kmd libkey.KeyMetadata,
	blockPtr data.BlockPointer, block data.Block, lifetime data.BlockCacheLifetime) error {
	// Check the journal explicitly first, so we don't get stuck in
	// the block-fetching queue.
	if journalBServer, ok := b.config.BlockServer().(journalBlockServer); ok {
		data, serverHalf, found, err := journalBServer.getBlockFromJournal(
			ctx, kmd.TlfID(), blockPtr.ID)
		if err != nil {
			return err
		}
		if found {
			return assembleBlock(
				ctx, b.config.keyGetter(), b.config.Codec(),
				b.config.cryptoPure(), kmd, blockPtr, block, data, serverHalf)
		}
	}

	b.log.LazyTrace(ctx, "BOps: Requesting %s", blockPtr.ID)

	errCh := b.queue.Request(
		ctx, defaultOnDemandRequestPriority, kmd,
		blockPtr, block, lifetime, b.config.Mode().DefaultBlockRequestAction())
	err := <-errCh

	b.log.LazyTrace(ctx, "BOps: Request fulfilled for %s (err=%v)", blockPtr.ID, err)

	return err
}
394156
func (kv *KV) Get(key []byte) (value []byte) {
	kv.db.View(func(tx *buntdb.Tx) error {
		val, err := tx.Get(gkv.Btos(key))
		if err != nil {
			return err
		}
		value = gkv.Stob(val)
		return nil
	})
	return
}
206604
func (e *Error) Get() error {
	e.lock.RLock()
	defer e.lock.RUnlock()

	return e.err
}
324676
func (p *BlockPrefetchClient) GetBlock(hash *chainhash.Hash) (*wire.MsgBlock, error) {
	msgBlock, _, err := p.GetBlockData(hash)
	return msgBlock, err
}
29635
func (s *state) getBlock(name string) *parse.BlockNode {
	for _, blocks := range s.blocks {
		if block, ok := blocks[name]; ok {
			return block
		}
	}

	return nil
}
315938
func (b *BlockServerRemote) Get(
	ctx context.Context, tlfID tlf.ID, id kbfsblock.ID,
	context kbfsblock.Context, cacheType DiskBlockCacheType) (
	buf []byte, serverHalf kbfscrypto.BlockCryptKeyServerHalf, err error) {
	ctx = rpc.WithFireNow(ctx)
	var res keybase1.GetBlockRes
	b.log.LazyTrace(ctx, "BServer: Get %s", id)

	// Once the block has been retrieved, cache it.
	defer func() {
		b.log.LazyTrace(ctx, "BServer: Get %s done (err=%v)", id, err)
		if err != nil {
			b.deferLog.CWarningf(
				ctx, "Get id=%s tlf=%s context=%s sz=%d err=%v",
				id, tlfID, context, len(buf), err)
		} else {
			// But don't cache it if it's archived data.
			if res.Status == keybase1.BlockStatus_ARCHIVED {
				return
			}

			b.deferLog.CDebugf(
				ctx, "Get id=%s tlf=%s context=%s sz=%d",
				id, tlfID, context, len(buf))
			dbc := b.config.DiskBlockCache()
			if dbc != nil {
				// This used to be called in a goroutine to prevent blocking
				// the `Get`. But we need this cached synchronously so prefetch
				// operations can work correctly.
				dbc.Put(ctx, tlfID, id, buf, serverHalf, cacheType)
			}
		}
	}()

	arg := kbfsblock.MakeGetBlockArg(tlfID, id, context)
	res, err = b.getConn.getClient().GetBlock(ctx, arg)
	return kbfsblock.ParseGetBlockRes(res, err)
}
453439
func Get(dest interface{}, q *gocql.Query) error {
	return Iter(q).Get(dest)
}
1077662
func (s *SortCommand) Get(patterns ...string) *SortCommand {
	s.get = patterns
	return s
}
924468
func (dbcr *DiskBlockCacheRemote) Get(ctx context.Context, tlfID tlf.ID,
	blockID kbfsblock.ID, _ DiskBlockCacheType) (buf []byte,
	serverHalf kbfscrypto.BlockCryptKeyServerHalf,
	prefetchStatus PrefetchStatus, err error) {
	dbcr.log.LazyTrace(ctx, "DiskBlockCacheRemote: Get %s", blockID)
	defer func() {
		dbcr.log.LazyTrace(ctx, "DiskBlockCacheRemote: Get %s done (err=%+v)", blockID, err)
	}()

	res, err := dbcr.client.GetBlock(ctx, kbgitkbfs.GetBlockArg{
		TlfID:   tlfID.Bytes(),
		BlockID: blockID.Bytes(),
	})
	if err != nil {
		return nil, kbfscrypto.BlockCryptKeyServerHalf{}, NoPrefetch, err
	}

	err = serverHalf.UnmarshalBinary(res.ServerHalf)
	if err != nil {
		return nil, kbfscrypto.BlockCryptKeyServerHalf{}, NoPrefetch, err
	}
	prefetchStatus = PrefetchStatusFromProtocol(res.PrefetchStatus)
	dbcr.statuses.Add(blockID, prefetchStatus)
	return res.Buf, serverHalf, prefetchStatus, nil
}
57661
func (cache *diskBlockCacheWrapped) Get(
	ctx context.Context, tlfID tlf.ID, blockID kbfsblock.ID,
	preferredCacheType DiskBlockCacheType) (
	buf []byte, serverHalf kbfscrypto.BlockCryptKeyServerHalf,
	prefetchStatus PrefetchStatus, err error) {
	cache.mtx.RLock()
	defer cache.mtx.RUnlock()
	primaryCache, secondaryCache := cache.rankCachesLocked(preferredCacheType)
	// Check both caches if the primary cache doesn't have the block.
	buf, serverHalf, prefetchStatus, err = primaryCache.Get(ctx, tlfID, blockID)
	if _, isNoSuchBlockError := errors.Cause(err).(data.NoSuchBlockError); isNoSuchBlockError &&
		secondaryCache != nil {
		buf, serverHalf, prefetchStatus, err = secondaryCache.Get(
			ctx, tlfID, blockID)
		if err != nil {
			return nil, kbfscrypto.BlockCryptKeyServerHalf{}, NoPrefetch, err
		}
		if preferredCacheType != DiskBlockAnyCache {
			cache.moveBetweenCachesWithBlockLocked(
				ctx, tlfID, blockID, buf, serverHalf, prefetchStatus,
				preferredCacheType)
		}
	}
	return buf, serverHalf, prefetchStatus, err
}
187000
func (client *Client) Get(ls Listable) (interface{}, error) {
	ctx, cancel := context.WithTimeout(context.Background(), client.Timeout)
	defer cancel()

	return client.GetWithContext(ctx, ls)
}
1127792
func (m *lockingMap) Get(key string) (interface{}, bool) {
	m.keyLocker.RLock(key)
	defer m.keyLocker.RUnlock(key)

	m.lock.RLock()
	defer m.lock.RUnlock()

	val, ok := m.data[key]
	if ok && (m.checkFunc == nil || m.checkFunc(key, val)) {
		return val, true
	} else {
		// No value or it failed to check
		return nil, false
	}
}
1112175
func (c *Collection) Get(key string, opts *GetOptions) (docOut *GetResult, errOut error) {
	if opts == nil {
		opts = &GetOptions{}
	}

	span := c.startKvOpTrace(opts.ParentSpanContext, "Get")
	defer span.Finish()

	ctx, cancel := c.context(opts.Context, opts.Timeout)
	if cancel != nil {
		defer cancel()
	}

	if (opts.Project == nil || (opts.Project != nil && len(opts.Project.Fields) > 16)) && !opts.WithExpiry {
		// Standard fulldoc
		doc, err := c.get(ctx, span.Context(), key, opts)
		if err != nil {
			return nil, err
		}
		return doc, nil
	}

	lookupOpts := LookupInOptions{Context: ctx, WithExpiry: opts.WithExpiry}
	spec := LookupInSpec{}
	var ops []LookupInOp
	if opts.Project == nil || (len(opts.Project.Fields) > 15 && opts.WithExpiry) {
		// This is a subdoc full doc as WithExpiry is set and projections are either missing or too many.
		ops = append(ops, spec.GetFull(nil))
		opts.Project = &ProjectOptions{}
	} else {
		for _, path := range opts.Project.Fields {
			ops = append(ops, spec.Get(path, nil))
		}
	}

	result, err := c.lookupIn(ctx, span.Context(), key, ops, lookupOpts)
	if err != nil {
		return nil, err
	}

	doc := &GetResult{}
	doc.withExpiration = result.withExpiration
	doc.expiration = result.expiration
	doc.cas = result.cas
	err = doc.fromSubDoc(ops, result, opts.Project.IgnorePathMissingError)
	if err != nil {
		return nil, err
	}

	return doc, nil
}
1217787
func Get() (p []byte, err error) {
	var l load.LoadAvg
	err = l.Get()
	if err != nil {
		return nil, err
	}
	return json.Marshal(&l)
}
128755
func (bp *BufferPool) Get() (res []byte) {
	bp.mutex.Lock()
	if bp.pos >= 0 {
		res = bp.pool[bp.pos]
		bp.pos--
	} else {
		res = make([]byte, bp.initBufSize, bp.initBufSize)
	}

	bp.mutex.Unlock()
	return res
}
543128
func (that *JSONNode) Get() interface{} {
	if that.t != TypeValue {
		panic(ErrorRetrieveUserValue)
	}
	if that.vChanged {
		rv := reflect.ValueOf(that.v)
		return rv.Elem().Interface()
	}
	return that.v
}
824337
func (txa *TxAllowAll) Get(immediate *querypb.VTGateCallerID, effective *vtrpcpb.CallerID) bool {
	return true
}