Package org.infinispan.persistence.sifs
Class FileProvider
- java.lang.Object
-
- org.infinispan.persistence.sifs.FileProvider
-
public class FileProvider extends java.lang.ObjectProvides 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 classFileProvider.HandleclassFileProvider.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 voidclear()voiddeleteFile(int fileId)FileProvider.HandlegetFile(int fileId)FileProvider.LoggetFileForLog()CloseableIterator<java.lang.Integer>getFileIterator()longgetFileSize(int file)protected java.nio.channels.FileChannelopenChannel(int fileId)voidstop()
-
-
-
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()
-
-