public StreamBlockRecordCursor(StreamBlockIndex blockIndex, StreamLogId slid) { _blockIndex = blockIndex; _slid = slid; _chunkCursorState = CursorState.Initialized; _cursorCurrentKey = default; _chunkCursorCurrent = default; }
internal StreamLogState(StreamLogId streamLogId, IntPtr statePointer) { Debug.Assert(BitUtil.IsAligned((long)statePointer, 64), "StreamLogState buffer must be aligned to 64 bytes."); _statePointer = (byte *)statePointer; if (StreamLogId != default && StreamLogId != streamLogId) { ThrowHelper.ThrowArgumentException($"Wrong existing StreamId {StreamLogId} in StreamLogState vs expected {streamLogId}."); } }
public bool GetIsCompleted(StreamLogId streamLogId) { var streamId = (long)streamLogId; using (var txn = Environment.BeginReadOnlyTransaction()) using (var c = _blocksDb.OpenReadOnlyCursor(txn)) { StreamBlockRecord value = default; if (c.TryGet(ref streamId, ref value, CursorGetOption.Set) && c.TryGet(ref streamId, ref value, CursorGetOption.LastDuplicate)) { return(value.Version == CompletedVersion); } return(false); } }
public StreamLogNotification(StreamLogId slid, bool rotated = false, bool completed = false, bool fromUpstream = false, bool priority = false) { byte tag = 0; ulong ustreamId; if (slid.IsInternal) { tag |= InternalMask; ustreamId = (ulong)-(long)(slid); } else { ustreamId = (ulong)(long)slid; } if (ustreamId > MaxStreamId) { ThrowArgumentEx(); } if (priority) { tag |= PriorityMask; } if (rotated) { tag |= RotateMask; } if (completed) { tag |= CompleteMask; } if (fromUpstream) { tag |= UpstreamMask; } _value = (ulong)tag << TagOffset | ustreamId; }
public Series <Timestamp, StreamBlockRecord, StreamBlockRecordTimestampCursor> GetBlockRecordTimeSeries(StreamLogId streamId) { return(GetBlockRecordTimestampCursor(streamId).Source); }
public Series <ulong, StreamBlockRecord, StreamBlockRecordCursor> GetBlockRecordSeries(StreamLogId streamId) { return(GetBlockRecordCursor(streamId).Source); }
public StreamBlockRecordTimestampCursor GetBlockRecordTimestampCursor(StreamLogId streamId) { return(new StreamBlockRecordTimestampCursor(this, streamId)); }
public BlockKey(StreamLogId slid, ulong version) { Slid = slid; Version = version; }
public CacheKey(StreamLogId slid, ulong version) { Slid = slid; Version = version; }