Versions in this module Expand all Collapse all v1 v1.1.1 Dec 18, 2024 Changes in this version + const SharedMemorySyncBound + var SharedMemoryTests = []func(t *testing.T, chainID0, chainID1 ids.ID, sm0, sm1 SharedMemory, ...) + func TestPutAndRemoveBatch(t *testing.T, chainID0, _ ids.ID, _, sm1 SharedMemory, db database.Database) + 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 NewMemory(db database.Database) *Memory + func (m *Memory) GetSharedDatabase(db database.Database, sharedID ids.ID) database.Database + func (m *Memory) NewSharedMemory(chainID ids.ID) SharedMemory + func (m *Memory) ReleaseSharedDatabase(sharedID ids.ID) + type MockSharedMemory struct + func NewMockSharedMemory(ctrl *gomock.Controller) *MockSharedMemory + func (m *MockSharedMemory) Apply(arg0 map[ids.ID]*Requests, arg1 ...database.Batch) error + func (m *MockSharedMemory) EXPECT() *MockSharedMemoryMockRecorder + func (m *MockSharedMemory) Get(arg0 ids.ID, arg1 [][]byte) ([][]byte, error) + func (m *MockSharedMemory) Indexed(arg0 ids.ID, arg1 [][]byte, arg2, arg3 []byte, arg4 int) ([][]byte, []byte, []byte, error) + type MockSharedMemoryMockRecorder struct + func (mr *MockSharedMemoryMockRecorder) Apply(arg0 interface{}, arg1 ...interface{}) *gomock.Call + func (mr *MockSharedMemoryMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call + func (mr *MockSharedMemoryMockRecorder) Indexed(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call + 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)