Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSummaryDoesntExist = errors.New("summary doesn't exist")
ErrSummaryDoesntExist is the error returned when trying to read a summary for a given key that doesn't exist
Functions ¶
This section is empty.
Types ¶
type AttributionMethod ¶
type AttributionMethod interface { // EmptySummary returns an empty summary for the given method type EmptySummary(ctx context.Context) Summary // ReadSummary reads a summary for a commit hash ReadSummary(ctx context.Context, key string) (Summary, error) // CollectShards gathers all the shards that need to be processed CollectShards(ctx context.Context, commit, prevCommit *doltdb.Commit, summary Summary) ([]ShardInfo, error) // ProcessShard processes a single shard ProcessShard(ctx context.Context, commitIdx int16, cm, prevCm *doltdb.Commit, shardInfo ShardInfo) (ShardResult, error) // ProcessResults takes all the results from processing all the shards and returns a summary ProcessResults(ctx context.Context, commitHash hash.Hash, prevSummary Summary, results []ShardResult) (Summary, error) // WriteSummary persists a summary WriteSummary(ctx context.Context, summary Summary) (string, error) // SerializeShardInfo takes a ShardInfo object and serializes it SerializeShardInfo(ctx context.Context, info ShardInfo) ([]byte, error) // DeserializeShardInfo takes a []byte and deserializes it to a ShardInfo object DeserializeShardInfo(ctx context.Context, data []byte) (ShardInfo, error) // SerializeResults takes a ShardResult object and serializes it SerializeResults(ctx context.Context, results ShardResult) ([]byte, error) // DeserializeResults takes a []bite and deserializes it ta a ShardResult DeserializeResults(ctx context.Context, data []byte) (ShardResult, error) }
AttributionMethod is an interface for attributing changes to commits
type FilesysShardStore ¶
type FilesysShardStore struct {
// contains filtered or unexported fields
}
FilesysShardStore is a ShardStore implementation that reads from and writes to the local file system
func NewFilesysShardStore ¶
func NewFilesysShardStore(rootDir string) (*FilesysShardStore, error)
NewFilesysShardStore returns a new FilesysShardStore object
func (*FilesysShardStore) Join ¶
func (f *FilesysShardStore) Join(keyElements ...string) string
Join joins key elements into a single key with delimiters that are appropriate for the backing storage. In this case it uses the filesys appropriate file separator.
func (*FilesysShardStore) WriteShard ¶
func (f *FilesysShardStore) WriteShard(ctx context.Context, key string, store *valuefile.FileValueStore, shardVal types.Value) error
WriteShard presists shard data stored in noms.valuefile format
type ShardInfo ¶
type ShardInfo interface {
Key(*types.NomsBinFormat) string
}
ShardInfo is an interface which contains data necessary for processing a single shard of data
type ShardResult ¶
type ShardResult interface{}
ShardResult is an interface which contains the result of processing a shard of data
type ShardStore ¶
type ShardStore interface { // WriteShard presists shard data stored in noms.valuefile format WriteShard(ctx context.Context, key string, store *valuefile.FileValueStore, shardVal types.Value) error // ReadShard reads shard data ReadShard(ctx context.Context, key string) (*MemShard, error) // Join joins key elements into a single key with delimiters that are appropriate for the backing storage Join(keyElements ...string) string }
ShardStore is an interface for storing and retrieving shard data