ste

package
v0.0.0-...-0cb12c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChunkTransferStatusInactive = 0
	ChunkTransferStatusActive   = 1
	ChunkTransferStatusProgress = 2
	ChunkTransferStatusComplete = 3
	ChunkTransferStatusFailed   = 4
)
View Source
const (
	HighJobPriority    = 0
	MediumJobPriority  = 1
	LowJobPriority     = 2
	DefaultJobPriority = HighJobPriority
)
View Source
const (
	MAX_SIZE_CONTENT_TYPE     = 256
	MAX_SIZE_CONTENT_ENCODING = 256
	MAX_SIZE_META_DATA        = 1000
)

Variables

This section is empty.

Functions

func ExecuteNewCopyJobPartOrder

func ExecuteNewCopyJobPartOrder(payload common.CopyJobPartOrder, coordiatorChannels *CoordinatorChannels, jPartPlanInfoMap *JobPartPlanInfoMap, jobToLoggerMap *JobToLoggerMap)

ExecuteNewCopyJobPartOrder api executes a new job part order

* payload -- It is the input data for new job part order. * coordiatorChannels -- coordinator channels has the High, Med and Low transfer msg channel to schedule the incoming transfers. * jPartPlanInfoMap -- Map to hold JobPartPlanInfo reference for combination of JobId and part number. * jobToLoggerMap -- Map to hold the logger instance specific to a job

func InitializeExecutionEngine

func InitializeExecutionEngine(execEngineChannels *EEChannels)

func InitializeSTE

func InitializeSTE() error

InitializeSTE initializes the coordinator channels, execution engine channels, coordinator and execution engine

func InitializedChannels

func InitializedChannels() (*CoordinatorChannels, *EEChannels)

InitializedChannels initializes the channels used further by coordinator and execution engine

Types

type ChunkMsg

type ChunkMsg struct {
	// contains filtered or unexported fields
}

type CoordinatorChannels

type CoordinatorChannels struct {
	HighTransfer chan<- TransferMsg
	MedTransfer  chan<- TransferMsg
	LowTransfer  chan<- TransferMsg
}

type EEChannels

type EEChannels struct {
	HighTransfer         <-chan TransferMsg
	MedTransfer          <-chan TransferMsg
	LowTransfer          <-chan TransferMsg
	HighChunkTransaction chan ChunkMsg
	MedChunkTransaction  chan ChunkMsg
	LowChunkTransaction  chan ChunkMsg
	SuicideChannel       <-chan SuicideJob
}

type JobPartPlanBlobData

type JobPartPlanBlobData struct {
	ContentTypeLength     uint8
	ContentType           [256]byte
	ContentEncodingLength uint8
	ContentEncoding       [256]byte
	MetaDataLength        uint16
	MetaData              [1000]byte
	BlockSize             uint64
}

JobPartPlan represent the header of Job Part's Optional Attributes in Memory Map File

type JobPartPlanHeader

type JobPartPlanHeader struct {
	Version            uint32 // represent the version of data schema format of header
	Id                 [128 / 8]byte
	PartNum            uint32
	IsFinalPart        bool
	Priority           uint8
	TTLAfterCompletion uint32
	SrcLocationType    common.LocationType
	DstLocationType    common.LocationType
	NumTransfers       uint32
	//Status uint8
	BlobData JobPartPlanBlobData
}

JobPartPlan represent the header of Job Part's Memory Map File

type JobPartPlanInfo

type JobPartPlanInfo struct {
	TrasnferInfo []TransferInfo
	Logger       *common.Logger
	// contains filtered or unexported fields
}

func (*JobPartPlanInfo) Transfer

func (job *JobPartPlanInfo) Transfer(index uint32) *JobPartPlanTransfer

Transfer api gives memory map JobPartPlanTransfer header for given index

type JobPartPlanInfoMap

type JobPartPlanInfoMap struct {
	// ReadWrite Mutex
	sync.RWMutex
	// contains filtered or unexported fields
}

JobToLoggerMap is the Synchronous Map of Map to hold JobPartPlanPointer reference for combination of JobId and partNum. Provides the thread safe Load and Store Method

func NewJobPartPlanInfoMap

func NewJobPartPlanInfoMap() *JobPartPlanInfoMap

NewJobPartPlanInfoMap returns a new instance of synchronous JobPartPlanInfoMap to hold JobPartPlanInfo Pointer for given combination of JobId and part number.

func (*JobPartPlanInfoMap) LoadExistingJobIds

func (jMap *JobPartPlanInfoMap) LoadExistingJobIds() []common.JobID

LoadExistingJobIds returns the list of existing JobIds for which there are entries in the internal map in thread-safe manner.

func (*JobPartPlanInfoMap) LoadJobPartPlanInfoForJobPart

func (jMap *JobPartPlanInfoMap) LoadJobPartPlanInfoForJobPart(jobId common.JobID, partNumber common.PartNumber) *JobPartPlanInfo

LoadJobPartPlanInfoForJobPart returns the JobPartPlanInfo Pointer for given combination of JobId and part number in thread-safe manner.

func (*JobPartPlanInfoMap) LoadPartPlanMapforJob

func (jMap *JobPartPlanInfoMap) LoadPartPlanMapforJob(jobId common.JobID) (map[common.PartNumber]*JobPartPlanInfo, bool)

LoadPartPlanMapforJob returns the map of PartNumber to JobPartPlanInfo Pointer for given JobId in thread-safe manner.

func (*JobPartPlanInfoMap) StoreJobPartPlanInfo

func (jMap *JobPartPlanInfoMap) StoreJobPartPlanInfo(jobId common.JobID, partNumber common.PartNumber, jHandler *JobPartPlanInfo)

StoreJobPartPlanInfo stores the JobPartPlanInfo reference for given combination of JobId and part number in thread-safe manner.

type JobPartPlanTransfer

type JobPartPlanTransfer struct {
	Offset         uint64
	SrcLength      uint16
	DstLength      uint16
	ChunkNum       uint16
	ModifiedTime   uint32
	Status         common.Status
	SourceSize     uint64
	CompletionTime uint64
}

JobPartPlan represent the header of Job Part's Transfer in Memory Map File

type JobPartPlanTransferChunk

type JobPartPlanTransferChunk struct {
	BlockId [128 / 8]byte
	Status  uint8
}

type JobToLoggerMap

type JobToLoggerMap struct {
	// Read Write Mutex
	sync.RWMutex
	// contains filtered or unexported fields
}

JobToLoggerMap are the Synchronous Map to hold logger instance mapped to jobId Provides the thread safe Load and Store Method

func NewJobToLoggerMap

func NewJobToLoggerMap() *JobToLoggerMap

NewJobToLoggerMap returns a new instance of synchronous JobToLoggerMap for holding logger instances mapped to JobIds

func (*JobToLoggerMap) LoadLoggerForJob

func (jLogger *JobToLoggerMap) LoadLoggerForJob(jobId common.JobID) *common.Logger

LoadLoggerForJob returns the logger instance for given JobId in thread-safe manner

func (*JobToLoggerMap) StoreLoggerForJob

func (jLogger *JobToLoggerMap) StoreLoggerForJob(jobId common.JobID, logger *common.Logger)

StoreLoggerForJob stores the logger instance for given JobId in thread-safe manner

type SuicideJob

type SuicideJob byte

type TransferInfo

type TransferInfo struct {
	NumChunksCompleted uint16
	// contains filtered or unexported fields
}

type TransferMsg

type TransferMsg struct {
	Id               common.JobID
	PartNumber       common.PartNumber
	TransferIndex    uint32
	JPartPlanInfoMap *JobPartPlanInfoMap
}

type TransferMsgDetail

type TransferMsgDetail struct {
	JobId              common.JobID
	PartNumber         common.PartNumber
	TransferId         uint32
	ChunkSize          uint64
	SourceType         common.LocationType
	Source             string
	DestinationType    common.LocationType
	Destination        string
	TransferCtx        context.Context
	TransferCancelFunc func()
	JobHandlerMap      *JobPartPlanInfoMap
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL