コード例 #1
0
        protected virtual IEventRepository CreateBoxEventRepository(Func <EventId, object, string> calculateShard)
        {
            var serializer        = new Serializer(new AllPropertiesExtractor());
            var cassandraCluster  = new CassandraCluster(cassandraClusterSettings, Logger.Instance);
            var eventTypeRegistry = new EventTypeRegistry();

            var factory = new EventRepositoryFactory(serializer, cassandraCluster, eventTypeRegistry, Logger.Instance);
            var eventRepositoryColumnFamilyFullNames = new EventRepositoryColumnFamilyFullNames(
                ColumnFamilies.eventLog,
                ColumnFamilies.eventLogAdditionalInfo,
                ColumnFamilies.remoteLock);
            var shardCalculator = new ShardCalculator(calculateShard);
            var eventRepository = factory.CreateEventRepository(shardCalculator, eventRepositoryColumnFamilyFullNames, new EventLogNullProfiler(), TimeSpan.FromDays(1));

            return(eventRepository);
        }
コード例 #2
0
        private IEventRepository CreateBoxEventRepository(Func <EventId, object, string> calculateShard, double timeoutInSeconds)
        {
            var serializer        = new Serializer(new AllPropertiesExtractor());
            var cassandraSettings = SingleCassandraNodeSetUpFixture.Node.CreateSettings();
            var cassandraCluster  = new CatalogueCassandraClusterWithLongWrites(new CassandraCluster(cassandraSettings, Logger.Instance), TimeSpan.FromSeconds(timeoutInSeconds));
            var eventTypeRegistry = new EventTypeRegistry();

            var factory = new EventRepositoryFactory(serializer, cassandraCluster, eventTypeRegistry, Logger.Instance);
            var eventRepositoryColumnFamilyFullNames = new EventRepositoryColumnFamilyFullNames(
                ColumnFamilies.eventLog,
                ColumnFamilies.eventLogAdditionalInfo,
                ColumnFamilies.remoteLock);
            var shardCalculator = new ShardCalculator(calculateShard);
            var result          = factory.CreateEventRepository(shardCalculator, eventRepositoryColumnFamilyFullNames, new EventLogNullProfiler(), TimeSpan.FromDays(1));

            return(result);
        }