public IStoreBuilder <ITimestampedKeyValueStore <K, V> > Materialize()
        {
            IKeyValueBytesStoreSupplier supplier = (IKeyValueBytesStoreSupplier)materialized.StoreSupplier;

            if (supplier == null)
            {
                // TODO : RocksDB
                //supplier = Stores.persistentTimestampedKeyValueStore(name);
                supplier = new InMemoryKeyValueBytesStoreSupplier(materialized.StoreName);
            }

            IStoreBuilder <ITimestampedKeyValueStore <K, V> > builder = Stores.TimestampedKeyValueStoreBuilder(
                supplier,
                materialized.KeySerdes,
                materialized.ValueSerdes);

            if (materialized.LoggingEnabled)
            {
                builder.WithLoggingEnabled(materialized.TopicConfig);
            }
            else
            {
                builder.WithLoggingDisabled();
            }

            if (materialized.CachingEnabled)
            {
                builder.WithCachingEnabled();
            }

            return(builder);
        }
        public StoreBuilder <ITimestampedKeyValueStore <K, V> > Materialize()
        {
            IKeyValueBytesStoreSupplier supplier = (IKeyValueBytesStoreSupplier)materialized.StoreSupplier;

            if (supplier == null)
            {
                supplier = Stores.DefaultKeyValueStore(materialized.StoreName);
            }

            StoreBuilder <ITimestampedKeyValueStore <K, V> > builder = Stores.TimestampedKeyValueStoreBuilder(
                supplier,
                materialized.KeySerdes,
                materialized.ValueSerdes);

            if (materialized.LoggingEnabled)
            {
                builder.WithLoggingEnabled(materialized.TopicConfig);
            }
            else
            {
                builder.WithLoggingDisabled();
            }

            if (materialized.CachingEnabled)
            {
                builder.WithCachingEnabled();
            }

            return(builder);
        }
예제 #3
0
 public TimestampedKeyValueStoreBuilder(IKeyValueBytesStoreSupplier supplier, ISerDes <K> keySerde, ISerDes <V> valueSerde) :
     base(supplier.Name, keySerde, valueSerde != null ? new ValueAndTimestampSerDes <V>(valueSerde) : null)
 {
     storeSupplier = supplier;
 }
예제 #4
0
 public static IStoreBuilder <ITimestampedKeyValueStore <K, V> > TimestampedKeyValueStoreBuilder <K, V>(IKeyValueBytesStoreSupplier supplier, ISerDes <K> keySerde, ISerDes <V> valueSerde)
 {
     return(new TimestampedKeyValueStoreBuilder <K, V>(supplier, keySerde, valueSerde));
 }
예제 #5
0
        /// <summary>
        /// Materialize a <see cref="IKeyValueStore{K, V}"/> using the provided <see cref="IKeyValueBytesStoreSupplier"/>
        /// </summary>
        /// <typeparam name="KS">New serializer for <typeparamref name="K"/> type</typeparam>
        /// <typeparam name="VS">New serializer for <typeparamref name="V"/> type</typeparam>
        /// <param name="supplier">the <see cref="IKeyValueBytesStoreSupplier"/> used to materialize the store</param>
        /// <returns>a new <see cref="Materialized{K, V, S}"/> instance with the given supplier</returns>
        public static Materialized <K, V, IKeyValueStore <Bytes, byte[]> > Create <KS, VS>(IKeyValueBytesStoreSupplier supplier)
            where KS : ISerDes <K>, new()
            where VS : ISerDes <V>, new()
        {
            var m = new Materialized <K, V, IKeyValueStore <Bytes, byte[]> >(supplier)
            {
                KeySerdes   = new KS(),
                ValueSerdes = new VS()
            };

            return(m);
        }
예제 #6
0
        /// <summary>
        /// Materialize a <see cref="IKeyValueStore{K, V}"/> using the provided <see cref="IKeyValueBytesStoreSupplier"/>
        /// </summary>
        /// <param name="supplier">the <see cref="IKeyValueBytesStoreSupplier"/> used to materialize the store</param>
        /// <returns>a new <see cref="Materialized{K, V, S}"/> instance with the given supplier</returns>
        public static Materialized <K, V, IKeyValueStore <Bytes, byte[]> > Create(IKeyValueBytesStoreSupplier supplier)
        {
            var m = new Materialized <K, V, IKeyValueStore <Bytes, byte[]> >(supplier);

            return(m);
        }
예제 #7
0
 internal static StoreBuilder <ITimestampedKeyValueStore <K, V> > TimestampedKeyValueStoreBuilder <K, V>(IKeyValueBytesStoreSupplier supplier, ISerDes <K> keySerde, ISerDes <V> valueSerde)
 => new TimestampedKeyValueStoreBuilder <K, V>(supplier, keySerde, valueSerde);