mirror of
https://github.com/hanzo-ml/kuberay.git
synced 2026-10-30 19:48:47 +00:00
* historyserver: move storage and update imports Signed-off-by: my-vegetable-has-exploded <[email protected]> * vet & fmt. Signed-off-by: my-vegetable-has-exploded <[email protected]> * chroe: update code structure and move storage to interface Signed-off-by: my-vegetable-has-exploded <[email protected]> --------- Signed-off-by: my-vegetable-has-exploded <[email protected]>
27 lines
797 B
Go
27 lines
797 B
Go
package storage
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/ray-project/kuberay/historyserver/pkg/utils"
|
|
)
|
|
|
|
// StorageWriter is the interface for storage writer.
|
|
type StorageWriter interface {
|
|
CreateDirectory(path string) error
|
|
WriteFile(file string, reader io.ReadSeeker) error
|
|
}
|
|
|
|
// HistoryServer create readers for each storage runtime
|
|
// Depends on the implementation of front end.
|
|
type StorageReader interface {
|
|
// need to return all available files from backend
|
|
List() []utils.ClusterInfo
|
|
// for log, pass filename to this func
|
|
// for metadata, fileName is generated by historyserver, which will obey the same rule as collector to make sure the historyserver can ready the right file.
|
|
//
|
|
GetContent(clusterId string, fileName string) io.Reader
|
|
|
|
ListFiles(clusterId string, dir string) []string
|
|
}
|