Documentation
¶
Index ¶
- Constants
- Variables
- func ToCompressionLevel(level uint32) (lz4.CompressionLevel, error)
- type BlockSize
- func (x BlockSize) Enum() *BlockSize
- func (x BlockSize) MarshalJSON() ([]byte, error)
- func (x BlockSize) MarshalProtoJSON(s *json.MarshalState)
- func (x BlockSize) MarshalProtoText() string
- func (x BlockSize) MarshalText() ([]byte, error)
- func (x BlockSize) String() string
- func (b BlockSize) ToBlockSize() (lz4.BlockSize, error)
- func (x *BlockSize) UnmarshalJSON(b []byte) error
- func (x *BlockSize) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (x *BlockSize) UnmarshalText(b []byte) error
- type Config
- func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Config) CloneVT() *Config
- func (this *Config) EqualMessageVT(thatMsg any) bool
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(other config.Config) bool
- func (x *Config) GetBlockChecksum() bool
- func (x *Config) GetBlockSize() BlockSize
- func (x *Config) GetCompressionLevel() uint32
- func (c *Config) GetConfigID() string
- func (x *Config) GetDisableChecksum() bool
- func (x *Config) MarshalJSON() ([]byte, error)
- func (x *Config) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config) MarshalProtoText() string
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (*Config) ProtoMessage()
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (c *Config) ToOptions() []lz4.Option
- func (x *Config) UnmarshalJSON(b []byte) error
- func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type LZ4
- type StepFactory
Constants ¶
const ConfigID = "hydra/transform/lz4"
ConfigID is the configuration identifier.
const DefaultBlockSize = lz4.Block4Mb
DefaultBlockSize matches the default block size in the lz4 library.
Variables ¶
var ( BlockSize_name = map[int32]string{ 0: "BlockSize_4MB", 1: "BlockSize_64KB", 2: "BlockSize_256KB", 3: "BlockSize_1MB", } BlockSize_value = map[string]int32{ "BlockSize_4MB": 0, "BlockSize_64KB": 1, "BlockSize_256KB": 2, "BlockSize_1MB": 3, } )
Enum value maps for BlockSize.
Functions ¶
func ToCompressionLevel ¶
func ToCompressionLevel(level uint32) (lz4.CompressionLevel, error)
ToCompressionLevel converts the level into a compression level.
Types ¶
type BlockSize ¶
type BlockSize int32
BlockSize is the list of available block sizes.
const ( // BlockSize_4MB is the default 4 megabyte block size. BlockSize_BlockSize_4MB BlockSize = 0 // BlockSize_64KB is the 64 kilobyte block size. BlockSize_BlockSize_64KB BlockSize = 1 // BlockSize_256KB is the 256 kilobyte block size. BlockSize_BlockSize_256KB BlockSize = 2 // BlockSize_1MB is the 1 megabyte block size. BlockSize_BlockSize_1MB BlockSize = 3 )
func (BlockSize) MarshalJSON ¶
MarshalJSON marshals the BlockSize to JSON.
func (BlockSize) MarshalProtoJSON ¶
func (x BlockSize) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the BlockSize to JSON.
func (BlockSize) MarshalProtoText ¶
func (BlockSize) MarshalText ¶
MarshalText marshals the BlockSize to text.
func (BlockSize) ToBlockSize ¶
ToBlockSize converts the size into a lz4 block size.
func (*BlockSize) UnmarshalJSON ¶
UnmarshalJSON unmarshals the BlockSize from JSON.
func (*BlockSize) UnmarshalProtoJSON ¶
func (x *BlockSize) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the BlockSize from JSON.
func (*BlockSize) UnmarshalText ¶
UnmarshalText unmarshals the BlockSize from text.
type Config ¶
type Config struct {
// BlockSize defines the maximum size of compressed blocks.
// Defaults to 4MB.
BlockSize BlockSize `protobuf:"varint,1,opt,name=block_size,json=blockSize,proto3" json:"blockSize,omitempty"`
// BlockChecksum enables the block checksum feature.
BlockChecksum bool `protobuf:"varint,2,opt,name=block_checksum,json=blockChecksum,proto3" json:"blockChecksum,omitempty"`
// DisableChecksum disables all blocks or content checksum.
// Default=false.
DisableChecksum bool `protobuf:"varint,3,opt,name=disable_checksum,json=disableChecksum,proto3" json:"disableChecksum,omitempty"`
// CompressionLevel sets the compression level from 0-9.
// The default value (0) is "FAST."
CompressionLevel uint32 `protobuf:"varint,4,opt,name=compression_level,json=compressionLevel,proto3" json:"compressionLevel,omitempty"`
// contains filtered or unexported fields
}
Config configures the lz4 compression transform.
func (*Config) CloneMessageVT ¶
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶
func (*Config) EqualsConfig ¶
EqualsConfig checks if the config is equal to another.
func (*Config) GetBlockChecksum ¶
func (*Config) GetBlockSize ¶
func (*Config) GetCompressionLevel ¶
func (*Config) GetConfigID ¶
GetConfigID returns the unique string for this configuration type. This string is stored with the encoded config.
func (*Config) GetDisableChecksum ¶
func (*Config) MarshalJSON ¶
MarshalJSON marshals the Config to JSON.
func (*Config) MarshalProtoJSON ¶
func (x *Config) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config message to JSON.
func (*Config) MarshalProtoText ¶
func (*Config) MarshalToSizedBufferVT ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Config from JSON.
func (*Config) UnmarshalProtoJSON ¶
func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config message from JSON.
func (*Config) UnmarshalVT ¶
type LZ4 ¶
type LZ4 struct {
// contains filtered or unexported fields
}
LZ4 is the LZ4 compression step.
func (*LZ4) DecodeBlock ¶
DecodeBlock decodes the block according to the config. May reuse the same byte slice if possible.
type StepFactory ¶
type StepFactory struct{}
StepFactory constructs the transform step.
func NewStepFactory ¶
func NewStepFactory() *StepFactory
NewStepFactory constructs the factory object.
func (*StepFactory) Construct ¶
func (f *StepFactory) Construct( conf config.Config, opts controller.ConstructOpts, ) (block_transform.Step, error)
Construct constructs the associated transform step given configuration.
func (*StepFactory) ConstructConfig ¶
func (f *StepFactory) ConstructConfig() config.Config
ConstructConfig constructs an instance of the transform configuration.
func (*StepFactory) ConstructMockConfig ¶
func (f *StepFactory) ConstructMockConfig() []config.Config
ConstructMockConfig constructs an instance of the transform configuration for testing.
func (*StepFactory) GetConfigID ¶
func (f *StepFactory) GetConfigID() string
GetConfigID returns the unique config ID for the transform step.