Example usage for org.apache.cassandra.db Directories getDirectoryForNewSSTables

List of usage examples for org.apache.cassandra.db Directories getDirectoryForNewSSTables

Introduction

In this page you can find the example usage for org.apache.cassandra.db Directories getDirectoryForNewSSTables.

Prototype

public File getDirectoryForNewSSTables() 

Source Link

Document

Basically the same as calling #getWriteableLocationAsFile(long) with an unknown size ( -1L ), which may return any non-blacklisted directory - even a data directory that has no usable space.

Usage

From source file:com.stratio.cassandra.lucene.IndexOptions.java

License:Apache License

private static Path parsePath(Map<String, String> options, CFMetaData tableMetadata,
        IndexMetadata indexMetadata) {//from  w  ww  . jav a2 s . com
    String pathOption = options.get(DIRECTORY_PATH_OPTION);
    if (pathOption != null) {
        return Paths.get(pathOption);
    } else if (indexMetadata != null) {
        Directories directories = new Directories(tableMetadata);
        String basePath = directories.getDirectoryForNewSSTables().getAbsolutePath();
        return Paths.get(basePath + File.separator + INDEXES_DIR_NAME + File.separator + indexMetadata.name);
    }
    return null;
}