// GetHeapObjectId -
// objectId - Identifier of the object to get heap object id for.
// Returns -  heapSnapshotObjectId - Id of the heap snapshot object corresponding to the passed remote object id.
342331
func (c *HeapProfiler) GetHeapObjectId(objectId string) (string, error) {
	var v HeapProfilerGetHeapObjectIdParams
	v.ObjectId = objectId
	return c.GetHeapObjectIdWithParams(&v)
}
902847
func (si *SnapshotInfo) GetSnapshotID() string {
	if strings.IndexByte(si.AuthServiceURL, ',') != -1 {
		panic(fmt.Errorf("forbidden symbol ',' in URL %q", si.AuthServiceURL))
	}
	return fmt.Sprintf("v1,%s,%d", si.AuthServiceURL, si.Rev)
}
614286
func (m Metadata) GetObject(key string) (Metadata, error) {
	val, ok := m[key]
	if !ok {
		return nil, ErrMetadataNonexistantKey
	}
	if val.Type != MetadataValueTypeObject {
		return nil, ErrMetadataUnexpectedValueType
	}
	out, _ := val.Value.(Metadata)
	return out, nil
}
941557
func GetObject(gc *storage.Client, bucket, name string) (*bytes.Buffer, error) {

	rc, err := gc.Bucket(bucket).Object(name).NewReader(context.Background())
	if err != nil {
		if err == storage.ErrObjectNotExist {
			return nil, cloudstorage.ErrObjectNotFound
		}
		return nil, err
	}
	by, err := ioutil.ReadAll(rc)
	if err != nil {
		return nil, err
	}
	return bytes.NewBuffer(by), nil
}
421023
func (c cacheObjects) GetObject(ctx context.Context, bucket, object string, startOffset int64, length int64, writer io.Writer, etag string, opts ObjectOptions) (err error) {
	GetObjectFn := c.GetObjectFn
	GetObjectInfoFn := c.GetObjectInfoFn

	if c.isCacheExclude(bucket, object) {
		return GetObjectFn(ctx, bucket, object, startOffset, length, writer, etag, opts)
	}
	// fetch cacheFSObjects if object is currently cached or nearest available cache drive
	dcache, err := c.cache.getCachedFSLoc(ctx, bucket, object)
	if err != nil {
		return GetObjectFn(ctx, bucket, object, startOffset, length, writer, etag, opts)
	}
	// stat object on backend
	objInfo, err := GetObjectInfoFn(ctx, bucket, object, opts)
	backendDown := backendDownError(err)
	if err != nil && !backendDown {
		if _, ok := err.(ObjectNotFound); ok {
			// Delete the cached entry if backend object was deleted.
			dcache.Delete(ctx, bucket, object)
		}
		return err
	}

	if !backendDown && !objInfo.IsCacheable() {
		return GetObjectFn(ctx, bucket, object, startOffset, length, writer, etag, opts)
	}

	if !backendDown && filterFromCache(objInfo.UserDefined) {
		return GetObjectFn(ctx, bucket, object, startOffset, length, writer, etag, opts)
	}

	cachedObjInfo, err := dcache.GetObjectInfo(ctx, bucket, object, opts)
	if err == nil {
		if backendDown {
			// If the backend is down, serve the request from cache.
			return dcache.Get(ctx, bucket, object, startOffset, length, writer, etag, opts)
		}
		if cachedObjInfo.ETag == objInfo.ETag && !isStaleCache(objInfo) {
			return dcache.Get(ctx, bucket, object, startOffset, length, writer, etag, opts)
		}
		dcache.Delete(ctx, bucket, object)
	}
	if startOffset != 0 || (length > 0 && length != objInfo.Size) {
		// We don't cache partial objects.
		return GetObjectFn(ctx, bucket, object, startOffset, length, writer, etag, opts)
	}
	if !dcache.diskAvailable(objInfo.Size) {
		return GetObjectFn(ctx, bucket, object, startOffset, length, writer, etag, opts)
	}
	// Initialize pipe.
	pipeReader, pipeWriter := io.Pipe()
	hashReader, err := hash.NewReader(pipeReader, objInfo.Size, "", "", objInfo.Size)
	if err != nil {
		return err
	}
	go func() {
		gerr := GetObjectFn(ctx, bucket, object, 0, objInfo.Size, io.MultiWriter(writer, pipeWriter), etag, opts)
		pipeWriter.CloseWithError(gerr) // Close writer explicitly signaling we wrote all data.
	}()

	opts.UserDefined = c.getMetadata(objInfo)
	err = dcache.Put(ctx, bucket, object, NewPutObjReader(hashReader, nil, nil), opts)
	if err != nil {
		return err
	}
	pipeReader.Close()
	return
}
703510
func (a *api) GetSnapshotByServiceIDAndTag(serviceID string, tag string) (string, error) {
	client, err := a.connectDAO()
	if err != nil {
		return "", err
	}
	req := dao.SnapshotByTagRequest{
		ServiceID: serviceID,
		TagName:   tag,
	}

	var snapshot dao.SnapshotInfo
	if err := client.GetSnapshotByServiceIDAndTag(req, &snapshot); err != nil {
		return "", err
	}

	return snapshot.SnapshotID, nil
}
488878
func (l *s3EncObjects) GetObject(ctx context.Context, bucket string, key string, startOffset int64, length int64, writer io.Writer, etag string, opts minio.ObjectOptions) error {
	return l.getObject(ctx, bucket, key, startOffset, length, writer, etag, opts)
}
585289
func (client *storageRESTClient) getInstanceID() (err error) {
	// getInstanceID() does not use storageRESTClient.call()
	// function so we need to update lastError field here.
	defer func() {
		if err != nil {
			client.lastError = err
		}
	}()

	respBody, err := client.restClient.Call(storageRESTMethodGetInstanceID, nil, nil, -1)
	if err != nil {
		return err
	}
	defer http.DrainBody(respBody)
	instanceIDBuf := make([]byte, 64)
	n, err := io.ReadFull(respBody, instanceIDBuf)
	if err != io.EOF && err != io.ErrUnexpectedEOF {
		return err
	}
	client.instanceID = string(instanceIDBuf[:n])
	return nil
}
175678
func (a *SetFileInputFilesArgs) SetObjectID(objectID runtime.RemoteObjectID) *SetFileInputFilesArgs {
	a.ObjectID = &objectID
	return a
}
1160276
func (os *OpenStack) GetNodeNameByID(instanceID string) (types.NodeName, error) {
	client, err := os.NewComputeV2()
	var nodeName types.NodeName
	if err != nil {
		return nodeName, err
	}

	server, err := servers.Get(client, instanceID).Extract()
	if err != nil {
		return nodeName, err
	}
	nodeName = mapServerToNodeName(server)
	return nodeName, nil
}
1177565
func (f *FS) getObjectMeta(ctx context.Context, objectname string) (*object, error) {

	req := &s3.HeadObjectInput{
		Key:    aws.String(objectname),
		Bucket: aws.String(f.bucket),
	}

	res, err := f.client.HeadObjectWithContext(ctx, req)
	if err != nil {
		// translate the string error to typed error
		if strings.Contains(err.Error(), "Not Found") {
			return nil, cloudstorage.ErrObjectNotFound
		}
		return nil, err
	}

	return newObjectFromHead(f, objectname, res), nil
}
473803
func (d *domainClient) GetHeapObjectID(ctx context.Context, args *GetHeapObjectIDArgs) (reply *GetHeapObjectIDReply, err error) {
	reply = new(GetHeapObjectIDReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "HeapProfiler.getHeapObjectId", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "HeapProfiler.getHeapObjectId", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "HeapProfiler", Op: "GetHeapObjectID", Err: err}
	}
	return
}
82672
func (f *Facade) GetSnapshotByServiceIDAndTag(ctx datastore.Context, serviceID, tagName string) (*dfs.SnapshotInfo, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetSnapshotByServiceIDAndTag"))
	logger := plog.WithFields(logrus.Fields{
		"serviceid": serviceID,
		"tagname":   tagName,
	})

	tenantID, err := f.GetTenantID(ctx, serviceID)
	if err != nil {
		logger.WithError(err).Debug("Could not find tenant for service")
		return nil, err
	}
	logger = logger.WithField("tenantid", tenantID)
	info, err := f.dfs.TagInfo(tenantID, tagName)
	if err != nil {
		logger.WithError(err).Debug("Could not get info for snapshot tag")
		return nil, err
	}
	return info, nil
}
1139514
func (s *xlSets) GetObjectInfo(ctx context.Context, bucket, object string, opts ObjectOptions) (objInfo ObjectInfo, err error) {
	return s.getHashedSet(object).GetObjectInfo(ctx, bucket, object, opts)
}
806773
func (c *HeapProfiler) GetHeapObjectIdWithParams(v *HeapProfilerGetHeapObjectIdParams) (string, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "HeapProfiler.getHeapObjectId", Params: v})
	if err != nil {
		return "", err
	}

	var chromeData struct {
		Result struct {
			HeapSnapshotObjectId string
		}
	}

	if resp == nil {
		return "", &gcdmessage.ChromeEmptyResponseErr{}
	}

	// test if error first
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return "", &gcdmessage.ChromeRequestErr{Resp: cerr}
	}

	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return "", err
	}

	return chromeData.Result.HeapSnapshotObjectId, nil
}
1049671
func (n *Node) GetNodeIDByRaftID(raftID uint64) (string, error) {
	if member, ok := n.cluster.Members()[raftID]; ok {
		return member.NodeID, nil
	}
	// this is the only possible error value that should be returned; the
	// manager code depends on this. if you need to add more errors later, make
	// sure that you update the callers of this method accordingly
	return "", ErrMemberUnknown
}
577029
func (RPCResponse *RPCResponse) GetObject(toType interface{}) error {
	js, err := json.Marshal(RPCResponse.Result)
	if err != nil {
		return err
	}

	err = json.Unmarshal(js, toType)
	if err != nil {
		return err
	}

	return nil
}