func (s *StandardScheduler) LoadResource(endPoint string) *core.ResourceInfo {
	defer s.resourceLocker.Unlock()
	s.resourceLocker.Lock()
	resource, isExists := s.resources[endPoint]
	if !isExists {
		resource := &core.ResourceInfo{}
		resource.RefreshLoadValue()
		s.resources[endPoint] = resource
	}
	return resource
}
LoadResource load resource by endPoint
package scheduler
import (
	"errors"
	"github.com/devfeel/rockman/core"
	"sort"
	"sync"
)
const (
	Balance_LowerLoad = iota  
	Balance_JobCount
	Balance_CpuRate
	Balance_MemoryRate
)
type (
	Scheduler interface {
		SetResource(resource *core.ResourceInfo)
		Resources() map[string]*core.ResourceInfo
		LoadResource(endPoint string) *core.ResourceInfo
		Schedule(balanceType int) ([]*core.ResourceInfo, error)
	}
	StandardScheduler struct {
		resources      map[string]*core.ResourceInfo
		resourceLocker *sync.RWMutex
	}
)
var ErrorNotSupportBalanceType = errors.New("not support balance type")
var ErrorNotExistsEnoughResource = errors.New("not exists enough resource")
func NewScheduler() Scheduler {
	scheduler := new(StandardScheduler)
	scheduler.resources = make(map[string]*core.ResourceInfo)
	scheduler.resourceLocker = new(sync.RWMutex)
	return scheduler
}
func (s *StandardScheduler) SetResource(resource *core.ResourceInfo) {
	defer s.resourceLocker.Unlock()
	s.resourceLocker.Lock()
	resource.RefreshLoadValue()
	s.resources[resource.EndPoint] = resource
}
func (s *StandardScheduler) Resources() map[string]*core.ResourceInfo {
	defer s.resourceLocker.RUnlock()
	s.resourceLocker.RLock()
	return s.resources
}