Documentation
¶
Index ¶
- Constants
- func AppendFile(filename, message string) error
- func CheckInternalState(isLeader *bool, term *int64, log []*surfstore.UpdateOperation, ...) (bool, error)
- func CleanUpDir(dirPath string)
- func ConcatPath(baseDir, fileDir string) string
- func CopyFile(sourceFile, destinationFile string) error
- func CreateDir(dirPath string)
- func DeleteFile(filename string) error
- func DirFullySynced(worker1, worker2 DirectoryWorker) bool
- func EndTest(test TestInfo)
- func InitBlockStores(blockStoreAddrs []string) []*exec.Cmd
- func InitRaftServers(cfgPath string, cfg surfstore.RaftConfig) []*exec.Cmd
- func InitSurfServers(blockStores int) []*exec.Cmd
- func IsTombHashList(hashList []string) bool
- func KillSurfServers(servers []*exec.Cmd)
- func LoadMetaFromDB(baseDir string) (fileMetaMap map[string]*surfstore.FileMetaData, e error)
- func LoadMetaFromMetaFile(baseDir string) (fileMetaMap map[string]*surfstore.FileMetaData, e error)
- func NewFileMetaData(InitMode int, filename string, version int, hashList []string, ...) *surfstore.FileMetaData
- func NewFileMetaDataFromConfig(configString string) *surfstore.FileMetaData
- func NewFileMetaDataFromParams(filename string, version int, hashList []string) *surfstore.FileMetaData
- func SameFile(filename1, filename2 string) (bool, error)
- func SameHashList(list1, list2 []string) bool
- func SameLog(log1, log2 []*surfstore.UpdateOperation) bool
- func SameMeta(meta1, meta2 map[string]*surfstore.FileMetaData) bool
- func SameOperation(op1, op2 *surfstore.UpdateOperation) bool
- func StartSurfServers(servers []*exec.Cmd, ready chan bool)
- func SyncClient(metaAddr, baseDir string, blockSize int, cfgPath string) error
- func TruncateFile(filename string, leftSize int) error
- type DirectoryWorker
- func (d *DirectoryWorker) AddFile(filename string) error
- func (d *DirectoryWorker) CleanUp()
- func (d *DirectoryWorker) DeleteFile(filename string) error
- func (d *DirectoryWorker) ListAllFile() map[string]bool
- func (d *DirectoryWorker) TruncateFile(filename string, size int) error
- func (d *DirectoryWorker) UpdateFile(filename, message string) error
- type TestInfo
Constants ¶
View Source
const BLOCK_SIZE = 1024
View Source
const CONFIG_DELIMITER string = ","
View Source
const DEFAULT_BLOCK_SIZE int = 4096
View Source
const DEFAULT_META_FILENAME string = "index.db"
View Source
const FILENAME_INDEX int = 0
View Source
const FILE_INIT_VERSION int = 1
View Source
const FILE_INIT_VERSION_STR string = "1"
View Source
const HASH_DELIMITER string = " "
View Source
const HASH_LIST_INDEX int = 2
View Source
const LOAD_FROM_DIR int = 0
View Source
const LOAD_FROM_METAFILE int = 1
View Source
const META_FILENAME = "index.db"
View Source
const META_INIT_BY_CONFIG_STR int = 2
View Source
const META_INIT_BY_FILENAME int = 0
View Source
const META_INIT_BY_PARAMS int = 1
View Source
const NON_EXIST_FILE_VERSION int = 0
View Source
const NON_EXIST_FILE_VERSION_STR string = "0"
View Source
const SRC_PATH = "./test_files"
View Source
const SURF_CLIENT string = "[Surfstore RPCClient]:"
View Source
const SURF_SERVER string = "[Surfstore Server]:"
View Source
const TOMBSTONE_HASH string = "0"
View Source
const VERSION_INDEX int = 1
Variables ¶
This section is empty.
Functions ¶
func AppendFile ¶
func CheckInternalState ¶
func CheckInternalState(isLeader *bool, term *int64, log []*surfstore.UpdateOperation, fileMetaMap map[string]*surfstore.FileMetaData, server surfstore.RaftSurfstoreClient, ctx context.Context) (bool, error)
func CleanUpDir ¶
func CleanUpDir(dirPath string)
func DeleteFile ¶
func DirFullySynced ¶
func DirFullySynced(worker1, worker2 DirectoryWorker) bool
func InitBlockStores ¶
func InitRaftServers ¶
func InitRaftServers(cfgPath string, cfg surfstore.RaftConfig) []*exec.Cmd
func InitSurfServers ¶
func IsTombHashList ¶
func KillSurfServers ¶
func LoadMetaFromDB ¶
func LoadMetaFromDB(baseDir string) (fileMetaMap map[string]*surfstore.FileMetaData, e error)
func LoadMetaFromMetaFile ¶
func LoadMetaFromMetaFile(baseDir string) (fileMetaMap map[string]*surfstore.FileMetaData, e error)
func NewFileMetaData ¶
func NewFileMetaDataFromConfig ¶
func NewFileMetaDataFromConfig(configString string) *surfstore.FileMetaData
func NewFileMetaDataFromParams ¶
func NewFileMetaDataFromParams(filename string, version int, hashList []string) *surfstore.FileMetaData
func SameHashList ¶
func SameLog ¶
func SameLog(log1, log2 []*surfstore.UpdateOperation) bool
func SameOperation ¶
func SameOperation(op1, op2 *surfstore.UpdateOperation) bool
func StartSurfServers ¶
func TruncateFile ¶
Types ¶
type DirectoryWorker ¶
func InitDirectoryWorker ¶
func InitDirectoryWorker(directoryName, srcPath string) *DirectoryWorker
func (*DirectoryWorker) AddFile ¶
func (d *DirectoryWorker) AddFile(filename string) error
func (*DirectoryWorker) CleanUp ¶
func (d *DirectoryWorker) CleanUp()
func (*DirectoryWorker) DeleteFile ¶
func (d *DirectoryWorker) DeleteFile(filename string) error
func (*DirectoryWorker) ListAllFile ¶
func (d *DirectoryWorker) ListAllFile() map[string]bool
func (*DirectoryWorker) TruncateFile ¶
func (d *DirectoryWorker) TruncateFile(filename string, size int) error
func (*DirectoryWorker) UpdateFile ¶
func (d *DirectoryWorker) UpdateFile(filename, message string) error
Click to show internal directories.
Click to hide internal directories.