priorityqueue

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2021 Antrea Authors

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpirePriorityQueue

type ExpirePriorityQueue struct {
	ActiveFlowTimeout time.Duration
	IdleFlowTimeout   time.Duration
	KeyToItem         map[flowexporter.ConnectionKey]*flowexporter.ItemToExpire
	// contains filtered or unexported fields
}

func NewExpirePriorityQueue

func NewExpirePriorityQueue(activeFlowTimeout time.Duration, idleFlowTimeout time.Duration) *ExpirePriorityQueue

func (*ExpirePriorityQueue) AddItemToQueue

func (pq *ExpirePriorityQueue) AddItemToQueue(connKey flowexporter.ConnectionKey, conn *flowexporter.Connection)

func (*ExpirePriorityQueue) GetExpiryFromExpirePriorityQueue

func (pq *ExpirePriorityQueue) GetExpiryFromExpirePriorityQueue() time.Duration

GetExpiryFromExpirePriorityQueue returns the shortest expire time duration from expire priority queue.

func (*ExpirePriorityQueue) GetTopExpiredItem

func (pq *ExpirePriorityQueue) GetTopExpiredItem(currTime time.Time) *flowexporter.ItemToExpire

func (*ExpirePriorityQueue) Len

func (pq *ExpirePriorityQueue) Len() int

func (*ExpirePriorityQueue) Less

func (pq *ExpirePriorityQueue) Less(i, j int) bool

func (*ExpirePriorityQueue) Peek

Peek returns the item at the beginning of the queue, without removing the item or otherwise mutating the queue. It is safe to call directly.

func (*ExpirePriorityQueue) Pop

func (pq *ExpirePriorityQueue) Pop() interface{}

func (*ExpirePriorityQueue) Push

func (pq *ExpirePriorityQueue) Push(x interface{})

func (*ExpirePriorityQueue) RemoveItemFromMap

func (pq *ExpirePriorityQueue) RemoveItemFromMap(conn *flowexporter.Connection)

func (*ExpirePriorityQueue) ResetActiveExpireTimeAndPush

func (pq *ExpirePriorityQueue) ResetActiveExpireTimeAndPush(pqItem *flowexporter.ItemToExpire, currTime time.Time)

func (*ExpirePriorityQueue) Swap

func (pq *ExpirePriorityQueue) Swap(i, j int)

func (*ExpirePriorityQueue) Update

func (pq *ExpirePriorityQueue) Update(item *flowexporter.ItemToExpire, activeExpireTime time.Time, idleExpireTime time.Time)

Update modifies the priority of an Item in the queue.

Jump to

Keyboard shortcuts

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