Package org.infinispan.persistence.sifs
Class FileProvider
- java.lang.Object
-
- org.infinispan.persistence.sifs.FileProvider
-
public class FileProvider extends java.lang.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(java.nio.file.Path dataDir, int openFileLimit)
-
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<java.lang.Integer>
getFileIterator()
long
getFileSize(int file)
protected java.nio.channels.FileChannel
openChannel(int fileId)
void
stop()
-
-
-
Method Detail
-
getFile
public FileProvider.Handle getFile(int fileId) throws java.io.IOException
- Throws:
java.io.IOException
-
getFileSize
public long getFileSize(int file)
-
openChannel
protected java.nio.channels.FileChannel openChannel(int fileId) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
getFileForLog
public FileProvider.Log getFileForLog() throws java.io.IOException
- Throws:
java.io.IOException
-
getFileIterator
public CloseableIterator<java.lang.Integer> getFileIterator()
-
clear
public void clear() throws java.io.IOException
- Throws:
java.io.IOException
-
deleteFile
public void deleteFile(int fileId)
-
stop
public void stop()
-
-