Пример #1
0
        public StreamId LookupValue(string streamName)
        {
            if (string.IsNullOrEmpty(streamName))
            {
                throw new ArgumentNullException(nameof(streamName));
            }

            StreamId streamId;

            if (SystemStreams.IsMetastream(streamName))
            {
                streamName = SystemStreams.OriginalStreamOf(streamName);
                streamId   = LookupValue(streamName);
                return(_metastreams.MetaStreamOf(streamId));
            }

            if (LogV3SystemStreams.TryGetVirtualStreamId(streamName, out streamId))
            {
                return(streamId);
            }

            var result = _wrapped.LookupValue(streamName);

            return(result == default
                                ? SystemStreams.IsSystemStream(streamName)
                                        ? LogV3SystemStreams.NoSystemStream
                                        : LogV3SystemStreams.NoUserStream
                                : result);
        }
        public long LookupId(string streamName)
        {
            long streamId;

            if (SystemStreams.IsMetastream(streamName))
            {
                streamName = SystemStreams.OriginalStreamOf(streamName);
                streamId   = LookupId(streamName);
                return(_metastreams.MetaStreamOf(streamId));
            }

            if (LogV3SystemStreams.TryGetVirtualStreamId(streamName, out streamId))
            {
                return(streamId);
            }

            return(_wrapped.LookupId(streamName));
        }
Пример #3
0
        public bool GetOrAddId(string streamName, out long streamId, out long createdId, out string createdName)
        {
            if (SystemStreams.IsMetastream(streamName))
            {
                streamName = SystemStreams.OriginalStreamOf(streamName);
                var ret = GetOrAddId(streamName, out streamId, out createdId, out createdName);
                streamId = _metastreams.MetaStreamOf(streamId);
                return(ret);
            }

            if (LogV3SystemStreams.TryGetVirtualStreamId(streamName, out streamId))
            {
                createdId   = default;
                createdName = default;
                return(true);
            }

            return(_wrapped.GetOrAddId(streamName, out streamId, out createdId, out createdName));
        }
Пример #4
0
        public bool GetOrReserve(string streamName, out StreamId streamId, out StreamId createdId, out string createdName)
        {
            Ensure.NotNullOrEmpty(streamName, "streamName");
            if (SystemStreams.IsMetastream(streamName))
            {
                streamName = SystemStreams.OriginalStreamOf(streamName);
                var ret = GetOrReserve(streamName, out streamId, out createdId, out createdName);
                streamId = _metastreams.MetaStreamOf(streamId);
                return(ret);
            }

            if (LogV3SystemStreams.TryGetVirtualStreamId(streamName, out streamId))
            {
                createdId   = default;
                createdName = default;
                return(true);
            }

            return(_wrapped.GetOrReserve(streamName, out streamId, out createdId, out createdName));
        }
Пример #5
0
        public long LookupId(string streamName)
        {
            long streamId;

            if (SystemStreams.IsMetastream(streamName))
            {
                streamName = SystemStreams.OriginalStreamOf(streamName);
                streamId   = LookupId(streamName);
                return(_metastreams.MetaStreamOf(streamId));
            }

            if (LogV3SystemStreams.TryGetVirtualStreamId(streamName, out streamId))
            {
                return(streamId);
            }

            var result = _wrapped.LookupId(streamName);

            return(result == default
                                ? SystemStreams.IsSystemStream(streamName)
                                        ? LogV3SystemStreams.NoSystemStream
                                        : LogV3SystemStreams.NoUserStream
                                : result);
        }
Пример #6
0
 public StreamId MetaStreamOf(StreamId streamId) => _metastreams.MetaStreamOf(streamId);
Пример #7
0
 public long MetaStreamOf(long streamId) => _metastreams.MetaStreamOf(streamId);