stream

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStreamComponent

func NewStreamComponent() internal.Component

Pipeline will call this method to create your object, initialize your variables here << DO NOT DELETE ANY AUTO GENERATED CODE HERE >>

Types

type ReadCache

type ReadCache struct {
	*Stream
	StreamConnection
}

func (*ReadCache) CloseFile

func (r *ReadCache) CloseFile(options internal.CloseFileOptions) error

func (*ReadCache) Configure

func (r *ReadCache) Configure(conf StreamOptions) error

func (*ReadCache) CreateFile

func (r *ReadCache) CreateFile(options internal.CreateFileOptions) (*handlemap.Handle, error)

func (*ReadCache) DeleteDirectory

func (r *ReadCache) DeleteDirectory(options internal.DeleteDirOptions) error

func (*ReadCache) DeleteFile

func (r *ReadCache) DeleteFile(options internal.DeleteFileOptions) error

func (*ReadCache) FlushFile

func (r *ReadCache) FlushFile(options internal.FlushFileOptions) error

func (*ReadCache) GetAttr

func (r *ReadCache) GetAttr(options internal.GetAttrOptions) (*internal.ObjAttr, error)

func (*ReadCache) OpenFile

func (r *ReadCache) OpenFile(options internal.OpenFileOptions) (*handlemap.Handle, error)

func (*ReadCache) ReadInBuffer

func (r *ReadCache) ReadInBuffer(options internal.ReadInBufferOptions) (int, error)

func (*ReadCache) RenameDirectory

func (r *ReadCache) RenameDirectory(options internal.RenameDirOptions) error

func (*ReadCache) RenameFile

func (r *ReadCache) RenameFile(options internal.RenameFileOptions) error

func (*ReadCache) Stop

func (r *ReadCache) Stop() error

Stop : Stop the component functionality and kill all threads started

func (*ReadCache) TruncateFile

func (r *ReadCache) TruncateFile(options internal.TruncateFileOptions) error

func (*ReadCache) WriteFile

func (r *ReadCache) WriteFile(options internal.WriteFileOptions) (int, error)

type ReadWriteCache

type ReadWriteCache struct {
	*Stream
	StreamConnection
}

func (*ReadWriteCache) CloseFile

func (rw *ReadWriteCache) CloseFile(options internal.CloseFileOptions) error

func (*ReadWriteCache) Configure

func (rw *ReadWriteCache) Configure(conf StreamOptions) error

func (*ReadWriteCache) CreateFile

func (rw *ReadWriteCache) CreateFile(options internal.CreateFileOptions) (*handlemap.Handle, error)

func (*ReadWriteCache) DeleteDirectory

func (rw *ReadWriteCache) DeleteDirectory(options internal.DeleteDirOptions) error

func (*ReadWriteCache) DeleteFile

func (rw *ReadWriteCache) DeleteFile(options internal.DeleteFileOptions) error

func (*ReadWriteCache) FlushFile

func (rw *ReadWriteCache) FlushFile(options internal.FlushFileOptions) error

func (*ReadWriteCache) GetAttr

func (rw *ReadWriteCache) GetAttr(options internal.GetAttrOptions) (*internal.ObjAttr, error)

func (*ReadWriteCache) OpenFile

func (rw *ReadWriteCache) OpenFile(options internal.OpenFileOptions) (*handlemap.Handle, error)

func (*ReadWriteCache) ReadInBuffer

func (rw *ReadWriteCache) ReadInBuffer(options internal.ReadInBufferOptions) (int, error)

func (*ReadWriteCache) RenameDirectory

func (rw *ReadWriteCache) RenameDirectory(options internal.RenameDirOptions) error

func (*ReadWriteCache) RenameFile

func (rw *ReadWriteCache) RenameFile(options internal.RenameFileOptions) error

func (*ReadWriteCache) Stop

func (rw *ReadWriteCache) Stop() error

Stop : Stop the component functionality and kill all threads started

func (*ReadWriteCache) TruncateFile

func (rw *ReadWriteCache) TruncateFile(options internal.TruncateFileOptions) error

func (*ReadWriteCache) WriteFile

func (rw *ReadWriteCache) WriteFile(options internal.WriteFileOptions) (int, error)

type ReadWriteFilenameCache

type ReadWriteFilenameCache struct {
	sync.RWMutex
	*Stream
	StreamConnection
	// contains filtered or unexported fields
}

func (*ReadWriteFilenameCache) CloseFile

func (rw *ReadWriteFilenameCache) CloseFile(options internal.CloseFileOptions) error

func (*ReadWriteFilenameCache) Configure

func (rw *ReadWriteFilenameCache) Configure(conf StreamOptions) error

func (*ReadWriteFilenameCache) CreateFile

func (*ReadWriteFilenameCache) DeleteDirectory

func (rw *ReadWriteFilenameCache) DeleteDirectory(options internal.DeleteDirOptions) error

func (*ReadWriteFilenameCache) DeleteFile

func (rw *ReadWriteFilenameCache) DeleteFile(options internal.DeleteFileOptions) error

func (*ReadWriteFilenameCache) FlushFile

func (rw *ReadWriteFilenameCache) FlushFile(options internal.FlushFileOptions) error

func (*ReadWriteFilenameCache) GetAttr

GetAttr : Try to serve the request from the attribute cache, otherwise cache attributes of the path returned by next component

func (*ReadWriteFilenameCache) OpenFile

func (*ReadWriteFilenameCache) ReadInBuffer

func (rw *ReadWriteFilenameCache) ReadInBuffer(options internal.ReadInBufferOptions) (int, error)

func (*ReadWriteFilenameCache) RenameDirectory

func (rw *ReadWriteFilenameCache) RenameDirectory(options internal.RenameDirOptions) error

func (*ReadWriteFilenameCache) RenameFile

func (rw *ReadWriteFilenameCache) RenameFile(options internal.RenameFileOptions) error

func (*ReadWriteFilenameCache) Stop

func (rw *ReadWriteFilenameCache) Stop() error

Stop : Stop the component functionality and kill all threads started

func (*ReadWriteFilenameCache) TruncateFile

func (rw *ReadWriteFilenameCache) TruncateFile(options internal.TruncateFileOptions) error

TODO: truncate in cache

func (*ReadWriteFilenameCache) WriteFile

func (rw *ReadWriteFilenameCache) WriteFile(options internal.WriteFileOptions) (int, error)

type Stream

type Stream struct {
	internal.BaseComponent

	BlockSize      int64
	BufferSize     uint64 // maximum number of blocks allowed to be stored for a file
	CachedObjLimit int32
	CachedObjects  int32
	StreamOnly     bool // parameter used to check if its pure streaming
	// contains filtered or unexported fields
}

func (*Stream) CloseFile

func (st *Stream) CloseFile(options internal.CloseFileOptions) error

func (*Stream) Configure

func (st *Stream) Configure(_ bool) error

func (*Stream) CreateFile

func (st *Stream) CreateFile(options internal.CreateFileOptions) (*handlemap.Handle, error)

func (*Stream) DeleteDir

func (st *Stream) DeleteDir(options internal.DeleteDirOptions) error

func (*Stream) DeleteFile

func (st *Stream) DeleteFile(options internal.DeleteFileOptions) error

func (*Stream) FlushFile

func (st *Stream) FlushFile(options internal.FlushFileOptions) error

func (*Stream) GetAttr

func (st *Stream) GetAttr(options internal.GetAttrOptions) (*internal.ObjAttr, error)

func (*Stream) Name

func (st *Stream) Name() string

func (*Stream) OpenFile

func (st *Stream) OpenFile(options internal.OpenFileOptions) (*handlemap.Handle, error)

func (*Stream) Priority

func (st *Stream) Priority() internal.ComponentPriority

func (*Stream) ReadInBuffer

func (st *Stream) ReadInBuffer(options internal.ReadInBufferOptions) (int, error)

func (*Stream) RenameDir

func (st *Stream) RenameDir(options internal.RenameDirOptions) error

func (*Stream) RenameFile

func (st *Stream) RenameFile(options internal.RenameFileOptions) error

func (*Stream) SetName

func (st *Stream) SetName(name string)

func (*Stream) SetNextComponent

func (st *Stream) SetNextComponent(nc internal.Component)

func (*Stream) Start

func (st *Stream) Start(ctx context.Context) error

func (*Stream) Stop

func (st *Stream) Stop() error

Stop : Stop the component functionality and kill all threads started

func (*Stream) TruncateFile

func (st *Stream) TruncateFile(options internal.TruncateFileOptions) error

func (*Stream) WriteFile

func (st *Stream) WriteFile(options internal.WriteFileOptions) (int, error)

type StreamConnection

type StreamConnection interface {
	RenameDirectory(options internal.RenameDirOptions) error
	DeleteDirectory(options internal.DeleteDirOptions) error
	RenameFile(options internal.RenameFileOptions) error
	DeleteFile(options internal.DeleteFileOptions) error
	CreateFile(options internal.CreateFileOptions) (*handlemap.Handle, error) //TODO TEST THIS
	Configure(cfg StreamOptions) error
	ReadInBuffer(internal.ReadInBufferOptions) (int, error)
	OpenFile(internal.OpenFileOptions) (*handlemap.Handle, error)
	WriteFile(options internal.WriteFileOptions) (int, error)
	TruncateFile(internal.TruncateFileOptions) error
	FlushFile(internal.FlushFileOptions) error
	GetAttr(internal.GetAttrOptions) (*internal.ObjAttr, error)
	CloseFile(options internal.CloseFileOptions) error
	Stop() error
}

func NewStreamConnection

func NewStreamConnection(cfg StreamOptions, stream *Stream) StreamConnection

NewAzStorageConnection : Based on account type create respective AzConnection Object

type StreamOptions

type StreamOptions struct {
	BlockSize      uint64 `config:"block-size-mb" yaml:"block-size-mb,omitempty"`
	BufferSize     uint64 `config:"buffer-size-mb" yaml:"buffer-size-mb,omitempty"`
	CachedObjLimit uint64 `config:"max-buffers" yaml:"max-buffers,omitempty"`
	FileCaching    bool   `config:"file-caching" yaml:"file-caching,omitempty"`

	// v1 support
	StreamCacheMb    uint64 `config:"stream-cache-mb" yaml:"-"`
	MaxBlocksPerFile uint64 `config:"max-blocks-per-file" yaml:"-"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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