plogcache

package
v1.202405300917.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 2 Imported by: 0

README

plogcache from istructsmem internal package

codecov

PLog events cache.

Motivation

performance: istructsmem: PLog Events cache

Design

flowchart

  processors:::Group
  subgraph processors [commandprocessor package]
    cp>command processors]
  end

  projectors:::Group
  subgraph projectors [projectors package]
    actualizers>async actualizers]
  end

  istructsmem:::Group
  subgraph istructsmem [istructsmem package]
    IEvents[istructs.IEvents implementation]
    eventsCache[(plog events cache)]:::NEW
    IEvents -.- eventsCache
  end
  
  istorage:::Group
  subgraph istorage [istorage package]
    storageCache[(cache)]:::Green
    storage[(storage)]:::Green
    storageCache -.- storage
  end
  
  processors -->|write events| istructsmem
  istructsmem -->|read events| projectors
  istructsmem <--->|"read/write (key,value)"| istorage
  
 
  classDef NEW fill:#FFE0E0,stroke:#800000, stroke-width:2px, stroke-dasharray: 5 5
  classDef Green fill:#E0FFF0,stroke:#008040
  classDef Group fill:#FFFFFF, stroke:#808080, stroke-width:2px, stroke-dasharray: 5 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

plog events cache

Get() returns plog event by handling partition and offset.

Put() puts plog event into cache.

func New

func New(size int) *Cache

func (*Cache) Get

func (c *Cache) Get(partition istructs.PartitionID, offset istructs.Offset) (e istructs.IPLogEvent, ok bool)

Gets PLOG event on the key from the specified partition and offset

func (*Cache) Put

func (c *Cache) Put(partition istructs.PartitionID, offset istructs.Offset, event istructs.IPLogEvent)

Puts the specified PLOG event on the key from the specified partition and offset

Jump to

Keyboard shortcuts

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