Exemplo n.º 1
0
        public RavenConfiguration Initialize()
        {
            Http.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Testing.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Server.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Core.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Replication.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Cluster.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Etl.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Queries.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Patching.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Logs.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Memory.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Storage.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Security.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Indexing.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Monitoring.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Studio.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Databases.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            PerformanceHints.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Licensing.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Tombstones.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);
            Subscriptions.Initialize(Settings, ServerWideSettings, ResourceType, ResourceName);

            PostInit();

            Initialized = true;

            return(this);
        }
Exemplo n.º 2
0
        public RavenConfiguration Initialize()
        {
            Core.Initialize(Settings);
            Replication.Initialize(Settings);
            SqlReplication.Initialize(Settings);
            Queries.Initialize(Settings);
            Patching.Initialize(Settings);
            DebugLog.Initialize(Settings);
            BulkInsert.Initialize(Settings);
            Server.Initialize(Settings);
            Memory.Initialize(Settings);
            Storage.Initialize(Settings);
            Encryption.Initialize(Settings);
            Indexing.Initialize(Settings);
            Monitoring.Initialize(Settings);
            Expiration.Initialize(Settings);
            Studio.Initialize(Settings);
            Databases.Initialize(Settings);
            Licensing.Initialize(Settings);
            Quotas.Initialize(Settings);
            Tombstones.Initialize(Settings);

            PostInit();

            Initialized = true;

            return(this);
        }
Exemplo n.º 3
0
        Task <NormalResult> ContinueExcutePlan(XmlDocument task_dom,
                                               CancellationToken token)
        {
            return(Task <NormalResult> .Run(() =>
            {
                Replication replication = new Replication();
                LibraryChannel channel = this.GetChannel();
                try
                {
                    int nRet = replication.Initialize(channel,
                                                      out string strError);
                    if (nRet == -1)
                    {
                        return new NormalResult
                        {
                            Value = -1,
                            ErrorInfo = strError
                        }
                    }
                    ;

                    DatabaseConfig.ServerName = "localhost";
                    DatabaseConfig.DatabaseName = "testrep";
                    DatabaseConfig.UserName = "******";
                    DatabaseConfig.Password = "******";

                    nRet = replication.RunFirstPlan(
                        channel,
                        ref task_dom,
                        (message) =>
                    {
                        OutputHistory(message);
                    },
                        token,
                        out strError);
                    if (nRet == -1)
                    {
                        return new NormalResult
                        {
                            Value = -1,
                            ErrorInfo = strError
                        }
                    }
                    ;

                    return new NormalResult();
                }
                finally
                {
                    this.ReturnChannel(channel);
                }
            }));
        }
Exemplo n.º 4
0
        public RavenConfiguration Initialize()
        {
            Core.Initialize(Settings);
            Replication.Initialize(Settings);
            Queries.Initialize(Settings);
            Patching.Initialize(Settings);
            BulkInsert.Initialize(Settings);
            Server.Initialize(Settings);
            Memory.Initialize(Settings);
            Indexing.Initialize(Settings);
            Prefetcher.Initialize(Settings);
            Storage.Initialize(Settings);
            Encryption.Initialize(Settings);
            Cluster.Initialize(Settings);
            Monitoring.Initialize(Settings);
            FileSystem.Initialize(Settings);
            Counter.Initialize(Settings);
            TimeSeries.Initialize(Settings);
            Expiration.Initialize(Settings);
            Versioning.Initialize(Settings);
            Studio.Initialize(Settings);
            Tenants.Initialize(Settings);
            Licensing.Initialize(Settings);
            Quotas.Initialize(Settings);

            if (Settings["Raven/MaxServicePointIdleTime"] != null)
            {
                ServicePointManager.MaxServicePointIdleTime = Convert.ToInt32(Settings["Raven/MaxServicePointIdleTime"]);
            }

            if (ConcurrentMultiGetRequests == null)
            {
                ConcurrentMultiGetRequests = new SemaphoreSlim(Server.MaxConcurrentMultiGetRequests);
            }

            PostInit();

            initialized = true;

            return(this);
        }
Exemplo n.º 5
0
        public RavenConfiguration Initialize()
        {
            var settingsNames           = Settings.AsEnumerable().Select(pair => pair.Key).ToHashSet(StringComparer.OrdinalIgnoreCase);
            var serverWideSettingsNames = ServerWideSettings?.AsEnumerable().Select(pair => pair.Key).ToHashSet(StringComparer.OrdinalIgnoreCase);

            Http.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Embedded.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Server.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Core.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Replication.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Cluster.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Etl.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Queries.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Patching.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Logs.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Memory.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Storage.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Security.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Backup.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Indexing.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Monitoring.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Studio.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Databases.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            PerformanceHints.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Licensing.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Tombstones.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Subscriptions.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            TransactionMergerConfiguration.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Notifications.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Updates.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Migration.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);
            Integrations.Initialize(Settings, settingsNames, ServerWideSettings, serverWideSettingsNames, ResourceType, ResourceName);

            PostInit();

            Initialized = true;

            return(this);
        }
Exemplo n.º 6
0
        Task <NormalResult> TestLogReplication(CancellationToken token)
        {
            return(Task <NormalResult> .Run(() =>
            {
                Replication replication = new Replication();
                LibraryChannel channel = this.GetChannel();
                try
                {
                    int nRet = replication.Initialize(channel,
                                                      out string strError);
                    if (nRet == -1)
                    {
                        return new NormalResult
                        {
                            Value = -1,
                            ErrorInfo = strError
                        }
                    }
                    ;

                    DatabaseConfig.ServerName = "localhost";
                    DatabaseConfig.DatabaseName = "testrep";
                    DatabaseConfig.UserName = "******";
                    DatabaseConfig.Password = "******";

                    var context = new LibraryContext();
                    try
                    {
                        nRet = replication.DoCreateOperLogTable(
                            ref context,
                            channel,
                            -1,
                            "19990101",
                            "20201231",
                            LogType.OperLog,
                            true,
                            (message) =>
                        {
                            OutputHistory(message);
                        },
                            token,
                            out string strLastDate,
                            out long last_index,
                            out strError);

                        /*
                         * nRet = replication.DoReplication(
                         *  ref context,
                         *  channel,
                         *  "19990101",
                         *  "20201231",
                         *  LogType.OperLog,
                         *  (message) =>
                         *  {
                         *      OutputHistory(message);
                         *  },
                         *  token,
                         *  out string strLastDate,
                         *  out long last_index,
                         *  out strError);
                         */
                        if (nRet == -1)
                        {
                            return new NormalResult
                            {
                                Value = -1,
                                ErrorInfo = strError
                            }
                        }
                        ;

                        return new NormalResult();
                    }
                    finally
                    {
                        if (context != null)
                        {
                            context.Dispose();
                        }
                    }
                }
                finally
                {
                    this.ReturnChannel(channel);
                }
            }));
        }