Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
Batch is used to perform multiple object additions/deletions at once.
func (*Batch) AddObject ¶
func (b *Batch) AddObject(meta RemoteObjectMetadata)
AddObject adds a new object to the batch.
The given FileNum must be new - it must not match that of any object that was ever in the catalog.
func (*Batch) DeleteObject ¶
func (b *Batch) DeleteObject(fileNum base.DiskFileNum)
DeleteObject adds an object removal to the batch.
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog is used to manage the on-disk remote object catalog.
The catalog file is a log of records, where each record is an encoded VersionEdit.
func (*Catalog) ApplyBatch ¶
ApplyBatch applies a batch of updates; returns after the change is stably recorded on storage.
func (*Catalog) Checkpoint ¶
Checkpoint copies catalog state to a file in the specified directory
func (*Catalog) SetCreatorID ¶
func (c *Catalog) SetCreatorID(id objstorage.CreatorID) error
SetCreatorID sets the creator ID. If it is already set, it must match.
type CatalogContents ¶
type CatalogContents struct {
// CreatorID, if it is set.
CreatorID objstorage.CreatorID
Objects []RemoteObjectMetadata
}
CatalogContents contains the remote objects in the catalog.
type RemoteObjectMetadata ¶
type RemoteObjectMetadata struct {
// FileNum is the identifier for the object within the context of a single DB
// instance.
FileNum base.DiskFileNum
// FileType is the type of the object. Only certain FileTypes are possible.
FileType base.FileType
// CreatorID identifies the DB instance that originally created the object.
CreatorID objstorage.CreatorID
// CreatorFileNum is the identifier for the object within the context of the
// DB instance that originally created the object.
CreatorFileNum base.DiskFileNum
// CleanupMethod indicates the method for cleaning up unused shared objects.
CleanupMethod objstorage.SharedCleanupMethod
// Locator identifies a remote.Storage implementation.
Locator remote.Locator
// CustomObjectName (if it is set) overrides the object name that is normally
// derived from the CreatorID and CreatorFileNum.
CustomObjectName string
}
RemoteObjectMetadata encapsulates the data stored in the catalog file for each object.
type VersionEdit ¶
type VersionEdit struct {
NewObjects []RemoteObjectMetadata
DeletedObjects []base.DiskFileNum
CreatorID objstorage.CreatorID
}
VersionEdit is a modification to the remote object state which can be encoded into a record.
TODO(radu): consider adding creation and deletion time for debugging purposes.
func (*VersionEdit) Apply ¶
func (v *VersionEdit) Apply( creatorID *objstorage.CreatorID, objects map[base.DiskFileNum]RemoteObjectMetadata, ) error
Apply the version edit to a creator ID and a map of objects.