コード例 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public SingleFilePageSwapper(java.io.File file, org.neo4j.io.fs.FileSystemAbstraction fs, int filePageSize, org.neo4j.io.pagecache.PageEvictionCallback onEviction, boolean noChannelStriping) throws java.io.IOException
        public SingleFilePageSwapper(File file, FileSystemAbstraction fs, int filePageSize, PageEvictionCallback onEviction, bool noChannelStriping)
        {
            this._fs   = fs;
            this._file = file;
            if (noChannelStriping)
            {
                this._channelStripeCount = 1;
                this._channelStripeMask  = StripeMask(_channelStripeCount);
            }
            else
            {
                this._channelStripeCount = _globalChannelStripeCount;
                this._channelStripeMask  = _globalChannelStripeMask;
            }
            this._channels = new StoreChannel[_channelStripeCount];
            for (int i = 0; i < _channelStripeCount; i++)
            {
                _channels[i] = fs.Open(file, OpenMode.READ_WRITE);
            }
            this._filePageSize = filePageSize;
            this._onEviction   = onEviction;
            IncreaseFileSizeTo(_channels[TOKEN_CHANNEL_STRIPE].size());

            try
            {
                AcquireLock();
            }
            catch (IOException e)
            {
                CloseAndCollectExceptions(0, e);
            }
            _hasPositionLock = _channels[0].GetType() == typeof(StoreFileChannel) && StoreFileChannelUnwrapper.unwrap(_channels[0]).GetType() == typeof(FileChannelImpl);
        }
コード例 #2
0
        private FileChannel UnwrappedChannel(long startFilePageId)
        {
            StoreChannel storeChannel = Channel(startFilePageId);

            return(StoreFileChannelUnwrapper.unwrap(storeChannel));
        }