Skip to content

Commit

Permalink
IGNITE-187 Review.
Browse files Browse the repository at this point in the history
  • Loading branch information
akuznetsov-gridgain committed Mar 10, 2015
1 parent 9cb1542 commit a15c96b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Expand Up @@ -24,8 +24,8 @@
import java.util.*; import java.util.*;


/** /**
* Contains constants for all system properties and environmental variables in Ignite. These * Contains constants for all system properties and environmental variables in Ignite.
* properties and variables can be used to affect the behavior of Ignite. * These properties and variables can be used to affect the behavior of Ignite.
*/ */
public final class IgniteSystemProperties { public final class IgniteSystemProperties {
/** /**
Expand Down Expand Up @@ -477,9 +477,12 @@ public static double getDouble(String name, double dflt) {
} }


/** /**
* @return Thread safe copy of system properties. * Gets snapshot of system properties.
* Snapshot could be used for thread safe iteration over system properties.
*
* @return Snapshot of system properties.
*/ */
public static Properties systemPropertiesSnapshot() { public static Properties snapshot() {
return (Properties)System.getProperties().clone(); return (Properties)System.getProperties().clone();
} }
} }
Expand Up @@ -1118,7 +1118,7 @@ private void fillNodeAttributes() throws IgniteCheckedException {
try { try {
// Stick all system properties into node's attributes overwriting any // Stick all system properties into node's attributes overwriting any
// identical names from environment properties. // identical names from environment properties.
for (Map.Entry<Object, Object> e : systemPropertiesSnapshot().entrySet()) { for (Map.Entry<Object, Object> e : snapshot().entrySet()) {
String key = (String)e.getKey(); String key = (String)e.getKey();


if (incProps == null || U.containsStringArray(incProps, key, true) || if (incProps == null || U.containsStringArray(incProps, key, true) ||
Expand Down Expand Up @@ -1908,7 +1908,7 @@ private void ackSystemProperties() {
assert log != null; assert log != null;


if (log.isDebugEnabled()) if (log.isDebugEnabled())
for (Map.Entry<Object, Object> entry : systemPropertiesSnapshot().entrySet()) for (Map.Entry<Object, Object> entry : snapshot().entrySet())
log.debug("System property [" + entry.getKey() + '=' + entry.getValue() + ']'); log.debug("System property [" + entry.getKey() + '=' + entry.getValue() + ']');
} }


Expand Down
Expand Up @@ -17,6 +17,7 @@


package org.apache.ignite.internal.visor.node; package org.apache.ignite.internal.visor.node;


import org.apache.ignite.*;
import org.apache.ignite.configuration.*; import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*; import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.internal.util.typedef.internal.*;
Expand All @@ -26,8 +27,6 @@
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;


import static java.lang.System.*;
import static org.apache.ignite.IgniteSystemProperties.*;
import static org.apache.ignite.internal.visor.util.VisorTaskUtils.*; import static org.apache.ignite.internal.visor.util.VisorTaskUtils.*;


/** /**
Expand Down Expand Up @@ -117,8 +116,8 @@ public VisorGridConfiguration from(IgniteEx ignite) {
caches = VisorCacheConfiguration.list(ignite, c.getCacheConfiguration()); caches = VisorCacheConfiguration.list(ignite, c.getCacheConfiguration());
igfss = VisorIgfsConfiguration.list(c.getFileSystemConfiguration()); igfss = VisorIgfsConfiguration.list(c.getFileSystemConfiguration());
streamers = VisorStreamerConfiguration.list(c.getStreamerConfiguration()); streamers = VisorStreamerConfiguration.list(c.getStreamerConfiguration());
env = new HashMap<>(getenv()); env = new HashMap<>(System.getenv());
sysProps = systemPropertiesSnapshot(); sysProps = IgniteSystemProperties.snapshot();
atomic = VisorAtomicConfiguration.from(c.getAtomicConfiguration()); atomic = VisorAtomicConfiguration.from(c.getAtomicConfiguration());
txCfg = VisorTransactionConfiguration.from(c.getTransactionConfiguration()); txCfg = VisorTransactionConfiguration.from(c.getTransactionConfiguration());
qryCfg = VisorQueryConfiguration.from(c.getQueryConfiguration()); qryCfg = VisorQueryConfiguration.from(c.getQueryConfiguration());
Expand Down

0 comments on commit a15c96b

Please sign in to comment.