private void CreateDurableState <T>(string name, StateMarshal <T> marshal) { DurableStateStorage <T> storage = new DurableStateStorage <T>(Fsa.get(), _clusterStateDirectory.get(), name, marshal, 1024, NullLogProvider.Instance); //noinspection EmptyTryBlock: Will create initial state. using (Lifespan ignored = new Lifespan(storage)) { } }
public DurableStateStorage(FileSystemAbstraction fsa, File baseDir, string name, StateMarshal <STATE> marshal, int numberOfEntriesBeforeRotation, LogProvider logProvider) { this._fsa = fsa; this._name = name; this._marshal = marshal; this._numberOfEntriesBeforeRotation = numberOfEntriesBeforeRotation; this._log = logProvider.getLog(this.GetType()); this._recoveryManager = new StateRecoveryManager <STATE>(fsa, marshal); File parent = StateDir(baseDir, name); this._fileA = new File(parent, name + ".a"); this._fileB = new File(parent, name + ".b"); }
private void DumpState <T1>(string name, StateMarshal <T1> marshal) { int rotationSize = Config.defaults().get(CausalClusteringSettings.replicated_lock_token_state_size); //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: org.neo4j.causalclustering.core.state.storage.DurableStateStorage<?> storage = new org.neo4j.causalclustering.core.state.storage.DurableStateStorage<>(fs, clusterStateDirectory, name, marshal, rotationSize, org.neo4j.logging.NullLogProvider.getInstance()); DurableStateStorage <object> storage = new DurableStateStorage <object>(_fs, _clusterStateDirectory, name, marshal, rotationSize, NullLogProvider.Instance); if (storage.Exists()) { using (Lifespan ignored = new Lifespan(storage)) { @out.println(name + ": " + storage.InitialState); } } }
public StateRecoveryManager(FileSystemAbstraction fileSystem, StateMarshal <STATE> marshal) { this.FileSystem = fileSystem; this._marshal = marshal; }