Object - cache : AbstractEvictionPolicy

Represents the Ballerina AbstractEvictionPolicy object and cache eviction related operations based on a linked list data structure. Any custom cache implementation should be object-wise similar.

get

Update the linked list based on the get operation.

Parameters

  • node Node
  • Node of the linked list, which is retrieved

put

Update the linked list based on the put operation.

Parameters

  • node Node
  • Node of the linked list, which is added newly

remove

Update the linked list based on the remove operation.

Parameters

  • node Node
  • Node of the linked list, which is deleted

replace

Update the linked list based on the replace operation.

Parameters

  • newNode Node
  • Node of the linked list, which is used for replacing

  • oldNode Node
  • Node of the linked list, which will be replaced

clear

Update the linked list based on the clear operation.

Parameters

evict

(LinkedList list)

returns Node?

Update the linked list based on the evict operation.

Parameters

  • Return Type

    (Node?)
  • The Node, which should evict from the linked list or () if nothing to be evicted