Ejemplo n.º 1
0
        public void Should_return_null_when_no_replicas_exist()
        {
            var store = new RavenStore("Foo");

            Assert.IsNull(store.GetClosestReplica("foo123"));
            Assert.IsNull(store.GetClosestReplica("bar456", true));
        }
Ejemplo n.º 2
0
        private RavenStore GetStore()
        {
            var store = new RavenStore("Foo");
            store.Servers.Add(new RavenServer("dc1raven01", false, true));
            store.Servers.Add(new RavenServer("dc1raven02", true, false));
            store.Servers.Add(new RavenServer("dc1raven03", true, false));
            store.Servers.Add(new RavenServer("dc1raven04", true, true));

            store.Servers.Add(new RavenServer("dc2ravenXX", true, true));
            store.Servers.Add(new RavenServer("dc2raven01", true, true));
            store.Servers.Add(new RavenServer("dc2raven02", true, true));
            store.Servers.Add(new RavenServer("dc2raven03", true, true));
            return store;
        }
Ejemplo n.º 3
0
        private static IEnumerable<string> GetIndexNames(RavenServer server, RavenStore store)
        {
            try
            {
                var documentStore = GetTenantDocumentStore(server.Name, store.Name);

                var indexNames = documentStore.DatabaseCommands.GetIndexNames(0, 255);

                return indexNames;
            }
            catch (Exception)
            {
                // Currently we provide no feedback in this context if the GetIndexNames command fails
                // e.g. when the server is not available
                return Enumerable.Empty<string>();
            }
        }