/** * Try to add a no-checksum anchor to our shared memory slot. * * It is only possible to add this anchor when the block is mlocked on the Datanode. * The DataNode will not munlock the block until the number of no-checksum anchors * for the block reaches zero. * * This method does not require any synchronization. * * @return True if we successfully added a no-checksum anchor. */ public boolean addNoChecksumAnchor() { if (slot == null) { return false; } boolean result = slot.addAnchor(); if (LOG.isTraceEnabled()) { if (result) { LOG.trace(this + ": added no-checksum anchor to slot " + slot); } else { LOG.trace(this + ": could not add no-checksum anchor to slot " + slot); } } return result; }
/** * Try to add a no-checksum anchor to our shared memory slot. * * It is only possible to add this anchor when the block is mlocked on the Datanode. * The DataNode will not munlock the block until the number of no-checksum anchors * for the block reaches zero. * * This method does not require any synchronization. * * @return True if we successfully added a no-checksum anchor. */ public boolean addNoChecksumAnchor() { if (slot == null) { return false; } boolean result = slot.addAnchor(); LOG.trace("{}: {} no-checksum anchor to slot {}", this, result ? "added" : "could not add", slot); return result; }
/** * Try to add a no-checksum anchor to our shared memory slot. * * It is only possible to add this anchor when the block is mlocked on the Datanode. * The DataNode will not munlock the block until the number of no-checksum anchors * for the block reaches zero. * * This method does not require any synchronization. * * @return True if we successfully added a no-checksum anchor. */ public boolean addNoChecksumAnchor() { if (slot == null) { return false; } boolean result = slot.addAnchor(); if (LOG.isTraceEnabled()) { if (result) { LOG.trace(this + ": added no-checksum anchor to slot " + slot); } else { LOG.trace(this + ": could not add no-checksum anchor to slot " + slot); } } return result; }