Documentation ¶
Overview ¶
Copyright 2024 The Tessera authors. All Rights Reserved.
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 ¶
- type NewTreeFunc
- type Storage
- func (s *Storage) Add(ctx context.Context, e *tessera.Entry) tessera.IndexFuture
- func (s *Storage) ReadCheckpoint(_ context.Context) ([]byte, error)
- func (s *Storage) ReadEntryBundle(_ context.Context, index, logSize uint64) ([]byte, error)
- func (s *Storage) ReadTile(_ context.Context, level, index, logSize uint64) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NewTreeFunc ¶
NewTreeFunc is the signature of a function which receives information about newly integrated trees.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage implements storage functions for a POSIX filesystem. It leverages the POSIX atomic operations.
func New ¶
func New(ctx context.Context, path string, create bool, opts ...func(*options.StorageOptions)) (*Storage, error)
New creates a new POSIX storage. - path is a directory in which the log should be stored - create must only be set when first creating the log, and will create the directory structure and an empty checkpoint
func (*Storage) Add ¶
Add takes an entry and queues it for inclusion in the log. Upon placing the entry in an in-memory queue to be sequenced, it returns a future that will evaluate to either the sequence number assigned to this entry, or an error. This future is made available when the entry is queued. Any further calls to Add after this returns will guarantee that the later entry appears later in the log than any earlier entries. Concurrent calls to Add are supported, but the order they are queued and thus included in the log is non-deterministic.
If the future resolves to a non-error state then it means that the entry is both sequenced and integrated into the log. This means that a checkpoint will be available that commits to this entry.
It is recommended that the caller keeps the process running until all futures returned by this method have successfully evaluated. Terminating earlier than this will likely mean that some of the entries added are not committed to by a checkpoint, and thus are not considered to be in the log.
func (*Storage) ReadCheckpoint ¶
func (*Storage) ReadEntryBundle ¶
ReadEntryBundle retrieves the Nth entries bundle for a log of the given size.