Class DirectoryStrategy
- java.lang.Object
-
- org.apache.iotdb.db.conf.directories.strategy.DirectoryStrategy
-
- Direct Known Subclasses:
MaxDiskUsableSpaceFirstStrategy,MinFolderOccupiedSpaceFirstStrategy,RandomOnDiskUsableSpaceStrategy,SequenceStrategy
public abstract class DirectoryStrategy extends java.lang.ObjectThe basic class of all the strategies of multiple directories. If a user wants to define his own strategy, his strategy has to extend this class and implement the abstract method.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description DirectoryStrategy()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract intnextFolderIndex()Choose a folder to allocate.voidsetFolders(java.util.List<java.lang.String> folders)To init folders.
-
-
-
Method Detail
-
setFolders
public void setFolders(java.util.List<java.lang.String> folders) throws DiskSpaceInsufficientExceptionTo init folders. Do not recommend to overwrite. This method guarantees that at least one folder has available space.- Parameters:
folders- the folders from conf- Throws:
DiskSpaceInsufficientException
-
nextFolderIndex
public abstract int nextFolderIndex() throws DiskSpaceInsufficientExceptionChoose a folder to allocate. The user should implement this method to define his own strategy.- Returns:
- the index of folder that will be allocated
- Throws:
DiskSpaceInsufficientException
-
-