Documentation ¶
Index ¶
- Constants
- Variables
- func DummyRecover()
- func Serve(index int) error
- type BlockServer
- type DataServer
- func (self *DataServer) GetBlock(param *proc.GetBlockParam, lease *proc.CatLease) error
- func (self *DataServer) PrepareSendBlock(param *proc.PrepareBlockParam, lease *proc.CatLease) error
- func (self *DataServer) SendingBlock(param *proc.SendingBlockParam, succ *bool) error
- func (self *DataServer) Serve() error
- type LeaseManager
- type PipelineParam
- type Transaction
Constants ¶
View Source
const ( DEFAULT_BLOCK_BUFFER = 1024 DEFAULT_FILE_PERM = 0664 )
View Source
const (
Block_Server_START_MSG = "CatFS Data Block Server are start: %s\n"
)
View Source
const (
DEFAULT_CHAN_SIZE = 10
)
View Source
const (
RPC_START_MSG = "CatFS Data Server %d RPC are start: %s\n"
)
Variables ¶
View Source
var ( ErrInvalidLease = errors.New("Invalid Lease") ErrInvalidPath = errors.New("Invalid Path") ErrOperationFailed = errors.New("Operation Failed") )
View Source
var (
DEFAULT_TIMEOUT = time.Second * 30
)
Functions ¶
func DummyRecover ¶
func DummyRecover()
Types ¶
type BlockServer ¶
type BlockServer struct {
// contains filtered or unexported fields
}
func NewBlockServer ¶
func NewBlockServer(location proc.ServerLocation, leaseManager *LeaseManager) *BlockServer
func (*BlockServer) FinishTransaction ¶
func (self *BlockServer) FinishTransaction(leaseID string)
Finish the transaction
func (*BlockServer) Serve ¶
func (self *BlockServer) Serve() error
Start by DataNode It will start an go routine waiting for block request
func (*BlockServer) StartTransaction ¶
func (self *BlockServer) StartTransaction(tran *Transaction)
DataServer will receive an transaction request and it will call this method to add an entry for the transaction
func (*BlockServer) Transaction ¶
func (self *BlockServer) Transaction(transID string) *Transaction
func (*BlockServer) Transactions ¶
func (self *BlockServer) Transactions() map[string]*Transaction
Get transactions
type DataServer ¶
type DataServer struct {
// contains filtered or unexported fields
}
func NewDataServer ¶
func NewDataServer(location proc.ServerLocation) *DataServer
Create a new Master Server
func (*DataServer) GetBlock ¶
func (self *DataServer) GetBlock(param *proc.GetBlockParam, lease *proc.CatLease) error
Get the block from data server Will start an tcp connect to request block
func (*DataServer) PrepareSendBlock ¶
func (self *DataServer) PrepareSendBlock(param *proc.PrepareBlockParam, lease *proc.CatLease) error
Prepare send a block to datanode
func (*DataServer) SendingBlock ¶
func (self *DataServer) SendingBlock(param *proc.SendingBlockParam, succ *bool) error
Wait util blocks reach destination The block will be sent by a pipeline
func (*DataServer) Serve ¶
func (self *DataServer) Serve() error
type LeaseManager ¶
type LeaseManager struct {
// contains filtered or unexported fields
}
func NewLeaseManager ¶
func NewLeaseManager() *LeaseManager
func (*LeaseManager) AddLease ¶
func (self *LeaseManager) AddLease(lease *proc.CatLease)
func (*LeaseManager) OnAddLease ¶
func (self *LeaseManager) OnAddLease(f func(lease *proc.CatLease))
func (*LeaseManager) OnRemoveLease ¶
func (self *LeaseManager) OnRemoveLease(f func(lease *proc.CatLease))
func (*LeaseManager) RemoveLease ¶
func (self *LeaseManager) RemoveLease(lease *proc.CatLease)
type PipelineParam ¶
type PipelineParam struct {
// contains filtered or unexported fields
}
func NewPipelineParam ¶
func NewPipelineParam(lease *proc.CatLease, param *proc.PrepareBlockParam) *PipelineParam
func (*PipelineParam) HasInit ¶
func (self *PipelineParam) HasInit() bool
func (*PipelineParam) NextSendingParam ¶
func (self *PipelineParam) NextSendingParam() *proc.SendingBlockParam
type Transaction ¶
type Transaction struct { ID string // lease id Done chan bool // contains filtered or unexported fields }
func NewProviderTransaction ¶
func NewProviderTransaction(leaseID string, provider <-chan []byte) *Transaction
func NewReadTransaction ¶
func NewReadTransaction(leaseID string, done chan bool, receivers ...chan<- []byte) *Transaction
Click to show internal directories.
Click to hide internal directories.