-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
IgniteConfiguration.java
3153 lines (2715 loc) · 103 KB
/
IgniteConfiguration.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ignite.configuration;
import java.io.Serializable;
import java.lang.management.ManagementFactory;
import java.util.Map;
import java.util.UUID;
import javax.cache.configuration.Factory;
import javax.cache.event.CacheEntryListener;
import javax.cache.expiry.ExpiryPolicy;
import javax.cache.integration.CacheLoader;
import javax.cache.processor.EntryProcessor;
import javax.management.MBeanServer;
import javax.net.ssl.SSLContext;
import org.apache.ignite.IgniteCompute;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.IgniteSystemProperties;
import org.apache.ignite.Ignition;
import org.apache.ignite.cache.CacheKeyConfiguration;
import org.apache.ignite.cache.affinity.Affinity;
import org.apache.ignite.cache.affinity.AffinityFunction;
import org.apache.ignite.cache.store.CacheStoreSessionListener;
import org.apache.ignite.cluster.ClusterGroup;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.ComputeTask;
import org.apache.ignite.spi.encryption.EncryptionSpi;
import org.apache.ignite.events.Event;
import org.apache.ignite.events.EventType;
import org.apache.ignite.failure.FailureHandler;
import org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager;
import org.apache.ignite.internal.processors.odbc.ClientListenerProcessor;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.lang.IgniteAsyncCallback;
import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.lifecycle.LifecycleBean;
import org.apache.ignite.lifecycle.LifecycleEventType;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.plugin.PluginConfiguration;
import org.apache.ignite.plugin.PluginProvider;
import org.apache.ignite.plugin.segmentation.SegmentationPolicy;
import org.apache.ignite.plugin.segmentation.SegmentationResolver;
import org.apache.ignite.services.Service;
import org.apache.ignite.services.ServiceConfiguration;
import org.apache.ignite.spi.checkpoint.CheckpointSpi;
import org.apache.ignite.spi.checkpoint.noop.NoopCheckpointSpi;
import org.apache.ignite.spi.collision.CollisionSpi;
import org.apache.ignite.spi.collision.noop.NoopCollisionSpi;
import org.apache.ignite.spi.communication.CommunicationSpi;
import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.deployment.DeploymentSpi;
import org.apache.ignite.spi.deployment.local.LocalDeploymentSpi;
import org.apache.ignite.spi.discovery.DiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.eventstorage.EventStorageSpi;
import org.apache.ignite.spi.eventstorage.NoopEventStorageSpi;
import org.apache.ignite.spi.failover.FailoverSpi;
import org.apache.ignite.spi.failover.always.AlwaysFailoverSpi;
import org.apache.ignite.spi.indexing.IndexingSpi;
import org.apache.ignite.spi.loadbalancing.LoadBalancingSpi;
import org.apache.ignite.spi.loadbalancing.roundrobin.RoundRobinLoadBalancingSpi;
import org.apache.ignite.ssl.SslContextFactory;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.plugin.segmentation.SegmentationPolicy.STOP;
/**
* This class defines grid runtime configuration. This configuration is passed to
* {@link Ignition#start(IgniteConfiguration)} method. It defines all configuration
* parameters required to start a grid instance. Usually, a special
* class called "loader" will create an instance of this interface and apply
* {@link Ignition#start(IgniteConfiguration)} method to initialize Ignite instance.
* <p>
* Note that you should only set values that differ from defaults, as grid
* will automatically pick default values for all values that are not set.
* <p>
* For more information about grid configuration and startup refer to {@link Ignition}
* documentation.
*/
public class IgniteConfiguration {
/** Courtesy notice log category. */
public static final String COURTESY_LOGGER_NAME = "org.apache.ignite.CourtesyConfigNotice";
/**
* Default flag for peer class loading. By default the value is {@code false}
* which means that peer class loading is disabled.
*/
public static final boolean DFLT_P2P_ENABLED = false;
/** Default metrics history size (value is {@code 10000}). */
public static final int DFLT_METRICS_HISTORY_SIZE = 10000;
/** Default metrics update frequency. */
public static final long DFLT_METRICS_UPDATE_FREQ = 2000;
/**
* Default metrics expire time. The value is {@link Long#MAX_VALUE} which
* means that metrics never expire.
*/
public static final long DFLT_METRICS_EXPIRE_TIME = Long.MAX_VALUE;
/** Default maximum timeout to wait for network responses in milliseconds (value is {@code 5,000ms}). */
public static final long DFLT_NETWORK_TIMEOUT = 5000;
/** Default interval between message send retries. */
public static final long DFLT_SEND_RETRY_DELAY = 1000;
/** Default message send retries count. */
public static final int DFLT_SEND_RETRY_CNT = 3;
/** Default discovery startup delay in milliseconds (value is {@code 60,000ms}). */
public static final long DFLT_DISCOVERY_STARTUP_DELAY = 60000;
/** Default deployment mode (value is {@link DeploymentMode#SHARED}). */
public static final DeploymentMode DFLT_DEPLOYMENT_MODE = DeploymentMode.SHARED;
/** Default cache size for missed resources. */
public static final int DFLT_P2P_MISSED_RESOURCES_CACHE_SIZE = 100;
/** Default time server port base. */
public static final int DFLT_TIME_SERVER_PORT_BASE = 31100;
/** Default time server port range. */
public static final int DFLT_TIME_SERVER_PORT_RANGE = 100;
/** Default core size of public thread pool. */
public static final int AVAILABLE_PROC_CNT = Runtime.getRuntime().availableProcessors();
/** Default core size of public thread pool. */
public static final int DFLT_PUBLIC_THREAD_CNT = Math.max(8, AVAILABLE_PROC_CNT);
/** Default size of data streamer thread pool. */
public static final int DFLT_DATA_STREAMER_POOL_SIZE = DFLT_PUBLIC_THREAD_CNT;
/** Default limit of threads used for rebalance. */
public static final int DFLT_REBALANCE_THREAD_POOL_SIZE = 1;
/** Default size of system thread pool. */
public static final int DFLT_SYSTEM_CORE_THREAD_CNT = DFLT_PUBLIC_THREAD_CNT;
/** Default size of query thread pool. */
public static final int DFLT_QUERY_THREAD_POOL_SIZE = DFLT_PUBLIC_THREAD_CNT;
/** Default Ignite thread keep alive time. */
public static final long DFLT_THREAD_KEEP_ALIVE_TIME = 60_000L;
/** Default size of peer class loading thread pool. */
public static final int DFLT_P2P_THREAD_CNT = 2;
/** Default size of management thread pool. */
public static final int DFLT_MGMT_THREAD_CNT = 4;
/** Default segmentation policy. */
public static final SegmentationPolicy DFLT_SEG_PLC = STOP;
/** Default value for wait for segment on startup flag. */
public static final boolean DFLT_WAIT_FOR_SEG_ON_START = true;
/** Default value for all segmentation resolvers pass required. */
public static final boolean DFLT_ALL_SEG_RESOLVERS_PASS_REQ = true;
/** Default value segmentation resolve attempts count. */
public static final int DFLT_SEG_RESOLVE_ATTEMPTS = 2;
/** Default segment check frequency in discovery manager. */
public static final long DFLT_SEG_CHK_FREQ = 10000;
/** Default frequency of metrics log print out. */
public static final long DFLT_METRICS_LOG_FREQ = 60000;
/** Default TCP server port. */
public static final int DFLT_TCP_PORT = 11211;
/** Default marshal local jobs flag. */
public static final boolean DFLT_MARSHAL_LOCAL_JOBS = false;
/** Default value for cache sanity check enabled flag. */
public static final boolean DFLT_CACHE_SANITY_CHECK_ENABLED = true;
/** Default value for late affinity assignment flag. */
@Deprecated
public static final boolean DFLT_LATE_AFF_ASSIGNMENT = true;
/** Default value for active on start flag. */
public static final boolean DFLT_ACTIVE_ON_START = true;
/** Default value for auto-activation flag. */
public static final boolean DFLT_AUTO_ACTIVATION = true;
/** Default failure detection timeout in millis. */
@SuppressWarnings("UnnecessaryBoxing")
public static final Long DFLT_FAILURE_DETECTION_TIMEOUT = new Long(10_000);
/** Default failure detection timeout for client nodes in millis. */
@SuppressWarnings("UnnecessaryBoxing")
public static final Long DFLT_CLIENT_FAILURE_DETECTION_TIMEOUT = new Long(30_000);
/** Default timeout after which long query warning will be printed. */
public static final long DFLT_LONG_QRY_WARN_TIMEOUT = 3000;
/** Default number of MVCC vacuum threads.. */
public static final int DFLT_MVCC_VACUUM_THREAD_CNT = 2;
/** Default time interval between MVCC vacuum runs in milliseconds. */
public static final long DFLT_MVCC_VACUUM_FREQUENCY = 5000;
/** Optional local Ignite instance name. */
private String igniteInstanceName;
/** User attributes. */
private Map<String, ?> userAttrs;
/** Logger. */
private IgniteLogger log;
/** Public pool size. */
private int pubPoolSize = DFLT_PUBLIC_THREAD_CNT;
/** Service pool size. */
private Integer svcPoolSize;
/** Async Callback pool size. */
private int callbackPoolSize = DFLT_PUBLIC_THREAD_CNT;
/**
* Use striped pool for internal requests processing when possible
* (e.g. cache requests per-partition striping).
*/
private int stripedPoolSize = DFLT_PUBLIC_THREAD_CNT;
/** System pool size. */
private int sysPoolSize = DFLT_SYSTEM_CORE_THREAD_CNT;
/** Management pool size. */
private int mgmtPoolSize = DFLT_MGMT_THREAD_CNT;
/** IGFS pool size. */
private int igfsPoolSize = AVAILABLE_PROC_CNT;
/** Data stream pool size. */
private int dataStreamerPoolSize = DFLT_DATA_STREAMER_POOL_SIZE;
/** Utility cache pool size. */
private int utilityCachePoolSize = DFLT_SYSTEM_CORE_THREAD_CNT;
/** Utility cache pool keep alive time. */
private long utilityCacheKeepAliveTime = DFLT_THREAD_KEEP_ALIVE_TIME;
/** P2P pool size. */
private int p2pPoolSize = DFLT_P2P_THREAD_CNT;
/** Query pool size. */
private int qryPoolSize = DFLT_QUERY_THREAD_POOL_SIZE;
/** Ignite installation folder. */
private String igniteHome;
/** Ignite work folder. */
private String igniteWorkDir;
/** MBean server. */
private MBeanServer mbeanSrv;
/** Local node ID. */
private UUID nodeId;
/** Marshaller. */
private Marshaller marsh;
/** Marshal local jobs. */
private boolean marshLocJobs = DFLT_MARSHAL_LOCAL_JOBS;
/** Daemon flag. */
private boolean daemon;
/** Whether or not peer class loading is enabled. */
private boolean p2pEnabled = DFLT_P2P_ENABLED;
/** List of package prefixes from the system class path that should be P2P loaded. */
private String[] p2pLocClsPathExcl;
/** Events of these types should be recorded. */
private int[] inclEvtTypes;
/** Maximum network requests timeout. */
private long netTimeout = DFLT_NETWORK_TIMEOUT;
/** Interval between message send retries. */
private long sndRetryDelay = DFLT_SEND_RETRY_DELAY;
/** Message send retries delay. */
private int sndRetryCnt = DFLT_SEND_RETRY_CNT;
/** Metrics history time. */
private int metricsHistSize = DFLT_METRICS_HISTORY_SIZE;
/** Full metrics enabled flag. */
private long metricsUpdateFreq = DFLT_METRICS_UPDATE_FREQ;
/** Metrics expire time. */
private long metricsExpTime = DFLT_METRICS_EXPIRE_TIME;
/** Collection of life-cycle beans. */
private LifecycleBean[] lifecycleBeans;
/** Discovery SPI. */
private DiscoverySpi discoSpi;
/** Segmentation policy. */
private SegmentationPolicy segPlc = DFLT_SEG_PLC;
/** Segmentation resolvers. */
private SegmentationResolver[] segResolvers;
/** Segmentation resolve attempts count. */
private int segResolveAttempts = DFLT_SEG_RESOLVE_ATTEMPTS;
/** Wait for segment on startup flag. */
private boolean waitForSegOnStart = DFLT_WAIT_FOR_SEG_ON_START;
/** All segmentation resolvers pass required flag. */
private boolean allResolversPassReq = DFLT_ALL_SEG_RESOLVERS_PASS_REQ;
/** Segment check frequency. */
private long segChkFreq = DFLT_SEG_CHK_FREQ;
/** Communication SPI. */
private CommunicationSpi commSpi;
/** Event storage SPI. */
private EventStorageSpi evtSpi;
/** Collision SPI. */
private CollisionSpi colSpi;
/** Deployment SPI. */
private DeploymentSpi deploySpi;
/** Checkpoint SPI. */
private CheckpointSpi[] cpSpi;
/** Failover SPI. */
private FailoverSpi[] failSpi;
/** Load balancing SPI. */
private LoadBalancingSpi[] loadBalancingSpi;
/** Indexing SPI. */
private IndexingSpi indexingSpi;
/** Address resolver. */
private AddressResolver addrRslvr;
/** Encryption SPI. */
private EncryptionSpi encryptionSpi;
/** Cache configurations. */
private CacheConfiguration[] cacheCfg;
/** Client mode flag. */
private Boolean clientMode;
/** Rebalance thread pool size. */
private int rebalanceThreadPoolSize = DFLT_REBALANCE_THREAD_POOL_SIZE;
/** Transactions configuration. */
private TransactionConfiguration txCfg = new TransactionConfiguration();
/** */
private PluginConfiguration[] pluginCfgs;
/** Flag indicating whether cache sanity check is enabled. */
private boolean cacheSanityCheckEnabled = DFLT_CACHE_SANITY_CHECK_ENABLED;
/** Discovery startup delay. */
@Deprecated
private long discoStartupDelay = DFLT_DISCOVERY_STARTUP_DELAY;
/** Tasks classes sharing mode. */
private DeploymentMode deployMode = DFLT_DEPLOYMENT_MODE;
/** Cache size of missed resources. */
private int p2pMissedCacheSize = DFLT_P2P_MISSED_RESOURCES_CACHE_SIZE;
/** Local host. */
private String locHost;
/** Base port number for time server. */
private int timeSrvPortBase = DFLT_TIME_SERVER_PORT_BASE;
/** Port number range for time server. */
private int timeSrvPortRange = DFLT_TIME_SERVER_PORT_RANGE;
/** Failure detection timeout. */
private Long failureDetectionTimeout = DFLT_FAILURE_DETECTION_TIMEOUT;
/** Timeout for blocked system workers detection. */
private Long sysWorkerBlockedTimeout;
/** Failure detection timeout for client nodes. */
private Long clientFailureDetectionTimeout = DFLT_CLIENT_FAILURE_DETECTION_TIMEOUT;
/** Property names to include into node attributes. */
private String[] includeProps;
/** Frequency of metrics log print out. */
@SuppressWarnings("RedundantFieldInitialization")
private long metricsLogFreq = DFLT_METRICS_LOG_FREQ;
/** Local event listeners. */
private Map<IgnitePredicate<? extends Event>, int[]> lsnrs;
/** IGFS configuration. */
private FileSystemConfiguration[] igfsCfg;
/** Service configuration. */
private ServiceConfiguration[] svcCfgs;
/** Hadoop configuration. */
private HadoopConfiguration hadoopCfg;
/** Client access configuration. */
private ConnectorConfiguration connectorCfg = new ConnectorConfiguration();
/** ODBC configuration. */
@Deprecated
private OdbcConfiguration odbcCfg;
/** Warmup closure. Will be invoked before actual grid start. */
private IgniteInClosure<IgniteConfiguration> warmupClos;
/** */
private AtomicConfiguration atomicCfg = new AtomicConfiguration();
/** User's class loader. */
private ClassLoader classLdr;
/** Cache store session listeners. */
private Factory<CacheStoreSessionListener>[] storeSesLsnrs;
/** Consistent globally unique node ID which survives node restarts. */
private Serializable consistentId;
/** SSL connection factory. */
private Factory<SSLContext> sslCtxFactory;
/** Platform configuration. */
private PlatformConfiguration platformCfg;
/** Cache key configuration. */
private CacheKeyConfiguration[] cacheKeyCfg;
/** */
private BinaryConfiguration binaryCfg;
/** Custom executor configurations. */
private ExecutorConfiguration[] execCfgs;
/** Page memory configuration. */
@Deprecated
private MemoryConfiguration memCfg;
/** Persistence store configuration. */
@Deprecated
private PersistentStoreConfiguration pstCfg;
/** Page memory configuration. */
private DataStorageConfiguration dsCfg;
/** Active on start flag. */
private boolean activeOnStart = DFLT_ACTIVE_ON_START;
/** Auto-activation flag. */
private boolean autoActivation = DFLT_AUTO_ACTIVATION;
/** */
private long longQryWarnTimeout = DFLT_LONG_QRY_WARN_TIMEOUT;
/** SQL connector configuration. */
@Deprecated
private SqlConnectorConfiguration sqlConnCfg;
/** Client connector configuration. */
private ClientConnectorConfiguration cliConnCfg = ClientListenerProcessor.DFLT_CLI_CFG;
/** Size of MVCC vacuum thread pool. */
private int mvccVacuumThreadCnt = DFLT_MVCC_VACUUM_THREAD_CNT;
/** Time interval between vacuum runs (ms). */
private long mvccVacuumFreq = DFLT_MVCC_VACUUM_FREQUENCY;
/** User authentication enabled. */
private boolean authEnabled;
/** Failure handler. */
private FailureHandler failureHnd;
/** Communication failure resolver */
private CommunicationFailureResolver commFailureRslvr;
/** SQL schemas to be created on node start. */
private String[] sqlSchemas;
/**
* Creates valid grid configuration with all default values.
*/
public IgniteConfiguration() {
// No-op.
}
/**
* Creates grid configuration by coping all configuration properties from
* given configuration.
*
* @param cfg Grid configuration to copy from.
*/
public IgniteConfiguration(IgniteConfiguration cfg) {
assert cfg != null;
// SPIs.
discoSpi = cfg.getDiscoverySpi();
commSpi = cfg.getCommunicationSpi();
deploySpi = cfg.getDeploymentSpi();
evtSpi = cfg.getEventStorageSpi();
cpSpi = cfg.getCheckpointSpi();
colSpi = cfg.getCollisionSpi();
failSpi = cfg.getFailoverSpi();
loadBalancingSpi = cfg.getLoadBalancingSpi();
indexingSpi = cfg.getIndexingSpi();
encryptionSpi = cfg.getEncryptionSpi();
commFailureRslvr = cfg.getCommunicationFailureResolver();
/*
* Order alphabetically for maintenance purposes.
*/
activeOnStart = cfg.isActiveOnStart();
addrRslvr = cfg.getAddressResolver();
allResolversPassReq = cfg.isAllSegmentationResolversPassRequired();
atomicCfg = cfg.getAtomicConfiguration();
authEnabled = cfg.isAuthenticationEnabled();
autoActivation = cfg.isAutoActivationEnabled();
binaryCfg = cfg.getBinaryConfiguration();
dsCfg = cfg.getDataStorageConfiguration();
memCfg = cfg.getMemoryConfiguration();
pstCfg = cfg.getPersistentStoreConfiguration();
cacheCfg = cfg.getCacheConfiguration();
cacheKeyCfg = cfg.getCacheKeyConfiguration();
cacheSanityCheckEnabled = cfg.isCacheSanityCheckEnabled();
callbackPoolSize = cfg.getAsyncCallbackPoolSize();
classLdr = cfg.getClassLoader();
clientFailureDetectionTimeout = cfg.getClientFailureDetectionTimeout();
clientMode = cfg.isClientMode();
cliConnCfg = cfg.getClientConnectorConfiguration();
connectorCfg = cfg.getConnectorConfiguration();
consistentId = cfg.getConsistentId();
daemon = cfg.isDaemon();
dataStreamerPoolSize = cfg.getDataStreamerThreadPoolSize();
deployMode = cfg.getDeploymentMode();
discoStartupDelay = cfg.getDiscoveryStartupDelay();
execCfgs = cfg.getExecutorConfiguration();
failureDetectionTimeout = cfg.getFailureDetectionTimeout();
hadoopCfg = cfg.getHadoopConfiguration();
igfsCfg = cfg.getFileSystemConfiguration();
igfsPoolSize = cfg.getIgfsThreadPoolSize();
failureHnd = cfg.getFailureHandler();
igniteHome = cfg.getIgniteHome();
igniteInstanceName = cfg.getIgniteInstanceName();
igniteWorkDir = cfg.getWorkDirectory();
inclEvtTypes = cfg.getIncludeEventTypes();
includeProps = cfg.getIncludeProperties();
lifecycleBeans = cfg.getLifecycleBeans();
locHost = cfg.getLocalHost();
log = cfg.getGridLogger();
longQryWarnTimeout = cfg.getLongQueryWarningTimeout();
lsnrs = cfg.getLocalEventListeners();
marsh = cfg.getMarshaller();
marshLocJobs = cfg.isMarshalLocalJobs();
mbeanSrv = cfg.getMBeanServer();
metricsExpTime = cfg.getMetricsExpireTime();
metricsHistSize = cfg.getMetricsHistorySize();
metricsLogFreq = cfg.getMetricsLogFrequency();
metricsUpdateFreq = cfg.getMetricsUpdateFrequency();
mgmtPoolSize = cfg.getManagementThreadPoolSize();
mvccVacuumThreadCnt = cfg.getMvccVacuumThreadCount();
mvccVacuumFreq = cfg.getMvccVacuumFrequency();
netTimeout = cfg.getNetworkTimeout();
nodeId = cfg.getNodeId();
odbcCfg = cfg.getOdbcConfiguration();
p2pEnabled = cfg.isPeerClassLoadingEnabled();
p2pLocClsPathExcl = cfg.getPeerClassLoadingLocalClassPathExclude();
p2pMissedCacheSize = cfg.getPeerClassLoadingMissedResourcesCacheSize();
p2pPoolSize = cfg.getPeerClassLoadingThreadPoolSize();
platformCfg = cfg.getPlatformConfiguration();
pluginCfgs = cfg.getPluginConfigurations();
pubPoolSize = cfg.getPublicThreadPoolSize();
qryPoolSize = cfg.getQueryThreadPoolSize();
rebalanceThreadPoolSize = cfg.getRebalanceThreadPoolSize();
segChkFreq = cfg.getSegmentCheckFrequency();
segPlc = cfg.getSegmentationPolicy();
segResolveAttempts = cfg.getSegmentationResolveAttempts();
segResolvers = cfg.getSegmentationResolvers();
sndRetryCnt = cfg.getNetworkSendRetryCount();
sndRetryDelay = cfg.getNetworkSendRetryDelay();
sqlConnCfg = cfg.getSqlConnectorConfiguration();
sqlSchemas = cfg.getSqlSchemas();
sslCtxFactory = cfg.getSslContextFactory();
storeSesLsnrs = cfg.getCacheStoreSessionListenerFactories();
stripedPoolSize = cfg.getStripedPoolSize();
svcCfgs = cfg.getServiceConfiguration();
svcPoolSize = cfg.getServiceThreadPoolSize();
sysPoolSize = cfg.getSystemThreadPoolSize();
sysWorkerBlockedTimeout = cfg.getSystemWorkerBlockedTimeout();
timeSrvPortBase = cfg.getTimeServerPortBase();
timeSrvPortRange = cfg.getTimeServerPortRange();
txCfg = cfg.getTransactionConfiguration();
userAttrs = cfg.getUserAttributes();
utilityCacheKeepAliveTime = cfg.getUtilityCacheKeepAliveTime();
utilityCachePoolSize = cfg.getUtilityCacheThreadPoolSize();
waitForSegOnStart = cfg.isWaitForSegmentOnStart();
warmupClos = cfg.getWarmupClosure();
}
/**
* @return Communication failure resovler.
*/
public CommunicationFailureResolver getCommunicationFailureResolver() {
return commFailureRslvr;
}
/**
* @param commFailureRslvr Communication failure resovler.
* @return {@code this} instance.
*/
public IgniteConfiguration setCommunicationFailureResolver(CommunicationFailureResolver commFailureRslvr) {
this.commFailureRslvr = commFailureRslvr;
return this;
}
/**
* Gets optional grid name. Returns {@code null} if non-default grid name was not
* provided.
* <p>The name only works locally and has no effect on topology</p>
*
* @return Optional grid name. Can be {@code null}, which is default grid name, if
* non-default grid name was not provided.
* @deprecated Use {@link #getIgniteInstanceName()} instead.
*/
@Deprecated
public String getGridName() {
return getIgniteInstanceName();
}
/**
* Gets optional local instance name. Returns {@code null} if non-default local instance
* name was not provided.
* <p>The name only works locally and has no effect on topology</p>
*
* @return Optional local instance name. Can be {@code null}, which is default local
* instance name, if non-default local instance name was not provided.
*/
public String getIgniteInstanceName() {
return igniteInstanceName;
}
/**
* Whether or not this node should be a daemon node.
* <p>
* Daemon nodes are the usual grid nodes that participate in topology but not
* visible on the main APIs, i.e. they are not part of any cluster groups. The only
* way to see daemon nodes is to use {@link ClusterGroup#forDaemons()} method.
* <p>
* Daemon nodes are used primarily for management and monitoring functionality that
* is build on Ignite and needs to participate in the topology, but also needs to be
* excluded from the "normal" topology, so that it won't participate in the task execution
* or in-memory data grid storage.
*
* @return {@code True} if this node should be a daemon node, {@code false} otherwise.
* @see ClusterGroup#forDaemons()
*/
public boolean isDaemon() {
return daemon;
}
/**
* Sets daemon flag.
* <p>
* Daemon nodes are the usual grid nodes that participate in topology but not
* visible on the main APIs, i.e. they are not part of any cluster group. The only
* way to see daemon nodes is to use {@link ClusterGroup#forDaemons()} method.
* <p>
* Daemon nodes are used primarily for management and monitoring functionality that
* is build on Ignite and needs to participate in the topology, but also needs to be
* excluded from the "normal" topology, so that it won't participate in the task execution
* or in-memory data grid storage.
*
* @param daemon Daemon flag.
* @return {@code this} for chaining.
*/
public IgniteConfiguration setDaemon(boolean daemon) {
this.daemon = daemon;
return this;
}
/**
* Sets grid name. Note that {@code null} is a default grid name.
*
* @param gridName Grid name to set. Can be {@code null}, which is default
* grid name.
* @return {@code this} for chaining.
* @deprecated Use {@link #setIgniteInstanceName(String)} instead.
*/
@Deprecated
public IgniteConfiguration setGridName(String gridName) {
return setIgniteInstanceName(gridName);
}
/**
* Sets of local instance name. Note that {@code null} is a default local instance name.
*
* @param instanceName Local instance name to set. Can be {@code null}. which is default
* local instance name.
* @return {@code this} for chaining.
*/
public IgniteConfiguration setIgniteInstanceName(String instanceName) {
this.igniteInstanceName = instanceName;
return this;
}
/**
* Sets consistent globally unique node ID which survives node restarts.
*
* @param consistentId Node consistent ID.
* @return {@code this} for chaining.
*/
public IgniteConfiguration setConsistentId(Serializable consistentId) {
this.consistentId = consistentId;
return this;
}
/**
* Gets consistent globally unique node ID which survives node restarts.
*
* @return Node consistent ID.
*/
public Serializable getConsistentId() {
return consistentId;
}
/**
* Should return any user-defined attributes to be added to this node. These attributes can
* then be accessed on nodes by calling {@link ClusterNode#attribute(String)} or
* {@link ClusterNode#attributes()} methods.
* <p>
* Note that system adds the following (among others) attributes automatically:
* <ul>
* <li>{@code {@link System#getProperties()}} - All system properties.</li>
* <li>{@code {@link System#getenv(String)}} - All environment properties.</li>
* </ul>
* <p>
* Note that grid will add all System properties and environment properties
* to grid node attributes also. SPIs may also add node attributes that are
* used for SPI implementation.
* <p>
* <b>NOTE:</b> attributes names starting with {@code org.apache.ignite} are reserved
* for internal use.
*
* @return User defined attributes for this node.
*/
public Map<String, ?> getUserAttributes() {
return userAttrs;
}
/**
* Sets user attributes for this node.
*
* @param userAttrs User attributes for this node.
* @see IgniteConfiguration#getUserAttributes()
* @return {@code this} for chaining.
*/
public IgniteConfiguration setUserAttributes(Map<String, ?> userAttrs) {
this.userAttrs = userAttrs;
return this;
}
/**
* Should return an instance of logger to use in grid. If not provided,
* {@ignitelink org.apache.ignite.logger.log4j.Log4JLogger}
* will be used.
*
* @return Logger to use in grid.
*/
public IgniteLogger getGridLogger() {
return log;
}
/**
* Sets logger to use within grid.
*
* @param log Logger to use within grid.
* @see IgniteConfiguration#getGridLogger()
* @return {@code this} for chaining.
*/
public IgniteConfiguration setGridLogger(IgniteLogger log) {
this.log = log;
return this;
}
/**
* Returns striped pool size that should be used for cache requests
* processing.
* <p>
* If set to non-positive value then requests get processed in system pool.
* <p>
* Striped pool is better for typical cache operations.
*
* @return Positive value if striped pool should be initialized
* with configured number of threads (stripes) and used for requests processing
* or non-positive value to process requests in system pool.
*
* @see #getPublicThreadPoolSize()
* @see #getSystemThreadPoolSize()
*/
public int getStripedPoolSize() {
return stripedPoolSize;
}
/**
* Sets striped pool size that should be used for cache requests
* processing.
* <p>
* If set to non-positive value then requests get processed in system pool.
* <p>
* Striped pool is better for typical cache operations.
*
* @param stripedPoolSize Positive value if striped pool should be initialized
* with passed in number of threads (stripes) and used for requests processing
* or non-positive value to process requests in system pool.
* @return {@code this} for chaining.
*
* @see #getPublicThreadPoolSize()
* @see #getSystemThreadPoolSize()
*/
public IgniteConfiguration setStripedPoolSize(int stripedPoolSize) {
this.stripedPoolSize = stripedPoolSize;
return this;
}
/**
* Should return a thread pool size to be used in grid.
* This executor service will be in charge of processing {@link ComputeJob GridJobs}
* and user messages sent to node.
* <p>
* If not provided, executor service will have size {@link #DFLT_PUBLIC_THREAD_CNT}.
*
* @return Thread pool size to be used in grid to process job execution
* requests and user messages sent to the node.
*/
public int getPublicThreadPoolSize() {
return pubPoolSize;
}
/**
* Should return a thread pool size to be used in grid.
* This executor service will be in charge of processing {@link Service} proxy invocations.
* <p>
* If not provided, executor service will have size {@link #DFLT_PUBLIC_THREAD_CNT}.
*
* @return Thread pool size to be used in grid to process service proxy invocations.
*/
public int getServiceThreadPoolSize() {
return svcPoolSize != null ? svcPoolSize : getPublicThreadPoolSize();
}
/**
* Size of thread pool that is in charge of processing internal system messages.
* <p>
* If not provided, executor service will have size {@link #DFLT_SYSTEM_CORE_THREAD_CNT}.
*
* @return Thread pool size to be used in grid for internal system messages.
*/
public int getSystemThreadPoolSize() {
return sysPoolSize;
}
/**
* Size of thread pool that is in charge of processing asynchronous callbacks.
* <p>
* This pool is used for callbacks annotated with {@link IgniteAsyncCallback}.
* <p>
* If not provided, executor service will have size {@link #DFLT_PUBLIC_THREAD_CNT}.
*
* @return Thread pool size to be used.
* @see IgniteAsyncCallback
*/
public int getAsyncCallbackPoolSize() {
return callbackPoolSize;
}
/**
* Size of thread pool that is in charge of processing internal and Visor
* {@link ComputeJob GridJobs}.
* <p>
* If not provided, executor service will have size {@link #DFLT_MGMT_THREAD_CNT}
*
* @return Thread pool size to be used in grid for internal and Visor
* jobs processing.
*/
public int getManagementThreadPoolSize() {
return mgmtPoolSize;
}
/**
* Size of thread pool which is in charge of peer class loading requests/responses. If you don't use
* peer class loading and use GAR deployment only we would recommend to decrease
* the value of total threads to {@code 1}.
* <p>
* If not provided, executor service will have size {@link #DFLT_P2P_THREAD_CNT}.
*
* @return Thread pool size to be used for peer class loading
* requests handling.
*/
public int getPeerClassLoadingThreadPoolSize() {
return p2pPoolSize;
}
/**
* Size of thread pool that is in charge of processing outgoing IGFS messages.
* <p>
* If not provided, executor service will have size equals number of processors available in system.
*
* @return Thread pool size to be used for IGFS outgoing message sending.
*/
public int getIgfsThreadPoolSize() {
return igfsPoolSize;
}
/**
* Size of thread pool that is in charge of processing data stream messages.
* <p>
* If not provided, executor service will have size {@link #DFLT_DATA_STREAMER_POOL_SIZE}.
*
* @return Thread pool size to be used for data stream messages.
*/
public int getDataStreamerThreadPoolSize() {
return dataStreamerPoolSize;
}
/**
* Default size of thread pool that is in charge of processing utility cache messages.
* <p>
* If not provided, executor service will have size {@link #DFLT_SYSTEM_CORE_THREAD_CNT}.
*
* @return Default thread pool size to be used in grid for utility cache messages.
*/
public int getUtilityCacheThreadPoolSize() {
return utilityCachePoolSize;
}
/**
* Keep alive time of thread pool that is in charge of processing utility cache messages.
* <p>
* If not provided, executor service will have keep alive time {@link #DFLT_THREAD_KEEP_ALIVE_TIME}.
*
* @return Thread pool keep alive time (in milliseconds) to be used in grid for utility cache messages.
*/
public long getUtilityCacheKeepAliveTime() {
return utilityCacheKeepAliveTime;
}
/**
* Size of thread pool that is in charge of processing query messages.
* <p>
* If not provided, executor service will have size {@link #DFLT_QUERY_THREAD_POOL_SIZE}.
*
* @return Thread pool size to be used in grid for query messages.