Documentation ¶
Index ¶
- func CreateStorageNodePaths(volumes []string, cid types.ClusterID, snid types.StorageNodeID) (snPaths []string, err error)
- func LogStreamDirName(tpid types.TopicID, lsid types.LogStreamID) string
- func StorageNodeDirName(cid types.ClusterID, snid types.StorageNodeID) string
- func WritableDirectory(dir string) error
- type DataDir
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateStorageNodePaths ¶
func CreateStorageNodePaths(volumes []string, cid types.ClusterID, snid types.StorageNodeID) (snPaths []string, err error)
CreateStorageNodePaths creates the directory structure for the storage node data. The directory structure is composed of the volume, cluster ID and storage node ID, for example, "/volume/cid_1_snid_1/".
func LogStreamDirName ¶
func LogStreamDirName(tpid types.TopicID, lsid types.LogStreamID) string
LogStreamDirName returns the directory name of the log stream data. The directory name is composed of the topic ID and log stream ID, for example, "tpid_1_lsid_1".
func StorageNodeDirName ¶
func StorageNodeDirName(cid types.ClusterID, snid types.StorageNodeID) string
StorageNodeDirName returns the directory name of the storage node data. The directory name is composed of the cluster ID and storage node ID, for example, "cid_1_snid_1".
func WritableDirectory ¶
WritableDirectory decides that the argument dir is writable directory.
Types ¶
type DataDir ¶
type DataDir struct { // Volume should be an absolute directory. Volume string ClusterID types.ClusterID StorageNodeID types.StorageNodeID TopicID types.TopicID LogStreamID types.LogStreamID }
DataDir represents data directory by using various identifiers.
func GetValidDataDirectories ¶
func GetValidDataDirectories(read []DataDir, given []string, strict bool, cid types.ClusterID, snid types.StorageNodeID) ([]DataDir, error)
GetValidDataDirectories checks data directories read from volumes whether they are valid to load. The argument given, specified by the flag `--data-dirs`, represents required directories that should exist in the directories read from the volumes. If the argument strict is true, which is set by the flag `--volume-strict-check`, no other directories must not exist in the volumes except the directories specified by the argument given. In non-strict mode, on the other hand, those other directories are ignored.
func ParseDataDir ¶
ParseDataDir parses data directory into DataDir struct only by lexical processing. The argument dataDir should be absolute path.
func ReadVolumes ¶
ReadVolumes reads all data directories from the volumes regardless their validness. It ignores files while walking the volumes. If duplicated volumes are given, this method returns an error. If there are malformed sub-directories in the volumes, it returns an error. To validate each data directories, user should call DataDir.Validate() method.