MCPcopy
hub / github.com/questdb/questdb / verifyFileSystem

Method verifyFileSystem

core/src/main/java/io/questdb/Bootstrap.java:645–678  ·  view source on GitHub ↗
(Path path, CharSequence rootDir, String kind, boolean failOnNfs, boolean logUnstable)

Source from the content-addressed store, hash-verified

643 }
644
645 private void verifyFileSystem(Path path, CharSequence rootDir, String kind, boolean failOnNfs, boolean logUnstable) {
646 if (rootDir == null) {
647 log.advisoryW().$(" - ").$(kind).$(" root: NOT SET").$();
648 return;
649 }
650 path.of(rootDir);
651
652 // path will contain file system name
653 if (Files.exists(path.$())) {
654 final long fsStatus = Files.getFileSystemStatus(path.$());
655 path.seekZ();
656 LogRecord rec = log.advisoryW().$(" - ").$(kind).$(" root: [path=").$(rootDir).$(", magic=0x");
657 if (fsStatus < 0 || (fsStatus == 0 && Os.type == Os.DARWIN && Os.arch == Os.ARCH_AARCH64)) {
658 rec.$hex(-fsStatus).$(", fs=").$(path).$("] -> SUPPORTED").$();
659 } else {
660 rec.$hex(fsStatus).$(", fs=").$(path);
661 if (logUnstable) {
662 rec.$("] -> UNSUPPORTED (SYSTEM COULD BE UNSTABLE)").$();
663 } else {
664 rec.$("] -> UNSUPPORTED").$();
665 }
666 }
667
668 if (failOnNfs && fsStatus == Files.NFS_MAGIC) {
669 throw new BootstrapException("Error: Unsupported Filesystem Detected. " + Misc.EOL
670 + "QuestDB cannot start because the '" + rootDirectory + "' is located on an NFS filesystem, "
671 + "which is not supported. Please relocate your '" + kind + " root' to a supported filesystem to continue. " + Misc.EOL
672 + "For a list of supported filesystems and further guidance, please visit: https://questdb.io/docs/deployment/capacity-planning/#supported-filesystems "
673 + "[path=" + rootDir + ", kind=" + kind + ", fs=NFS]", true);
674 }
675 } else {
676 log.info().$(" - ").$(kind).$(" root: [path=").$(rootDir).$("] -> NOT FOUND").$();
677 }
678 }
679
680 void logBannerAndEndpoints(String schema) {
681 final boolean ilpEnabled = config.getHttpServerConfiguration().getLineHttpProcessorConfiguration().isEnabled();

Callers 1

reportValidateConfigMethod · 0.95

Calls 8

$Method · 0.95
existsMethod · 0.95
getFileSystemStatusMethod · 0.95
$hexMethod · 0.95
seekZMethod · 0.80
advisoryWMethod · 0.65
ofMethod · 0.65
infoMethod · 0.65

Tested by

no test coverage detected