public class MemoryLimitedLinkedBlockingQueue<E>
extends java.util.concurrent.LinkedBlockingQueue<E>
LinkedBlockingQueue.MemoryLimiter,
MemoryLimitCalculator,
Serialized Form| Constructor and Description |
|---|
MemoryLimitedLinkedBlockingQueue(java.util.Collection<? extends E> c,
long memoryLimit,
java.lang.instrument.Instrumentation inst) |
MemoryLimitedLinkedBlockingQueue(java.lang.instrument.Instrumentation inst) |
MemoryLimitedLinkedBlockingQueue(long memoryLimit,
java.lang.instrument.Instrumentation inst) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
long |
getCurrentMemory()
get the current memory.
|
long |
getCurrentRemainMemory()
get the current remain memory.
|
long |
getMemoryLimit()
get the memory limit.
|
boolean |
offer(E e) |
boolean |
offer(E e,
long timeout,
java.util.concurrent.TimeUnit unit) |
E |
poll() |
E |
poll(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
put(E e) |
boolean |
remove(java.lang.Object o) |
void |
setMemoryLimit(long memoryLimit)
set the memory limit.
|
E |
take() |
contains, drainTo, drainTo, iterator, peek, remainingCapacity, size, spliterator, toArray, toArray, toStringcontainsAll, isEmpty, removeAll, retainAllclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic MemoryLimitedLinkedBlockingQueue(java.lang.instrument.Instrumentation inst)
public MemoryLimitedLinkedBlockingQueue(long memoryLimit,
java.lang.instrument.Instrumentation inst)
public MemoryLimitedLinkedBlockingQueue(java.util.Collection<? extends E> c, long memoryLimit, java.lang.instrument.Instrumentation inst)
public void setMemoryLimit(long memoryLimit)
memoryLimit - the memory limitpublic long getMemoryLimit()
public long getCurrentMemory()
public long getCurrentRemainMemory()
public void put(E e) throws java.lang.InterruptedException
public boolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
public boolean offer(E e)
public E take() throws java.lang.InterruptedException
public E poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
public E poll()
public boolean remove(java.lang.Object o)
Copyright © 2024 The Apache Software Foundation. All rights reserved.