Documentation ¶
Index ¶
- Variables
- func AssembleId(arid, jobType string) string
- func NewLog(serverName string) log15.Logger
- type JobManager
- func (m *JobManager) AddJob(arid, jobType string)
- func (j *JobManager) BroadcastData(arId, jobType string, tx *types.Transaction, peers []string, txPosted bool)
- func (j *JobManager) BroadcastTxMeta(arId, jobType string, tx *types.Transaction, peers []string)
- func (m *JobManager) CloseJob(arid, jobType string) error
- func (m *JobManager) GetJob(arid, jobType string) *JobStatus
- func (m *JobManager) GetJobs() (jobs map[string]JobStatus)
- func (j *JobManager) GetTxDataFromPeers(arId, jobType string, peers []string) ([]byte, error)
- func (j *JobManager) GetUnconfirmedTxFromPeers(arId, jobType string, peers []string) (*types.Transaction, error)
- func (m *JobManager) IncFailed(arid, jobType string)
- func (m *JobManager) IncSuccessed(arid, jobType string)
- func (m *JobManager) InitJobManager(boltDb *Store) error
- func (m *JobManager) IsClosed(arid, jobType string) bool
- func (m *JobManager) JobBeginSet(arid, jobType string, totalNodes int) error
- func (j *JobManager) PopBroadcastSubmitTxChan() <-chan string
- func (j *JobManager) PutToBroadcastSubmitTxChan(txId string)
- func (m *JobManager) RegisterJob(arid, jobType string) (err error)
- func (m *JobManager) UnregisterJob(arid, jobType string)
- type JobStatus
- type Server
- type Store
- func (s *Store) BatchDeletePendingPool(jobType string, arIds []string) error
- func (s *Store) Close() error
- func (s *Store) IsExistChunk(chunkStartOffset uint64) bool
- func (s *Store) IsExistTxDataEndOffset(dataRoot, dataSize string) bool
- func (s *Store) IsExistTxMeta(arId string) bool
- func (s *Store) LoadAllDataEndOffset() (offset uint64)
- func (s *Store) LoadChunk(chunkStartOffset uint64) (chunk *types.GetChunk, err error)
- func (s *Store) LoadJobStatus(jobType, arId string) (*JobStatus, error)
- func (s *Store) LoadPendingPool(jobType string, num int) ([]string, error)
- func (s *Store) LoadTxDataEndOffSet(dataRoot, dataSize string) (txDataEndOffset uint64, err error)
- func (s *Store) LoadTxMeta(arId string) (arTx *types.Transaction, err error)
- func (s *Store) PutPendingPool(jobType string, arId string) error
- func (s *Store) SaveAllDataEndOffset(allDataEndOffset uint64, dbTx *bolt.Tx) (err error)
- func (s *Store) SaveChunk(chunkStartOffset uint64, chunk types.GetChunk) error
- func (s *Store) SaveJobStatus(jobType string, arId string, jobStatus JobStatus) error
- func (s *Store) SaveTxDataEndOffSet(dataRoot, dataSize string, txDataEndOffset uint64, dbTx *bolt.Tx) (err error)
- func (s *Store) SaveTxMeta(arTx types.Transaction) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotExist = errors.New("not exist") // bucket ChunkBucket = []byte("chunk-bucket") // key: chunkStartOffset, val: chunk TxDataEndOffSetBucket = []byte("tx-data-end-offset-bucket") // key: dataRoot+dataSize; val: txDataEndOffSet TxMetaBucket = []byte("tx-meta-bucket") // key: txId, val: arTx; not include data ConstantsBucket = []byte("constants-bucket") // pending pool bucketName BroadcastJobsPendingPool = []byte("broadcast-pending-pool") // key: arId, value: "0x01" BroadcastSubmitTxJobsPendingPool = []byte("broadcast-submit-tx-pending-pool") // key: arId, value: "0x01" SyncJobsPendingPool = []byte("sync-pending-pool") // key: arId,value: "0x01" // save jobStatus bucketName BroadcastJobStatus = []byte("broadcast-job-status") // key: arId, value jobStatus BroadcastSubmitTxJobStatus = []byte("broadcast-submit-tx-job-status") SyncJobStatus = []byte("sync-job-status") // key: arId, value jobStatus )
Functions ¶
func AssembleId ¶
Types ¶
type JobManager ¶
type JobManager struct {
// contains filtered or unexported fields
}
func NewJobManager ¶
func NewJobManager(cap int) *JobManager
func (*JobManager) AddJob ¶
func (m *JobManager) AddJob(arid, jobType string)
func (*JobManager) BroadcastData ¶
func (j *JobManager) BroadcastData(arId, jobType string, tx *types.Transaction, peers []string, txPosted bool)
func (*JobManager) BroadcastTxMeta ¶ added in v0.0.2
func (j *JobManager) BroadcastTxMeta(arId, jobType string, tx *types.Transaction, peers []string)
func (*JobManager) CloseJob ¶
func (m *JobManager) CloseJob(arid, jobType string) error
func (*JobManager) GetJob ¶
func (m *JobManager) GetJob(arid, jobType string) *JobStatus
func (*JobManager) GetJobs ¶
func (m *JobManager) GetJobs() (jobs map[string]JobStatus)
func (*JobManager) GetTxDataFromPeers ¶
func (j *JobManager) GetTxDataFromPeers(arId, jobType string, peers []string) ([]byte, error)
func (*JobManager) GetUnconfirmedTxFromPeers ¶
func (j *JobManager) GetUnconfirmedTxFromPeers(arId, jobType string, peers []string) (*types.Transaction, error)
func (*JobManager) IncFailed ¶
func (m *JobManager) IncFailed(arid, jobType string)
func (*JobManager) IncSuccessed ¶
func (m *JobManager) IncSuccessed(arid, jobType string)
func (*JobManager) InitJobManager ¶
func (m *JobManager) InitJobManager(boltDb *Store) error
func (*JobManager) IsClosed ¶
func (m *JobManager) IsClosed(arid, jobType string) bool
func (*JobManager) JobBeginSet ¶
func (m *JobManager) JobBeginSet(arid, jobType string, totalNodes int) error
func (*JobManager) PopBroadcastSubmitTxChan ¶ added in v0.0.2
func (j *JobManager) PopBroadcastSubmitTxChan() <-chan string
func (*JobManager) PutToBroadcastSubmitTxChan ¶ added in v0.0.2
func (j *JobManager) PutToBroadcastSubmitTxChan(txId string)
func (*JobManager) RegisterJob ¶
func (m *JobManager) RegisterJob(arid, jobType string) (err error)
func (*JobManager) UnregisterJob ¶
func (m *JobManager) UnregisterJob(arid, jobType string)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) BroadcastSubmitTx ¶ added in v0.0.2
func (s *Server) BroadcastSubmitTx()
type Store ¶
func (*Store) BatchDeletePendingPool ¶
func (*Store) IsExistChunk ¶
func (*Store) IsExistTxDataEndOffset ¶
func (*Store) IsExistTxMeta ¶
func (*Store) LoadAllDataEndOffset ¶
func (*Store) LoadJobStatus ¶
func (*Store) LoadPendingPool ¶
func (*Store) LoadTxDataEndOffSet ¶
func (*Store) LoadTxMeta ¶
func (s *Store) LoadTxMeta(arId string) (arTx *types.Transaction, err error)
func (*Store) SaveAllDataEndOffset ¶
func (*Store) SaveJobStatus ¶
func (*Store) SaveTxDataEndOffSet ¶
func (*Store) SaveTxMeta ¶
func (s *Store) SaveTxMeta(arTx types.Transaction) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.