示例#1
0
        private long ManuallyCountTotalMappedFileSize(File dbDir)
        {
            MutableLong           result            = new MutableLong();
            NativeIndexFileFilter nativeIndexFilter = new NativeIndexFileFilter(dbDir);

            ManuallyCountTotalMappedFileSize(dbDir, result, nativeIndexFilter);
            return(result.Value);
        }
示例#2
0
        private void ManuallyCountTotalMappedFileSize(File dir, MutableLong result, NativeIndexFileFilter nativeIndexFilter)
        {
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            ISet <string> storeFiles = Stream.of(StoreType.values()).filter(StoreType::isRecordStore).map(type => type.DatabaseFile.Name).collect(Collectors.toSet());

            foreach (File file in dir.listFiles())
            {
                if (file.Directory)
                {
                    ManuallyCountTotalMappedFileSize(file, result, nativeIndexFilter);
                }
                else if (storeFiles.Contains(file.Name) || file.Name.Equals(DatabaseFile.LABEL_SCAN_STORE.Name) || nativeIndexFilter.Accept(file))
                {
                    result.add(file.length());
                }
            }
        }
示例#3
0
        private FilenameFilter GetNativeIndexFileFilter(File storeDir, bool inverse)
        {
            FileFilter nativeIndexFilter = new NativeIndexFileFilter(storeDir);

            return((dir, name) =>
            {
                File file = new File(dir, name);
                if (_outsideWorld.fileSystem().isDirectory(file))
                {
                    // Always go down directories
                    return true;
                }
                if (name.Equals(FailureStorage.DEFAULT_FAILURE_FILE_NAME))
                {
                    // Never include failure-storage files
                    return false;
                }

                return inverse != nativeIndexFilter.accept(file);
            });
        }