public abstract class TimestampedStringQueueFileHandler
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_PREFIX
The default prefix for each file of the cache
|
static long |
DEFAULT_SIZE
The default max size for each file of the cache.
|
long |
maxFilesSize
The max length of each file of the cache
|
static java.lang.String |
MAXSIZE_PROPERTY_NAME
The name of the property with the size of the file
|
java.lang.String |
prefix
The prefix to prepend to the name of each file of the cache
|
| Constructor and Description |
|---|
TimestampedStringQueueFileHandler()
Constructor with the default max length and prefix of the files.
|
TimestampedStringQueueFileHandler(long maxLength)
Constructor with the prefix of the files.
|
TimestampedStringQueueFileHandler(long maxLength,
java.lang.String prefix)
Constructor.
|
TimestampedStringQueueFileHandler(java.lang.String prefix)
Constructor with the default max length of the files.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
fileProcessed(java.io.File filePointer,
java.lang.String minTime,
java.lang.String maxTime)
This method is invoked when all the strings in the passed file have been processed
by the queue i.e.
|
long |
getMaxFileSize()
Return the maximum size of each file of the cache.
|
abstract java.io.File |
getNewFile()
Create and return a new file for reading and writing.
|
java.lang.String |
getPrefix()
Return the prefix of each file of the cache.
|
public static final long DEFAULT_SIZE
public static final java.lang.String MAXSIZE_PROPERTY_NAME
public static final java.lang.String DEFAULT_PREFIX
public final long maxFilesSize
public final java.lang.String prefix
public TimestampedStringQueueFileHandler()
MAXSIZE_PROPERTY_NAME exists then
the max length is taken from the passed value other wise it is DEFAULT_SIZEStringQueueFileHandlerpublic TimestampedStringQueueFileHandler(java.lang.String prefix)
MAXSIZE_PROPERTY_NAME exists then
the max length is taken from the passed value other wise it is DEFAULT_SIZEprefix - The prefix of the name of the cache filesStringQueueFileHandlerpublic TimestampedStringQueueFileHandler(long maxLength)
maxLength - The max length of each file of the cacheStringQueueFileHandlerpublic TimestampedStringQueueFileHandler(long maxLength,
java.lang.String prefix)
maxLength - The max length of each file of the cacheprefix - The prefix of the name of the cache filesStringQueueFileHandlerpublic abstract java.io.File getNewFile()
throws java.io.IOException
The created file will be used to store strings and accessed randomly by the engine. Note: implementors of this method should ensure tha the file is deleted for example setting deleteOnExit().
java.io.IOException - In case of error creating the filepublic abstract void fileProcessed(java.io.File filePointer,
java.lang.String minTime,
java.lang.String maxTime)
Note: implementors of this method shall ensure that the file is deleted.
The dates are represented as strings in ISO format.
filePointer - The file to be releasedminTime - The min timestamp of the strings in cache
(null if the file is empty)maxTime - The max timestamp of the strings in cache
(null if the file is empty)public final long getMaxFileSize()
public final java.lang.String getPrefix()