Documentation ¶
Overview ¶
Package objectserver is a generated protocol buffer package.
It is generated from these files:
kv_service.proto
It has these top-level messages:
KVAsyncJob ListAsyncJobsMsg ListAsyncJobsReply SaveAsyncJobMsg SaveAsyncJobReply CleanAsyncJobMsg CleanAsyncJobReply
Index ¶
- Constants
- Variables
- func InitServer(config conf.Config, flags *flag.FlagSet) (srv.Server, error)
- func InitUpdater(cnf conf.Config, flags *flag.FlagSet) (srv.Daemon, error)
- func RegisterKVServiceServer(s *grpc.Server, srv KVServiceServer)
- type AsyncJob
- type AsyncJobMgr
- type CleanAsyncJobMsg
- type CleanAsyncJobReply
- type FSAsyncJob
- type FSAsyncJobMgr
- type FSStore
- type KVAsyncJob
- func (*KVAsyncJob) Descriptor() ([]byte, []int)
- func (m *KVAsyncJob) GetAccount() string
- func (m *KVAsyncJob) GetContainer() string
- func (m *KVAsyncJob) GetDevice() string
- func (m *KVAsyncJob) GetHeaders() map[string]string
- func (m *KVAsyncJob) GetMethod() string
- func (m *KVAsyncJob) GetObject() string
- func (m *KVAsyncJob) GetPolicy() int32
- func (*KVAsyncJob) ProtoMessage()
- func (m *KVAsyncJob) Reset()
- func (m *KVAsyncJob) String() string
- type KVAsyncJobMgr
- type KVService
- func (k *KVService) CleanAsyncJob(ctx context.Context, msg *CleanAsyncJobMsg) (*CleanAsyncJobReply, error)
- func (k *KVService) ListAsyncJobs(ctx context.Context, msg *ListAsyncJobsMsg) (*ListAsyncJobsReply, error)
- func (k *KVService) SaveAsyncJob(ctx context.Context, msg *SaveAsyncJobMsg) (*SaveAsyncJobReply, error)
- type KVServiceClient
- type KVServiceServer
- type KVStore
- type ListAsyncJobsMsg
- func (*ListAsyncJobsMsg) Descriptor() ([]byte, []int)
- func (m *ListAsyncJobsMsg) GetDevice() string
- func (m *ListAsyncJobsMsg) GetPagination() int32
- func (m *ListAsyncJobsMsg) GetPolicy() int32
- func (*ListAsyncJobsMsg) ProtoMessage()
- func (m *ListAsyncJobsMsg) Reset()
- func (m *ListAsyncJobsMsg) String() string
- type ListAsyncJobsReply
- type ObjectServer
- func (s *ObjectServer) DeviceAcquirer(next http.Handler) http.Handler
- func (s *ObjectServer) DiffReplicasHandler(w http.ResponseWriter, req *http.Request)
- func (s *ObjectServer) DiskUsageHandler(w http.ResponseWriter, req *http.Request)
- func (s *ObjectServer) Finalize()
- func (s *ObjectServer) HealthcheckHandler(w http.ResponseWriter, req *http.Request)
- func (s *ObjectServer) ObjDeleteHandler(w http.ResponseWriter, req *http.Request)
- func (s *ObjectServer) ObjGetHandler(w http.ResponseWriter, req *http.Request)
- func (s *ObjectServer) ObjPostHandler(w http.ResponseWriter, req *http.Request)
- func (s *ObjectServer) ObjPutHandler(w http.ResponseWriter, req *http.Request)
- func (s *ObjectServer) OptionsHandler(w http.ResponseWriter, req *http.Request)
- func (s *ObjectServer) ReconHandler(w http.ResponseWriter, req *http.Request)
- func (s *ObjectServer) ReplicateHandler(w http.ResponseWriter, req *http.Request)
- func (server *ObjectServer) RequestLogger(next http.Handler) http.Handler
- func (s *ObjectServer) Start() error
- type SaveAsyncJobMsg
- type SaveAsyncJobReply
- type Updater
Constants ¶
View Source
const ( BLOOMFILTER_ENTRIES = float64(1 << 16) BLOOMFILTER_FP_RATIO = float64(0.01) BLOOMFILTER_RESET_THREASHHOLD = 1 << 16 )
View Source
const ( ASYNC_JOB_DIR_PREFIX = "async_pending" ASYNC_JOB_BUF_SIZE = 256 )
View Source
const (
KV_JOBS_PAGINATION = 1024
)
Variables ¶
View Source
var ( EngineNotFound = errors.New("object engine not found") LockPathError = errors.New("unable to lock path") PathNotDirError = errors.New("path is not a directory") NotPackEngine = errors.New("engine is not pack type") DriveFull = errors.New("drive is full") ErrHashConfNotFound = errors.New("unable to read hash prefix and suffix") ErrAsyncJobDBNotFound = errors.New("unable to find db for async jobs") ErrKVAsyncJobNotSaved = errors.New("unable to save async job") ErrKVAsyncJobNotClean = errors.New("unable to clean async job") ErrUnknownAsyncJobMgr = errors.New("unknown async job manager type") ErrFSAsyncJobMgrNotInit = errors.New("unable to create fs job mgr") )
View Source
var ( ReqPolicyNotFound = "storage policy not found" ReqNotPackEngine = "target engine is not pack type" ReqNotPbData = "body is not protobuf data" ReqContentTypeMissed = "content type not specified" ReqDeleteInPass = "X-Delete-At in past" ReqContentTypeNotAllowed = "Content-Type is not allowed in POST" ReqInvalidTimestamp = "invalid X-Timestamp header" )
Client bad request error text
Functions ¶
func RegisterKVServiceServer ¶
func RegisterKVServiceServer(s *grpc.Server, srv KVServiceServer)
Types ¶
type AsyncJobMgr ¶
type AsyncJobMgr interface { New(vars, headers map[string]string) AsyncJob Save(job AsyncJob) error Next(device string, policy int) AsyncJob Finish(job AsyncJob) error }
func NewAsyncJobMgr ¶
type CleanAsyncJobMsg ¶
type CleanAsyncJobMsg struct {
Job *KVAsyncJob `protobuf:"bytes,4,opt,name=job" json:"job,omitempty"`
}
func (*CleanAsyncJobMsg) Descriptor ¶
func (*CleanAsyncJobMsg) Descriptor() ([]byte, []int)
func (*CleanAsyncJobMsg) GetJob ¶
func (m *CleanAsyncJobMsg) GetJob() *KVAsyncJob
func (*CleanAsyncJobMsg) ProtoMessage ¶
func (*CleanAsyncJobMsg) ProtoMessage()
func (*CleanAsyncJobMsg) Reset ¶
func (m *CleanAsyncJobMsg) Reset()
func (*CleanAsyncJobMsg) String ¶
func (m *CleanAsyncJobMsg) String() string
type CleanAsyncJobReply ¶
type CleanAsyncJobReply struct {
Success bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"`
}
func (*CleanAsyncJobReply) Descriptor ¶
func (*CleanAsyncJobReply) Descriptor() ([]byte, []int)
func (*CleanAsyncJobReply) GetSuccess ¶
func (m *CleanAsyncJobReply) GetSuccess() bool
func (*CleanAsyncJobReply) ProtoMessage ¶
func (*CleanAsyncJobReply) ProtoMessage()
func (*CleanAsyncJobReply) Reset ¶
func (m *CleanAsyncJobReply) Reset()
func (*CleanAsyncJobReply) String ¶
func (m *CleanAsyncJobReply) String() string
type FSAsyncJob ¶
type FSAsyncJob struct { Method string `pickle:"op"` Headers map[string]string `pickle:"headers"` Account string `pickle:"account"` Container string `pickle:"container"` Object string `pickle:"obj"` Device string `pickle:"device"` Policy int `pickle:"policy"` }
I'm afraid we can't reuse here KVAsyncJob since FSAsyncJobMgr uses another serialization framework, pickle. Cannot figure out how to ignore field in Pickle. Both Device and Policy could be ignored.
func (*FSAsyncJob) GetAccount ¶
func (j *FSAsyncJob) GetAccount() string
func (*FSAsyncJob) GetContainer ¶
func (j *FSAsyncJob) GetContainer() string
func (*FSAsyncJob) GetHeaders ¶
func (j *FSAsyncJob) GetHeaders() map[string]string
func (*FSAsyncJob) GetMethod ¶
func (j *FSAsyncJob) GetMethod() string
func (*FSAsyncJob) GetObject ¶
func (j *FSAsyncJob) GetObject() string
type FSAsyncJobMgr ¶
type FSAsyncJobMgr struct {
// contains filtered or unexported fields
}
func NewFSAsyncJobMgr ¶
func NewFSAsyncJobMgr(driveRoot string) (*FSAsyncJobMgr, error)
func (*FSAsyncJobMgr) Finish ¶
func (m *FSAsyncJobMgr) Finish(job AsyncJob) error
func (*FSAsyncJobMgr) Save ¶
func (m *FSAsyncJobMgr) Save(job AsyncJob) error
type FSStore ¶
type FSStore struct {
// contains filtered or unexported fields
}
func NewFSStore ¶
func (*FSStore) CleanAsyncJob ¶
func (s *FSStore) CleanAsyncJob(job *FSAsyncJob) error
func (*FSStore) ListAsyncJobs ¶
func (*FSStore) SaveAsyncJob ¶
func (s *FSStore) SaveAsyncJob(job *FSAsyncJob) error
type KVAsyncJob ¶
type KVAsyncJob struct { Method string `protobuf:"bytes,1,opt,name=method" json:"method,omitempty"` Headers map[string]string `` /* 134-byte string literal not displayed */ Account string `protobuf:"bytes,3,opt,name=account" json:"account,omitempty"` Container string `protobuf:"bytes,4,opt,name=container" json:"container,omitempty"` Object string `protobuf:"bytes,5,opt,name=object" json:"object,omitempty"` Device string `protobuf:"bytes,6,opt,name=device" json:"device,omitempty"` Policy int32 `protobuf:"varint,7,opt,name=policy" json:"policy,omitempty"` }
func (*KVAsyncJob) Descriptor ¶
func (*KVAsyncJob) Descriptor() ([]byte, []int)
func (*KVAsyncJob) GetAccount ¶
func (m *KVAsyncJob) GetAccount() string
func (*KVAsyncJob) GetContainer ¶
func (m *KVAsyncJob) GetContainer() string
func (*KVAsyncJob) GetDevice ¶
func (m *KVAsyncJob) GetDevice() string
func (*KVAsyncJob) GetHeaders ¶
func (m *KVAsyncJob) GetHeaders() map[string]string
func (*KVAsyncJob) GetMethod ¶
func (m *KVAsyncJob) GetMethod() string
func (*KVAsyncJob) GetObject ¶
func (m *KVAsyncJob) GetObject() string
func (*KVAsyncJob) GetPolicy ¶
func (m *KVAsyncJob) GetPolicy() int32
func (*KVAsyncJob) ProtoMessage ¶
func (*KVAsyncJob) ProtoMessage()
func (*KVAsyncJob) Reset ¶
func (m *KVAsyncJob) Reset()
func (*KVAsyncJob) String ¶
func (m *KVAsyncJob) String() string
type KVAsyncJobMgr ¶
type KVAsyncJobMgr struct {
// contains filtered or unexported fields
}
func NewKVAsyncJobMgr ¶
func NewKVAsyncJobMgr(port int) (*KVAsyncJobMgr, error)
func (*KVAsyncJobMgr) Finish ¶
func (m *KVAsyncJobMgr) Finish(job AsyncJob) error
func (*KVAsyncJobMgr) Save ¶
func (m *KVAsyncJobMgr) Save(job AsyncJob) error
type KVService ¶
type KVService struct {
// contains filtered or unexported fields
}
func NewKVService ¶
func (*KVService) CleanAsyncJob ¶
func (k *KVService) CleanAsyncJob( ctx context.Context, msg *CleanAsyncJobMsg) (*CleanAsyncJobReply, error)
func (*KVService) ListAsyncJobs ¶
func (k *KVService) ListAsyncJobs( ctx context.Context, msg *ListAsyncJobsMsg) (*ListAsyncJobsReply, error)
func (*KVService) SaveAsyncJob ¶
func (k *KVService) SaveAsyncJob( ctx context.Context, msg *SaveAsyncJobMsg) (*SaveAsyncJobReply, error)
type KVServiceClient ¶
type KVServiceClient interface { SaveAsyncJob(ctx context.Context, in *SaveAsyncJobMsg, opts ...grpc.CallOption) (*SaveAsyncJobReply, error) ListAsyncJobs(ctx context.Context, in *ListAsyncJobsMsg, opts ...grpc.CallOption) (*ListAsyncJobsReply, error) CleanAsyncJob(ctx context.Context, in *CleanAsyncJobMsg, opts ...grpc.CallOption) (*CleanAsyncJobReply, error) }
func NewKVServiceClient ¶
func NewKVServiceClient(cc *grpc.ClientConn) KVServiceClient
type KVServiceServer ¶
type KVServiceServer interface { SaveAsyncJob(context.Context, *SaveAsyncJobMsg) (*SaveAsyncJobReply, error) ListAsyncJobs(context.Context, *ListAsyncJobsMsg) (*ListAsyncJobsReply, error) CleanAsyncJob(context.Context, *CleanAsyncJobMsg) (*CleanAsyncJobReply, error) }
type KVStore ¶
func NewKVStore ¶
func (*KVStore) CleanAsyncJob ¶
func (s *KVStore) CleanAsyncJob(job *KVAsyncJob) error
func (*KVStore) ListAsyncJobs ¶
func (*KVStore) SaveAsyncJob ¶
func (s *KVStore) SaveAsyncJob(job *KVAsyncJob) error
type ListAsyncJobsMsg ¶
type ListAsyncJobsMsg struct { Device string `protobuf:"bytes,1,opt,name=device" json:"device,omitempty"` Policy int32 `protobuf:"varint,2,opt,name=policy" json:"policy,omitempty"` Pagination int32 `protobuf:"varint,3,opt,name=pagination" json:"pagination,omitempty"` }
func (*ListAsyncJobsMsg) Descriptor ¶
func (*ListAsyncJobsMsg) Descriptor() ([]byte, []int)
func (*ListAsyncJobsMsg) GetDevice ¶
func (m *ListAsyncJobsMsg) GetDevice() string
func (*ListAsyncJobsMsg) GetPagination ¶
func (m *ListAsyncJobsMsg) GetPagination() int32
func (*ListAsyncJobsMsg) GetPolicy ¶
func (m *ListAsyncJobsMsg) GetPolicy() int32
func (*ListAsyncJobsMsg) ProtoMessage ¶
func (*ListAsyncJobsMsg) ProtoMessage()
func (*ListAsyncJobsMsg) Reset ¶
func (m *ListAsyncJobsMsg) Reset()
func (*ListAsyncJobsMsg) String ¶
func (m *ListAsyncJobsMsg) String() string
type ListAsyncJobsReply ¶
type ListAsyncJobsReply struct {
Jobs []*KVAsyncJob `protobuf:"bytes,1,rep,name=jobs" json:"jobs,omitempty"`
}
func (*ListAsyncJobsReply) Descriptor ¶
func (*ListAsyncJobsReply) Descriptor() ([]byte, []int)
func (*ListAsyncJobsReply) GetJobs ¶
func (m *ListAsyncJobsReply) GetJobs() []*KVAsyncJob
func (*ListAsyncJobsReply) ProtoMessage ¶
func (*ListAsyncJobsReply) ProtoMessage()
func (*ListAsyncJobsReply) Reset ¶
func (m *ListAsyncJobsReply) Reset()
func (*ListAsyncJobsReply) String ¶
func (m *ListAsyncJobsReply) String() string
type ObjectServer ¶
func (*ObjectServer) DeviceAcquirer ¶
func (s *ObjectServer) DeviceAcquirer(next http.Handler) http.Handler
func (*ObjectServer) DiffReplicasHandler ¶
func (s *ObjectServer) DiffReplicasHandler( w http.ResponseWriter, req *http.Request)
func (*ObjectServer) DiskUsageHandler ¶
func (s *ObjectServer) DiskUsageHandler( w http.ResponseWriter, req *http.Request)
func (*ObjectServer) Finalize ¶
func (s *ObjectServer) Finalize()
func (*ObjectServer) HealthcheckHandler ¶
func (s *ObjectServer) HealthcheckHandler( w http.ResponseWriter, req *http.Request)
func (*ObjectServer) ObjDeleteHandler ¶
func (s *ObjectServer) ObjDeleteHandler( w http.ResponseWriter, req *http.Request)
func (*ObjectServer) ObjGetHandler ¶
func (s *ObjectServer) ObjGetHandler(w http.ResponseWriter, req *http.Request)
func (*ObjectServer) ObjPostHandler ¶
func (s *ObjectServer) ObjPostHandler( w http.ResponseWriter, req *http.Request)
func (*ObjectServer) ObjPutHandler ¶
func (s *ObjectServer) ObjPutHandler(w http.ResponseWriter, req *http.Request)
func (*ObjectServer) OptionsHandler ¶
func (s *ObjectServer) OptionsHandler( w http.ResponseWriter, req *http.Request)
func (*ObjectServer) ReconHandler ¶
func (s *ObjectServer) ReconHandler(w http.ResponseWriter, req *http.Request)
func (*ObjectServer) ReplicateHandler ¶
func (s *ObjectServer) ReplicateHandler( w http.ResponseWriter, req *http.Request)
func (*ObjectServer) RequestLogger ¶
func (server *ObjectServer) RequestLogger(next http.Handler) http.Handler
func (*ObjectServer) Start ¶
func (s *ObjectServer) Start() error
type SaveAsyncJobMsg ¶
type SaveAsyncJobMsg struct {
Job *KVAsyncJob `protobuf:"bytes,1,opt,name=job" json:"job,omitempty"`
}
func (*SaveAsyncJobMsg) Descriptor ¶
func (*SaveAsyncJobMsg) Descriptor() ([]byte, []int)
func (*SaveAsyncJobMsg) GetJob ¶
func (m *SaveAsyncJobMsg) GetJob() *KVAsyncJob
func (*SaveAsyncJobMsg) ProtoMessage ¶
func (*SaveAsyncJobMsg) ProtoMessage()
func (*SaveAsyncJobMsg) Reset ¶
func (m *SaveAsyncJobMsg) Reset()
func (*SaveAsyncJobMsg) String ¶
func (m *SaveAsyncJobMsg) String() string
type SaveAsyncJobReply ¶
type SaveAsyncJobReply struct {
Success bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"`
}
func (*SaveAsyncJobReply) Descriptor ¶
func (*SaveAsyncJobReply) Descriptor() ([]byte, []int)
func (*SaveAsyncJobReply) GetSuccess ¶
func (m *SaveAsyncJobReply) GetSuccess() bool
func (*SaveAsyncJobReply) ProtoMessage ¶
func (*SaveAsyncJobReply) ProtoMessage()
func (*SaveAsyncJobReply) Reset ¶
func (m *SaveAsyncJobReply) Reset()
func (*SaveAsyncJobReply) String ¶
func (m *SaveAsyncJobReply) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.