rs

package
v0.0.0-...-28682f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATA_SHARDS     = 4
	PARITY_SHARDS   = 2
	ALL_SHARDS      = DATA_SHARDS + PARITY_SHARDS
	BLOCK_PER_SHARD = 8000
	BLOCK_SIZE      = BLOCK_PER_SHARD * DATA_SHARDS
)

Variables

This section is empty.

Functions

func NewDecoder

func NewDecoder(readers []io.Reader, writers []io.Writer, size int64) *decoder

func NewEncoder

func NewEncoder(writers []io.Writer) *encoder

Types

type RSGetStream

type RSGetStream struct {
	// contains filtered or unexported fields
}

func NewRSGetStream

func NewRSGetStream(locateInfo map[int]string, dataServers []string, hash string, size int64) (*RSGetStream, error)

func (*RSGetStream) Close

func (s *RSGetStream) Close()

func (RSGetStream) Read

func (d RSGetStream) Read(p []byte) (n int, err error)

func (*RSGetStream) Seek

func (s *RSGetStream) Seek(offset int64, whence int) (int64, error)

type RSPutStream

type RSPutStream struct {
	// contains filtered or unexported fields
}

func NewRSPutStream

func NewRSPutStream(dataServers []string, hash string, size int64) (*RSPutStream, error)

func (*RSPutStream) Commit

func (s *RSPutStream) Commit(success bool)

func (RSPutStream) Flush

func (e RSPutStream) Flush()

func (RSPutStream) Write

func (e RSPutStream) Write(p []byte) (n int, err error)

type RSResumableGetStream

type RSResumableGetStream struct {
	// contains filtered or unexported fields
}

func NewRSResumableGetStream

func NewRSResumableGetStream(dataServers []string, uuids []string, size int64) (*RSResumableGetStream, error)

func (RSResumableGetStream) Read

func (d RSResumableGetStream) Read(p []byte) (n int, err error)

type RSResumablePutStream

type RSResumablePutStream struct {
	*RSPutStream
	// contains filtered or unexported fields
}

func NewRSResumablePutStream

func NewRSResumablePutStream(dataServers []string, name, hash string, size int64) (*RSResumablePutStream, error)

func NewRSResumablePutStreamFromToken

func NewRSResumablePutStreamFromToken(token string) (*RSResumablePutStream, error)

func (*RSResumablePutStream) CurrentSize

func (s *RSResumablePutStream) CurrentSize() int64

func (RSResumablePutStream) Flush

func (e RSResumablePutStream) Flush()

func (*RSResumablePutStream) ToToken

func (s *RSResumablePutStream) ToToken() string

func (RSResumablePutStream) Write

func (e RSResumablePutStream) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL