Documentation ¶
Index ¶
- Constants
- type AllocCacheEventHandlerFunc
- type AllocEvent
- type AllocStore
- func (store *AllocStore) ClearAlloc()
- func (store *AllocStore) CreateAlloc(location string, data []byte)
- func (store *AllocStore) CreateAllocJob(location string, key string, jobId string)
- func (store *AllocStore) GetAlloc(location string) *models.JobsAlloc
- func (store *AllocStore) GetAllocJob(location string, jobId string) *models.JobData
- func (store *AllocStore) GetAllocJobIds(location string, key string) []string
- func (store *AllocStore) HasAlloc(location string) bool
- func (store *AllocStore) HasAllocJobId(location string, jobId string) bool
- func (store *AllocStore) RemoveAlloc(location string)
- func (store *AllocStore) RemoveAllocJob(location string, jobId string)
- func (store *AllocStore) RemoveAllocJobs(location string, jobIds []string)
- func (store *AllocStore) SetAllocJobsKey(location string, jobs map[string]string)
- func (store *AllocStore) UpdateAllocJobs(location string, jobIds []string)
- type CacheConfigs
- type CacheRepository
- func (cacheRepository *CacheRepository) ChangeLocationAlloc(location string)
- func (cacheRepository *CacheRepository) ChangeWorker(key string, node *gzkwrapper.NodeData)
- func (cacheRepository *CacheRepository) ChoiceWorker(location string, key string, servers []string) *Worker
- func (cacheRepository *CacheRepository) Clear()
- func (cacheRepository *CacheRepository) Close()
- func (cacheRepository *CacheRepository) CreateAllocJob(location string, key string, jobId string)
- func (cacheRepository *CacheRepository) CreateLocationAlloc(location string)
- func (cacheRepository *CacheRepository) CreateWorker(key string, node *gzkwrapper.NodeData)
- func (cacheRepository *CacheRepository) GetAlloc(location string) *models.JobsAlloc
- func (cacheRepository *CacheRepository) GetAllocData(location string) *models.JobsAllocData
- func (cacheRepository *CacheRepository) GetAllocJob(location string, jobId string) *models.JobData
- func (cacheRepository *CacheRepository) GetAllocJobIds(location string, key string) []string
- func (cacheRepository *CacheRepository) GetJob(jobid string) *models.Job
- func (cacheRepository *CacheRepository) GetLocation(location string) *models.WorkLocation
- func (cacheRepository *CacheRepository) GetLocationGroup(location string, groupid string) *models.Group
- func (cacheRepository *CacheRepository) GetLocationGroups(location string) []*models.Group
- func (cacheRepository *CacheRepository) GetLocationServers(location string) []*models.Server
- func (cacheRepository *CacheRepository) GetLocationSimpleJobs(location string) []*models.SimpleJob
- func (cacheRepository *CacheRepository) GetLocationsName() []string
- func (cacheRepository *CacheRepository) GetRawJob(jobid string) *models.Job
- func (cacheRepository *CacheRepository) GetSimpleJob(jobid string) *models.SimpleJob
- func (cacheRepository *CacheRepository) GetWorker(key string) *Worker
- func (cacheRepository *CacheRepository) GetWorkers(location string) []*Worker
- func (cacheRepository *CacheRepository) HasAlloc(location string) bool
- func (cacheRepository *CacheRepository) HasAllocJobId(location string, jobId string) bool
- func (cacheRepository *CacheRepository) InitLocalStorageLocations()
- func (cacheRepository *CacheRepository) Open() error
- func (cacheRepository *CacheRepository) RemoveAllocJob(location string, jobId string)
- func (cacheRepository *CacheRepository) RemoveAllocJobs(location string, jobIds []string)
- func (cacheRepository *CacheRepository) RemoveJob(jobid string)
- func (cacheRepository *CacheRepository) RemoveJobs(jobIds []string)
- func (cacheRepository *CacheRepository) RemoveLocationAlloc(location string)
- func (cacheRepository *CacheRepository) RemoveWorker(key string, node *gzkwrapper.NodeData)
- func (cacheRepository *CacheRepository) SetAllocJobsKey(location string, jobs map[string]string)
- func (cacheRepository *CacheRepository) SetJobAction(location string, jobid string, action string)
- func (cacheRepository *CacheRepository) SetJobExecute(jobid string, state int, execerr string, execat time.Time, nextat time.Time)
- func (cacheRepository *CacheRepository) SetJobLog(joblog *models.JobLog)
- func (cacheRepository *CacheRepository) SetJobNextAt(jobid string, nextat time.Time)
- func (cacheRepository *CacheRepository) SetJobState(jobid string, state int)
- func (cacheRepository *CacheRepository) SetStorageDriverConfigParameters(parameters types.Parameters)
- func (cacheRepository *CacheRepository) UpdateAllocJob(location string, jobId string)
- func (cacheRepository *CacheRepository) UpdateAllocJobs(location string, jobIds []string)
- type LocalStorage
- func (storage *LocalStorage) AddJob(job *models.Job)
- func (storage *LocalStorage) Clear()
- func (storage *LocalStorage) ContainsLocationServer(location string, ipaddr string, hostname string) bool
- func (storage *LocalStorage) GetJob(jobid string) *models.Job
- func (storage *LocalStorage) GetLocation(location string) *models.WorkLocation
- func (storage *LocalStorage) GetLocationGroup(location string, groupid string) *models.Group
- func (storage *LocalStorage) GetLocationGroups(location string) []*models.Group
- func (storage *LocalStorage) GetLocationServers(location string) []*models.Server
- func (storage *LocalStorage) GetLocationsName() []string
- func (storage *LocalStorage) RemoveJob(jobid string)
- func (storage *LocalStorage) RemoveLocation(location string)
- func (storage *LocalStorage) SetLocation(workLocation *models.WorkLocation)
- type NodeCacheEventHandlerFunc
- type NodeEvent
- type NodeStore
- func (store *NodeStore) ChangeWorker(location string, attach *models.AttachData, server *models.Server)
- func (store *NodeStore) ClearWorkers()
- func (store *NodeStore) ContainsLocationWorker(location string, ipaddr string) bool
- func (store *NodeStore) CreateWorker(location string, attach *models.AttachData, server *models.Server)
- func (store *NodeStore) GetWorker(key string) *Worker
- func (store *NodeStore) GetWorkers(location string) []*Worker
- func (store *NodeStore) HashLocationRangeWorker(location string, key string, servers []string) *Worker
- func (store *NodeStore) HashLocationWorker(location string, key string) *Worker
- func (store *NodeStore) RemoveLocation(location string)
- func (store *NodeStore) RemoveWorker(location string, key string)
- type ProcLocationAllocFunc
- type ReadLocationAllocFunc
- type Worker
Constants ¶
const ( MinLRUSize = 128 MaxLRUSize = 1024 DefaultLRUSize = 256 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllocCacheEventHandlerFunc ¶
type AllocCacheEventHandlerFunc func(event AllocEvent, location string, data []byte, err error)
AllocCacheEventHandlerFunc is exported
type AllocEvent ¶
type AllocEvent int
AllocEvent is exported
const ( ALLOC_CREATED_EVENT AllocEvent = iota + 1 ALLOC_CHANGED_EVENT ALLOC_REMOVED_EVENT )
func (AllocEvent) String ¶
func (event AllocEvent) String() string
type AllocStore ¶
AllocStore is exported
func NewAllocStore ¶
func NewAllocStore(callback AllocCacheEventHandlerFunc) *AllocStore
NewAllocStore is exported
func (*AllocStore) CreateAlloc ¶
func (store *AllocStore) CreateAlloc(location string, data []byte)
CreateAlloc is exported
func (*AllocStore) CreateAllocJob ¶
func (store *AllocStore) CreateAllocJob(location string, key string, jobId string)
CreateAllocJob is exported create jobdata to location alloc.
func (*AllocStore) GetAlloc ¶
func (store *AllocStore) GetAlloc(location string) *models.JobsAlloc
GetAlloc is exported return location jobsalloc.
func (*AllocStore) GetAllocJob ¶
func (store *AllocStore) GetAllocJob(location string, jobId string) *models.JobData
GetAllocJob is exported return location alloc's jobdata.
func (*AllocStore) GetAllocJobIds ¶
func (store *AllocStore) GetAllocJobIds(location string, key string) []string
GetAllocJobIds is exported return all jobs ids contained in location key.
func (*AllocStore) HasAlloc ¶
func (store *AllocStore) HasAlloc(location string) bool
HasAlloc is exported
func (*AllocStore) HasAllocJobId ¶
func (store *AllocStore) HasAllocJobId(location string, jobId string) bool
HasAllocJobId is exported
func (*AllocStore) RemoveAlloc ¶
func (store *AllocStore) RemoveAlloc(location string)
RemoveAlloc is exported
func (*AllocStore) RemoveAllocJob ¶
func (store *AllocStore) RemoveAllocJob(location string, jobId string)
RemoveAllocJob is exported remove jobdata to location alloc.
func (*AllocStore) RemoveAllocJobs ¶
func (store *AllocStore) RemoveAllocJobs(location string, jobIds []string)
RemoveAllocJobs is exported
func (*AllocStore) SetAllocJobsKey ¶
func (store *AllocStore) SetAllocJobsKey(location string, jobs map[string]string)
SetAllocJobsKey is exported set location alloc's jobs key.
func (*AllocStore) UpdateAllocJobs ¶
func (store *AllocStore) UpdateAllocJobs(location string, jobIds []string)
UpdateAllocJobs is exported update location's jobIds version & alloc version.
type CacheConfigs ¶
type CacheConfigs struct { LRUSize int StorageBackend types.Backend StorageDriverParameters types.Parameters AllocHandlerFunc AllocCacheEventHandlerFunc NodeHandlerFunc NodeCacheEventHandlerFunc ReadLocationAllocFunc ReadLocationAllocFunc ProcLocationAllocFunc ProcLocationAllocFunc }
CacheConfigs is exported
type CacheRepository ¶
type CacheRepository struct {
// contains filtered or unexported fields
}
CacheRepository is expotred
func NewCacheRepository ¶
func NewCacheRepository(configs *CacheConfigs) (*CacheRepository, error)
NewCacheRepository is expotred
func (*CacheRepository) ChangeLocationAlloc ¶
func (cacheRepository *CacheRepository) ChangeLocationAlloc(location string)
ChangeLocationAlloc is exported
func (*CacheRepository) ChangeWorker ¶
func (cacheRepository *CacheRepository) ChangeWorker(key string, node *gzkwrapper.NodeData)
ChangeWorker is exported
func (*CacheRepository) ChoiceWorker ¶
func (cacheRepository *CacheRepository) ChoiceWorker(location string, key string, servers []string) *Worker
ChoiceWorker is exported
func (*CacheRepository) CreateAllocJob ¶
func (cacheRepository *CacheRepository) CreateAllocJob(location string, key string, jobId string)
CreateAllocJob is exported
func (*CacheRepository) CreateLocationAlloc ¶
func (cacheRepository *CacheRepository) CreateLocationAlloc(location string)
CreateLocationAlloc is exported
func (*CacheRepository) CreateWorker ¶
func (cacheRepository *CacheRepository) CreateWorker(key string, node *gzkwrapper.NodeData)
CreateWorker is exported
func (*CacheRepository) GetAlloc ¶
func (cacheRepository *CacheRepository) GetAlloc(location string) *models.JobsAlloc
GetAlloc is exported
func (*CacheRepository) GetAllocData ¶
func (cacheRepository *CacheRepository) GetAllocData(location string) *models.JobsAllocData
GetAllocData is exported
func (*CacheRepository) GetAllocJob ¶
func (cacheRepository *CacheRepository) GetAllocJob(location string, jobId string) *models.JobData
GetAllocJob is exported
func (*CacheRepository) GetAllocJobIds ¶
func (cacheRepository *CacheRepository) GetAllocJobIds(location string, key string) []string
GetAllocJobIds is exported
func (*CacheRepository) GetJob ¶
func (cacheRepository *CacheRepository) GetJob(jobid string) *models.Job
GetJob is exported
func (*CacheRepository) GetLocation ¶
func (cacheRepository *CacheRepository) GetLocation(location string) *models.WorkLocation
GetLocation is exported
func (*CacheRepository) GetLocationGroup ¶
func (cacheRepository *CacheRepository) GetLocationGroup(location string, groupid string) *models.Group
GetLocationGroup is exported
func (*CacheRepository) GetLocationGroups ¶
func (cacheRepository *CacheRepository) GetLocationGroups(location string) []*models.Group
GetLocationGroups is exported
func (*CacheRepository) GetLocationServers ¶
func (cacheRepository *CacheRepository) GetLocationServers(location string) []*models.Server
GetLocationServers is exported
func (*CacheRepository) GetLocationSimpleJobs ¶
func (cacheRepository *CacheRepository) GetLocationSimpleJobs(location string) []*models.SimpleJob
GetLocationSimpleJobs is exported
func (*CacheRepository) GetLocationsName ¶
func (cacheRepository *CacheRepository) GetLocationsName() []string
GetLocationsName is exported
func (*CacheRepository) GetRawJob ¶
func (cacheRepository *CacheRepository) GetRawJob(jobid string) *models.Job
GetRawJob is exported
func (*CacheRepository) GetSimpleJob ¶
func (cacheRepository *CacheRepository) GetSimpleJob(jobid string) *models.SimpleJob
GetSimpleJob is exported
func (*CacheRepository) GetWorker ¶
func (cacheRepository *CacheRepository) GetWorker(key string) *Worker
GetWorker is exported
func (*CacheRepository) GetWorkers ¶
func (cacheRepository *CacheRepository) GetWorkers(location string) []*Worker
GetWorkers is exported
func (*CacheRepository) HasAlloc ¶
func (cacheRepository *CacheRepository) HasAlloc(location string) bool
HasAlloc is exported
func (*CacheRepository) HasAllocJobId ¶
func (cacheRepository *CacheRepository) HasAllocJobId(location string, jobId string) bool
HasAllocJobId is exported
func (*CacheRepository) InitLocalStorageLocations ¶
func (cacheRepository *CacheRepository) InitLocalStorageLocations()
InitLocalStorageLocations is exported
func (*CacheRepository) Open ¶
func (cacheRepository *CacheRepository) Open() error
Open is exported
func (*CacheRepository) RemoveAllocJob ¶
func (cacheRepository *CacheRepository) RemoveAllocJob(location string, jobId string)
RemoveAllocJob is exported
func (*CacheRepository) RemoveAllocJobs ¶
func (cacheRepository *CacheRepository) RemoveAllocJobs(location string, jobIds []string)
RemoveAllocJobs is exported
func (*CacheRepository) RemoveJob ¶
func (cacheRepository *CacheRepository) RemoveJob(jobid string)
RemoveJob is exported
func (*CacheRepository) RemoveJobs ¶
func (cacheRepository *CacheRepository) RemoveJobs(jobIds []string)
RemoveJobs is exported
func (*CacheRepository) RemoveLocationAlloc ¶
func (cacheRepository *CacheRepository) RemoveLocationAlloc(location string)
RemoveLocationAlloc is exported
func (*CacheRepository) RemoveWorker ¶
func (cacheRepository *CacheRepository) RemoveWorker(key string, node *gzkwrapper.NodeData)
RemoveWorker is exported
func (*CacheRepository) SetAllocJobsKey ¶
func (cacheRepository *CacheRepository) SetAllocJobsKey(location string, jobs map[string]string)
SetAllocJobsKey is exported
func (*CacheRepository) SetJobAction ¶
func (cacheRepository *CacheRepository) SetJobAction(location string, jobid string, action string)
SetJobAction is exported
func (*CacheRepository) SetJobExecute ¶
func (cacheRepository *CacheRepository) SetJobExecute(jobid string, state int, execerr string, execat time.Time, nextat time.Time)
SetJobExecute is exported
func (*CacheRepository) SetJobLog ¶
func (cacheRepository *CacheRepository) SetJobLog(joblog *models.JobLog)
SetJobLog is exported
func (*CacheRepository) SetJobNextAt ¶
func (cacheRepository *CacheRepository) SetJobNextAt(jobid string, nextat time.Time)
SetJobNextAt is exported
func (*CacheRepository) SetJobState ¶
func (cacheRepository *CacheRepository) SetJobState(jobid string, state int)
SetJobState is exported
func (*CacheRepository) SetStorageDriverConfigParameters ¶
func (cacheRepository *CacheRepository) SetStorageDriverConfigParameters(parameters types.Parameters)
SetStorageDriverConfigParameters is exported
func (*CacheRepository) UpdateAllocJob ¶
func (cacheRepository *CacheRepository) UpdateAllocJob(location string, jobId string)
UpdateAllocJob is exported
func (*CacheRepository) UpdateAllocJobs ¶
func (cacheRepository *CacheRepository) UpdateAllocJobs(location string, jobIds []string)
UpdateAllocJobs is exported
type LocalStorage ¶
LocalStorage is exported
func (*LocalStorage) AddJob ¶
func (storage *LocalStorage) AddJob(job *models.Job)
AddJob is exported
func (*LocalStorage) ContainsLocationServer ¶
func (storage *LocalStorage) ContainsLocationServer(location string, ipaddr string, hostname string) bool
ContainsLocationServer is exported
func (*LocalStorage) GetJob ¶
func (storage *LocalStorage) GetJob(jobid string) *models.Job
GetJob is exported
func (*LocalStorage) GetLocation ¶
func (storage *LocalStorage) GetLocation(location string) *models.WorkLocation
GetLocation is exported
func (*LocalStorage) GetLocationGroup ¶
func (storage *LocalStorage) GetLocationGroup(location string, groupid string) *models.Group
GetLocationGroup is exported
func (*LocalStorage) GetLocationGroups ¶
func (storage *LocalStorage) GetLocationGroups(location string) []*models.Group
GetLocationGroups is exported
func (*LocalStorage) GetLocationServers ¶
func (storage *LocalStorage) GetLocationServers(location string) []*models.Server
GetLocationServers is exported
func (*LocalStorage) GetLocationsName ¶
func (storage *LocalStorage) GetLocationsName() []string
GetLocationsName is exported
func (*LocalStorage) RemoveJob ¶
func (storage *LocalStorage) RemoveJob(jobid string)
RemoveJob is exported
func (*LocalStorage) RemoveLocation ¶
func (storage *LocalStorage) RemoveLocation(location string)
RemoveLocation is exported
func (*LocalStorage) SetLocation ¶
func (storage *LocalStorage) SetLocation(workLocation *models.WorkLocation)
SetLocation is exported
type NodeCacheEventHandlerFunc ¶
NodeCacheEventHandlerFunc is exported
type NodeStore ¶
NodeStore is exported
func NewNodeStore ¶
func NewNodeStore(callback NodeCacheEventHandlerFunc) *NodeStore
NewNodeStore is exported
func (*NodeStore) ChangeWorker ¶
func (store *NodeStore) ChangeWorker(location string, attach *models.AttachData, server *models.Server)
ChangeWorker is exported
func (*NodeStore) ContainsLocationWorker ¶
ContainsLocationWorker is exported
func (*NodeStore) CreateWorker ¶
func (store *NodeStore) CreateWorker(location string, attach *models.AttachData, server *models.Server)
CreateWorker is exported
func (*NodeStore) GetWorkers ¶
GetWorkers is exported
func (*NodeStore) HashLocationRangeWorker ¶
func (store *NodeStore) HashLocationRangeWorker(location string, key string, servers []string) *Worker
HashLocationRangeWorker is exported
func (*NodeStore) HashLocationWorker ¶
HashLocationWorker is exported
func (*NodeStore) RemoveLocation ¶
RemoveLocation is exported
func (*NodeStore) RemoveWorker ¶
RemoveWorker is exported
type ProcLocationAllocFunc ¶
type ProcLocationAllocFunc func(location string, addServers []*models.Server, delServers []*models.Server)
ProcLocationAllocFunc is exported
type ReadLocationAllocFunc ¶
ReadLocationAllocFunc is exported read jobs alloc path real data.