Package org.infinispan.persistence.sifs
Class FileProvider
- java.lang.Object
-
- org.infinispan.persistence.sifs.FileProvider
-
public class FileProvider extends Object
Provides resource management for files - only limited amount of files may be opened in one moment, and opened file should not be deleted. Also allows to generate file indexes.- Author:
- Radim Vansa <rvansa@redhat.com>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileProvider.Handle
class
FileProvider.Log
-
Constructor Summary
Constructors Constructor Description FileProvider(Path dataDir, int openFileLimit, String prefix, int maxFileSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
void
deleteFile(int fileId)
FileProvider.Handle
getFile(int fileId)
FileProvider.Log
getFileForLog()
CloseableIterator<Integer>
getFileIterator()
long
getFileSize(int file)
boolean
hasFiles()
boolean
isLogFile(int fileId)
protected FileChannel
openChannel(int fileId)
protected FileChannel
openChannel(File file, boolean create, boolean readSharedMeadata)
void
stop()
-
-
-
Method Detail
-
isLogFile
public boolean isLogFile(int fileId)
-
getFile
public FileProvider.Handle getFile(int fileId) throws IOException
- Throws:
IOException
-
getFileSize
public long getFileSize(int file)
-
openChannel
protected FileChannel openChannel(int fileId) throws FileNotFoundException
- Throws:
FileNotFoundException
-
openChannel
protected FileChannel openChannel(File file, boolean create, boolean readSharedMeadata) throws FileNotFoundException
- Throws:
FileNotFoundException
-
getFileForLog
public FileProvider.Log getFileForLog() throws IOException
- Throws:
IOException
-
getFileIterator
public CloseableIterator<Integer> getFileIterator()
-
hasFiles
public boolean hasFiles()
-
clear
public void clear() throws IOException
- Throws:
IOException
-
deleteFile
public void deleteFile(int fileId)
-
stop
public void stop()
-
-