Files
yi wangandGitHub fc6f1628ea [history server] move storage interface (#4302)
* 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]>
2026-01-08 20:16:29 +08:00

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
}