cache

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2024 The Solaris Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedStorage

type CachedStorage struct {
	// contains filtered or unexported fields
}

CachedStorage wraps LogsChunksMetaStorage with caches for logs and chunks

func NewCachedStorage

func NewCachedStorage(storage LogsChunksMetaStorage) *CachedStorage

NewCachedStorage wraps LogsChunksMetaStorage into cache

func (*CachedStorage) CreateLog

func (s *CachedStorage) CreateLog(ctx context.Context, log *solaris.Log) (*solaris.Log, error)

CreateLog implements storage.Logs

func (*CachedStorage) DeleteLogs

func (s *CachedStorage) DeleteLogs(ctx context.Context, request storage.DeleteLogsRequest) (*solaris.DeleteLogsResult, error)

DeleteLogs implements storage.Logs

func (*CachedStorage) GetChunks

func (s *CachedStorage) GetChunks(ctx context.Context, logID string) ([]logfs.ChunkInfo, error)

GetChunks implements logfs.LogsMetaStorage

func (*CachedStorage) GetLastChunk

func (s *CachedStorage) GetLastChunk(ctx context.Context, logID string) (logfs.ChunkInfo, error)

GetLastChunk implements logfs.LogsMetaStorage

func (*CachedStorage) GetLogByID

func (s *CachedStorage) GetLogByID(ctx context.Context, id string) (*solaris.Log, error)

GetLogByID implements storage.Logs

func (*CachedStorage) Init

func (s *CachedStorage) Init(ctx context.Context) error

Init implements linker.Initializer

func (*CachedStorage) QueryLogs

func (s *CachedStorage) QueryLogs(ctx context.Context, qr storage.QueryLogsRequest) (*solaris.QueryLogsResult, error)

QueryLogs implements storage.Logs

func (*CachedStorage) Shutdown

func (s *CachedStorage) Shutdown()

Shutdown implements linker.Shutdowner

func (*CachedStorage) UpdateLog

func (s *CachedStorage) UpdateLog(ctx context.Context, log *solaris.Log) (*solaris.Log, error)

UpdateLog implements storage.Logs

func (*CachedStorage) UpsertChunkInfos

func (s *CachedStorage) UpsertChunkInfos(ctx context.Context, logID string, cis []logfs.ChunkInfo) error

UpsertChunkInfos implements logfs.LogsMetaStorage

type LogsChunksMetaStorage

type LogsChunksMetaStorage interface {
	storage.Logs
	logfs.LogsMetaStorage
}

LogsChunksMetaStorage combines storage.Logs and logfs.LogsMetaStorage interfaces

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL