MCPcopy Create free account
hub / github.com/apache/mesos / ___set

Method ___set

src/state/log.cpp:549–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547
548
549Future<bool> LogStorageProcess::___set(
550 const Entry& entry,
551 size_t diffs,
552 Option<Log::Position> position)
553{
554 if (position.isNone()) {
555 starting = None(); // Reset 'starting' so we try again.
556 return false;
557 }
558
559 // Update index so we don't bother reading anything before this
560 // position again (if we don't have to).
561 index = max(index, position);
562
563 // Determine the position that represents the snapshot: if we just
564 // wrote a diff then we want to use the existing position of the
565 // snapshot, otherwise we just overwrote the snapshot so we should
566 // use the returned position (i.e., do nothing).
567 if (diffs > 0) {
568 CHECK(snapshots.contains(entry.name()));
569 position = snapshots.at(entry.name()).position;
570 }
571
572 Snapshot snapshot(position.get(), entry, diffs);
573 snapshots.put(snapshot.entry.name(), snapshot);
574
575 // And truncate the log if necessary.
576 truncate();
577
578 return true;
579}
580
581
582Future<bool> LogStorageProcess::expunge(const Entry& entry)

Callers

nothing calls this directly

Calls 8

NoneClass · 0.85
maxFunction · 0.85
atMethod · 0.80
isNoneMethod · 0.45
containsMethod · 0.45
nameMethod · 0.45
getMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected