Class LimitedTemporaryStorage
- java.lang.Object
-
- org.apache.druid.query.groupby.epinephelinae.LimitedTemporaryStorage
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class LimitedTemporaryStorage extends Object implements Closeable
An area for limited temporary storage on disk. Limits are checked when opening files and on all writes to those files. Thread-safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classLimitedTemporaryStorage.LimitedOutputStream
-
Constructor Summary
Constructors Constructor Description LimitedTemporaryStorage(File storageDirectory, long maxBytesUsed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()LimitedTemporaryStorage.LimitedOutputStreamcreateFile()Create a new temporary file.voiddelete(File file)longmaxSize()
-
-
-
Constructor Detail
-
LimitedTemporaryStorage
public LimitedTemporaryStorage(File storageDirectory, long maxBytesUsed)
-
-
Method Detail
-
createFile
public LimitedTemporaryStorage.LimitedOutputStream createFile() throws IOException
Create a new temporary file. All methods of the returned output stream may throwTemporaryStorageFullExceptionif the temporary storage area fills up.- Returns:
- output stream to the file
- Throws:
TemporaryStorageFullException- if the temporary storage area is fullIOException- if something goes wrong while creating the file
-
delete
public void delete(File file)
-
maxSize
public long maxSize()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-