public long TryClaim(int length, ExclusiveBufferClaim bufferClaim) { CheckForMaxPayloadLength(length); var newPosition = CLOSED; if (!_isClosed) { var limit = _positionLimit.Volatile; ExclusiveTermAppender termAppender = _termAppenders[_activePartitionIndex]; long position = _termBeginPosition + _termOffset; if (position < limit) { int result = termAppender.Claim(_termId, _termOffset, _headerWriter, length, bufferClaim); newPosition = NewPosition(result); } else if (_conductor.IsPublicationConnected(LogBufferDescriptor.TimeOfLastStatusMessage(_logMetaDataBuffer))) { newPosition = BACK_PRESSURED; } else { newPosition = NOT_CONNECTED; } } return(newPosition); }
public override long TryClaim(int length, BufferClaim bufferClaim) { CheckPayloadLength(length); var newPosition = CLOSED; if (!_isClosed) { var limit = _positionLimit.GetVolatile(); ExclusiveTermAppender termAppender = _termAppenders[_activePartitionIndex]; long position = _termBeginPosition + _termOffset; if (position < limit) { int result = termAppender.Claim(_termId, _termOffset, _headerWriter, length, bufferClaim); newPosition = NewPosition(result); } else { newPosition = BackPressureStatus(position, length); } } return(newPosition); }