Documentation
¶
Index ¶
Constants ¶
const ( // DefaultChunkSize is 20MB (leaving room for overhead). DefaultChunkSize = 20 * 1024 * 1024 // MaxChunkSize is 500MB to prevent excessive memory usage. MaxChunkSize = 500 * 1024 * 1024 )
Size constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketPath ¶
type BucketPath struct { // StringPath is the hex-encoded path with / delimiters for logging. StringPath string // RawPath contains the original bucket names as raw bytes. RawPath [][]byte }
BucketPath represents a path in the database with both string and raw representations.
func NewBucketPath ¶
func NewBucketPath(buckets [][]byte) BucketPath
NewBucketPath creates a bucket path from raw bucket names.
func (BucketPath) AppendBucket ¶
func (bp BucketPath) AppendBucket(bucket []byte) BucketPath
AppendBucket creates a new BucketPath with an additional bucket.
func (BucketPath) Equal ¶
func (bp BucketPath) Equal(other BucketPath) bool
Equal compares two bucket paths for equality.
func (BucketPath) HasPath ¶
func (bp BucketPath) HasPath() bool
HasPath returns true if the BucketPath contains any path elements.
func (BucketPath) MarshalJSON ¶
func (bp BucketPath) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface by marshaling the raw byte arrays directly.
func (BucketPath) String ¶
func (bp BucketPath) String() string
String implements the Stringer interface.
func (*BucketPath) UnmarshalJSON ¶
func (bp *BucketPath) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface by unmarshaling directly into the raw byte arrays.
type Config ¶
type Config struct { // ChunkSize is the number of items (key-value pairs or buckets) to // process in a single transaction in bytes. ChunkSize uint64 // Logger is the logger to use for logging. Logger btclog.Logger // MetaDB is the database that stores the migration/verification state. // We store it separately to not clutter the source or destination // databases. MetaDB *bbolt.DB // DBPrefixName is the prefix of the database name. DBPrefixName string }
Config holds the configuration for the migrator.
type MigrationState ¶
type MigrationState struct {
// contains filtered or unexported fields
}
MigrationState holds migration-specific state for resumability of the process.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator handles the chunked migration of bolt databases. It supports:
- Resumable migrations through state tracking
- Chunk-based processing to handle large databases
- Verification of migrated data (also resumable)
- Progress logging
type VerificationState ¶
type VerificationState struct {
// contains filtered or unexported fields
}
VerificationState holds verification-specific state for resumability of the process.