public class JournalFilesRepository extends Object
Constructor and Description |
---|
JournalFilesRepository(SequentialFileFactory fileFactory,
JournalImpl journal,
String filePrefix,
String fileExtension,
int userVersion,
int maxAIO,
int fileSize,
int minFiles) |
Modifier and Type | Method and Description |
---|---|
void |
addDataFileOnBottom(JournalFile file) |
void |
addDataFileOnTop(JournalFile file) |
void |
addFreeFile(JournalFile file,
boolean renameTmp) |
void |
addFreeFile(JournalFile file,
boolean renameTmp,
boolean checkDelete) |
void |
calculateNextfileID(List<JournalFile> files) |
void |
checkDataFiles() |
void |
clear() |
void |
clearDataFiles() |
void |
closeFile(JournalFile file) |
String |
debugFiles() |
void |
ensureMinFiles() |
Collection<JournalFile> |
getDataFiles() |
JournalFile[] |
getDataFilesArray() |
int |
getDataFilesCount() |
String |
getFileExtension() |
String |
getFilePrefix() |
JournalFile |
getFreeFile() |
Collection<JournalFile> |
getFreeFiles() |
int |
getFreeFilesCount() |
int |
getMaxAIO() |
int |
getOpenedFilesCount() |
JournalFile |
openFile()
This method will instantly return the opened file, and schedule opening and reclaiming.
|
void |
openFile(JournalFile file,
boolean multiAIO) |
JournalFile |
pollLastDataFile() |
void |
pushOpenedFile()
Open a file and place it into the openedFiles queue
|
void |
removeDataFile(JournalFile file) |
void |
setExecutor(Executor fileExecutor) |
JournalFile |
takeFile(boolean keepOpened,
boolean multiAIO,
boolean initFile,
boolean tmpCompactExtension)
This will get a File from freeFile without initializing it
|
public JournalFilesRepository(SequentialFileFactory fileFactory, JournalImpl journal, String filePrefix, String fileExtension, int userVersion, int maxAIO, int fileSize, int minFiles)
public void setExecutor(Executor fileExecutor)
public int getMaxAIO()
public String getFileExtension()
public String getFilePrefix()
public void calculateNextfileID(List<JournalFile> files)
public void openFile(JournalFile file, boolean multiAIO) throws Exception
Exception
public JournalFile[] getDataFilesArray()
public JournalFile pollLastDataFile()
public void removeDataFile(JournalFile file)
public int getDataFilesCount()
public Collection<JournalFile> getDataFiles()
public void clearDataFiles()
public void addDataFileOnTop(JournalFile file)
public String debugFiles()
public void checkDataFiles()
public void addDataFileOnBottom(JournalFile file)
public int getFreeFilesCount()
public void addFreeFile(JournalFile file, boolean renameTmp) throws Exception
file
- Exception
public void addFreeFile(JournalFile file, boolean renameTmp, boolean checkDelete) throws Exception
file
- renameTmp
- - should rename the file as it's being added to free filescheckDelete
- - should delete the file if max condition has been metException
public Collection<JournalFile> getFreeFiles()
public JournalFile getFreeFile()
public int getOpenedFilesCount()
public JournalFile openFile() throws InterruptedException
This method will instantly return the opened file, and schedule opening and reclaiming.
In case there are no cached opened files, this method will block until the file was opened, what would happen only if the system is under heavy load by another system (like a backup system, or a DB sharing the same box as HornetQ).
InterruptedException
public void pushOpenedFile() throws Exception
Exception
public void closeFile(JournalFile file) throws Exception
Exception
public JournalFile takeFile(boolean keepOpened, boolean multiAIO, boolean initFile, boolean tmpCompactExtension) throws Exception
Exception
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.