Documentation ¶
Index ¶
- Constants
- Variables
- func GetReqID() int64
- func IsDir(mode uint32) bool
- func IsRegular(mode uint32) bool
- func IsSymlink(mode uint32) bool
- func Mode(osMode os.FileMode) uint32
- func OsMode(mode uint32) os.FileMode
- func ReadFull(c net.Conn, buf *[]byte, readSize int) (err error)
- type AdminTask
- func (t *AdminTask) CheckTaskIsFail() (isFail bool)
- func (t *AdminTask) CheckTaskIsSuccess() (isSuccess bool)
- func (t *AdminTask) CheckTaskNeedSend() (needRetry bool)
- func (t *AdminTask) CheckTaskTimeOut() (notResponse bool)
- func (t *AdminTask) IsHeartbeatTask() bool
- func (t *AdminTask) IsUrgentTask() bool
- func (t *AdminTask) SetStatus(status int8)
- func (t *AdminTask) ToString() (msg string)
- type AppendExtentKeyRequest
- type BatchInodeGetRequest
- type BatchInodeGetResponse
- type ClusterInfo
- type CreateDataPartitionRequest
- type CreateDataPartitionResponse
- type CreateDentryRequest
- type CreateInodeRequest
- type CreateInodeResponse
- type CreateMetaPartitionRequest
- type CreateMetaPartitionResponse
- type CreateNameSpaceRequest
- type CreateNameSpaceResponse
- type DataNodeHeartBeatResponse
- type DeleteDataPartitionRequest
- type DeleteDataPartitionResponse
- type DeleteDentryRequest
- type DeleteDentryResponse
- type DeleteFileRequest
- type DeleteFileResponse
- type DeleteInodeRequest
- type DeleteInodeResponse
- type DeleteMetaPartitionRequest
- type DeleteMetaPartitionResponse
- type Dentry
- type EvictInodeRequest
- type ExtentKey
- func (ek *ExtentKey) Equal(k ExtentKey) bool
- func (ek *ExtentKey) FullEqual(k ExtentKey) bool
- func (k *ExtentKey) GetExtentKey() (m string)
- func (k *ExtentKey) Marshal() (m string)
- func (k *ExtentKey) MarshalBinary() ([]byte, error)
- func (ek ExtentKey) String() string
- func (k *ExtentKey) UnMarshal(m string) (err error)
- func (k *ExtentKey) UnmarshalBinary(buf *bytes.Buffer) (err error)
- type File
- type GetExtentsRequest
- type GetExtentsResponse
- type HeartBeatRequest
- type InodeGetRequest
- type InodeGetResponse
- type InodeInfo
- type LinkInodeRequest
- type LinkInodeResponse
- type LoadDataPartitionRequest
- type LoadDataPartitionResponse
- type LoadMetaPartitionMetricRequest
- type LoadMetaPartitionMetricResponse
- type LookupRequest
- type LookupResponse
- type MetaNodeHeartbeatResponse
- type MetaPartitionOfflineRequest
- type MetaPartitionOfflineResponse
- type MetaPartitionReport
- type OpenRequest
- type Packet
- func (p *Packet) ActionMsg(action, remote string, start int64, err error) (m string)
- func (p *Packet) GetData() string
- func (p *Packet) GetOpMsg() (m string)
- func (p *Packet) GetResultMesg() (m string)
- func (p *Packet) GetStoreModeMsg() (m string)
- func (p *Packet) GetUniqueLogId() (m string)
- func (p *Packet) IsOkReply() bool
- func (p *Packet) IsTransitPkg() bool
- func (p *Packet) MarshalData(v interface{}) error
- func (p *Packet) MarshalHeader(out []byte)
- func (p *Packet) PackErrorWithBody(errCode uint8, reply []byte)
- func (p *Packet) PackOkGetWatermarkReply(size int64)
- func (p *Packet) PackOkReadReply()
- func (p *Packet) PackOkReply()
- func (p *Packet) PackOkWithBody(reply []byte)
- func (p *Packet) ReadFromConn(c net.Conn, timeoutSec int) (err error)
- func (p *Packet) ShallRetry() bool
- func (p *Packet) UnmarshalData(v interface{}) error
- func (p *Packet) UnmarshalHeader(in []byte) error
- func (p *Packet) WriteHeaderToConn(c net.Conn) (err error)
- func (p *Packet) WriteToConn(c net.Conn) (err error)
- func (p *Packet) WriteToNoDeadLineConn(c net.Conn) (err error)
- type PartitionReport
- type Peer
- type ReadDirRequest
- type ReadDirResponse
- type RegisterMetaNodeResp
- type SetattrRequest
- type StreamKey
- func (sk *StreamKey) GetExtentLen() int
- func (sk *StreamKey) Marshal() (data []byte, err error)
- func (sk *StreamKey) MarshalBinary() (data []byte, err error)
- func (sk *StreamKey) Put(k ExtentKey)
- func (sk *StreamKey) Range(f func(i int, v ExtentKey) bool)
- func (sk *StreamKey) Size() (bytes uint64)
- func (sk *StreamKey) String() string
- func (sk *StreamKey) ToString() (m string)
- func (sk *StreamKey) UnMarshal(data []byte)
- func (sk *StreamKey) UnmarshalBinary(data []byte) (err error)
- type TruncateRequest
- type TruncateResponse
- type UpdateDentryRequest
- type UpdateDentryResponse
- type UpdateMetaPartitionRequest
- type UpdateMetaPartitionResponse
Constants ¶
View Source
const ( TaskFail = 2 TaskStart = 0 TaskSuccess = 1 TaskRunning = 3 ResponseInterval = 5 ResponseTimeOut = 100 MaxSendCount = 5 )
View Source
const ( AttrMode uint32 = 1 << iota AttrUid AttrGid )
View Source
const ( AddrSplit = "/" ExtentPartition = "extent" BlobPartition = "blob" )
View Source
const ( ProtoMagic uint8 = 0xFF OpInitResultCode uint8 = 0x00 OpCreateFile uint8 = 0x01 OpMarkDelete uint8 = 0x02 OpWrite uint8 = 0x03 OpRead uint8 = 0x04 OpStreamRead uint8 = 0x05 OpGetWatermark uint8 = 0x06 OpExtentStoreGetAllWaterMark uint8 = 0x07 OpNotifyExtentRepair uint8 = 0x08 OpERepairRead uint8 = 0x09 OpBlobFileRepairRead uint8 = 0x0A OpFlowInfo uint8 = 0x0B OpSyncDelNeedle uint8 = 0x0C OpNotifyCompactBlobFile uint8 = 0x0D OpGetDataPartitionMetrics uint8 = 0x0E OpBlobStoreGetAllWaterMark uint8 = 0x0F OpNotifyBlobRepair uint8 = 0x10 // Operations: Client -> MetaNode. OpMetaCreateInode uint8 = 0x20 OpMetaDeleteInode uint8 = 0x21 OpMetaCreateDentry uint8 = 0x22 OpMetaDeleteDentry uint8 = 0x23 OpMetaOpen uint8 = 0x24 OpMetaLookup uint8 = 0x25 OpMetaReadDir uint8 = 0x26 OpMetaInodeGet uint8 = 0x27 OpMetaBatchInodeGet uint8 = 0x28 OpMetaExtentsAdd uint8 = 0x29 OpMetaExtentsDel uint8 = 0x2A OpMetaExtentsList uint8 = 0x2B OpMetaUpdateDentry uint8 = 0x2C OpMetaTruncate uint8 = 0x2D OpMetaLinkInode uint8 = 0x2E OpMetaEvictInode uint8 = 0x2F OpMetaSetattr uint8 = 0x30 // Operations: Master -> MetaNode OpCreateMetaPartition uint8 = 0x40 OpMetaNodeHeartbeat uint8 = 0x41 OpDeleteMetaPartition uint8 = 0x42 OpUpdateMetaPartition uint8 = 0x43 OpLoadMetaPartition uint8 = 0x44 OpOfflineMetaPartition uint8 = 0x45 // Operations: Master -> DataNode OpCreateDataPartition uint8 = 0x60 OpDeleteDataPartition uint8 = 0x61 OpLoadDataPartition uint8 = 0x62 OpDataNodeHeartbeat uint8 = 0x63 OpReplicateFile uint8 = 0x64 OpDeleteFile uint8 = 0x65 // Commons OpIntraGroupNetErr uint8 = 0xF3 OpArgMismatchErr uint8 = 0xF4 OpNotExistErr uint8 = 0xF5 OpDiskNoSpaceErr uint8 = 0xF6 OpDiskErr uint8 = 0xF7 OpErr uint8 = 0xF8 OpAgain uint8 = 0xF9 OpExistErr uint8 = 0xFA OpInodeFullErr uint8 = 0xFB OpOk uint8 = 0xF0 // For connection diagnosis OpPing uint8 = 0xFF )
operations
View Source
const ( WriteDeadlineTime = 5 ReadDeadlineTime = 5 NoReadDeadlineTime = -1 StreamReadDeadLineTime = 2 )
View Source
const ( BlobStoreMode = 0 ExtentStoreMode = 1 )
View Source
const ( ReadOnly = 1 ReadWrite = 2 )
View Source
const (
RootIno = uint64(1)
)
Variables ¶
View Source
var ( ReqIDGlobal = int64(1) Buffers = buf.NewBufferPool() )
View Source
var InvalidKey = errors.New("invalid key error")
Functions ¶
Types ¶
type AdminTask ¶
type AdminTask struct { ID string OpCode uint8 OperatorAddr string Status int8 SendTime int64 CreateTime int64 SendCount uint8 Request interface{} Response interface{} }
task struct to node
func NewAdminTask ¶
func (*AdminTask) CheckTaskIsFail ¶
func (*AdminTask) CheckTaskIsSuccess ¶
func (*AdminTask) CheckTaskNeedSend ¶
1.has never send, t.SendTime=0, 2.has send but response time out
func (*AdminTask) CheckTaskTimeOut ¶
the task which sendCount >= MaxSendCount, the last send has no response after ResponseTimeOut passed, to be consider time out
func (*AdminTask) IsHeartbeatTask ¶
func (*AdminTask) IsUrgentTask ¶
type AppendExtentKeyRequest ¶
type BatchInodeGetRequest ¶
type BatchInodeGetResponse ¶
type BatchInodeGetResponse struct {
Infos []*InodeInfo `json:"infos"`
}
type ClusterInfo ¶
type CreateDentryRequest ¶
type CreateInodeRequest ¶
type CreateInodeResponse ¶
type CreateInodeResponse struct {
Info *InodeInfo `json:"info"`
}
type CreateNameSpaceRequest ¶
type CreateNameSpaceRequest struct {
Name string
}
type CreateNameSpaceResponse ¶
type DataNodeHeartBeatResponse ¶
type DataNodeHeartBeatResponse struct { Total uint64 Used uint64 Available uint64 CreatedPartitionWeights uint64 //volCnt*volsize RemainWeightsForCreatePartition uint64 //all-usedvolsWieghts CreatedPartitionCnt uint32 MaxWeightsForCreatePartition uint64 RackName string PartitionInfo []*PartitionReport Status uint8 Result string }
type DeleteDentryRequest ¶
type DeleteDentryResponse ¶
type DeleteDentryResponse struct {
Inode uint64 `json:"ino"`
}
type DeleteFileRequest ¶
type DeleteFileResponse ¶
type DeleteInodeRequest ¶
type DeleteInodeRequest struct { VolName string `json:"vol"` PartitionID uint64 `json:"pid"` Inode uint64 `json:"ino"` }
FIXME: unlink inode
type DeleteInodeResponse ¶
type DeleteInodeResponse struct {
Info *InodeInfo `json:"info"`
}
type DeleteMetaPartitionRequest ¶
type DeleteMetaPartitionRequest struct {
PartitionID uint64
}
type Dentry ¶
type EvictInodeRequest ¶
type GetExtentsRequest ¶
type GetExtentsResponse ¶
type GetExtentsResponse struct {
Extents []ExtentKey `json:"eks"`
}
type HeartBeatRequest ¶
type InodeGetRequest ¶
type InodeGetResponse ¶
type InodeGetResponse struct {
Info *InodeInfo `json:"info"`
}
type InodeInfo ¶
type InodeInfo struct { Inode uint64 `json:"ino"` Mode uint32 `json:"mode"` Nlink uint32 `json:"nlink"` Size uint64 `json:"sz"` Uid uint32 `json:"uid"` Gid uint32 `json:"gid"` Generation uint64 `json:"gen"` ModifyTime time.Time `json:"mt"` CreateTime time.Time `json:"ct"` AccessTime time.Time `json:"at"` Target []byte `json:"tgt"` }
type LinkInodeRequest ¶
type LinkInodeResponse ¶
type LinkInodeResponse struct {
Info *InodeInfo `json:"info"`
}
type LookupRequest ¶
type LookupResponse ¶
type MetaPartitionReport ¶
type OpenRequest ¶
type Packet ¶
type Packet struct { Magic uint8 StoreMode uint8 Opcode uint8 ResultCode uint8 Nodes uint8 Crc uint32 Size uint32 Arglen uint32 PartitionID uint32 FileID uint64 Offset int64 ReqID int64 Arg []byte //if create or append ops, data contains addrs Data []byte StartT int64 }
func NewPingPacket ¶
func NewPingPacket() *Packet
func (*Packet) GetResultMesg ¶
func (*Packet) GetStoreModeMsg ¶
func (*Packet) GetUniqueLogId ¶
func (*Packet) IsTransitPkg ¶
func (*Packet) MarshalData ¶
func (*Packet) MarshalHeader ¶
func (*Packet) PackErrorWithBody ¶
func (*Packet) PackOkGetWatermarkReply ¶
func (*Packet) PackOkReadReply ¶
func (p *Packet) PackOkReadReply()
func (*Packet) PackOkReply ¶
func (p *Packet) PackOkReply()
func (*Packet) PackOkWithBody ¶
func (*Packet) ShallRetry ¶
func (*Packet) UnmarshalData ¶
func (*Packet) UnmarshalHeader ¶
type PartitionReport ¶
type ReadDirRequest ¶
type ReadDirResponse ¶
type ReadDirResponse struct {
Children []Dentry `json:"children"`
}
type RegisterMetaNodeResp ¶
type RegisterMetaNodeResp struct {
ID uint64
}
type SetattrRequest ¶
type StreamKey ¶
func NewStreamKey ¶
func (*StreamKey) GetExtentLen ¶
func (*StreamKey) MarshalBinary ¶
func (*StreamKey) Range ¶
Range calls f sequentially for each key and value present in the extent key collection. If f returns false, range stops the iteration.
func (*StreamKey) UnmarshalBinary ¶
type TruncateRequest ¶
type TruncateResponse ¶
type TruncateResponse struct {
Extents []ExtentKey `json:"ek"`
}
type UpdateDentryRequest ¶
type UpdateDentryResponse ¶
type UpdateDentryResponse struct {
Inode uint64 `json:"ino"` // old inode number
}
Click to show internal directories.
Click to hide internal directories.