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,
int poolSize) |
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) |
JournalFile |
createRemoteBackupSyncFile(long fileID)
Creates files for journal synchronization of a replicated backup.
|
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) |
void |
setNextFileID(long targetUpdate)
Set the {link #nextFileID} value to
targetUpdate if the current value is less than
targetUpdate . |
JournalFile |
takeFile(boolean keepOpened,
boolean multiAIO,
boolean initFile,
boolean tmpCompactExtension)
This will get a File from freeFile without initializing it
|
String |
toString() |
public JournalFilesRepository(SequentialFileFactory fileFactory, JournalImpl journal, String filePrefix, String fileExtension, int userVersion, int maxAIO, int fileSize, int minFiles, int poolSize)
public void setExecutor(Executor fileExecutor)
public int getMaxAIO()
public String getFileExtension()
public String getFilePrefix()
public void calculateNextfileID(List<JournalFile> files)
public void setNextFileID(long targetUpdate)
targetUpdate
if the current value is less than
targetUpdate
.
Notice that nextFileID
is incremented before being used, see
generateFileID()
.targetUpdate
- 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, ActiveMQIOErrorException
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 ActiveMQ).
ActiveMQIOErrorException
- In case the file could not be openedInterruptedException
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
JournalImpl.initFileHeader(SequentialFileFactory, SequentialFile, int, long)
public JournalFile createRemoteBackupSyncFile(long fileID) throws Exception
fileID
- the fileID to use when creating the file.Exception
Copyright © 2016 JBoss by Red Hat. All rights reserved.