Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSuppressFailureToCloseChannelInFailedAttemptToReadHeaderAfterOpen() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldSuppressFailureToCloseChannelInFailedAttemptToReadHeaderAfterOpen()
        {
            // GIVEN a file which returns 1/2 log header size worth of bytes
            FileSystemAbstraction fs = mock(typeof(FileSystemAbstraction));
            LogFiles     logFiles    = LogFilesBuilder.builder(_directory.databaseLayout(), fs).withTransactionIdStore(_transactionIdStore).withLogVersionRepository(_logVersionRepository).build();
            int          logVersion  = 0;
            File         logFile     = logFiles.GetLogFileForVersion(logVersion);
            StoreChannel channel     = mock(typeof(StoreChannel));

            when(channel.read(any(typeof(ByteBuffer)))).thenReturn(LogHeader.LOG_HEADER_SIZE / 2);
            when(fs.FileExists(logFile)).thenReturn(true);
            when(fs.Open(eq(logFile), any(typeof(OpenMode)))).thenReturn(channel);
            doThrow(typeof(IOException)).when(channel).close();

            // WHEN
            try
            {
                logFiles.OpenForVersion(logVersion);
                fail("Should have failed");
            }
            catch (IncompleteLogHeaderException e)
            {
                // THEN good
                verify(channel).close();
                assertEquals(1, e.Suppressed.length);
                assertTrue(e.Suppressed[0] is IOException);
            }
        }
Ejemplo n.º 2
0
        internal static LuceneIndexProvider LuceneProvider(FileSystemAbstraction fs, IndexDirectoryStructure.Factory directoryStructure, IndexProvider.Monitor monitor, Config config, OperationalMode operationalMode)
        {
            bool             ephemeral        = config.Get(GraphDatabaseSettings.ephemeral);
            DirectoryFactory directoryFactory = directoryFactory(ephemeral);

            return(new LuceneIndexProvider(fs, directoryFactory, directoryStructure, monitor, config, operationalMode));
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @VisibleForTesting static Threshold getThresholdByType(org.neo4j.io.fs.FileSystemAbstraction fileSystem, java.time.Clock clock, org.neo4j.kernel.impl.transaction.log.pruning.ThresholdConfigParser.ThresholdConfigValue value, String originalConfigValue)
        internal static Threshold GetThresholdByType(FileSystemAbstraction fileSystem, Clock clock, ThresholdConfigValue value, string originalConfigValue)
        {
            long thresholdValue = value.Value;

            switch (value.Type)
            {
            case "files":
                return(new FileCountThreshold(thresholdValue));

            case "size":
                return(new FileSizeThreshold(fileSystem, thresholdValue));

            case "txs":
            case "entries":                             // txs and entries are synonyms
                return(new EntryCountThreshold(thresholdValue));

            case "hours":
                return(new EntryTimespanThreshold(clock, HOURS, thresholdValue));

            case "days":
                return(new EntryTimespanThreshold(clock, DAYS, thresholdValue));

            default:
                throw new System.ArgumentException("Invalid log pruning configuration value '" + originalConfigValue + "'. Invalid type '" + value.Type + "', valid are files, size, txs, entries, hours, days.");
            }
        }
Ejemplo n.º 4
0
 public Builder(RecordStorageEngineRule outerInstance, FileSystemAbstraction fs, PageCache pageCache, DatabaseLayout databaseLayout)
 {
     this._outerInstance = outerInstance;
     this.Fs             = fs;
     this.PageCache      = pageCache;
     this.DatabaseLayout = databaseLayout;
 }
Ejemplo n.º 5
0
        private static ChildInitializer ChildInitializer(FileSystemAbstraction fileSystem, GraphDatabaseAPI graphDb)
        {
            ApplicationSupportedProtocols catchupProtocols  = new ApplicationSupportedProtocols(CATCHUP, emptyList());
            ModifierSupportedProtocols    modifierProtocols = new ModifierSupportedProtocols(COMPRESSION, emptyList());

            ApplicationProtocolRepository catchupRepository  = new ApplicationProtocolRepository(Protocol_ApplicationProtocols.values(), catchupProtocols);
            ModifierProtocolRepository    modifierRepository = new ModifierProtocolRepository(Protocol_ModifierProtocols.values(), singletonList(modifierProtocols));

            System.Func <CheckPointer>       checkPointer = () => graphDb.DependencyResolver.resolveDependency(typeof(CheckPointer));
            System.Func <bool>               availability = () => graphDb.DependencyResolver.resolveDependency(typeof(DatabaseAvailabilityGuard)).Available;
            System.Func <NeoStoreDataSource> dataSource   = () => graphDb.DependencyResolver.resolveDependency(typeof(NeoStoreDataSource));
            LogProvider logProvider = NullLogProvider.Instance;

            Org.Neo4j.Storageengine.Api.StoreId kernelStoreId = dataSource().StoreId;
            StoreId storeId = new StoreId(kernelStoreId.CreationTime, kernelStoreId.RandomId, kernelStoreId.UpgradeTime, kernelStoreId.UpgradeId);

            CheckPointerService         checkPointerService  = new CheckPointerService(checkPointer, createInitialisedScheduler(), Group.CHECKPOINT);
            RegularCatchupServerHandler catchupServerHandler = new RegularCatchupServerHandler(new Monitors(), logProvider, () => storeId, dataSource, availability, fileSystem, null, checkPointerService);

            NettyPipelineBuilderFactory pipelineBuilder = new NettyPipelineBuilderFactory(VoidPipelineWrapperFactory.VOID_WRAPPER);

            CatchupProtocolServerInstaller.Factory catchupProtocolServerInstaller = new CatchupProtocolServerInstaller.Factory(pipelineBuilder, logProvider, catchupServerHandler);

            ProtocolInstallerRepository <Org.Neo4j.causalclustering.protocol.ProtocolInstaller_Orientation_Server> protocolInstallerRepository = new ProtocolInstallerRepository <Org.Neo4j.causalclustering.protocol.ProtocolInstaller_Orientation_Server>(singletonList(catchupProtocolServerInstaller), Org.Neo4j.causalclustering.protocol.ModifierProtocolInstaller_Fields.AllServerInstallers);

            return(new HandshakeServerInitializer(catchupRepository, modifierRepository, protocolInstallerRepository, pipelineBuilder, logProvider));
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Creates a new id file.
 /// </summary>
 /// <param name="file"> The name of the id generator </param>
 /// <param name="throwIfFileExists"> if {@code true} will cause an <seealso cref="System.InvalidOperationException"/> to be thrown if
 /// the file already exists. if {@code false} will truncate the file writing the header in it. </param>
 public static void CreateEmptyIdFile(FileSystemAbstraction fs, File file, long highId, bool throwIfFileExists)
 {
     // sanity checks
     if (fs == null)
     {
         throw new System.ArgumentException("Null filesystem");
     }
     if (file == null)
     {
         throw new System.ArgumentException("Null filename");
     }
     if (throwIfFileExists && fs.FileExists(file))
     {
         throw new System.InvalidOperationException("Can't create id file [" + file + "], file already exists");
     }
     try
     {
         using (StoreChannel channel = fs.Create(file))
         {
             // write the header
             channel.Truncate(0);
             ByteBuffer buffer = ByteBuffer.allocate(HeaderSize);
             buffer.put(_cleanGenerator).putLong(highId).flip();
             channel.WriteAll(buffer);
             channel.Force(false);
         }
     }
     catch (IOException e)
     {
         throw new UnderlyingStorageException("Unable to create id file " + file, e);
     }
 }
Ejemplo n.º 7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUp()
        public virtual void SetUp()
        {
            FileSystemAbstraction fs = _fsRule.get();

            _pageCache          = _pageCacheRule.getPageCache(fs);
            _idGeneratorFactory = new DefaultIdGeneratorFactory(fs);
        }
Ejemplo n.º 8
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static java.io.File createNeoStoreFile(org.neo4j.io.fs.FileSystemAbstraction fileSystem, org.neo4j.io.layout.DatabaseLayout databaseLayout) throws java.io.IOException
        private static File CreateNeoStoreFile(FileSystemAbstraction fileSystem, DatabaseLayout databaseLayout)
        {
            File neoStoreFile = databaseLayout.MetadataStore();

            fileSystem.Create(neoStoreFile).close();
            return(neoStoreFile);
        }
Ejemplo n.º 9
0
 public virtual PageCache GetPageCache(FileSystemAbstraction fs, PageCacheConfig pageCacheConfig, Config config)
 {
     CloseExistingPageCache();
     PageCache = CreatePageCache(fs, pageCacheConfig, config);
     PageCachePostConstruct(pageCacheConfig);
     return(PageCache);
 }
Ejemplo n.º 10
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static LogHeader readLogHeader(org.neo4j.io.fs.FileSystemAbstraction fileSystem, java.io.File file, boolean strict) throws java.io.IOException
        public static LogHeader ReadLogHeader(FileSystemAbstraction fileSystem, File file, bool strict)
        {
            using (StoreChannel channel = fileSystem.Open(file, OpenMode.READ))
            {
                return(ReadLogHeader(ByteBuffer.allocate(LOG_HEADER_SIZE), channel, strict, file));
            }
        }
Ejemplo n.º 11
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void prepareNeoStoreFile(org.neo4j.io.fs.FileSystemAbstraction fileSystem, org.neo4j.io.layout.DatabaseLayout databaseLayout, String storeVersion, org.neo4j.io.pagecache.PageCache pageCache) throws java.io.IOException
        private static void PrepareNeoStoreFile(FileSystemAbstraction fileSystem, DatabaseLayout databaseLayout, string storeVersion, PageCache pageCache)
        {
            File neoStoreFile = CreateNeoStoreFile(fileSystem, databaseLayout);
            long value        = MetaDataStore.versionStringToLong(storeVersion);

            MetaDataStore.setRecord(pageCache, neoStoreFile, STORE_VERSION, value);
        }
Ejemplo n.º 12
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: IndexUpdateStorage(org.neo4j.io.fs.FileSystemAbstraction fs, java.io.File file, ByteBufferFactory.Allocator byteBufferFactory, int blockSize, org.neo4j.index.internal.gbptree.Layout<KEY,VALUE> layout) throws java.io.IOException
        internal IndexUpdateStorage(FileSystemAbstraction fs, File file, ByteBufferFactory.Allocator byteBufferFactory, int blockSize, Layout <KEY, VALUE> layout) : base(fs, file, byteBufferFactory, blockSize)
        {
            this._layout = layout;
            this._key1   = layout.NewKey();
            this._key2   = layout.NewKey();
            this._value  = layout.NewValue();
        }
Ejemplo n.º 13
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: BlockReader(org.neo4j.io.fs.FileSystemAbstraction fs, java.io.File file, org.neo4j.index.internal.gbptree.Layout<KEY,VALUE> layout) throws java.io.IOException
        internal BlockReader(FileSystemAbstraction fs, File file, Layout <KEY, VALUE> layout)
        {
            this._fs      = fs;
            this._file    = file;
            this._layout  = layout;
            this._channel = fs.Open(file, OpenMode.READ);
        }
Ejemplo n.º 14
0
 internal StoreResource(File file, string relativePath, int recordSize, FileSystemAbstraction fs)
 {
     this._file       = file;
     this._path       = relativePath;
     this._recordSize = recordSize;
     this._fs         = fs;
 }
Ejemplo n.º 15
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: static long readHighId(org.neo4j.io.fs.FileSystemAbstraction fileSystem, java.io.File file) throws java.io.IOException
        internal static long ReadHighId(FileSystemAbstraction fileSystem, File file)
        {
            using (StoreChannel channel = fileSystem.Open(file, OpenMode.READ))
            {
                return(ReadAndValidate(channel, file));
            }
        }
Ejemplo n.º 16
0
 public RecoveryRequiredChecker(FileSystemAbstraction fs, PageCache pageCache, Config config, Monitors monitors)
 {
     this._fs        = fs;
     this._pageCache = pageCache;
     this._config    = config;
     this._monitors  = monitors;
 }
Ejemplo n.º 17
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: static long readDefragCount(org.neo4j.io.fs.FileSystemAbstraction fileSystem, java.io.File file) throws java.io.IOException
        internal static long ReadDefragCount(FileSystemAbstraction fileSystem, File file)
        {
            using (StoreChannel channel = fileSystem.Open(file, OpenMode.READ))
            {
                return(FreeIdKeeper.CountFreeIds(new OffsetChannel(channel, HeaderSize)));
            }
        }
Ejemplo n.º 18
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static void assertRecoveryIsNotRequired(org.neo4j.io.fs.FileSystemAbstraction fs, org.neo4j.io.pagecache.PageCache pageCache, org.neo4j.kernel.configuration.Config config, org.neo4j.io.layout.DatabaseLayout databaseLayout, org.neo4j.kernel.monitoring.Monitors monitors) throws RecoveryRequiredException, java.io.IOException
        public static void AssertRecoveryIsNotRequired(FileSystemAbstraction fs, PageCache pageCache, Config config, DatabaseLayout databaseLayout, Monitors monitors)
        {
            if ((new RecoveryRequiredChecker(fs, pageCache, config, monitors)).IsRecoveryRequiredAt(databaseLayout))
            {
                throw new RecoveryRequiredException();
            }
        }
Ejemplo n.º 19
0
 public SimpleFileStorage(FileSystemAbstraction fileSystem, File directory, string name, ChannelMarshal <T> marshal, LogProvider logProvider)
 {
     this._fileSystem = fileSystem;
     this._log        = logProvider.getLog(this.GetType());
     this._file       = new File(DurableStateStorage.StateDir(directory, name), name);
     this._marshal    = marshal;
 }
Ejemplo n.º 20
0
            internal CausalClusteringBeanImpl(ManagementData management, bool isMXBean) : base(management, isMXBean)
            {
                ClusterStateDirectory = management.ResolveDependency(typeof(ClusterStateDirectory));
                RaftMachine           = management.ResolveDependency(typeof(RaftMachine));

                Fs = management.KernelData.FilesystemAbstraction;
            }
Ejemplo n.º 21
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static void restoreFromBackup(java.io.File backup, org.neo4j.io.fs.FileSystemAbstraction fsa, org.neo4j.causalclustering.discovery.ClusterMember clusterMember) throws java.io.IOException, org.neo4j.commandline.admin.CommandFailed
        public static void RestoreFromBackup(File backup, FileSystemAbstraction fsa, ClusterMember clusterMember)
        {
            Config config = clusterMember.config();
            RestoreDatabaseCommand restoreDatabaseCommand = new RestoreDatabaseCommand(fsa, backup, config, GraphDatabaseSettings.DEFAULT_DATABASE_NAME, true);

            restoreDatabaseCommand.Execute();
        }
Ejemplo n.º 22
0
        public void SetMigrationStatus(Org.Neo4j.Io.fs.FileSystemAbstraction fs, java.io.File stateFile, string info)
        {
            if (fs.FileExists(stateFile))
            {
                try
                {
                    fs.Truncate(stateFile, 0);
                }
                catch (IOException e)
                {
                    throw new Exception(e);
                }
            }

            try
            {
                using (Writer writer = fs.OpenAsWriter(stateFile, StandardCharsets.UTF_8, false))
                {
                    writer.write(name());
                    writer.write('\n');
                    writer.write(info);
                    writer.flush();
                }
            }
            catch (IOException e)
            {
                throw new Exception(e);
            }
        }
Ejemplo n.º 23
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void before()
        public virtual void Before()
        {
            FileSystemAbstraction fs           = this._fs.get();
            StoreFactory          storeFactory = new StoreFactory(_testDirectory.databaseLayout(), Config.defaults(), new DefaultIdGeneratorFactory(fs), _pageCacheRule.getPageCache(fs), fs, NullLogProvider.Instance, EmptyVersionContextSupplier.EMPTY);

            _neoStores = storeFactory.OpenAllNeoStores(true);
        }
Ejemplo n.º 24
0
 internal ThresholdBasedPruneStrategy(FileSystemAbstraction fileSystem, LogFiles logFiles, Threshold threshold)
 {
     this._fileSystem         = fileSystem;
     this._files              = logFiles;
     this._logFileInformation = _files.LogFileInformation;
     this._threshold          = threshold;
 }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void dropShouldDeleteEntireIndexFolder()
        public virtual void DropShouldDeleteEntireIndexFolder()
        {
            // given
            File root = Storage.directory().directory("root");
            IndexDirectoryStructure directoryStructure = IndexDirectoryStructure.directoriesByProvider(root).forProvider(GenericNativeIndexProvider.Descriptor);
            long indexId                    = 8;
            File indexDirectory             = directoryStructure.DirectoryForIndex(indexId);
            StoreIndexDescriptor descriptor = IndexDescriptorFactory.forSchema(SchemaDescriptorFactory.forLabel(1, 1)).withId(indexId);
            IndexSpecificSpaceFillingCurveSettingsCache spatialSettings = mock(typeof(IndexSpecificSpaceFillingCurveSettingsCache));
            PageCache             pageCache        = Storage.pageCache();
            FileSystemAbstraction fs               = Storage.fileSystem();
            File          indexFile                = new File(indexDirectory, "my-index");
            GenericLayout layout                   = new GenericLayout(1, spatialSettings);
            RecoveryCleanupWorkCollector immediate = immediate();
            IndexDropAction             dropAction = new FileSystemIndexDropAction(fs, directoryStructure);
            GenericNativeIndexPopulator populator  = new GenericNativeIndexPopulator(pageCache, fs, indexFile, layout, EMPTY, descriptor, spatialSettings, directoryStructure, mock(typeof(SpaceFillingCurveConfiguration)), dropAction, false);

            populator.Create();

            // when
            assertTrue(fs.ListFiles(indexDirectory).Length > 0);
            populator.Drop();

            // then
            assertFalse(fs.FileExists(indexDirectory));
        }
Ejemplo n.º 26
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void createStore()
        public virtual void CreateStore()
        {
            _file       = new File("target/test-data/index-provider-store");
            _fileSystem = new DefaultFileSystemAbstraction();
            _file.mkdirs();
            _fileSystem.deleteFile(_file);
        }
Ejemplo n.º 27
0
        public ClusteringModule(DiscoveryServiceFactory discoveryServiceFactory, MemberId myself, PlatformModule platformModule, File clusterStateDirectory, DatabaseLayout databaseLayout)
        {
            LifeSupport           life                  = platformModule.Life;
            Config                config                = platformModule.Config;
            LogProvider           logProvider           = platformModule.Logging.InternalLogProvider;
            LogProvider           userLogProvider       = platformModule.Logging.UserLogProvider;
            Dependencies          dependencies          = platformModule.Dependencies;
            Monitors              monitors              = platformModule.Monitors;
            FileSystemAbstraction fileSystem            = platformModule.FileSystem;
            RemoteMembersResolver remoteMembersResolver = chooseResolver(config, platformModule.Logging);

            _topologyService = discoveryServiceFactory.CoreTopologyService(config, myself, platformModule.JobScheduler, logProvider, userLogProvider, remoteMembersResolver, ResolveStrategy(config, logProvider), monitors);

            life.Add(_topologyService);

            dependencies.SatisfyDependency(_topologyService);                 // for tests

            CoreBootstrapper coreBootstrapper = new CoreBootstrapper(databaseLayout, platformModule.PageCache, fileSystem, config, logProvider, platformModule.Monitors);

            SimpleStorage <ClusterId> clusterIdStorage = new SimpleFileStorage <ClusterId>(fileSystem, clusterStateDirectory, CLUSTER_ID_NAME, new ClusterId.Marshal(), logProvider);

            SimpleStorage <DatabaseName> dbNameStorage = new SimpleFileStorage <DatabaseName>(fileSystem, clusterStateDirectory, DB_NAME, new DatabaseName.Marshal(), logProvider);

            string dbName           = config.Get(CausalClusteringSettings.database);
            int    minimumCoreHosts = config.Get(CausalClusteringSettings.minimum_core_cluster_size_at_formation);

            Duration clusterBindingTimeout = config.Get(CausalClusteringSettings.cluster_binding_timeout);

            _clusterBinder = new ClusterBinder(clusterIdStorage, dbNameStorage, _topologyService, Clocks.systemClock(), () => sleep(100), clusterBindingTimeout, coreBootstrapper, dbName, minimumCoreHosts, platformModule.Monitors);
        }
Ejemplo n.º 28
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.kernel.impl.transaction.log.ReadableLogChannel openLogFile(org.neo4j.io.fs.FileSystemAbstraction fs, int version) throws java.io.IOException
            internal virtual ReadableLogChannel OpenLogFile(FileSystemAbstraction fs, int version)
            {
                LogFiles logFiles = LogFilesBuilder.logFilesBasedOnlyBuilder(WorkingDirectory, fs).build();
                PhysicalLogVersionedStoreChannel channel = logFiles.OpenForVersion(version);

                return(new ReadAheadLogChannel(channel, new ReaderLogVersionBridge(logFiles)));
            }
Ejemplo n.º 29
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private boolean isUnclean(org.neo4j.io.fs.FileSystemAbstraction fileSystem) throws java.io.IOException
        private bool IsUnclean(FileSystemAbstraction fileSystem)
        {
            PageCache pageCache = PageCacheRule.getPageCache(fileSystem);
            RecoveryRequiredChecker requiredChecker = new RecoveryRequiredChecker(fileSystem, pageCache, Config.defaults(), _monitors);

            return(requiredChecker.IsRecoveryRequiredAt(TestDirectory.databaseLayout()));
        }
Ejemplo n.º 30
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldWriteSomeDataIntoTheLog() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldWriteSomeDataIntoTheLog()
        {
            // GIVEN
            string name = "log";
            FileSystemAbstraction fs = _fileSystemRule.get();
            LogFiles logFiles        = LogFilesBuilder.builder(_directory.databaseLayout(), fs).withTransactionIdStore(_transactionIdStore).withLogVersionRepository(_logVersionRepository).build();

            _life.start();
            _life.add(logFiles);

            // WHEN
            FlushablePositionAwareChannel writer         = logFiles.LogFile.Writer;
            LogPositionMarker             positionMarker = new LogPositionMarker();

            writer.GetCurrentPosition(positionMarker);
            int  intValue  = 45;
            long longValue = 4854587;

            writer.PutInt(intValue);
            writer.PutLong(longValue);
            writer.PrepareForFlush().flush();

            // THEN
            using (ReadableClosableChannel reader = logFiles.LogFile.getReader(positionMarker.NewPosition()))
            {
                assertEquals(intValue, reader.Int);
                assertEquals(longValue, reader.Long);
            }
        }