github.com/ethersphere/bee/v2@v2.2.0/pkg/storer/migration/all_steps.go (about)

     1  // Copyright 2023 The Swarm Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package migration
     6  
     7  import (
     8  	"github.com/ethersphere/bee/v2/pkg/log"
     9  	"github.com/ethersphere/bee/v2/pkg/storage"
    10  	"github.com/ethersphere/bee/v2/pkg/storage/migration"
    11  	"github.com/ethersphere/bee/v2/pkg/storer/internal/transaction"
    12  )
    13  
    14  // AfterInitSteps lists all migration steps for localstore IndexStore after the localstore is initiated.
    15  func AfterInitSteps(
    16  	sharkyPath string,
    17  	sharkyNoOfShards int,
    18  	st transaction.Storage,
    19  	logger log.Logger,
    20  ) migration.Steps {
    21  	return map[uint64]migration.StepFn{
    22  		1: step_01,
    23  		2: step_02(st),
    24  		3: ReserveRepairer(st, storage.ChunkType, logger),
    25  		4: step_04(sharkyPath, sharkyNoOfShards, st),
    26  		5: step_05(st),
    27  		6: step_06(st),
    28  	}
    29  }
    30  
    31  // BeforeInitSteps lists all migration steps for localstore IndexStore before the localstore is initiated.
    32  func BeforeInitSteps(st storage.BatchStore) migration.Steps {
    33  	return map[uint64]migration.StepFn{
    34  		1: RefCountSizeInc(st),
    35  	}
    36  }