internal virtual void Remove(JournalManager j) { JournalSet.JournalAndStream jasToRemove = null; foreach (JournalSet.JournalAndStream jas in journals) { if (jas.GetManager().Equals(j)) { jasToRemove = jas; break; } } if (jasToRemove != null) { jasToRemove.Abort(); journals.Remove(jasToRemove); } }
/// <exception cref="System.IO.IOException"/> private static EditLogInputStream GetJournalInputStream(JournalManager jm, long txId , bool inProgressOk) { PriorityQueue <EditLogInputStream> allStreams = new PriorityQueue <EditLogInputStream >(64, JournalSet.EditLogInputStreamComparator); jm.SelectInputStreams(allStreams, txId, inProgressOk); EditLogInputStream elis = null; EditLogInputStream ret; try { while ((elis = allStreams.Poll()) != null) { if (elis.GetFirstTxId() > txId) { break; } if (elis.GetLastTxId() < txId) { elis.Close(); continue; } elis.SkipUntil(txId); ret = elis; elis = null; return(ret); } } finally { IOUtils.Cleanup(Log, Sharpen.Collections.ToArray(allStreams, new EditLogInputStream [0])); IOUtils.Cleanup(Log, elis); } return(null); }
internal virtual void Add(JournalManager j, bool required, bool shared) { JournalSet.JournalAndStream jas = new JournalSet.JournalAndStream(j, required, shared ); journals.AddItem(jas); }
internal virtual void Add(JournalManager j, bool required) { Add(j, required, false); }
public JournalAndStream(JournalManager manager, bool required, bool shared) { this.journal = manager; this.required = required; this.shared = shared; }