public StoreBuilder <TimestampedKeyValueStore <K, V> > Materialize()
        {
            KeyValueBytesStoreSupplier supplier = (KeyValueBytesStoreSupplier)materialized.StoreSupplier;

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

            StoreBuilder <TimestampedKeyValueStore <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);
        }
Esempio n. 2
0
        public StoreBuilder <ITimestampedKeyValueStore <K, V> > Materialize()
        {
            KeyValueBytesStoreSupplier supplier = (KeyValueBytesStoreSupplier)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);
        }
Esempio n. 3
0
        /// <summary>
        /// Materialize a <see cref="IKeyValueStore{K, V}"/> using the provided <see cref="KeyValueBytesStoreSupplier"/>
        /// </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="KeyValueBytesStoreSupplier"/> 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>(KeyValueBytesStoreSupplier 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);
        }
Esempio n. 4
0
        /// <summary>
        /// Materialize a <see cref="IKeyValueStore{K, V}"/> using the provided <see cref="KeyValueBytesStoreSupplier"/>
        /// </summary>
        /// <param name="supplier">the <see cref="KeyValueBytesStoreSupplier"/> 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(KeyValueBytesStoreSupplier supplier)
        {
            var m = new Materialized <K, V, IKeyValueStore <Bytes, byte[]> >(supplier);

            return(m);
        }
Esempio n. 5
0
 public static StoreBuilder <TimestampedKeyValueStore <K, V> > TimestampedKeyValueStoreBuilder <K, V>(KeyValueBytesStoreSupplier supplier, ISerDes <K> keySerde, ISerDes <V> valueSerde)
 {
     return(new TimestampedKeyValueStoreBuilder <K, V>(supplier, keySerde, valueSerde));
 }
 public TimestampedKeyValueStoreBuilder(KeyValueBytesStoreSupplier supplier, ISerDes <K> keySerde, ISerDes <V> valueSerde) :
     base(supplier.Name, keySerde, valueSerde != null ? new ValueAndTimestampSerDes <V>(valueSerde) : null)
 {
     storeSupplier = supplier;
 }