Documentation
¶
Index ¶
Constants ¶
View Source
const BatchSize = 4 * 1024 * 1024 // 4 MiB
BatchSize is the max number of bytes that can be downloaded in a single request in replication.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryDownloader ¶
type CategoryDownloader struct {
// contains filtered or unexported fields
}
func (*CategoryDownloader) Loop ¶
func (c *CategoryDownloader) Loop(ctx context.Context)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client describes the client-side state of replication and continiously downloads new chunks from other servers.
type DirectWriter ¶
type DirectWriter interface { Stat(category string, fileName string) (size int64, exists bool, deleted bool, err error) WriteDirect(category string, fileName string, contents []byte) error AckDirect(ctx context.Context, category string, chunk string) error SetReplicationDisabled(category string, v bool) error Write(ctx context.Context, category string, msgs []byte) (chunkName string, off int64, err error) }
DirectWriter writes to underlying storage directly for replication purposes.
type Message ¶
type Message struct { Type MessageType Chunk Chunk }
type MessageType ¶
type MessageType string
const ( ChunkCreated MessageType = "chunk_created" ChunkAcknowledged MessageType = "chunk_ack" )
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage provides hooks for the ondisk storage that will be called to ensure that chunks are replicated.
func (*Storage) AfterAcknowledgeChunk ¶
func (*Storage) AfterCreatingChunk ¶
func (*Storage) RegisterReplica ¶
Click to show internal directories.
Click to hide internal directories.