Skip to content

Commit

Permalink
Merge pull request #9 from solarisdb/chunks_meta_store
Browse files Browse the repository at this point in the history
Chunks meta store, no caching yet
  • Loading branch information
kbabushkin committed Mar 15, 2024
2 parents d9ecb3a + 8e472ce commit 7909e52
Show file tree
Hide file tree
Showing 5 changed files with 516 additions and 140 deletions.
6 changes: 5 additions & 1 deletion pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ type (
Config struct {
// GrpcTransport specifies grpc transport configuration
GrpcTransport *transport.Config
// MetaDBFilePath specifies logs and chunks metadata is stored,
// if left empty, in-memory storage is used
MetaDBFilePath string
}
)

// getDefaultConfig returns the default server config
func getDefaultConfig() *Config {
return &Config{
GrpcTransport: transport.GetDefaultGRPCConfig(),
GrpcTransport: transport.GetDefaultGRPCConfig(),
MetaDBFilePath: ":memory:",
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func Run(ctx context.Context, cfg *Config) error {

inj := linker.New()
inj.Register(linker.Component{Name: "", Value: grpc.NewServer(grpc.Config{Transport: *cfg.GrpcTransport, RegisterEndpoints: grpcRegF})})
inj.Register(linker.Component{Name: "", Value: buntdb.NewLogStorage(buntdb.Config{})})
inj.Register(linker.Component{Name: "", Value: buntdb.NewStorage(buntdb.Config{DBFilePath: cfg.MetaDBFilePath})})

inj.Init(ctx)
<-ctx.Done()
Expand Down
Loading

0 comments on commit 7909e52

Please sign in to comment.