public class DummyWorkspace extends Object implements MemoryWorkspace
MemoryWorkspace.Type| Modifier and Type | Field and Description |
|---|---|
protected MemoryWorkspace |
parentWorkspace |
DEFAULT_ID| Constructor and Description |
|---|
DummyWorkspace() |
| Modifier and Type | Method and Description |
|---|---|
PagedPointer |
alloc(long requiredMemory,
DataType dataType,
boolean initialize)
This method does allocation from a given Workspace
|
PagedPointer |
alloc(long requiredMemory,
MemoryKind kind,
DataType dataType,
boolean initialize)
This method does allocation from a given Workspace
|
void |
close()
This method is for compatibility with "try-with-resources" java blocks.
|
Deallocator |
deallocator()
This method returns deallocator associated with this instance
|
void |
destroyWorkspace()
This method causes Workspace destruction: all memory allocations are released after this call.
|
void |
destroyWorkspace(boolean extended) |
void |
enableDebug(boolean reallyEnable)
This method enabled debugging mode for this workspace
|
long |
getCurrentOffset()
This mehtod returns current offset within buffer
|
long |
getCurrentSize()
This methos returns current allocated size of this workspace
|
int |
getDeviceId()
Returns deviceId for this workspace
|
long |
getGenerationId()
This method returns current generation Id
|
String |
getId()
This method returns Id of this workspace
|
long |
getLastCycleAllocations()
This method returns amount of memory consumed in last successful cycle, in bytes
|
long |
getMaxCycleAllocations()
This method returns amount of memory consumed by largest successful cycle, in bytes
|
MemoryWorkspace |
getParentWorkspace()
This method returns parent Workspace, if any.
|
long |
getPrimaryOffset() |
long |
getThisCycleAllocations()
This method returns amount of memory consumed in last successful cycle, in bytes
|
Long |
getThreadId()
This method returns threadId where this workspace was created
|
String |
getUniqueId()
This method returns unique ID for this instance
|
WorkspaceConfiguration |
getWorkspaceConfiguration()
This method returns WorkspaceConfiguration bean that was used for given Workspace instance
|
MemoryWorkspace.Type |
getWorkspaceType()
This method returns Type of this workspace
|
void |
initializeWorkspace()
This method causes Workspace initialization
|
boolean |
isScopeActive()
This method returns True if scope was opened, and not closed yet.
|
MemoryWorkspace |
notifyScopeBorrowed()
This method TEMPORARY enters this workspace, without reset applied
|
MemoryWorkspace |
notifyScopeEntered()
This method notifies given Workspace that new use cycle is starting now
|
MemoryWorkspace |
notifyScopeLeft()
This method notifies given Workspace that use cycle just ended
|
void |
setPreviousWorkspace(MemoryWorkspace memoryWorkspace)
Set the previous workspace, if any
NOTE: this method should only be used if you are fully aware of the consequences of doing so. |
MemoryWorkspace |
tagOutOfScopeUse()
This method temporary disables this workspace
|
int |
targetDevice()
This method returns deviceId it's affined with, so deallocator thread will be guaranteed to match it
|
void |
toggleWorkspaceUse(boolean isEnabled)
This method allows you to temporary disable/enable given Workspace use.
|
protected MemoryWorkspace parentWorkspace
public WorkspaceConfiguration getWorkspaceConfiguration()
getWorkspaceConfiguration in interface MemoryWorkspacepublic String getId()
getId in interface MemoryWorkspacepublic Long getThreadId()
MemoryWorkspacegetThreadId in interface MemoryWorkspacepublic int getDeviceId()
MemoryWorkspacegetDeviceId in interface MemoryWorkspacepublic MemoryWorkspace.Type getWorkspaceType()
MemoryWorkspacegetWorkspaceType in interface MemoryWorkspacepublic PagedPointer alloc(long requiredMemory, DataType dataType, boolean initialize)
alloc in interface MemoryWorkspacerequiredMemory - allocation size, in bytesdataType - dataType that is going to be usedinitialize - public PagedPointer alloc(long requiredMemory, MemoryKind kind, DataType dataType, boolean initialize)
alloc in interface MemoryWorkspacerequiredMemory - allocation size, in byteskind - MemoryKind for allocationdataType - dataType that is going to be usedinitialize - public long getGenerationId()
MemoryWorkspacegetGenerationId in interface MemoryWorkspacepublic MemoryWorkspace notifyScopeEntered()
notifyScopeEntered in interface MemoryWorkspacepublic MemoryWorkspace notifyScopeBorrowed()
notifyScopeBorrowed in interface MemoryWorkspacepublic MemoryWorkspace notifyScopeLeft()
notifyScopeLeft in interface MemoryWorkspacepublic boolean isScopeActive()
isScopeActive in interface MemoryWorkspacepublic void initializeWorkspace()
PLEASE NOTE: This call will have no effect on previously initialized Workspace
initializeWorkspace in interface MemoryWorkspacepublic void destroyWorkspace()
destroyWorkspace in interface MemoryWorkspacepublic void destroyWorkspace(boolean extended)
destroyWorkspace in interface MemoryWorkspacepublic void toggleWorkspaceUse(boolean isEnabled)
toggleWorkspaceUse in interface MemoryWorkspaceisEnabled - public long getThisCycleAllocations()
getThisCycleAllocations in interface MemoryWorkspacepublic void enableDebug(boolean reallyEnable)
enableDebug in interface MemoryWorkspacereallyEnable - public long getLastCycleAllocations()
getLastCycleAllocations in interface MemoryWorkspacepublic long getMaxCycleAllocations()
getMaxCycleAllocations in interface MemoryWorkspacepublic long getCurrentSize()
getCurrentSize in interface MemoryWorkspacepublic void close()
MemoryWorkspaceclose in interface AutoCloseableclose in interface MemoryWorkspacepublic MemoryWorkspace getParentWorkspace()
getParentWorkspace in interface MemoryWorkspacepublic MemoryWorkspace tagOutOfScopeUse()
MemoryWorkspacetagOutOfScopeUse in interface MemoryWorkspacepublic void setPreviousWorkspace(MemoryWorkspace memoryWorkspace)
MemoryWorkspacesetPreviousWorkspace in interface MemoryWorkspacememoryWorkspace - Workspace to set as the previous workspace. This is the workspace that will become active
when this workspace is closed.public long getCurrentOffset()
MemoryWorkspacegetCurrentOffset in interface MemoryWorkspacepublic String getUniqueId()
DeallocatablegetUniqueId in interface Deallocatablepublic Deallocator deallocator()
Deallocatabledeallocator in interface Deallocatablepublic int targetDevice()
DeallocatabletargetDevice in interface Deallocatablepublic long getPrimaryOffset()
getPrimaryOffset in interface MemoryWorkspaceCopyright © 2021. All rights reserved.