Esempio n. 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.io.fs.StoreChannel open(java.io.File fileName, org.neo4j.io.fs.OpenMode openMode) throws java.io.IOException
        public override StoreChannel Open(File fileName, OpenMode openMode)
        {
            StoreFileChannel channel = ( StoreFileChannel )base.Open(fileName, openMode);

            if (fileName.Name.Equals("neostore.nodestore.db") || fileName.Name.Equals("neostore.nodestore.db.labels") || fileName.Name.Equals("neostore.relationshipstore.db") || fileName.Name.Equals("neostore.propertystore.db") || fileName.Name.Equals("neostore.propertystore.db.strings") || fileName.Name.Equals("neostore.propertystore.db.arrays") || fileName.Name.Equals("neostore.relationshipgroupstore.db"))
            {
                return(new JumpingFileChannel(this, channel, RecordSizeFor(fileName)));
            }
            return(channel);
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ParameterizedTest @ValueSource(ints = {0, 1}) @DisabledOnOs(org.junit.jupiter.api.condition.OS.WINDOWS) void creatingSwapperForInternallyLockedFileMustThrow(int noChannelStriping) throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void CreatingSwapperForInternallyLockedFileMustThrow(int noChannelStriping)
        {
            PageSwapperFactory factory = CreateSwapperFactory();

            factory.Open(_fileSystem, Configuration.EMPTY);
            File file = TestDir.file("file");

            StoreFileChannel channel = _fileSystem.create(file);

            using (FileLock fileLock = channel.TryLock())
            {
                assertThat(fileLock, @is(not(nullValue())));
                assertThrows(typeof(FileLockException), () => CreateSwapper(factory, file, 4, NoCallback, true, Bool(noChannelStriping)));
            }
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ParameterizedTest @ValueSource(ints = {0, 1}) @DisabledOnOs(org.junit.jupiter.api.condition.OS.WINDOWS) void mustUnlockFileWhenThePageSwapperIsClosed(int noChannelStriping) throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void MustUnlockFileWhenThePageSwapperIsClosed(int noChannelStriping)
        {
            PageSwapperFactory factory = CreateSwapperFactory();

            factory.Open(_fileSystem, Configuration.EMPTY);
            File file = TestDir.file("file");

            _fileSystem.create(file).close();

            CreateSwapper(factory, file, 4, NoCallback, false, false).close();

            using (StoreFileChannel channel = _fileSystem.open(file, OpenMode.READ_WRITE), FileLock fileLock = channel.TryLock())
            {
                assertThat(fileLock, @is(not(nullValue())));
            }
        }
 public static FileChannel Unwrap(StoreChannel channel)
 {
     return(StoreFileChannel.Unwrap(channel));
 }
Esempio n. 5
0
 internal JumpingFileChannel(JumpingFileSystemAbstraction outerInstance, StoreFileChannel actual, int recordSize) : base(actual)
 {
     this._outerInstance = outerInstance;
     this.RecordSize     = recordSize;
 }
Esempio n. 6
0
 public StoreFileChannel(StoreFileChannel channel)
 {
     this._channel = channel._channel;
 }
Esempio n. 7
0
        internal static FileChannel Unwrap(StoreChannel channel)
        {
            StoreFileChannel sfc = ( StoreFileChannel )channel;

            return(sfc._channel);
        }