| Modifier and Type | Field and Description |
|---|---|
| private final long | maxMainMemoryBytes
maximum number of main-memory bytes allowed to be used;
|
| private final long | maxStorageBytes
maximum number of bytes allowed for storage at all (main-memory+file);
|
| public final RandomAccessStreamCache. | streamCache
Implementation of the function to create an instance of ScratchFile using the current settings. |
| private File | tempDir
directory to be used for scratch file |
| private final boolean | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| private | MemoryUsageSetting(boolean
if useMainMemory, boolean true main memory usage is enabled; in case of
false and useTempFile is false too
we set this to trueif useTempFile, long true using of temporary file(s) is enabledmaximum number of main-memory to be used;
if maxMainMemoryBytes, long -1 means 'unrestricted';
if 0 we only use temporary file if useTempFile
is true otherwise main-memory usage will have restriction
defined by maxStorageBytesmaximum size the main-memory and temporary file(s) may have all together;
maxStorageBytes)0 or less will be ignored; if it is less than
maxMainMemoryBytes we use maxMainMemoryBytes value insteadPrivate constructor for setup buffering memory usage called by one of the setup methods. |
| Modifier and Type | Method and Description |
|---|---|
| public long | Returns: the maximum number of main-memory in bytes to be usedReturns maximum size of main-memory in bytes to be used. |
| public long | Returns: the maximum size of storage bytes to be usedReturns maximum size of storage bytes to be used (main-memory in temporary files all together). |
| public File | Returns: the temp dir to bes used for temporary files or nullReturns directory to be used for temporary files or |
| public boolean | Returns: true if this instance is set up to restrict main memoryReturns |
| public boolean | Returns: true if this instance is set up to restrict storage sizeReturns |
| public MemoryUsageSetting | Returns: this instancedirectory for temporary files tempDir)Sets directory to be used for temporary files. |
| public static MemoryUsageSetting | Returns: returns an instance of MemoryUsageSetting set up to use unlimited memorySetups buffering memory usage to only use main-memory (no temporary file) which is not restricted in size. |
| public static MemoryUsageSetting | Returns: returns an instance of MemoryUsageSetting set up to use main memorymaximum number of main-memory to be used; maxMainMemoryBytes)-1 for no restriction;
0 will also be interpreted here as no restrictionSetups buffering memory usage to only use main-memory with the defined maximum. |
| public static MemoryUsageSetting | Returns: returns an instance of MemoryUsageSetting set up to use a mixed settingmaximum number of main-memory to be used; if maxMainMemoryBytes)-1 this is the same as
setupMainMemoryOnly(); if 0 this is the same as setupTempFileOnly()Setups buffering memory usage to use a portion of main-memory and additionally temporary file(s) in case the specified portion is exceeded. |
| public static MemoryUsageSetting | Returns: returns an instance of MemoryUsageSetting set up to use a mixed settingmaximum number of main-memory to be used; if maxMainMemoryBytes, long -1 this is the same as
setupMainMemoryOnly(); if 0 this is the same as setupTempFileOnly()maximum size the main-memory and temporary file(s) may have all together; maxStorageBytes)0
or less will be ignored; if it is less than maxMainMemoryBytes we use maxMainMemoryBytes value insteadSetups buffering memory usage to use a portion of main-memory and additionally temporary file(s) in case the specified portion is exceeded. |
| public static MemoryUsageSetting | Returns: returns an instance of MemoryUsageSetting set up to use temporary files with not restricted sizeSetups buffering memory usage to only use temporary file(s) (no main-memory) with not restricted size. |
| public static MemoryUsageSetting | Returns: returns an instance of MemoryUsageSetting set up to use temporary files with restricted sizemaximum size the temporary file(s) may have all together; maxStorageBytes)-1 for no
restriction; 0 will also be interpreted here as no restrictionSetups buffering memory usage to only use temporary file(s) (no main-memory) with the specified maximum size. |
| public String | |
| public boolean | Returns: true if this instance is set up to use main memoryReturns |
| public boolean | Returns: true if this instance is set up to use temporary filesReturns |
| maxMainMemoryBytes | back to summary |
|---|---|
| private final long maxMainMemoryBytes maximum number of main-memory bytes allowed to be used;
| |
| maxStorageBytes | back to summary |
|---|---|
| private final long maxStorageBytes maximum number of bytes allowed for storage at all (main-memory+file);
| |
| streamCache | back to summary |
|---|---|
| public final RandomAccessStreamCache. Implementation of the function to create an instance of ScratchFile using the current settings. | |
| tempDir | back to summary |
|---|---|
| private File tempDir directory to be used for scratch file | |
| useMainMemory | back to summary |
|---|---|
| private final boolean useMainMemory | |
| useTempFile | back to summary |
|---|---|
| private final boolean useTempFile | |
| MemoryUsageSetting | back to summary |
|---|---|
| private MemoryUsageSetting(boolean useMainMemory, boolean useTempFile, long maxMainMemoryBytes, long maxStorageBytes) Private constructor for setup buffering memory usage called by one of the setup methods.
| |
| getMaxMainMemoryBytes | back to summary |
|---|---|
| public long getMaxMainMemoryBytes() Returns maximum size of main-memory in bytes to be used.
| |
| getMaxStorageBytes | back to summary |
|---|---|
| public long getMaxStorageBytes() Returns maximum size of storage bytes to be used (main-memory in temporary files all together).
| |
| getTempDir | back to summary |
|---|---|
| public File getTempDir() Returns directory to be used for temporary files or
| |
| isMainMemoryRestricted | back to summary |
|---|---|
| public boolean isMainMemoryRestricted() Returns
| |
| isStorageRestricted | back to summary |
|---|---|
| public boolean isStorageRestricted() Returns
| |
| setTempDir | back to summary |
|---|---|
| public MemoryUsageSetting setTempDir(File tempDir) Sets directory to be used for temporary files.
| |
| setupMainMemoryOnly | back to summary |
|---|---|
| public static MemoryUsageSetting setupMainMemoryOnly() Setups buffering memory usage to only use main-memory (no temporary file) which is not restricted in size.
| |
| setupMainMemoryOnly | back to summary |
|---|---|
| public static MemoryUsageSetting setupMainMemoryOnly(long maxMainMemoryBytes) Setups buffering memory usage to only use main-memory with the defined maximum.
| |
| setupMixed | back to summary |
|---|---|
| public static MemoryUsageSetting setupMixed(long maxMainMemoryBytes) Setups buffering memory usage to use a portion of main-memory and additionally temporary file(s) in case the specified portion is exceeded.
| |
| setupMixed | back to summary |
|---|---|
| public static MemoryUsageSetting setupMixed(long maxMainMemoryBytes, long maxStorageBytes) Setups buffering memory usage to use a portion of main-memory and additionally temporary file(s) in case the specified portion is exceeded.
| |
| setupTempFileOnly | back to summary |
|---|---|
| public static MemoryUsageSetting setupTempFileOnly() Setups buffering memory usage to only use temporary file(s) (no main-memory) with not restricted size.
| |
| setupTempFileOnly | back to summary |
|---|---|
| public static MemoryUsageSetting setupTempFileOnly(long maxStorageBytes) Setups buffering memory usage to only use temporary file(s) (no main-memory) with the specified maximum size.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| useMainMemory | back to summary |
|---|---|
| public boolean useMainMemory() Returns
If this returns
| |
| useTempFile | back to summary |
|---|---|
| public boolean useTempFile() Returns
If this returns
| |