Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterator classes becomes sealed #371

Merged
merged 3 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/net/KNet/Specific/Streams/KNetKeyValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace MASES.KNet.Streams
/// </summary>
/// <typeparam name="TKey">The key type</typeparam>
/// <typeparam name="TValue">The value type</typeparam>
public class KNetKeyValue<TKey, TValue> : IGenericSerDesFactoryApplier
public sealed class KNetKeyValue<TKey, TValue> : IGenericSerDesFactoryApplier
{
readonly Org.Apache.Kafka.Streams.KeyValue<byte[], byte[]> _valueInner1 = null;
readonly Org.Apache.Kafka.Streams.KeyValue<Java.Lang.Long, byte[]> _valueInner2 = null;
Expand Down
2 changes: 1 addition & 1 deletion src/net/KNet/Specific/Streams/KNetTimestampedKeyValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace MASES.KNet.Streams
/// </summary>
/// <typeparam name="TKey">The key type</typeparam>
/// <typeparam name="TValue">The value type</typeparam>
public class KNetTimestampedKeyValue<TKey, TValue> : IGenericSerDesFactoryApplier
public sealed class KNetTimestampedKeyValue<TKey, TValue> : IGenericSerDesFactoryApplier
{
readonly Org.Apache.Kafka.Streams.KeyValue<byte[], Org.Apache.Kafka.Streams.State.ValueAndTimestamp<byte[]>> _valueInner1 = null;
readonly Org.Apache.Kafka.Streams.KeyValue<Java.Lang.Long, Org.Apache.Kafka.Streams.State.ValueAndTimestamp<byte[]>> _valueInner2 = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace MASES.KNet.Streams
/// </summary>
/// <typeparam name="TKey">The key type</typeparam>
/// <typeparam name="TValue">The value type</typeparam>
public class KNetTimestampedWindowedKeyValue<TKey, TValue> : IGenericSerDesFactoryApplier
public sealed class KNetTimestampedWindowedKeyValue<TKey, TValue> : IGenericSerDesFactoryApplier
{
readonly Org.Apache.Kafka.Streams.KeyValue<Org.Apache.Kafka.Streams.Kstream.Windowed<byte[]>, Org.Apache.Kafka.Streams.State.ValueAndTimestamp<byte[]>> _valueInner;
KNetWindowed<TKey> _key = null;
Expand Down
2 changes: 1 addition & 1 deletion src/net/KNet/Specific/Streams/KNetWindowedKeyValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace MASES.KNet.Streams
/// </summary>
/// <typeparam name="TKey">The key type</typeparam>
/// <typeparam name="TValue">The value type</typeparam>
public class KNetWindowedKeyValue<TKey, TValue> : IGenericSerDesFactoryApplier
public sealed class KNetWindowedKeyValue<TKey, TValue> : IGenericSerDesFactoryApplier
{
readonly Org.Apache.Kafka.Streams.KeyValue<Org.Apache.Kafka.Streams.Kstream.Windowed<byte[]>, byte[]> _valueInner;
KNetWindowed<TKey> _key = null;
Expand Down
16 changes: 8 additions & 8 deletions src/net/KNet/Specific/Streams/State/KNetKeyValueIterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ namespace MASES.KNet.Streams.State
public sealed class KNetKeyValueIterator<TKey, TValue> : CommonIterator<KNetKeyValue<TKey, TValue>>
{
#if NET7_0_OR_GREATER
class PrefetchableLocalEnumerator(bool isVersion2,
IGenericSerDesFactory factory,
IJavaObject obj,
IKNetSerDes<TKey> keySerDes,
IKNetSerDes<TValue> valueSerDes,
bool isAsync, CancellationToken token = default)
sealed class PrefetchableLocalEnumerator(bool isVersion2,
IGenericSerDesFactory factory,
IJavaObject obj,
IKNetSerDes<TKey> keySerDes,
IKNetSerDes<TValue> valueSerDes,
bool isAsync, CancellationToken token = default)
: JVMBridgeBasePrefetchableEnumerator<KNetKeyValue<TKey, TValue>>(obj, new PrefetchableEnumeratorSettings()),
IGenericSerDesFactoryApplier,
IAsyncEnumerator<KNetKeyValue<TKey, TValue>>
Expand Down Expand Up @@ -81,7 +81,7 @@ public ValueTask DisposeAsync()
}
}
#endif
class StandardLocalEnumerator : JVMBridgeBaseEnumerator<KNetKeyValue<TKey, TValue>>, IGenericSerDesFactoryApplier, IAsyncEnumerator<KNetKeyValue<TKey, TValue>>
sealed class StandardLocalEnumerator : JVMBridgeBaseEnumerator<KNetKeyValue<TKey, TValue>>, IGenericSerDesFactoryApplier, IAsyncEnumerator<KNetKeyValue<TKey, TValue>>
{
readonly IKNetSerDes<TKey> _keySerDes = null;
readonly IKNetSerDes<TValue> _valueSerDes = null;
Expand Down Expand Up @@ -151,7 +151,7 @@ internal KNetKeyValueIterator(IGenericSerDesFactory factory, Org.Apache.Kafka.St
_iterator2 = iterator;
}
/// <inheritdoc/>
protected override object GetEnumerator(bool isAsync, CancellationToken cancellationToken = default)
protected sealed override object GetEnumerator(bool isAsync, CancellationToken cancellationToken = default)
{
_keySerDes ??= _factory.BuildKeySerDes<TKey>();
_valueSerDes ??= _factory.BuildValueSerDes<TValue>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ namespace MASES.KNet.Streams.State
/// </summary>
/// <typeparam name="TKey">The key type</typeparam>
/// <typeparam name="TValue">The value type</typeparam>
public class KNetTimestampedKeyValueIterator<TKey, TValue> : CommonIterator<KNetTimestampedKeyValue<TKey, TValue>>
public sealed class KNetTimestampedKeyValueIterator<TKey, TValue> : CommonIterator<KNetTimestampedKeyValue<TKey, TValue>>
{
#if NET7_0_OR_GREATER
class PrefetchableLocalEnumerator(bool isVersion2,
IGenericSerDesFactory factory,
IJavaObject obj,
IKNetSerDes<TKey> keySerDes,
bool isAsync, CancellationToken token = default)
sealed class PrefetchableLocalEnumerator(bool isVersion2,
IGenericSerDesFactory factory,
IJavaObject obj,
IKNetSerDes<TKey> keySerDes,
bool isAsync, CancellationToken token = default)
: JVMBridgeBasePrefetchableEnumerator<KNetTimestampedKeyValue<TKey, TValue>>(obj, new PrefetchableEnumeratorSettings()),
IGenericSerDesFactoryApplier,
IAsyncEnumerator<KNetTimestampedKeyValue<TKey, TValue>>
Expand Down Expand Up @@ -79,7 +79,7 @@ public ValueTask DisposeAsync()
}
}
#endif
class StandardLocalEnumerator : JVMBridgeBaseEnumerator<KNetTimestampedKeyValue<TKey, TValue>>, IGenericSerDesFactoryApplier, IAsyncEnumerator<KNetTimestampedKeyValue<TKey, TValue>>
sealed class StandardLocalEnumerator : JVMBridgeBaseEnumerator<KNetTimestampedKeyValue<TKey, TValue>>, IGenericSerDesFactoryApplier, IAsyncEnumerator<KNetTimestampedKeyValue<TKey, TValue>>
{
IKNetSerDes<TKey> _keySerDes = null;
readonly bool _isVersion2;
Expand Down Expand Up @@ -142,7 +142,7 @@ internal KNetTimestampedKeyValueIterator(IGenericSerDesFactory factory, Org.Apac
}

/// <inheritdoc/>
protected override object GetEnumerator(bool isAsync, CancellationToken cancellationToken = default)
protected sealed override object GetEnumerator(bool isAsync, CancellationToken cancellationToken = default)
{
_keySerDes ??= _factory.BuildKeySerDes<TKey>();
#if NET7_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace MASES.KNet.Streams.State
/// KNet implementation of <see cref="Org.Apache.Kafka.Streams.State.WindowStoreIterator"/>
/// </summary>
/// <typeparam name="TValue">The value type</typeparam>
public class KNetTimestampedWindowStoreIterator<TValue> : IGenericSerDesFactoryApplier
public sealed class KNetTimestampedWindowStoreIterator<TValue> : IGenericSerDesFactoryApplier
{
readonly Org.Apache.Kafka.Streams.State.WindowStoreIterator<Org.Apache.Kafka.Streams.State.ValueAndTimestamp<byte[]>> _iterator;
IGenericSerDesFactory _factory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ namespace MASES.KNet.Streams.State
/// </summary>
/// <typeparam name="TKey">The key type</typeparam>
/// <typeparam name="TValue">The value type</typeparam>
public class KNetTimestampedWindowedKeyValueIterator<TKey, TValue> : CommonIterator<KNetTimestampedWindowedKeyValue<TKey, TValue>>
public sealed class KNetTimestampedWindowedKeyValueIterator<TKey, TValue> : CommonIterator<KNetTimestampedWindowedKeyValue<TKey, TValue>>
{
#if NET7_0_OR_GREATER
class PrefetchableLocalEnumerator(IGenericSerDesFactory factory,
IJavaObject obj,
bool isAsync, CancellationToken token = default)
sealed class PrefetchableLocalEnumerator(IGenericSerDesFactory factory,
IJavaObject obj,
bool isAsync, CancellationToken token = default)
: JVMBridgeBasePrefetchableEnumerator<KNetTimestampedWindowedKeyValue<TKey, TValue>>(obj, new PrefetchableEnumeratorSettings()),
IGenericSerDesFactoryApplier,
IAsyncEnumerator<KNetTimestampedWindowedKeyValue<TKey, TValue>>
Expand Down Expand Up @@ -74,7 +74,7 @@ public ValueTask DisposeAsync()
}
#endif

class StandardLocalEnumerator : JVMBridgeBaseEnumerator<KNetTimestampedWindowedKeyValue<TKey, TValue>>, IGenericSerDesFactoryApplier, IAsyncEnumerator<KNetTimestampedWindowedKeyValue<TKey, TValue>>
sealed class StandardLocalEnumerator : JVMBridgeBaseEnumerator<KNetTimestampedWindowedKeyValue<TKey, TValue>>, IGenericSerDesFactoryApplier, IAsyncEnumerator<KNetTimestampedWindowedKeyValue<TKey, TValue>>
{
IGenericSerDesFactory _factory;
IGenericSerDesFactory IGenericSerDesFactoryApplier.Factory { get => _factory; set { _factory = value; } }
Expand Down Expand Up @@ -116,7 +116,7 @@ internal KNetTimestampedWindowedKeyValueIterator(IGenericSerDesFactory factory,
}

/// <inheritdoc/>
protected override object GetEnumerator(bool isAsync, CancellationToken cancellationToken = default)
protected sealed override object GetEnumerator(bool isAsync, CancellationToken cancellationToken = default)
{
#if NET7_0_OR_GREATER
if (UsePrefetch)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ namespace MASES.KNet.Streams.State
/// </summary>
/// <typeparam name="TKey">The key type</typeparam>
/// <typeparam name="TValue">The value type</typeparam>
public class KNetWindowedKeyValueIterator<TKey, TValue> : CommonIterator<KNetWindowedKeyValue<TKey, TValue>>
public sealed class KNetWindowedKeyValueIterator<TKey, TValue> : CommonIterator<KNetWindowedKeyValue<TKey, TValue>>
{
#if NET7_0_OR_GREATER
class PrefetchableLocalEnumerator(IGenericSerDesFactory factory,
IJavaObject obj,
IKNetSerDes<TValue> valueSerDes,
bool isAsync, CancellationToken token = default)
sealed class PrefetchableLocalEnumerator(IGenericSerDesFactory factory,
IJavaObject obj,
IKNetSerDes<TValue> valueSerDes,
bool isAsync, CancellationToken token = default)
: JVMBridgeBasePrefetchableEnumerator<KNetWindowedKeyValue<TKey, TValue>>(obj, new PrefetchableEnumeratorSettings()),
IGenericSerDesFactoryApplier,
IAsyncEnumerator<KNetWindowedKeyValue<TKey, TValue>>
Expand Down Expand Up @@ -76,7 +76,7 @@ public ValueTask DisposeAsync()
}
}
#endif
class StandardLocalEnumerator : JVMBridgeBaseEnumerator<KNetWindowedKeyValue<TKey, TValue>>, IGenericSerDesFactoryApplier, IAsyncEnumerator<KNetWindowedKeyValue<TKey, TValue>>
sealed class StandardLocalEnumerator : JVMBridgeBaseEnumerator<KNetWindowedKeyValue<TKey, TValue>>, IGenericSerDesFactoryApplier, IAsyncEnumerator<KNetWindowedKeyValue<TKey, TValue>>
{
IKNetSerDes<TValue> _valueSerDes = null;
IGenericSerDesFactory _factory;
Expand Down Expand Up @@ -126,7 +126,7 @@ internal KNetWindowedKeyValueIterator(IGenericSerDesFactory factory, Org.Apache.
}

/// <inheritdoc/>
protected override object GetEnumerator(bool isAsync, CancellationToken cancellationToken = default)
protected sealed override object GetEnumerator(bool isAsync, CancellationToken cancellationToken = default)
{
_valueSerDes ??= _factory.BuildValueSerDes<TValue>();
#if NET7_0_OR_GREATER
Expand Down