// getItemByID returns an item, if found, for the given ID.
180188
func (pq *PriorityQueue) getItemByPriorityID(priority uint8, id uint64) (*PriorityItem, error) {
	// Check if empty or out of bounds.
	if pq.levels[priority].length() == 0 {
		return nil, ErrEmpty
	} else if id <= pq.levels[priority].head || id > pq.levels[priority].tail {
		return nil, ErrOutOfBounds
	}

	// Get item from database.
	var err error
	item := &PriorityItem{ID: id, Priority: priority, Key: pq.generateKey(priority, id)}
	if item.Value, err = pq.db.Get(item.Key, nil); err != nil {
		return nil, err
	}

	return item, nil
}
302088
func (m *Milestone) GetID() int64 {
	if m == nil || m.ID == nil {
		return 0
	}
	return *m.ID
}
514493
func (m *RecordCollectionManager) FindRecordByID(rID string) (*common.Record, error) {
	Record := &common.Record{}
	err := m.manager.col.Find(bson.M{"_id": rID}).One(Record)
	return Record, err
}
596677
func (j *Jenkins) GetQueueItem(id int64) (*Task, error) {
	t := &Task{Raw: new(taskResponse), Jenkins: j, Base: j.getQueueItemURL(id)}
	_, err := t.Poll()
	if err != nil {
		return nil, err
	}
	return t, nil
}
688425
func (c *Client) GetExecutorByID(executor []Executor, executorID string) (*Executor, error) {
	for _, e := range executor {
		if e.ID == executorID {
			return &e, nil
		}
	}

	return nil, fmt.Errorf("No executor found with id \"%s\"", executorID)
}
1150705
func (w *WebHookCommit) GetID() string {
	if w == nil || w.ID == nil {
		return ""
	}
	return *w.ID
}
834071
func FnFindContainerByID(client *docker.Client, ID string) (container docker.APIContainers, err error) {
	var containers []docker.APIContainers
	containers, err = client.ListContainers(docker.ListContainersOptions{All: true})
	if err != nil {
		return
	}
	for _, v := range containers {
		if v.ID == ID {
			container = v
			return
		}
	}
	err = ErrContainerNotFound
	return
}
1320189
func (c *Cache) GetBytes(id string) (ItemInfo, []byte, error) {
	id = cleanID(id)

	c.nlocker.Lock(id)
	defer c.nlocker.Unlock(id)

	info := ItemInfo{Name: id}

	if r := c.getOrRemove(id); r != nil {
		defer r.Close()
		b, err := ioutil.ReadAll(r)
		return info, b, err
	}

	return info, nil, nil
}
18834
func (s *StatusEvent) GetID() int64 {
	if s == nil || s.ID == nil {
		return 0
	}
	return *s.ID
}
737893
func (m *FileManager) GetById(id string) (*file.File, error) {
	f, err := m.grid.OpenId(id)
	if err != nil {
		return nil, stackerr.Wrap(err)
	}
	meta := &file.Meta{}
	if err = f.GetMeta(meta); err != nil {
		return nil, stackerr.Wrap(err)
	}
	meta.MD5 = f.MD5()
	return &file.File{Meta: meta, ReadCloser: f}, nil
}
922308
func (a *Allocator) GetByID(id idpool.ID) (AllocatorKey, error) {
	if key := a.mainCache.getByID(id); key != nil {
		return key, nil
	}

	v, err := kvstore.Get(path.Join(a.idPrefix, id.String()))
	if err != nil {
		return nil, err
	}

	return a.keyType.PutKey(string(v))
}
403869
func (n *Notification) GetID() string {
	if n == nil || n.ID == nil {
		return ""
	}
	return *n.ID
}
85852
func (item *MultiGetItem) Id(id string) *MultiGetItem {
	item.id = id
	return item
}
488261
func (d *DeploymentStatus) GetID() int64 {
	if d == nil || d.ID == nil {
		return 0
	}
	return *d.ID
}
734774
func (c *Cache) Get(id string) (ItemInfo, io.ReadCloser, error) {
	id = cleanID(id)

	c.nlocker.Lock(id)
	defer c.nlocker.Unlock(id)

	info := ItemInfo{Name: id}

	r := c.getOrRemove(id)

	return info, r, nil
}
415592
func (p *PushEventRepository) GetID() int64 {
	if p == nil || p.ID == nil {
		return 0
	}
	return *p.ID
}
45072
func (d *Deployment) GetID() int64 {
	if d == nil || d.ID == nil {
		return 0
	}
	return *d.ID
}