Abstract Object - cache : AbstractEvictionPolicy

The cache:AbstractEvictionPolicy Ballerina object is used for custom implementations of the eviction policy for a Ballerina cache object. Any custom eviction policy implementation should be object-wise similar.

Methods

Updates the linked list based on the get operation.

Updates the linked list based on the put operation.

Updates the linked list based on the remove operation.

Updates the linked list based on the replace operation.

Updates the linked list based on the clear operation.

Updates the linked list based on the evict operation.

get

(Node node)

Isolated Function

Updates the linked list based on the get operation.

Parameters

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

put

(Node node)

Isolated Function

Updates the linked list based on the put operation.

Parameters

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

remove

(Node node)

Isolated Function

Updates the linked list based on the remove operation.

Parameters

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

replace

(Node newNode, Node oldNode)

Isolated Function

Updates the linked list based on the replace operation.

Parameters

  • newNode Node
  • Node of the linked list, which will be replacing the oldNode

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

clear

()

Isolated Function

Updates the linked list based on the clear operation.

evict

()

returns Node?
Isolated Function

Updates the linked list based on the evict operation.

  • Return Type

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