/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override public Collection<String> getUserAttributesFormatted() { assert cfg != null; return F.transform(cfg.getUserAttributes().entrySet(), new C1<Map.Entry<String, ?>, String>() { @Override public String apply(Map.Entry<String, ?> e) { return e.getKey() + ", " + e.getValue().toString(); } }); }
/** * Prints all user attributes in info mode. */ private void logNodeUserAttributes() { assert log != null; if (log.isInfoEnabled()) for (Map.Entry<?, ?> attr : cfg.getUserAttributes().entrySet()) log.info("Local node user attribute [" + attr.getKey() + '=' + attr.getValue() + ']'); }
if (cfg.getUserAttributes() != null) { for (Map.Entry<String, ?> e : cfg.getUserAttributes().entrySet()) { if (attrs.containsKey(e.getKey())) U.warn(log, "User or internal attribute has the same name as environment or system " +
/** * @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; }
Map<String, ?> attrs = cfg.getUserAttributes();
for (String name : cfg.getUserAttributes().keySet()) if (name.startsWith(ATTR_PREFIX)) throw new GridException("User attribute has illegal name: '" + name + "'. Note that all names " +
A.notNull(cfg.getMarshaller(), "cfg.getMarshaller()"); A.notNull(cfg.getExecutorService(), "cfg.getExecutorService()"); A.notNull(cfg.getUserAttributes(), "cfg.getUserAttributes()");
timeSrvPortBase = cfg.getTimeServerPortBase(); timeSrvPortRange = cfg.getTimeServerPortRange(); userAttrs = cfg.getUserAttributes(); utilityCacheSvc = cfg.getUtilityCacheExecutorService(); utilityCacheSvcShutdown = cfg.getUtilityCacheExecutorServiceShutdown();