Esempio n. 1
0
 public void SetUp()
 {
     _tempFolder = PathUtils.GetTempDirectoryName();
 }
 /// <summary>
 /// Gets the custom configuration.
 /// </summary>
 private static IgniteConfiguration GetCustomConfig()
 {
     // CacheConfiguration is not tested here - see CacheConfigurationTest
     return(new IgniteConfiguration(TestUtils.GetTestConfiguration())
     {
         DiscoverySpi = new TcpDiscoverySpi
         {
             NetworkTimeout = TimeSpan.FromSeconds(1),
             AckTimeout = TimeSpan.FromSeconds(2),
             MaxAckTimeout = TimeSpan.FromSeconds(3),
             SocketTimeout = TimeSpan.FromSeconds(4),
             JoinTimeout = TimeSpan.FromSeconds(5),
             IpFinder = new TcpDiscoveryStaticIpFinder
             {
                 Endpoints = new[] { "127.0.0.1:47503", "127.0.0.1:47504" }
             },
             ClientReconnectDisabled = true,
             ForceServerMode = true,
             IpFinderCleanFrequency = TimeSpan.FromMinutes(7),
             LocalAddress = "127.0.0.1",
             LocalPort = 47503,
             LocalPortRange = 13,
             ReconnectCount = 11,
             StatisticsPrintFrequency = TimeSpan.FromSeconds(20),
             ThreadPriority = 6,
             TopologyHistorySize = 1234567
         },
         EncryptionSpi = new KeystoreEncryptionSpi
         {
             KeySize = 192,
             KeyStorePassword = "******",
             KeyStorePath = "tde.jks",
             MasterKeyName = KeystoreEncryptionSpi.DefaultMasterKeyName
         },
         IgniteInstanceName = "gridName1",
         IgniteHome = IgniteHome.Resolve(),
         IncludedEventTypes = EventType.DiscoveryAll,
         MetricsExpireTime = TimeSpan.FromMinutes(7),
         MetricsHistorySize = 125,
         MetricsLogFrequency = TimeSpan.FromMinutes(8),
         MetricsUpdateFrequency = TimeSpan.FromMinutes(9),
         NetworkSendRetryCount = 54,
         NetworkTimeout = TimeSpan.FromMinutes(10),
         NetworkSendRetryDelay = TimeSpan.FromMinutes(11),
         WorkDirectory = Path.GetTempPath(),
         Localhost = "127.0.0.1",
         IsDaemon = false,
         IsLateAffinityAssignment = false,
         UserAttributes = Enumerable.Range(1, 10).ToDictionary(x => x.ToString(), x => (object)x),
         AtomicConfiguration = new AtomicConfiguration
         {
             CacheMode = CacheMode.Replicated,
             Backups = 2,
             AtomicSequenceReserveSize = 200
         },
         TransactionConfiguration = new TransactionConfiguration
         {
             DefaultTransactionConcurrency = TransactionConcurrency.Optimistic,
             DefaultTimeout = TimeSpan.FromSeconds(25),
             DefaultTransactionIsolation = TransactionIsolation.Serializable,
             PessimisticTransactionLogLinger = TimeSpan.FromHours(1),
             PessimisticTransactionLogSize = 240,
             DefaultTimeoutOnPartitionMapExchange = TimeSpan.FromSeconds(25)
         },
         CommunicationSpi = new TcpCommunicationSpi
         {
             LocalPort = 47501,
             MaxConnectTimeout = TimeSpan.FromSeconds(34),
             MessageQueueLimit = 15,
             ConnectTimeout = TimeSpan.FromSeconds(17),
             IdleConnectionTimeout = TimeSpan.FromSeconds(19),
             SelectorsCount = 8,
             ReconnectCount = 33,
             SocketReceiveBufferSize = 512,
             AckSendThreshold = 99,
             DirectBuffer = false,
             DirectSendBuffer = true,
             LocalPortRange = 45,
             LocalAddress = "127.0.0.1",
             TcpNoDelay = false,
             SlowClientQueueLimit = 98,
             SocketSendBufferSize = 2045,
             UnacknowledgedMessagesBufferSize = 3450,
             ConnectionsPerNode = 12,
             UsePairedConnections = true,
             SharedMemoryPort = 1234,
             SocketWriteTimeout = 2222,
             SelectorSpins = 12,
             FilterReachableAddresses = true
         },
         FailureDetectionTimeout = TimeSpan.FromSeconds(3.5),
         SystemWorkerBlockedTimeout = TimeSpan.FromSeconds(8.5),
         ClientFailureDetectionTimeout = TimeSpan.FromMinutes(12.3),
         LongQueryWarningTimeout = TimeSpan.FromMinutes(1.23),
         IsActiveOnStart = true,
         BinaryConfiguration = new BinaryConfiguration
         {
             CompactFooter = false,
             TypeConfigurations = new[]
             {
                 new BinaryTypeConfiguration
                 {
                     TypeName = "myType",
                     IsEnum = true,
                     AffinityKeyFieldName = "affKey",
                     KeepDeserialized = false
                 }
             }
         },
         // Skip cache check because with persistence the grid is not active by default.
         PluginConfigurations = new[] { new TestIgnitePluginConfiguration {
                                            SkipCacheCheck = true
                                        } },
         EventStorageSpi = new MemoryEventStorageSpi
         {
             ExpirationTimeout = TimeSpan.FromSeconds(5),
             MaxEventCount = 10
         },
         PublicThreadPoolSize = 3,
         StripedThreadPoolSize = 5,
         ServiceThreadPoolSize = 6,
         SystemThreadPoolSize = 7,
         AsyncCallbackThreadPoolSize = 8,
         ManagementThreadPoolSize = 9,
         DataStreamerThreadPoolSize = 10,
         UtilityCacheThreadPoolSize = 11,
         QueryThreadPoolSize = 12,
         SqlConnectorConfiguration = new SqlConnectorConfiguration
         {
             Host = "127.0.0.2",
             Port = 1081,
             PortRange = 3,
             SocketReceiveBufferSize = 2048,
             MaxOpenCursorsPerConnection = 5,
             ThreadPoolSize = 4,
             TcpNoDelay = false,
             SocketSendBufferSize = 4096
         },
         ConsistentId = new MyConsistentId {
             Data = "abc"
         },
         DataStorageConfiguration = new DataStorageConfiguration
         {
             AlwaysWriteFullPages = true,
             CheckpointFrequency = TimeSpan.FromSeconds(25),
             CheckpointThreads = 2,
             LockWaitTime = TimeSpan.FromSeconds(5),
             StoragePath = Path.GetTempPath(),
             WalThreadLocalBufferSize = 64 * 1024,
             WalArchivePath = Path.GetTempPath(),
             WalFlushFrequency = TimeSpan.FromSeconds(3),
             WalFsyncDelayNanos = 3,
             WalHistorySize = 10,
             WalMode = Configuration.WalMode.LogOnly,
             WalRecordIteratorBufferSize = 32 * 1024 * 1024,
             WalSegments = 6,
             WalSegmentSize = 5 * 1024 * 1024,
             WalPath = Path.GetTempPath(),
             MetricsEnabled = true,
             MetricsSubIntervalCount = 7,
             MetricsRateTimeInterval = TimeSpan.FromSeconds(9),
             CheckpointWriteOrder = Configuration.CheckpointWriteOrder.Random,
             WriteThrottlingEnabled = true,
             SystemRegionInitialSize = 64 * 1024 * 1024,
             SystemRegionMaxSize = 128 * 1024 * 1024,
             ConcurrencyLevel = 1,
             PageSize = 8 * 1024,
             WalAutoArchiveAfterInactivity = TimeSpan.FromMinutes(5),
             CheckpointReadLockTimeout = TimeSpan.FromSeconds(9.5),
             DefaultDataRegionConfiguration = new DataRegionConfiguration
             {
                 Name = "reg1",
                 EmptyPagesPoolSize = 50,
                 EvictionThreshold = 0.8,
                 InitialSize = 100 * 1024 * 1024,
                 MaxSize = 150 * 1024 * 1024,
                 MetricsEnabled = true,
                 PageEvictionMode = Configuration.DataPageEvictionMode.Random2Lru,
                 PersistenceEnabled = false,
                 MetricsRateTimeInterval = TimeSpan.FromMinutes(2),
                 MetricsSubIntervalCount = 6,
                 SwapPath = PathUtils.GetTempDirectoryName(),
                 CheckpointPageBufferSize = 28 * 1024 * 1024
             },
             DataRegionConfigurations = new[]
             {
                 new DataRegionConfiguration
                 {
                     Name = "reg2",
                     EmptyPagesPoolSize = 51,
                     EvictionThreshold = 0.7,
                     InitialSize = 101 * 1024 * 1024,
                     MaxSize = 151 * 1024 * 1024,
                     MetricsEnabled = false,
                     PageEvictionMode = Configuration.DataPageEvictionMode.RandomLru,
                     PersistenceEnabled = false,
                     MetricsRateTimeInterval = TimeSpan.FromMinutes(3),
                     MetricsSubIntervalCount = 7,
                     SwapPath = PathUtils.GetTempDirectoryName()
                 }
             }
         },
         AuthenticationEnabled = false,
         MvccVacuumFrequency = 20000,
         MvccVacuumThreadCount = 8,
         SqlQueryHistorySize = 99,
         SqlSchemas = new List <string> {
             "SCHEMA_3", "schema_4"
         },
         ExecutorConfiguration = new[]
         {
             new ExecutorConfiguration
             {
                 Name = "ex-1",
                 Size = 11
             }
         }
     });
 }