MCPcopy
hub / github.com/kopia/kopia / updateRepositoryParameters

Function updateRepositoryParameters

cli/command_repository_set_parameters.go:114–141  ·  view source on GitHub ↗
(
	ctx context.Context,
	upgradeToEpochManager bool,
	mp format.MutableParameters,
	rep repo.DirectRepositoryWriter,
	blobcfg format.BlobStorageConfiguration,
	requiredFeatures []feature.Required,
)

Source from the content-addressed store, hash-verified

112}
113
114func updateRepositoryParameters(
115 ctx context.Context,
116 upgradeToEpochManager bool,
117 mp format.MutableParameters,
118 rep repo.DirectRepositoryWriter,
119 blobcfg format.BlobStorageConfiguration,
120 requiredFeatures []feature.Required,
121) error {
122 if upgradeToEpochManager {
123 log(ctx).Info("migrating current indexes to epoch format")
124
125 if err := rep.ContentManager().PrepareUpgradeToIndexBlobManagerV1(ctx); err != nil {
126 return errors.Wrap(err, "error upgrading indexes")
127 }
128 }
129
130 if err := rep.FormatManager().SetParameters(ctx, mp, blobcfg, requiredFeatures); err != nil {
131 return errors.Wrap(err, "error setting parameters")
132 }
133
134 if upgradeToEpochManager {
135 if err := format.WriteLegacyIndexPoisonBlob(ctx, rep.BlobStorage()); err != nil {
136 log(ctx).Errorf("unable to write legacy index poison blob: %v", err)
137 }
138 }
139
140 return nil
141}
142
143func updateEpochParameters(mp *format.MutableParameters, anyChange, upgradeToEpochManager *bool) {
144 *anyChange = true

Callers 1

runMethod · 0.85

Calls 8

InfoMethod · 0.80
SetParametersMethod · 0.80
ErrorfMethod · 0.80
ContentManagerMethod · 0.65
FormatManagerMethod · 0.65
BlobStorageMethod · 0.65

Tested by

no test coverage detected