@ThreadSafe public final class SimpleLocalMemoryContext extends Object implements LocalMemoryContext
| Constructor and Description |
|---|
SimpleLocalMemoryContext(AggregatedMemoryContext parentMemoryContext,
String allocationTag) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this LocalMemoryContext.
|
long |
getBytes() |
com.google.common.util.concurrent.ListenableFuture<?> |
setBytes(long bytes)
When this method returns, the bytes tracked by this LocalMemoryContext has been updated.
|
com.google.common.util.concurrent.ListenableFuture<?> |
setBytes(long bytes,
boolean enforceBroadcastMemoryLimit)
This method will eventually call
setBytes(long bytes) function, after conditionally check against
broadcast memory usage limit based on the value of enforceBroadcastMemoryLimit. |
String |
toString() |
boolean |
trySetBytes(long bytes)
This method can return false when there is not enough memory available to satisfy a positive delta allocation
(
bytes is greater than the bytes tracked by this LocalMemoryContext). |
boolean |
trySetBytes(long bytes,
boolean enforceBroadcastMemoryLimit)
This method will eventually call
trySetBytes(long bytes) function, after conditionally check against
broadcast memory usage limit based on the value of enforceBroadcastMemoryLimit. |
public SimpleLocalMemoryContext(AggregatedMemoryContext parentMemoryContext, String allocationTag)
public long getBytes()
getBytes in interface LocalMemoryContextpublic com.google.common.util.concurrent.ListenableFuture<?> setBytes(long bytes)
LocalMemoryContextsetBytes in interface LocalMemoryContextpublic com.google.common.util.concurrent.ListenableFuture<?> setBytes(long bytes,
boolean enforceBroadcastMemoryLimit)
LocalMemoryContextsetBytes(long bytes) function, after conditionally check against
broadcast memory usage limit based on the value of enforceBroadcastMemoryLimit.setBytes in interface LocalMemoryContextpublic boolean trySetBytes(long bytes)
LocalMemoryContextbytes is greater than the bytes tracked by this LocalMemoryContext).
trySetBytes in interface LocalMemoryContextbytes.public boolean trySetBytes(long bytes,
boolean enforceBroadcastMemoryLimit)
LocalMemoryContexttrySetBytes(long bytes) function, after conditionally check against
broadcast memory usage limit based on the value of enforceBroadcastMemoryLimit.trySetBytes in interface LocalMemoryContextpublic void close()
LocalMemoryContextgetBytes()) can be called.close in interface LocalMemoryContextCopyright © 2012–2022. All rights reserved.