Versions in this module Expand all Collapse all v1 v1.0.0 Jul 21, 2022 Changes in this version + var SharedMemoryTests = []func(t *testing.T, chainID0, chainID1 ids.ID, sm0, sm1 SharedMemory, ...) + func TestPutAndRemoveBatch(t *testing.T, chainID0, chainID1 ids.ID, _, sm1 SharedMemory, ...) + func TestSharedMemoryCantDuplicatePut(t *testing.T, _, chainID1 ids.ID, sm0, _ SharedMemory, _ database.Database) + func TestSharedMemoryCantDuplicateRemove(t *testing.T, _, chainID1 ids.ID, sm0, _ SharedMemory, _ database.Database) + func TestSharedMemoryCommitOnPut(t *testing.T, _, chainID1 ids.ID, sm0, _ SharedMemory, db database.Database) + func TestSharedMemoryCommitOnRemove(t *testing.T, _, chainID1 ids.ID, sm0, _ SharedMemory, db database.Database) + func TestSharedMemoryIndexed(t *testing.T, chainID0, chainID1 ids.ID, sm0, sm1 SharedMemory, ...) + func TestSharedMemoryLargeBatchSize(t *testing.T, _, chainID1 ids.ID, sm0, _ SharedMemory, db database.Database) + func TestSharedMemoryLargeIndexed(t *testing.T, chainID0, chainID1 ids.ID, sm0, sm1 SharedMemory, ...) + func TestSharedMemoryLargePutGetAndRemove(t *testing.T, chainID0, chainID1 ids.ID, sm0, sm1 SharedMemory, ...) + func TestSharedMemoryPutAndGet(t *testing.T, chainID0, chainID1 ids.ID, sm0, sm1 SharedMemory, ...) + func WriteAll(baseBatch database.Batch, batches ...database.Batch) error + type Element struct + Key []byte + Traits [][]byte + Value []byte + type Memory struct + func (m *Memory) GetSharedDatabase(db database.Database, sharedID ids.ID) database.Database + func (m *Memory) Initialize(log logging.Logger, db database.Database) error + func (m *Memory) NewSharedMemory(chainID ids.ID) SharedMemory + func (m *Memory) ReleaseSharedDatabase(sharedID ids.ID) + type Requests struct + PutRequests []*Element + RemoveRequests [][]byte + type SharedMemory interface + Apply func(requests map[ids.ID]*Requests, batches ...database.Batch) error + Get func(peerChainID ids.ID, keys [][]byte) (values [][]byte, err error) + Indexed func(peerChainID ids.ID, traits [][]byte, startTrait, startKey []byte, limit int) (values [][]byte, lastTrait, lastKey []byte, err error) v1.0.0-alpha Nov 22, 2022