multiapp

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCompressionFormat = appendable.DefaultCompressionFormat
View Source
const DefaultCompressionLevel = appendable.DefaultCompressionLevel
View Source
const DefaultFileMode = os.FileMode(0755)
View Source
const DefaultFileSize = 1 << 26 // 64Mb
View Source
const DefaultMaxOpenedFiles = 10
View Source
const DefaultReadBufferSize = 4096
View Source
const DefaultWriteBufferSize = 4096

Variables

View Source
var ErrAlreadyClosed = errors.New("multiapp: already closed")
View Source
var ErrIllegalArguments = errors.New("multiapp: illegal arguments")
View Source
var ErrInvalidOptions = fmt.Errorf("%w: invalid options", ErrIllegalArguments)
View Source
var ErrReadOnly = errors.New("multiapp: read-only mode")
View Source
var ErrorPathIsNotADirectory = errors.New("multiapp: path is not a directory")

Functions

This section is empty.

Types

type DefaultMultiFileAppendableHooks added in v1.0.5

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

func (*DefaultMultiFileAppendableHooks) OpenAppendable added in v1.0.5

func (d *DefaultMultiFileAppendableHooks) OpenAppendable(options *singleapp.Options, appname string, needsWriteAccess bool) (appendable.Appendable, error)

func (*DefaultMultiFileAppendableHooks) OpenInitialAppendable added in v1.0.5

func (d *DefaultMultiFileAppendableHooks) OpenInitialAppendable(opts *Options, singleAppOpts *singleapp.Options) (app appendable.Appendable, appID int64, err error)

type MultiFileAppendable

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

func Open

func Open(path string, opts *Options) (*MultiFileAppendable, error)

func OpenWithHooks added in v1.0.5

func OpenWithHooks(path string, hooks MultiFileAppendableHooks, opts *Options) (*MultiFileAppendable, error)

func (*MultiFileAppendable) Append

func (mf *MultiFileAppendable) Append(bs []byte) (off int64, n int, err error)

func (*MultiFileAppendable) Close

func (mf *MultiFileAppendable) Close() error

func (*MultiFileAppendable) CompressionFormat

func (mf *MultiFileAppendable) CompressionFormat() int

func (*MultiFileAppendable) CompressionLevel

func (mf *MultiFileAppendable) CompressionLevel() int

func (*MultiFileAppendable) Copy added in v0.9.1

func (mf *MultiFileAppendable) Copy(dstPath string) error

func (*MultiFileAppendable) CurrApp added in v1.0.5

func (*MultiFileAppendable) DiscardUpto added in v1.2.3

func (mf *MultiFileAppendable) DiscardUpto(off int64) error

func (*MultiFileAppendable) Flush

func (mf *MultiFileAppendable) Flush() error

func (*MultiFileAppendable) Metadata

func (mf *MultiFileAppendable) Metadata() []byte

func (*MultiFileAppendable) Offset

func (mf *MultiFileAppendable) Offset() int64

func (*MultiFileAppendable) ReadAt

func (mf *MultiFileAppendable) ReadAt(bs []byte, off int64) (int, error)

func (*MultiFileAppendable) ReplaceCachedChunk added in v1.0.5

func (mf *MultiFileAppendable) ReplaceCachedChunk(appID int64, app appendable.Appendable) (appendable.Appendable, error)

func (*MultiFileAppendable) SetOffset

func (mf *MultiFileAppendable) SetOffset(off int64) error

func (*MultiFileAppendable) Size

func (mf *MultiFileAppendable) Size() (int64, error)

func (*MultiFileAppendable) SwitchToReadOnlyMode added in v1.3.2

func (mf *MultiFileAppendable) SwitchToReadOnlyMode() error

func (*MultiFileAppendable) Sync

func (mf *MultiFileAppendable) Sync() error

type MultiFileAppendableHooks added in v1.0.5

type MultiFileAppendableHooks interface {
	// Hook to open underlying appendable.
	// If needsWriteAccess is set to true, this appendable must be a single file appendable
	OpenAppendable(options *singleapp.Options, appname string, needsWriteAccess bool) (appendable.Appendable, error)

	// Hook to open the last underlying appendable that's available
	OpenInitialAppendable(opts *Options, singleAppOpts *singleapp.Options) (app appendable.Appendable, appID int64, err error)
}

type Options

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

func DefaultOptions

func DefaultOptions() *Options

func (*Options) GetFileExt added in v1.0.5

func (opt *Options) GetFileExt() string

func (*Options) GetFileMode added in v1.0.5

func (opt *Options) GetFileMode() os.FileMode

func (*Options) GetPrealloc added in v1.5.0

func (opts *Options) GetPrealloc() bool

func (*Options) GetReadBufferSize added in v1.2.3

func (opts *Options) GetReadBufferSize() int

func (*Options) GetWriteBufferSize added in v1.2.3

func (opts *Options) GetWriteBufferSize() int

func (*Options) Validate added in v1.3.2

func (opts *Options) Validate() error

func (*Options) WithAutoSync added in v1.3.2

func (opt *Options) WithAutoSync(autoSync bool) *Options

func (*Options) WithCompresionLevel

func (opt *Options) WithCompresionLevel(compressionLevel int) *Options

func (*Options) WithCompressionFormat

func (opt *Options) WithCompressionFormat(compressionFormat int) *Options

func (*Options) WithFileExt

func (opt *Options) WithFileExt(fileExt string) *Options

func (*Options) WithFileMode

func (opt *Options) WithFileMode(fileMode os.FileMode) *Options

func (*Options) WithFileSize

func (opt *Options) WithFileSize(fileSize int) *Options

func (*Options) WithMaxOpenedFiles

func (opt *Options) WithMaxOpenedFiles(maxOpenedFiles int) *Options

func (*Options) WithMetadata

func (opt *Options) WithMetadata(metadata []byte) *Options

func (*Options) WithPrealloc added in v1.5.0

func (opts *Options) WithPrealloc(prealloc bool) *Options

func (*Options) WithReadBufferSize added in v1.2.3

func (opts *Options) WithReadBufferSize(size int) *Options

func (*Options) WithReadOnly

func (opt *Options) WithReadOnly(readOnly bool) *Options

func (*Options) WithRetryableSync added in v1.3.2

func (opt *Options) WithRetryableSync(retryableSync bool) *Options

func (*Options) WithWriteBufferSize added in v1.2.3

func (opts *Options) WithWriteBufferSize(size int) *Options

Jump to

Keyboard shortcuts

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