use of alluxio.master.journal.sink.JournalSink in project alluxio by Alluxio.
the class AbstractJournalSystem method removeJournalSink.
@Override
public void removeJournalSink(Master master, JournalSink journalSink) {
try (LockResource r = new LockResource(mSinkLock.writeLock())) {
Set<JournalSink> sinks = mJournalSinks.get(master.getName());
if (sinks != null) {
sinks.remove(journalSink);
if (sinks.isEmpty()) {
mJournalSinks.remove(master.getName());
}
}
// Compute the full set of sinks on removal. Simply removing it may be incorrect, if the same
// sink is associated with other masters.
mAllJournalSinks.clear();
for (Set<JournalSink> s : mJournalSinks.values()) {
mAllJournalSinks.addAll(s);
}
}
}
use of alluxio.master.journal.sink.JournalSink in project alluxio by Alluxio.
the class AbstractJournalSystem method addJournalSink.
@Override
public void addJournalSink(Master master, JournalSink journalSink) {
try (LockResource r = new LockResource(mSinkLock.writeLock())) {
mJournalSinks.computeIfAbsent(master.getName(), (key) -> new HashSet<>()).add(journalSink);
mAllJournalSinks.add(journalSink);
}
}
Aggregations