Skip to content

Commit

Permalink
# ignite-164 : GridNodeAttributes -> IgniteNodeAttributes (auto-renam…
Browse files Browse the repository at this point in the history
…ing)
  • Loading branch information
ashutakGG committed Feb 3, 2015
1 parent aa74616 commit d4c21ba
Show file tree
Hide file tree
Showing 52 changed files with 83 additions and 84 deletions.
Expand Up @@ -55,17 +55,17 @@ public class ClientTcpConnectivitySelfTest extends ClientAbstractConnectivitySel

/** {@inheritDoc} */
@Override protected String restAddressAttributeName() {
return GridNodeAttributes.ATTR_REST_TCP_ADDRS;
return IgniteNodeAttributes.ATTR_REST_TCP_ADDRS;
}

/** {@inheritDoc} */
@Override protected String restHostNameAttributeName() {
return GridNodeAttributes.ATTR_REST_TCP_HOST_NAMES;
return IgniteNodeAttributes.ATTR_REST_TCP_HOST_NAMES;
}

/** {@inheritDoc} */
@Override protected String restPortAttributeName() {
return GridNodeAttributes.ATTR_REST_TCP_PORT;
return IgniteNodeAttributes.ATTR_REST_TCP_PORT;
}

/** {@inheritDoc} */
Expand Down
Expand Up @@ -446,7 +446,7 @@ private Map<UUID, Collection<ClusterNode>> neighbors(Collection<ClusterNode> top

// Group by mac addresses.
for (ClusterNode node : topSnapshot) {
String macs = node.attribute(GridNodeAttributes.ATTR_MACS);
String macs = node.attribute(IgniteNodeAttributes.ATTR_MACS);

Collection<ClusterNode> nodes = macMap.get(macs);

Expand Down
Expand Up @@ -26,7 +26,7 @@
import java.util.*;

import static org.apache.ignite.client.util.GridClientUtils.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;

/**
* Compute projection implementation.
Expand Down
Expand Up @@ -34,7 +34,7 @@
import java.util.concurrent.atomic.*;
import java.util.logging.*;

import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;

/**
* Client implementation.
Expand Down
Expand Up @@ -41,7 +41,7 @@

import static java.util.logging.Level.*;
import static org.apache.ignite.client.impl.connection.GridClientConnectionCloseReason.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;

/**
* Cached connections manager.
Expand Down
Expand Up @@ -29,7 +29,7 @@
import java.util.concurrent.locks.*;
import java.util.logging.*;

import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;

/**
* Client topology cache.
Expand Down
Expand Up @@ -18,7 +18,6 @@
package org.apache.ignite.cluster;

import org.apache.ignite.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.lang.*;
import org.jetbrains.annotations.*;

Expand Down Expand Up @@ -130,7 +129,7 @@ public interface ClusterNode {
* <ul>
* <li>{@code {@link System#getProperties()}} - All system properties.</li>
* <li>{@code {@link System#getenv(String)}} - All environment properties.</li>
* <li>All attributes defined in {@link GridNodeAttributes}</li>
* <li>All attributes defined in {@link org.apache.ignite.internal.IgniteNodeAttributes}</li>
* </ul>
* <p>
* Note that attributes cannot be changed at runtime.
Expand Down Expand Up @@ -165,7 +164,7 @@ public interface ClusterNode {
* <ul>
* <li>{@code {@link System#getProperties()}} - All system properties.</li>
* <li>{@code {@link System#getenv(String)}} - All environment properties.</li>
* <li>All attributes defined in {@link GridNodeAttributes}</li>
* <li>All attributes defined in {@link org.apache.ignite.internal.IgniteNodeAttributes}</li>
* </ul>
* <p>
* Note that attributes cannot be changed at runtime.
Expand Down
Expand Up @@ -31,7 +31,7 @@
import java.util.*;
import java.util.concurrent.*;

import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;

/**
*
Expand Down
Expand Up @@ -25,7 +25,7 @@

import java.util.*;

import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;

/**
* Special kill task that never fails over jobs.
Expand Down
Expand Up @@ -93,7 +93,7 @@

import static org.apache.ignite.IgniteSystemProperties.*;
import static org.apache.ignite.internal.GridKernalState.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.internal.GridProductImpl.*;
import static org.apache.ignite.internal.IgniteComponentType.*;
import static org.apache.ignite.internal.processors.license.GridLicenseSubsystem.*;
Expand Down
Expand Up @@ -20,7 +20,7 @@
/**
* This class defines constants (NOT enums) for <b>internally-used</b> node attributes.
*/
public final class GridNodeAttributes {
public final class IgniteNodeAttributes {
/** Prefix for internally reserved attribute names. */
public static final String ATTR_PREFIX = "org.gridgain";

Expand Down Expand Up @@ -139,7 +139,7 @@ public final class GridNodeAttributes {
/**
* Enforces singleton.
*/
private GridNodeAttributes() {
private IgniteNodeAttributes() {
/* No-op. */
}
}
Expand Up @@ -53,7 +53,7 @@

import static java.util.concurrent.TimeUnit.*;
import static org.apache.ignite.events.IgniteEventType.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.plugin.segmentation.GridSegmentationPolicy.*;

/**
Expand Down Expand Up @@ -207,7 +207,7 @@ public void setNodeAttributes(Map<String, Object> attrs, IgniteProductVersion ve
// No-op.
}

attrs.put(GridNodeAttributes.ATTR_PHY_RAM, totSysMemory);
attrs.put(IgniteNodeAttributes.ATTR_PHY_RAM, totSysMemory);

getSpi().setNodeAttributes(attrs, ver);
}
Expand Down
Expand Up @@ -63,7 +63,7 @@
import static org.apache.ignite.cache.CachePreloadMode.*;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
import static org.apache.ignite.configuration.IgniteDeploymentMode.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.internal.IgniteComponentType.*;
import static org.apache.ignite.internal.processors.cache.GridCacheUtils.*;
import static org.apache.ignite.transactions.IgniteTxIsolation.*;
Expand Down Expand Up @@ -1067,7 +1067,7 @@ private void checkCache(ClusterNode rmt) throws IgniteCheckedException {
return;

IgniteDeploymentMode locDepMode = ctx.config().getDeploymentMode();
IgniteDeploymentMode rmtDepMode = rmt.attribute(GridNodeAttributes.ATTR_DEPLOYMENT_MODE);
IgniteDeploymentMode rmtDepMode = rmt.attribute(IgniteNodeAttributes.ATTR_DEPLOYMENT_MODE);

for (GridCacheAttributes rmtAttr : rmtAttrs) {
for (GridCacheAttributes locAttr : locAttrs) {
Expand Down
Expand Up @@ -50,7 +50,7 @@
import static org.apache.ignite.cache.CachePreloadMode.*;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
import static org.apache.ignite.cache.GridCachePeekMode.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.internal.GridTopic.*;
import static org.apache.ignite.internal.processors.cache.GridCacheOperation.*;

Expand Down
Expand Up @@ -34,7 +34,7 @@
import java.util.*;

import static org.apache.ignite.events.IgniteEventType.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.internal.GridTopic.*;
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;

Expand Down
Expand Up @@ -46,7 +46,7 @@
import java.util.concurrent.atomic.*;

import static org.apache.ignite.events.IgniteEventType.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.internal.GridTopic.*;
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;

Expand Down
Expand Up @@ -27,7 +27,7 @@

import java.util.*;

import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;

/**
* GGFS context holding all required components for GGFS instance.
Expand Down
Expand Up @@ -47,7 +47,7 @@

import static org.apache.ignite.events.IgniteEventType.*;
import static org.apache.ignite.fs.IgniteFsMode.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.internal.GridTopic.*;
import static org.apache.ignite.internal.processors.fs.GridGgfsFileInfo.*;

Expand Down
Expand Up @@ -43,7 +43,7 @@
import static org.apache.ignite.cache.CacheMemoryMode.*;
import static org.apache.ignite.cache.CacheMode.*;
import static org.apache.ignite.fs.IgniteFsMode.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.internal.processors.license.GridLicenseSubsystem.*;

/**
Expand Down Expand Up @@ -390,8 +390,8 @@ else if (offHeapSize > 0 && maxSpaceSize > maxHeapSize + offHeapSize)
* @throws IgniteCheckedException If check failed.
*/
private void checkGgfsOnRemoteNode(ClusterNode rmtNode) throws IgniteCheckedException {
GridGgfsAttributes[] locAttrs = ctx.discovery().localNode().attribute(GridNodeAttributes.ATTR_GGFS);
GridGgfsAttributes[] rmtAttrs = rmtNode.attribute(GridNodeAttributes.ATTR_GGFS);
GridGgfsAttributes[] locAttrs = ctx.discovery().localNode().attribute(IgniteNodeAttributes.ATTR_GGFS);
GridGgfsAttributes[] rmtAttrs = rmtNode.attribute(IgniteNodeAttributes.ATTR_GGFS);

if (F.isEmpty(locAttrs) || F.isEmpty(rmtAttrs))
return;
Expand Down
Expand Up @@ -35,7 +35,7 @@
import java.net.*;
import java.util.*;

import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.internal.processors.rest.GridRestCommand.*;

/**
Expand Down
Expand Up @@ -320,16 +320,16 @@ private boolean startTcpServer(InetAddress hostAddr, int port, GridNioServerList

/** {@inheritDoc} */
@Override protected String getAddressPropertyName() {
return GridNodeAttributes.ATTR_REST_TCP_ADDRS;
return IgniteNodeAttributes.ATTR_REST_TCP_ADDRS;
}

/** {@inheritDoc} */
@Override protected String getHostNamePropertyName() {
return GridNodeAttributes.ATTR_REST_TCP_HOST_NAMES;
return IgniteNodeAttributes.ATTR_REST_TCP_HOST_NAMES;
}

/** {@inheritDoc} */
@Override protected String getPortPropertyName() {
return GridNodeAttributes.ATTR_REST_TCP_PORT;
return IgniteNodeAttributes.ATTR_REST_TCP_PORT;
}
}
Expand Up @@ -33,7 +33,7 @@
import java.util.*;

import static org.apache.ignite.IgniteSystemProperties.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.internal.processors.license.GridLicenseSubsystem.*;

/**
Expand Down
Expand Up @@ -80,7 +80,7 @@

import static org.apache.ignite.IgniteSystemProperties.*;
import static org.apache.ignite.events.IgniteEventType.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;

/**
* Collection of utility methods used throughout the system.
Expand Down Expand Up @@ -1718,8 +1718,8 @@ public static boolean sameMacs(ClusterNode loc, ClusterNode rmt) {
assert loc != null;
assert rmt != null;

String locMacs = loc.attribute(GridNodeAttributes.ATTR_MACS);
String rmtMacs = rmt.attribute(GridNodeAttributes.ATTR_MACS);
String locMacs = loc.attribute(IgniteNodeAttributes.ATTR_MACS);
String rmtMacs = rmt.attribute(IgniteNodeAttributes.ATTR_MACS);

return locMacs != null && locMacs.equals(rmtMacs);
}
Expand Down
Expand Up @@ -424,7 +424,7 @@ private void checkConfigurationConsistency(IgniteSpiContext spiCtx, ClusterNode
if (!enabled)
return;

String clsAttr = createSpiAttributeName(GridNodeAttributes.ATTR_SPI_CLASS);
String clsAttr = createSpiAttributeName(IgniteNodeAttributes.ATTR_SPI_CLASS);

String name = getName();

Expand Down
Expand Up @@ -46,7 +46,7 @@
import java.util.concurrent.*;

import static org.apache.ignite.events.IgniteEventType.*;
import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;
import static org.apache.ignite.spi.IgnitePortProtocol.*;
import static org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoverySpiState.*;
import static org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryHeartbeatMessage.*;
Expand Down Expand Up @@ -1259,7 +1259,7 @@ private void joinTopology() throws IgniteSpiException {
}

GridSecurityCredentials locCred = (GridSecurityCredentials)locNode.getAttributes()
.get(GridNodeAttributes.ATTR_SECURITY_CREDENTIALS);
.get(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS);

// Marshal credentials for backward compatibility and security.
marshalCredentials(locNode);
Expand All @@ -1278,9 +1278,9 @@ private void joinTopology() throws IgniteSpiException {

Map<String, Object> attrs = new HashMap<>(locNode.attributes());

attrs.put(GridNodeAttributes.ATTR_SECURITY_SUBJECT,
attrs.put(IgniteNodeAttributes.ATTR_SECURITY_SUBJECT,
ignite.configuration().getMarshaller().marshal(subj));
attrs.remove(GridNodeAttributes.ATTR_SECURITY_CREDENTIALS);
attrs.remove(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS);

locNode.setAttributes(attrs);
}
Expand Down Expand Up @@ -1666,8 +1666,8 @@ private void marshalCredentials(TcpDiscoveryNode node) throws IgniteSpiException
// Use security-unsafe getter.
Map<String, Object> attrs = new HashMap<>(node.getAttributes());

attrs.put(GridNodeAttributes.ATTR_SECURITY_CREDENTIALS,
marsh.marshal(attrs.get(GridNodeAttributes.ATTR_SECURITY_CREDENTIALS)));
attrs.put(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS,
marsh.marshal(attrs.get(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS)));

node.setAttributes(attrs);
}
Expand All @@ -1685,7 +1685,7 @@ private void marshalCredentials(TcpDiscoveryNode node) throws IgniteSpiException
*/
private GridSecurityCredentials unmarshalCredentials(TcpDiscoveryNode node) throws IgniteSpiException {
try {
byte[] credBytes = (byte[])node.getAttributes().get(GridNodeAttributes.ATTR_SECURITY_CREDENTIALS);
byte[] credBytes = (byte[])node.getAttributes().get(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS);

if (credBytes == null)
return null;
Expand Down Expand Up @@ -3149,7 +3149,7 @@ private void processJoinRequestMessage(TcpDiscoveryJoinRequestMessage msg) {
// Stick in authentication subject to node (use security-safe attributes for copy).
Map<String, Object> attrs = new HashMap<>(node.getAttributes());

attrs.put(GridNodeAttributes.ATTR_SECURITY_SUBJECT,
attrs.put(IgniteNodeAttributes.ATTR_SECURITY_SUBJECT,
ignite.configuration().getMarshaller().marshal(subj));

node.setAttributes(attrs);
Expand Down Expand Up @@ -3590,7 +3590,7 @@ private void processNodeAddedMessage(TcpDiscoveryNodeAddedMessage msg) {
GridSecurityContext subj = nodeAuth.authenticateNode(node, cred);

GridSecurityContext coordSubj = ignite.configuration().getMarshaller().unmarshal(
node.<byte[]>attribute(GridNodeAttributes.ATTR_SECURITY_SUBJECT), U.gridClassLoader());
node.<byte[]>attribute(IgniteNodeAttributes.ATTR_SECURITY_SUBJECT), U.gridClassLoader());

if (!permissionsEqual(coordSubj.subject().permissions(), subj.subject().permissions())) {
// Node has not pass authentication.
Expand Down
Expand Up @@ -31,7 +31,7 @@
import java.net.*;
import java.util.*;

import static org.apache.ignite.internal.GridNodeAttributes.*;
import static org.apache.ignite.internal.IgniteNodeAttributes.*;

/**
* Node for {@link org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi}.
Expand Down Expand Up @@ -156,7 +156,7 @@ public TcpDiscoveryNode(UUID id, Collection<String> addrs, Collection<String> ho
@SuppressWarnings("unchecked")
@Override public <T> T attribute(String name) {
// Even though discovery SPI removes this attribute after authentication, keep this check for safety.
if (GridNodeAttributes.ATTR_SECURITY_CREDENTIALS.equals(name))
if (IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS.equals(name))
return null;

return (T)attrs.get(name);
Expand All @@ -167,7 +167,7 @@ public TcpDiscoveryNode(UUID id, Collection<String> addrs, Collection<String> ho
// Even though discovery SPI removes this attribute after authentication, keep this check for safety.
return F.view(attrs, new IgnitePredicate<String>() {
@Override public boolean apply(String s) {
return !GridNodeAttributes.ATTR_SECURITY_CREDENTIALS.equals(s);
return !IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS.equals(s);
}
});
}
Expand Down

0 comments on commit d4c21ba

Please sign in to comment.