本文整理汇总了Java中org.apache.ignite.configuration.IgniteConfiguration.setMetricsLogFrequency方法的典型用法代码示例。如果您正苦于以下问题:Java IgniteConfiguration.setMetricsLogFrequency方法的具体用法?Java IgniteConfiguration.setMetricsLogFrequency怎么用?Java IgniteConfiguration.setMetricsLogFrequency使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.configuration.IgniteConfiguration
的用法示例。
在下文中一共展示了IgniteConfiguration.setMetricsLogFrequency方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: helloworldConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
public static IgniteConfiguration helloworldConfiguration() {
int cpus = Runtime.getRuntime().availableProcessors();
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("hello-world");
cfg.setClientMode(true);
cfg.setPeerClassLoadingEnabled(true);
cfg.setDeploymentMode(DeploymentMode.CONTINUOUS);
cfg.setPeerClassLoadingMissedResourcesCacheSize(200);
cfg.setPublicThreadPoolSize(4 * cpus);
cfg.setSystemThreadPoolSize(2 * cpus);
// log frequency in ms
cfg.setMetricsLogFrequency(30000);
cfg.setGridLogger(igniteLogger());
cfg.setDiscoverySpi(multicastDiscoverySpi());
return cfg;
}
示例2: createIgnite
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
@Bean
@Scope("singleton")
@Qualifier("operationIgniteClient")
@ConditionalOnMissingBean(KafkaOperationRepository.class)
public Ignite createIgnite(ApplicationContext applicationContext) throws IgniteCheckedException {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setClientMode(true);
cfg.setPeerClassLoadingEnabled(false);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Arrays.asList(clientAddress.split(",")));
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
cfg.setMetricsLogFrequency(0);
return IgniteSpring.start(cfg,applicationContext);
}
示例3: copyDefaultsFromSource
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* @param cfg Config.
* @param srcCfg Source config.
*/
private static void copyDefaultsFromSource(IgniteConfiguration cfg, IgniteConfiguration srcCfg) {
cfg.setIgniteInstanceName(srcCfg.getIgniteInstanceName());
cfg.setGridLogger(srcCfg.getGridLogger());
cfg.setNodeId(srcCfg.getNodeId());
cfg.setIgniteHome(srcCfg.getIgniteHome());
cfg.setMBeanServer(srcCfg.getMBeanServer());
cfg.setMetricsLogFrequency(srcCfg.getMetricsLogFrequency());
cfg.setConnectorConfiguration(srcCfg.getConnectorConfiguration());
cfg.setCommunicationSpi(srcCfg.getCommunicationSpi());
cfg.setNetworkTimeout(srcCfg.getNetworkTimeout());
cfg.setDiscoverySpi(srcCfg.getDiscoverySpi());
cfg.setCheckpointSpi(srcCfg.getCheckpointSpi());
cfg.setIncludeEventTypes(srcCfg.getIncludeEventTypes());
// Specials.
((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);
cfg.getTransactionConfiguration().setTxSerializableEnabled(true);
}
示例4: apply
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
@Override
public Ignite apply(ExtendedActorSystem system) {
final IgniteProperties properties = igniteConfigProvider.apply(system);
final IgniteConfiguration igniteConfiguration = new IgniteConfiguration();
igniteConfiguration.setClientMode(properties.isClientNode());
// durable file memory persistence
if (properties.isEnableFilePersistence()) {
DataStorageConfiguration persistentStoreConfiguration = new DataStorageConfiguration();
persistentStoreConfiguration.setStoragePath(properties.getIgnitePersistenceFilePath() + "/data/store");
persistentStoreConfiguration.setWalArchivePath(properties.getIgnitePersistenceFilePath() + "./data/walArchive");
igniteConfiguration.setDataStorageConfiguration(persistentStoreConfiguration);
}
// connector configuration
final ConnectorConfiguration connectorConfiguration = new ConnectorConfiguration();
connectorConfiguration.setPort(properties.getIgniteConnectorPort());
// common ignite configuration
igniteConfiguration.setMetricsLogFrequency(properties.getMetricsLogFrequency());
igniteConfiguration.setQueryThreadPoolSize(properties.getQueryThreadPoolSize());
igniteConfiguration.setDataStreamerThreadPoolSize(properties.getDataStreamerThreadPoolSize());
igniteConfiguration.setManagementThreadPoolSize(properties.getManagementThreadPoolSize());
igniteConfiguration.setPublicThreadPoolSize(properties.getPublicThreadPoolSize());
igniteConfiguration.setSystemThreadPoolSize(properties.getSystemThreadPoolSize());
igniteConfiguration.setRebalanceThreadPoolSize(properties.getRebalanceThreadPoolSize());
igniteConfiguration.setAsyncCallbackPoolSize(properties.getAsyncCallbackPoolSize());
igniteConfiguration.setPeerClassLoadingEnabled(properties.isPeerClassLoadingEnabled());
final BinaryConfiguration binaryConfiguration = new BinaryConfiguration();
binaryConfiguration.setCompactFooter(false);
igniteConfiguration.setBinaryConfiguration(binaryConfiguration);
// cluster tcp configuration
final TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
final TcpDiscoveryVmIpFinder tcpDiscoveryVmIpFinder = new TcpDiscoveryVmIpFinder();
// need to be changed when it come to real cluster configuration
tcpDiscoveryVmIpFinder.setAddresses(Arrays.asList(properties.getTcpDiscoveryAddresses() + properties.getIgniteServerPortRange()));
tcpDiscoverySpi.setIpFinder(tcpDiscoveryVmIpFinder);
igniteConfiguration.setDiscoverySpi(new TcpDiscoverySpi());
final Ignite ignite = Ignition.start(igniteConfiguration);
Runtime.getRuntime().addShutdownHook(new Thread(ignite::close));
return ignite;
}
示例5: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings({"unchecked"})
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setMetricsLogFrequency(1000);
cfg.setExecutorConfiguration(new ExecutorConfiguration(CUSTOM_EXECUTOR_0),
new ExecutorConfiguration(CUSTOM_EXECUTOR_1));
return cfg;
}
示例6: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setMetricsLogFrequency(0);
return cfg;
}
示例7: configure
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void configure(IgniteConfiguration cfg) {
cfg.setMetricsLogFrequency(5000);
}
示例8: systemInitialize
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* <code>systemInitialize</code> is the entry method to start all the operations within iotracah.
* This class is expected to be extended by the core plugin only.
* If there is more than that implementation then the first implementation with no
* guarantee of selection will be loaded.
* The system will automatically throw a <code>UnRetriableException</code> if no implementation of this
* interface is detected.
*
* @param baseSystemHandlerList
* @throws UnRetriableException
*/
@Override
public void systemInitialize(List<BaseSystemHandler> baseSystemHandlerList) throws UnRetriableException {
//Initiate ignite.
synchronized (this) {
TcpDiscoverySpi spi = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
// Set initial IP addresses.
// Note that you can optionally specify a port or a port range.
ipFinder.setAddresses(Arrays.asList(getDiscoveryAddresses()));
spi.setIpFinder(ipFinder);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setGridName(getExecutorDefaultName());
// Override default discovery SPI.
cfg.setDiscoverySpi(spi);
//Set node attribute.
Map<String, String> attributes = new HashMap<>();
attributes.put("ROLE", getExecutorDefaultName());
cfg.setUserAttributes(attributes);
//Use sl4j logger
IgniteLogger gridLog = new Slf4jLogger(LoggerFactory.getLogger("org.apache.ignite")); // Provide correct SLF4J logger here.
cfg.setGridLogger(gridLog);
//Optimize marshaller
OptimizedMarshaller optimizedMarshaller = new OptimizedMarshaller();
optimizedMarshaller.setRequireSerializable(true);
cfg.setMarshaller(optimizedMarshaller);
TransactionConfiguration transactionConfiguration = new TransactionConfiguration();
transactionConfiguration.setDefaultTxConcurrency(TransactionConcurrency.PESSIMISTIC);
transactionConfiguration.setDefaultTxIsolation(TransactionIsolation.READ_COMMITTED);
transactionConfiguration.setDefaultTxTimeout(30000);
cfg.setTransactionConfiguration(transactionConfiguration);
cfg.setMetricsLogFrequency(0);
cfg.setMetricsUpdateFrequency(15000);
Ignition.start(cfg);
//Also instantiate the server router.
IgniteMessaging igniteMessaging = getIgnite().message();
String cluster = getExecutorDefaultName();
UUID nodeId = getNodeId();
DefaultServerRouter defaultServerRouter = new DefaultServerRouter(cluster, nodeId, igniteMessaging);
defaultServerRouter.initiate();
this.serverRouter = defaultServerRouter;
}
log.debug(" systemInitialize : performing classifications for base system handlers");
baseSystemHandlerList.forEach(this::classifyBaseHandler);
}
示例9: igniteConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* Configure node.
* @param basePort Base port.
* @param gridIdx Ignite instance name index.
* @param client If {@code true} then start client node.
* @return IgniteConfiguration
*/
private static IgniteConfiguration igniteConfiguration(int basePort, int gridIdx, boolean client) {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName((client ? "demo-client-" : "demo-server-" ) + gridIdx);
cfg.setLocalHost("127.0.0.1");
cfg.setEventStorageSpi(new MemoryEventStorageSpi());
int[] evts = new int[EVTS_DISCOVERY.length + VISOR_TASK_EVTS.length];
System.arraycopy(EVTS_DISCOVERY, 0, evts, 0, EVTS_DISCOVERY.length);
System.arraycopy(VISOR_TASK_EVTS, 0, evts, EVTS_DISCOVERY.length, VISOR_TASK_EVTS.length);
cfg.setIncludeEventTypes(evts);
cfg.getConnectorConfiguration().setPort(basePort);
System.setProperty(IGNITE_JETTY_PORT, String.valueOf(basePort + 10));
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
int discoPort = basePort + 20;
ipFinder.setAddresses(Collections.singletonList("127.0.0.1:" + discoPort + ".." + (discoPort + NODE_CNT - 1)));
// Configure discovery SPI.
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setLocalPort(discoPort);
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
commSpi.setSharedMemoryPort(-1);
commSpi.setMessageQueueLimit(10);
int commPort = basePort + 30;
commSpi.setLocalPort(commPort);
cfg.setCommunicationSpi(commSpi);
cfg.setGridLogger(new Slf4jLogger(log));
cfg.setMetricsLogFrequency(0);
DataRegionConfiguration dataRegCfg = new DataRegionConfiguration();
dataRegCfg.setName("demo");
dataRegCfg.setMetricsEnabled(true);
dataRegCfg.setMaxSize(DFLT_DATA_REGION_INITIAL_SIZE);
DataStorageConfiguration dataStorageCfg = new DataStorageConfiguration();
dataStorageCfg.setDefaultDataRegionConfiguration(dataRegCfg);
dataStorageCfg.setSystemRegionMaxSize(DFLT_DATA_REGION_INITIAL_SIZE);
cfg.setDataStorageConfiguration(dataStorageCfg);
if (client)
cfg.setClientMode(true);
return cfg;
}