/** * Checks for explicit events configuration. * * @param g Grid instance. * @return {@code true} if all task events explicitly specified in configuration. */ public static boolean checkExplicitTaskMonitoring(Grid g) { int[] evts = g.configuration().getIncludeEventTypes(); if (F.isEmpty(evts)) return false; for (int evt : VISOR_TASK_EVTS) { if (!F.contains(evts, evt)) return false; } return true; }
/** * @param ctx Context. * @param cfg Configuration to check for possible performance issues. */ private void suggestOptimizations(GridKernalContext ctx, GridConfiguration cfg) { GridPerformanceSuggestions perf = ctx.performance(); if (ctx.collision().enabled()) perf.add("Disable collision resolution (remove 'collisionSpi' from configuration)"); if (ctx.checkpoint().enabled()) perf.add("Disable checkpoints (remove 'checkpointSpi' from configuration)"); if (cfg.isPeerClassLoadingEnabled()) perf.add("Disable peer class loading (set 'peerClassLoadingEnabled' to false)"); if (cfg.isMarshalLocalJobs()) perf.add("Disable local jobs marshalling (set 'marshalLocalJobs' to false)"); if (cfg.getIncludeEventTypes() != null && cfg.getIncludeEventTypes().length != 0) perf.add("Disable grid events (remove 'includeEventTypes' from configuration)"); if (GridOptimizedMarshaller.available() && !(cfg.getMarshaller() instanceof GridOptimizedMarshaller)) perf.add("Enable optimized marshaller (set 'marshaller' to " + GridOptimizedMarshaller.class.getSimpleName() + ')'); }
int[] cfgInclEvtTypes0 = ctx.config().getIncludeEventTypes();
/** * @param g Grid. * @return Data transfer object for node configuration data. */ public static VisorGridConfig from(GridEx g) { assert g != null; GridConfiguration c = g.configuration(); VisorGridConfig cfg = new VisorGridConfig(); cfg.license(VisorLicense.from(g)); cfg.basic(VisorBasicConfig.from(g, c)); cfg.metrics(VisorMetricsConfig.from(c)); cfg.spis(VisorSpisConfig.from(c)); cfg.p2p(VisorPeerToPeerConfig.from(c)); cfg.email(VisorEmailConfig.from(c)); cfg.lifecycle(VisorLifecycleConfig.from(c)); cfg.executeService(VisorExecutorServiceConfig.from(c)); cfg.segmentation(VisorSegmentationConfig.from(c)); cfg.includeProperties(compactArray(c.getIncludeProperties())); cfg.includeEventTypes(c.getIncludeEventTypes()); cfg.rest(VisorRestConfig.from(c)); cfg.userAttributes(c.getUserAttributes()); cfg.caches(VisorCacheConfig.list(c.getCacheConfiguration())); cfg.ggfss(VisorGgfsConfig.list(c.getGgfsConfiguration())); cfg.streamers(VisorStreamerConfig.list(c.getStreamerConfiguration())); cfg.drSenderHub(VisorDrSenderHubConfig.from(c.getDrSenderHubConfiguration())); cfg.drReceiverHub(VisorDrReceiverHubConfig.from(c.getDrReceiverHubConfiguration())); cfg.env(new HashMap<>(getenv())); cfg.systemProperties(getProperties()); return cfg; }
myCfg.setLocalEventListeners(cfg.getLocalEventListeners()); myCfg.setPeerClassLoadingMissedResourcesCacheSize(cfg.getPeerClassLoadingMissedResourcesCacheSize()); myCfg.setIncludeEventTypes(cfg.getIncludeEventTypes()); myCfg.setDaemon(cfg.isDaemon()); myCfg.setIncludeProperties(cfg.getIncludeProperties());
ggfsSvcShutdown = cfg.getGgfsExecutorServiceShutdown(); hadoopCfg = cfg.getHadoopConfiguration(); inclEvtTypes = cfg.getIncludeEventTypes(); includeProps = cfg.getIncludeProperties(); jettyPath = cfg.getRestJettyPath();