Interface MemoryWorkspace

    • Method Detail

      • getWorkspaceConfiguration

        WorkspaceConfiguration getWorkspaceConfiguration()
        This method returns WorkspaceConfiguration bean that was used for given Workspace instance
        Returns:
      • getWorkspaceType

        MemoryWorkspace.Type getWorkspaceType()
        This method returns Type of this workspace
        Returns:
      • getId

        String getId()
        This method returns Id of this workspace
        Returns:
      • getDeviceId

        int getDeviceId()
        Returns deviceId for this workspace
        Returns:
      • getThreadId

        Long getThreadId()
        This method returns threadId where this workspace was created
        Returns:
      • getGenerationId

        long getGenerationId()
        This method returns current generation Id
        Returns:
      • alloc

        PagedPointer alloc​(long requiredMemory,
                           DataType dataType,
                           boolean initialize)
        This method does allocation from a given Workspace
        Parameters:
        requiredMemory - allocation size, in bytes
        dataType - dataType that is going to be used
        Returns:
      • getPrimaryOffset

        long getPrimaryOffset()
      • alloc

        PagedPointer alloc​(long requiredMemory,
                           MemoryKind kind,
                           DataType dataType,
                           boolean initialize)
        This method does allocation from a given Workspace
        Parameters:
        requiredMemory - allocation size, in bytes
        kind - MemoryKind for allocation
        dataType - dataType that is going to be used
        Returns:
      • notifyScopeEntered

        MemoryWorkspace notifyScopeEntered()
        This method notifies given Workspace that new use cycle is starting now
        Returns:
      • notifyScopeBorrowed

        MemoryWorkspace notifyScopeBorrowed()
        This method TEMPORARY enters this workspace, without reset applied
        Returns:
      • notifyScopeLeft

        MemoryWorkspace notifyScopeLeft()
        This method notifies given Workspace that use cycle just ended
        Returns:
      • isScopeActive

        boolean isScopeActive()
        This method returns True if scope was opened, and not closed yet.
        Returns:
      • initializeWorkspace

        void initializeWorkspace()
        This method causes Workspace initialization PLEASE NOTE: This call will have no effect on previously initialized Workspace
      • destroyWorkspace

        void destroyWorkspace()
        This method causes Workspace destruction: all memory allocations are released after this call.
      • destroyWorkspace

        void destroyWorkspace​(boolean extended)
      • toggleWorkspaceUse

        void toggleWorkspaceUse​(boolean isEnabled)
        This method allows you to temporary disable/enable given Workspace use. If turned off - direct memory allocations will be used.
        Parameters:
        isEnabled -
      • getThisCycleAllocations

        long getThisCycleAllocations()
        This method returns amount of memory consumed in current cycle, in bytes
        Returns:
      • enableDebug

        void enableDebug​(boolean reallyEnable)
        This method enabled debugging mode for this workspace
        Parameters:
        reallyEnable -
      • getLastCycleAllocations

        long getLastCycleAllocations()
        This method returns amount of memory consumed in last successful cycle, in bytes
        Returns:
      • getMaxCycleAllocations

        long getMaxCycleAllocations()
        This method returns amount of memory consumed by largest successful cycle, in bytes
        Returns:
      • getCurrentSize

        long getCurrentSize()
        This methos returns current allocated size of this workspace
        Returns:
      • close

        void close()
        This method is for compatibility with "try-with-resources" java blocks. Internally it should be equal to notifyScopeLeft() method
        Specified by:
        close in interface AutoCloseable
      • getParentWorkspace

        MemoryWorkspace getParentWorkspace()
        This method returns parent Workspace, if any. Null if there's none.
        Returns:
      • tagOutOfScopeUse

        MemoryWorkspace tagOutOfScopeUse()
        This method temporary disables this workspace
        Returns:
      • setPreviousWorkspace

        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. Incorrect use of this method may leave workspace management in an invalid/indeterminant state!
        Parameters:
        memoryWorkspace - Workspace to set as the previous workspace. This is the workspace that will become active when this workspace is closed.
      • getCurrentOffset

        long getCurrentOffset()
        This mehtod returns current offset within buffer
        Returns: