Exemple #1
0
        public void Start()
        {
            if (EmbeddedEventStoreConfiguration.RunWithLogging)
            {
                if (!Directory.Exists(EmbeddedEventStoreConfiguration.LogPath))
                {
                    Directory.CreateDirectory(EmbeddedEventStoreConfiguration.LogPath);
                }
                LogManager.Init(string.Format("as-embed-es-{0}", DateTime.Now.Ticks), EmbeddedEventStoreConfiguration.LogPath);
            }

            var db       = CreateTFChunkDb(EmbeddedEventStoreConfiguration.StoragePath);
            var settings = CreateSingleVNodeSettings();

            _node = new SingleVNode(db, settings, false, 0xf4240, new ISubsystem[0]);
            var waitHandle = new ManualResetEvent(false);

            _node.MainBus.Subscribe(new AdHocHandler <SystemMessage.BecomeMaster>(m => waitHandle.Set()));
            _node.Start();
            waitHandle.WaitOne();
            _credentials = new UserCredentials("admin", "changeit");
            _connection  = EventStoreConnection.Create(
                ConnectionSettings.Create().
                EnableVerboseLogging().
                SetDefaultUserCredentials(_credentials).
                UseConsoleLogger(),
                TcpEndPoint);
            _connection.Connect();
        }
Exemple #2
0
        protected override void Start()
        {
            _node.Start();

            if (_projections != null)
            {
                _projections.Start();
            }
        }
Exemple #3
0
        protected override void Start()
        {
            Node.Start();

            if (!_noProjections)
            {
                _projections.Start();
            }
        }
        protected virtual void SetUp()
        {
            var dbPath = Path.Combine(Path.GetTempPath(), "EventStoreTests", Guid.NewGuid().ToString());

            Directory.CreateDirectory(dbPath);

            var chunkSize     = 256 * 1024 * 1024;
            var chunksToCache = 2;


            if (Runtime.IsMono)
            {
                _writerChk = new FileCheckpoint(Path.Combine(dbPath, Checkpoint.Writer + ".chk"), Checkpoint.Writer, cached: true);
                _chaserChk = new FileCheckpoint(Path.Combine(dbPath, Checkpoint.Chaser + ".chk"), Checkpoint.Chaser, cached: true);
            }
            else
            {
                _writerChk = new MemoryMappedFileCheckpoint(Path.Combine(dbPath, Checkpoint.Writer + ".chk"), Checkpoint.Writer, cached: true);
                _chaserChk = new MemoryMappedFileCheckpoint(Path.Combine(dbPath, Checkpoint.Chaser + ".chk"), Checkpoint.Chaser, cached: true);
            }

            var nodeConfig = new TFChunkDbConfig(dbPath,
                                                 new VersionedPatternFileNamingStrategy(dbPath, "chunk-"),
                                                 chunkSize,
                                                 chunksToCache,
                                                 _writerChk,
                                                 new[] { _chaserChk });

            var settings = new SingleVNodeSettings(new IPEndPoint(IPAddress.Loopback, 1111),
                                                   new IPEndPoint(IPAddress.Loopback, 2111),
                                                   new[] { new IPEndPoint(IPAddress.Loopback, 2111).ToHttpUrl() });
            var appsets = new SingleVNodeAppSettings(TimeSpan.FromDays(1));

            _db = new TFChunkDb(nodeConfig);

            _vNode = new SingleVNode(_db, settings, appsets);


            var startCallback = new EnvelopeCallback <SystemMessage.SystemStart>();

            _vNode.Bus.Subscribe <SystemMessage.SystemStart>(startCallback);

            _vNode.Start();
            startCallback.Wait();
        }
Exemple #5
0
        public void Start()
        {
            StartingTime.Start();

            var startedEvent = new ManualResetEventSlim(false);

            Node.MainBus.Subscribe(
                new AdHocHandler <UserManagementMessage.UserManagementServiceInitialized>(m => startedEvent.Set()));

            Node.Start();

            if (!startedEvent.Wait(60000))
            {
                throw new TimeoutException("MiniNode haven't started in 60 seconds.");
            }

            StartingTime.Stop();
        }
        protected virtual void SetUp()
        {
            var dbPath = Path.Combine(Path.GetTempPath(), "EventStoreTests", Guid.NewGuid().ToString());

            Directory.CreateDirectory(dbPath);

            var chunkSize = 256*1024*1024;
            var chunksToCache = 2;

            if (Runtime.IsMono)
            {
                _writerChk = new FileCheckpoint(Path.Combine(dbPath, Checkpoint.Writer + ".chk"), Checkpoint.Writer, cached: true);
                _chaserChk = new FileCheckpoint(Path.Combine(dbPath, Checkpoint.Chaser + ".chk"), Checkpoint.Chaser, cached: true);
            }
            else
            {
                _writerChk = new MemoryMappedFileCheckpoint(Path.Combine(dbPath, Checkpoint.Writer + ".chk"), Checkpoint.Writer, cached: true);
                _chaserChk = new MemoryMappedFileCheckpoint(Path.Combine(dbPath, Checkpoint.Chaser + ".chk"), Checkpoint.Chaser, cached: true);
            }

            var nodeConfig = new TFChunkDbConfig(dbPath,
                                                 new VersionedPatternFileNamingStrategy(dbPath, "chunk-"),
                                                 chunkSize,
                                                 chunksToCache,
                                                 _writerChk,
                                                 new[] {_chaserChk});

            var settings = new SingleVNodeSettings(new IPEndPoint(IPAddress.Loopback, 1111),
                                                   new IPEndPoint(IPAddress.Loopback, 2111),
                                                   new[] {new IPEndPoint(IPAddress.Loopback, 2111).ToHttpUrl()});
            var appsets = new SingleVNodeAppSettings(TimeSpan.FromDays(1));
            _db = new TFChunkDb(nodeConfig);

            _vNode = new SingleVNode(_db, settings, appsets);

            var startCallback = new EnvelopeCallback<SystemMessage.SystemStart>();
            _vNode.Bus.Subscribe<SystemMessage.SystemStart>(startCallback);

            _vNode.Start();
            startCallback.Wait();
        }
Exemple #7
0
 public void Start()
 {
     _node.Start();
     Thread.Sleep(2000);
 }
Exemple #8
0
 protected override void Start()
 {
     Node.Start();
 }
Exemple #9
0
        protected override void Start()
        {
            _node.Start();

            _node.HttpService.SetupController(new TestController(_node.MainQueue /*, _node.NetworkSendService*/));
        }