transform_lz4

package
v0.56.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigID = "hydra/transform/lz4"

ConfigID is the configuration identifier.

View Source
const DefaultBlockSize = lz4.Block4Mb

DefaultBlockSize matches the default block size in the lz4 library.

Variables

View Source
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) Enum

func (x BlockSize) Enum() *BlockSize

func (BlockSize) MarshalJSON

func (x BlockSize) MarshalJSON() ([]byte, error)

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 (x BlockSize) MarshalProtoText() string

func (BlockSize) MarshalText

func (x BlockSize) MarshalText() ([]byte, error)

MarshalText marshals the BlockSize to text.

func (BlockSize) String

func (x BlockSize) String() string

func (BlockSize) ToBlockSize

func (b BlockSize) ToBlockSize() (lz4.BlockSize, error)

ToBlockSize converts the size into a lz4 block size.

func (*BlockSize) UnmarshalJSON

func (x *BlockSize) UnmarshalJSON(b []byte) error

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

func (x *BlockSize) UnmarshalText(b []byte) error

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) CloneVT

func (m *Config) CloneVT() *Config

func (*Config) EqualMessageVT

func (this *Config) EqualMessageVT(thatMsg any) bool

func (*Config) EqualVT

func (this *Config) EqualVT(that *Config) bool

func (*Config) EqualsConfig

func (c *Config) EqualsConfig(other config.Config) bool

EqualsConfig checks if the config is equal to another.

func (*Config) GetBlockChecksum

func (x *Config) GetBlockChecksum() bool

func (*Config) GetBlockSize

func (x *Config) GetBlockSize() BlockSize

func (*Config) GetCompressionLevel

func (x *Config) GetCompressionLevel() uint32

func (*Config) GetConfigID

func (c *Config) GetConfigID() string

GetConfigID returns the unique string for this configuration type. This string is stored with the encoded config.

func (*Config) GetDisableChecksum

func (x *Config) GetDisableChecksum() bool

func (*Config) MarshalJSON

func (x *Config) MarshalJSON() ([]byte, error)

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 (x *Config) MarshalProtoText() string

func (*Config) MarshalToSizedBufferVT

func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Config) MarshalToVT

func (m *Config) MarshalToVT(dAtA []byte) (int, error)

func (*Config) MarshalVT

func (m *Config) MarshalVT() (dAtA []byte, err error)

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (x *Config) Reset()

func (*Config) SizeVT

func (m *Config) SizeVT() (n int)

func (*Config) String

func (x *Config) String() string

func (*Config) ToOptions

func (c *Config) ToOptions() []lz4.Option

ToOptions converts the config into lz4 options.

func (*Config) UnmarshalJSON

func (x *Config) UnmarshalJSON(b []byte) error

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

func (m *Config) UnmarshalVT(dAtA []byte) error

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

type LZ4

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

LZ4 is the LZ4 compression step.

func NewLZ4

func NewLZ4(c *Config) (*LZ4, error)

NewLZ4 constructs the s2 compress step.

func (*LZ4) DecodeBlock

func (s *LZ4) DecodeBlock(data []byte) ([]byte, error)

DecodeBlock decodes the block according to the config. May reuse the same byte slice if possible.

func (*LZ4) EncodeBlock

func (s *LZ4) EncodeBlock(data []byte) ([]byte, error)

EncodeBlock encodes 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.

Jump to

Keyboard shortcuts

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