mirror of https://github.com/apache/cassandra
Fix NativeLibrary.tryOpenDirectory callers for Windows
Patch by Jeff Jirsa; Reviewed by Dinesh Joshi for CASSANDRA-15426
This commit is contained in:
parent
5508fecf54
commit
4e6c0fadfe
|
|
@ -16,6 +16,7 @@
|
|||
* Make sure index summary redistribution does not start when compactions are paused (CASSANDRA-15265)
|
||||
* Ensure legacy rows have primary key livenessinfo when they contain illegal cells (CASSANDRA-15365)
|
||||
* Fix race condition when setting bootstrap flags (CASSANDRA-14878)
|
||||
* Fix NativeLibrary.tryOpenDirectory callers for Windows (CASSANDRA-15426)
|
||||
Merged from 2.2
|
||||
* Fix SELECT JSON output for empty blobs (CASSANDRA-15435)
|
||||
* In-JVM DTest: Set correct internode message version for upgrade test (CASSANDRA-15371)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory;
|
|||
import org.apache.cassandra.io.FSError;
|
||||
import org.apache.cassandra.io.FSReadError;
|
||||
import org.apache.cassandra.io.util.FileUtils;
|
||||
import org.apache.cassandra.utils.FBUtilities;
|
||||
import org.apache.cassandra.utils.NativeLibrary;
|
||||
|
||||
/**
|
||||
|
|
@ -50,7 +51,7 @@ final class LogReplica implements AutoCloseable
|
|||
static LogReplica create(File folder, String fileName)
|
||||
{
|
||||
int folderFD = NativeLibrary.tryOpenDirectory(folder.getPath());
|
||||
if (folderFD == -1)
|
||||
if (folderFD == -1 && !FBUtilities.isWindows())
|
||||
throw new FSReadError(new IOException(String.format("Invalid folder descriptor trying to create log replica %s", folder.getPath())), folder.getPath());
|
||||
|
||||
return new LogReplica(new File(fileName), folderFD);
|
||||
|
|
@ -59,7 +60,7 @@ final class LogReplica implements AutoCloseable
|
|||
static LogReplica open(File file)
|
||||
{
|
||||
int folderFD = NativeLibrary.tryOpenDirectory(file.getParentFile().getPath());
|
||||
if (folderFD == -1)
|
||||
if (folderFD == -1 && !FBUtilities.isWindows())
|
||||
throw new FSReadError(new IOException(String.format("Invalid folder descriptor trying to create log replica %s", file.getParentFile().getPath())), file.getParentFile().getPath());
|
||||
|
||||
return new LogReplica(file, folderFD);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import org.apache.cassandra.io.FSError;
|
|||
import org.apache.cassandra.io.FSReadError;
|
||||
import org.apache.cassandra.io.FSWriteError;
|
||||
import org.apache.cassandra.io.util.FileUtils;
|
||||
import org.apache.cassandra.utils.FBUtilities;
|
||||
import org.apache.cassandra.utils.NativeLibrary;
|
||||
import org.apache.cassandra.utils.SyncUtil;
|
||||
|
||||
|
|
@ -161,7 +162,7 @@ final class HintsCatalog
|
|||
FileUtils.handleFSErrorAndPropagate(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!FBUtilities.isWindows())
|
||||
{
|
||||
logger.error("Unable to open directory {}", hintsDirectory.getAbsolutePath());
|
||||
FileUtils.handleFSErrorAndPropagate(new FSWriteError(new IOException(String.format("Unable to open hint directory %s", hintsDirectory.getAbsolutePath())), hintsDirectory.getAbsolutePath()));
|
||||
|
|
|
|||
Loading…
Reference in New Issue