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; }
internal RecoveryProtocol(FileSystemAbstraction fileSystem, FileNames fileNames, ReaderPool readerPool, ChannelMarshal <ReplicatedContent> contentMarshal, LogProvider logProvider) { this._fileSystem = fileSystem; this._fileNames = fileNames; this._readerPool = readerPool; this._contentMarshal = contentMarshal; this._logProvider = logProvider; this._log = logProvider.getLog(this.GetType()); }
internal Segments(FileSystemAbstraction fileSystem, FileNames fileNames, ReaderPool readerPool, IList <SegmentFile> allSegments, ChannelMarshal <ReplicatedContent> contentMarshal, LogProvider logProvider, long currentVersion) { this._fileSystem = fileSystem; this._fileNames = fileNames; this._allSegments = new List <SegmentFile>(allSegments); this._contentMarshal = contentMarshal; this._logProvider = logProvider; this._log = logProvider.getLog(this.GetType()); this._currentVersion = currentVersion; this._readerPool = readerPool; PopulateRangeMap(); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public static EntryRecord read(org.neo4j.storageengine.api.ReadableChannel channel, org.neo4j.causalclustering.messaging.marshalling.ChannelMarshal<org.neo4j.causalclustering.core.replication.ReplicatedContent> contentMarshal) throws java.io.IOException, org.neo4j.causalclustering.messaging.EndOfStreamException public static EntryRecord Read(ReadableChannel channel, ChannelMarshal <ReplicatedContent> contentMarshal) { try { long appendIndex = channel.Long; long term = channel.Long; ReplicatedContent content = contentMarshal.Unmarshal(channel); return(new EntryRecord(appendIndex, new RaftLogEntry(term, content))); } catch (ReadPastEndException e) { throw new EndOfStreamException(e); } }
internal SegmentFile(FileSystemAbstraction fileSystem, File file, ReaderPool readerPool, long version, ChannelMarshal <ReplicatedContent> contentMarshal, LogProvider logProvider, SegmentHeader header) { this._fileSystem = fileSystem; this._file = file; this._readerPool = readerPool; this._contentMarshal = contentMarshal; this._header = header; this._version = version; this._positionCache = new PositionCache(); this._refCount = new ReferenceCounter(); this._log = logProvider.getLog(this.GetType()); }
public SegmentedRaftLog(FileSystemAbstraction fileSystem, File directory, long rotateAtSize, ChannelMarshal <ReplicatedContent> contentMarshal, LogProvider logProvider, int readerPoolSize, Clock clock, JobScheduler scheduler, CoreLogPruningStrategy pruningStrategy) { this._fileSystem = fileSystem; this._directory = directory; this._rotateAtSize = rotateAtSize; this._contentMarshal = contentMarshal; this._logProvider = logProvider; this._scheduler = scheduler; this._fileNames = new FileNames(directory); this._readerPool = new ReaderPool(readerPoolSize, logProvider, _fileNames, fileSystem, clock); this._pruner = new SegmentedRaftLogPruner(pruningStrategy); this._log = logProvider.getLog(this.GetType()); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: EntryRecordCursor(Reader reader, org.neo4j.causalclustering.messaging.marshalling.ChannelMarshal<org.neo4j.causalclustering.core.replication.ReplicatedContent> contentMarshal, long currentIndex, long wantedIndex, SegmentFile segment) throws java.io.IOException, org.neo4j.causalclustering.messaging.EndOfStreamException internal EntryRecordCursor(Reader reader, ChannelMarshal <ReplicatedContent> contentMarshal, long currentIndex, long wantedIndex, SegmentFile segment) { this._bufferedReader = new ReadAheadChannel <StoreChannel>(reader.Channel()); this._reader = reader; this._contentMarshal = contentMarshal; this._segment = segment; /* The cache lookup might have given us an earlier position, scan forward to the exact position. */ while (currentIndex < wantedIndex) { read(_bufferedReader, contentMarshal); currentIndex++; } this._position = new LogPosition(currentIndex, _bufferedReader.position()); }
private DumpSegmentedRaftLog(FileSystemAbstraction fileSystem, ChannelMarshal <ReplicatedContent> marshal) { this._fileSystem = fileSystem; this._marshal = marshal; }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public static void write(org.neo4j.storageengine.api.WritableChannel channel, org.neo4j.causalclustering.messaging.marshalling.ChannelMarshal<org.neo4j.causalclustering.core.replication.ReplicatedContent> contentMarshal, long logIndex, long term, org.neo4j.causalclustering.core.replication.ReplicatedContent content) throws java.io.IOException public static void Write(WritableChannel channel, ChannelMarshal <ReplicatedContent> contentMarshal, long logIndex, long term, ReplicatedContent content) { channel.PutLong(logIndex); channel.PutLong(term); contentMarshal.Marshal(content, channel); }
public Marshal(ChannelMarshal <MemberId> marshal) { this.MemberMarshal = marshal; }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: static SegmentFile create(org.neo4j.io.fs.FileSystemAbstraction fileSystem, java.io.File file, ReaderPool readerPool, long version, org.neo4j.causalclustering.messaging.marshalling.ChannelMarshal<org.neo4j.causalclustering.core.replication.ReplicatedContent> contentMarshal, org.neo4j.logging.LogProvider logProvider, SegmentHeader header) throws java.io.IOException internal static SegmentFile Create(FileSystemAbstraction fileSystem, File file, ReaderPool readerPool, long version, ChannelMarshal <ReplicatedContent> contentMarshal, LogProvider logProvider, SegmentHeader header) { if (fileSystem.FileExists(file)) { throw new System.InvalidOperationException("File was not expected to exist"); } SegmentFile segment = new SegmentFile(fileSystem, file, readerPool, version, contentMarshal, logProvider, header); _headerMarshal.marshal(header, segment.OrCreateWriter); segment.Flush(); return(segment); }
private RaftLog CreateRaftLog(Config config, LifeSupport life, FileSystemAbstraction fileSystem, File clusterStateDirectory, ChannelMarshal <ReplicatedContent> marshal, LogProvider logProvider, JobScheduler scheduler) { EnterpriseCoreEditionModule.RaftLogImplementation raftLogImplementation = Enum.Parse(typeof(EnterpriseCoreEditionModule.RaftLogImplementation), config.Get(CausalClusteringSettings.raft_log_implementation)); switch (raftLogImplementation) { case EnterpriseCoreEditionModule.RaftLogImplementation.IN_MEMORY: { return(new InMemoryRaftLog()); } case EnterpriseCoreEditionModule.RaftLogImplementation.SEGMENTED: { long rotateAtSize = config.Get(CausalClusteringSettings.raft_log_rotation_size); int readerPoolSize = config.Get(CausalClusteringSettings.raft_log_reader_pool_size); CoreLogPruningStrategy pruningStrategy = (new CoreLogPruningStrategyFactory(config.Get(CausalClusteringSettings.raft_log_pruning_strategy), logProvider)).newInstance(); File directory = new File(clusterStateDirectory, RAFT_LOG_DIRECTORY_NAME); return(life.Add(new SegmentedRaftLog(fileSystem, directory, rotateAtSize, marshal, logProvider, readerPoolSize, systemClock(), scheduler, pruningStrategy))); } default: throw new System.InvalidOperationException("Unknown raft log implementation: " + raftLogImplementation); } }
internal Handler(ChannelMarshal <ReplicatedContent> marshal, MemberId.Marshal memberMarshal, NetworkWritableChannel channel) { this.Marshal = marshal; this.MemberMarshal = memberMarshal; this.Channel = channel; }
public RaftMessageEncoder(ChannelMarshal <ReplicatedContent> marshal) { this._marshal = marshal; }
public RaftMessageDecoder(ChannelMarshal <ReplicatedContent> marshal, Clock clock) { this._marshal = marshal; this._clock = clock; }