Skip to content

Commit

Permalink
Distributed Classloading renamed to User Code Deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrinot committed Jan 23, 2017
1 parent f7b062e commit 43243bf
Show file tree
Hide file tree
Showing 42 changed files with 233 additions and 230 deletions.
26 changes: 13 additions & 13 deletions hazelcast-build-utils/src/test/resources/manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ Export-Package: com.hazelcast.cluster.impl;uses:="com.hazelcast.loggin
azelcast.concurrent.semaphore,com.hazelcast.spi,com.hazelcast.nio,com
.hazelcast.logging,com.hazelcast.spi.partition,com.hazelcast.nio.seri
alization,com.hazelcast.spi.impl";version="3.8.0.SNAPSHOT",com.hazelc
ast.internal.distributedclassloading.impl;uses:="com.hazelcast.nio.se
ast.internal.usercodedeployment.impl;uses:="com.hazelcast.nio.se
rialization,com.hazelcast.nio,com.hazelcast.logging,com.hazelcast.con
fig,com.hazelcast.internal.distributedclassloading,com.hazelcast.core
,com.hazelcast.spi,com.hazelcast.internal.distributedclassloading.imp
fig,com.hazelcast.internal.usercodedeployment,com.hazelcast.core
,com.hazelcast.spi,com.hazelcast.internal.usercodedeployment.imp
l.operation,com.hazelcast.internal.cluster,com.hazelcast.internal.uti
l.filter,com.hazelcast.util,com.hazelcast.internal.serialization.impl
,com.hazelcast.internal.serialization";version="3.8.0.SNAPSHOT",com.h
Expand Down Expand Up @@ -246,7 +246,7 @@ Export-Package: com.hazelcast.cluster.impl;uses:="com.hazelcast.loggin
.SNAPSHOT",com.hazelcast.util.function;version="3.8.0.SNAPSHOT",com.h
azelcast.util;uses:="com.hazelcast.nio,com.hazelcast.nio.serializatio
n,com.hazelcast.spi.serialization,com.hazelcast.core,com.hazelcast.in
stance,com.hazelcast.internal.distributedclassloading.impl,com.hazelc
stance,com.hazelcast.internal.usercodedeployment.impl,com.hazelc
ast.logging,com.hazelcast.transaction,com.hazelcast.spi.annotation,co
m.hazelcast.spi,com.hazelcast.internal.memory,com.hazelcast.internal.
memory.impl,javax.management,javax.management.openmbean,sun.misc,com.
Expand Down Expand Up @@ -422,7 +422,7 @@ Export-Package: com.hazelcast.cluster.impl;uses:="com.hazelcast.loggin
.hazelcast.nio,com.hazelcast.instance,com.hazelcast.spi.annotation,co
m.hazelcast.spi.impl.servicemanager.impl,com.hazelcast.spi.impl.execu
tionservice.impl,com.hazelcast.internal.management,com.hazelcast.inte
rnal.distributedclassloading,com.hazelcast.spi.impl.packetdispatcher.
rnal.usercodedeployment,com.hazelcast.spi.impl.packetdispatcher.
impl,com.hazelcast.quorum,com.hazelcast.spi.impl.eventservice,com.haz
elcast.internal.metrics.metricsets,com.hazelcast.spi.serialization,co
m.hazelcast.wan,com.hazelcast.spi.impl.executionservice,com.hazelcast
Expand Down Expand Up @@ -463,7 +463,7 @@ Export-Package: com.hazelcast.cluster.impl;uses:="com.hazelcast.loggin
lcast.spi,com.hazelcast.nio,com.hazelcast.core";version="3.8.0.SNAPSH
OT",com.hazelcast.internal.serialization.impl;uses:="com.hazelcast.lo
gging,com.hazelcast.core,com.hazelcast.nio.serialization,com.hazelcas
t.util,com.hazelcast.internal.distributedclassloading.impl,com.hazelc
t.util,com.hazelcast.internal.usercodedeployment.impl,com.hazelc
ast.internal.serialization.impl.bufferpool,com.hazelcast.nio,com.haze
lcast.internal.serialization,com.hazelcast.nio.serialization.impl,com
.hazelcast.util.collection,com.hazelcast.query.impl.getters,com.hazel
Expand Down Expand Up @@ -654,7 +654,7 @@ Export-Package: com.hazelcast.cluster.impl;uses:="com.hazelcast.loggin
.serialization,com.hazelcast.util,com.hazelcast.nio.serialization.imp
l,com.hazelcast.internal.cluster.impl,com.hazelcast.internal.memory,c
om.hazelcast.spi.annotation,com.hazelcast.internal.memory.impl,com.ha
zelcast.internal.distributedclassloading.impl,com.hazelcast.logging,c
zelcast.internal.usercodedeployment.impl,com.hazelcast.logging,c
om.hazelcast.nio.tcp,com.hazelcast.internal.ascii,com.hazelcast.spi,c
om.hazelcast.config,com.hazelcast.internal.networking,com.hazelcast.c
lient.impl.protocol,com.hazelcast.instance,com.hazelcast.internal.ser
Expand Down Expand Up @@ -694,7 +694,7 @@ Export-Package: com.hazelcast.cluster.impl;uses:="com.hazelcast.loggin
.executor.impl,com.hazelcast.concurrent.semaphore,com.hazelcast.durab
leexecutor,com.hazelcast.nio.serialization,com.hazelcast.internal.clu
ster.impl.operations,com.hazelcast.spi.impl.operationservice,com.haze
lcast.internal.distributedclassloading,com.hazelcast.internal.managem
lcast.internal.usercodedeployment,com.hazelcast.internal.managem
ent,com.hazelcast.spi.impl.eventservice,com.hazelcast.cluster.members
elector,com.hazelcast.spi.discovery,com.hazelcast.partition,com.hazel
cast.internal.ascii,com.hazelcast.spi.discovery.impl,com.hazelcast.sp
Expand Down Expand Up @@ -981,8 +981,8 @@ Export-Package: com.hazelcast.cluster.impl;uses:="com.hazelcast.loggin
PSHOT",com.hazelcast.config.properties;uses:="com.hazelcast.core,com.
hazelcast.util";version="3.8.0.SNAPSHOT",com.hazelcast.internal.distr
ibutedclassloading;uses:="com.hazelcast.logging,com.hazelcast.spi,com
.hazelcast.internal.distributedclassloading.impl.filter,com.hazelcast
.config,com.hazelcast.internal.distributedclassloading.impl,com.hazel
.hazelcast.internal.usercodedeployment.impl.filter,com.hazelcast
.config,com.hazelcast.internal.usercodedeployment.impl,com.hazel
cast.internal.util.filter";version="3.8.0.SNAPSHOT",com.hazelcast.hot
restart;uses:="com.hazelcast.internal.management.dto,com.hazelcast.ni
o";version="3.8.0.SNAPSHOT",com.hazelcast.spi;uses:="com.hazelcast.co
Expand Down Expand Up @@ -1564,9 +1564,9 @@ Export-Package: com.hazelcast.cluster.impl;uses:="com.hazelcast.loggin
m.hazelcast.internal.eviction,com.hazelcast.internal.eviction.impl.st
rategy.sampling";version="3.8.0.SNAPSHOT",com.hazelcast.spi.impl.prox
yservice;uses:="com.hazelcast.spi";version="3.8.0.SNAPSHOT",com.hazel
cast.internal.distributedclassloading.impl.operation;uses:="com.hazel
cast.internal.distributedclassloading,com.hazelcast.spi,com.hazelcast
.nio.serialization,com.hazelcast.internal.distributedclassloading.imp
cast.internal.usercodedeployment.impl.operation;uses:="com.hazel
cast.internal.usercodedeployment,com.hazelcast.spi,com.hazelcast
.nio.serialization,com.hazelcast.internal.usercodedeployment.imp
l,com.hazelcast.nio";version="3.8.0.SNAPSHOT",com.hazelcast.client.im
pl.operations;uses:="com.hazelcast.spi,com.hazelcast.nio.serializatio
n,com.hazelcast.client.impl,com.hazelcast.nio,com.hazelcast.client,co
Expand Down
18 changes: 9 additions & 9 deletions hazelcast/src/main/java/com/hazelcast/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public class Config {

private HotRestartPersistenceConfig hotRestartPersistenceConfig = new HotRestartPersistenceConfig();

private DistributedClassloadingConfig distributedClassloadingConfig = new DistributedClassloadingConfig();
private UserCodeDeploymentConfig userCodeDeploymentConfig = new UserCodeDeploymentConfig();

private String licenseKey;

Expand Down Expand Up @@ -1325,24 +1325,24 @@ public Config setLiteMember(boolean liteMember) {
}

/**
* Get current configuration of distributed classloading.
* Get current configuration of User Code Deployment.
*
* @since 3.8
*
*/
public DistributedClassloadingConfig getDistributedClassloadingConfig() {
return distributedClassloadingConfig;
public UserCodeDeploymentConfig getUserCodeDeploymentConfig() {
return userCodeDeploymentConfig;
}

/**
* Set distributed classloading configuration
* Set User Code Deployment configuration
*
* @param distributedClassloadingConfig
* @param userCodeDeploymentConfig
* @since 3.8
* @return distributed classloading configuration
* @return User Code Deployment configuration
*/
public Config setDistributedClassloadingConfig(DistributedClassloadingConfig distributedClassloadingConfig) {
this.distributedClassloadingConfig = distributedClassloadingConfig;
public Config setUserCodeDeploymentConfig(UserCodeDeploymentConfig userCodeDeploymentConfig) {
this.userCodeDeploymentConfig = userCodeDeploymentConfig;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
import com.hazelcast.spi.annotation.Beta;

/**
* Configuration of distributed classloading. When enabled it allows members to load classes from other members.
* This simplifies deployment as you do not have to deploy your domain classes into classpath of all cluster members.
* Configuration of User Code Deployment. When enabled it allows Hazelcast members to load classes from other cluster
* members. This simplifies deployment as you do not have to deploy your domain classes into classpath of all
* cluster members.
*
*/

@Beta
public class DistributedClassloadingConfig {
public class UserCodeDeploymentConfig {

/**
* Controls caching of caches loaded from remote members
Expand Down Expand Up @@ -77,34 +77,34 @@ public enum ProviderMode {
private boolean enabled;

/**
* Enable or disable distributed classloading. Default: {{@code false}}
* Enable or disable User Code Deployment. Default: {{@code false}}
*
* @param enabled
* @return
*/
public DistributedClassloadingConfig setEnabled(boolean enabled) {
public UserCodeDeploymentConfig setEnabled(boolean enabled) {
this.enabled = enabled;
return this;
}

/**
* Returns true when distributed classloading is enabled
* Returns true when User Code Deployment is enabled
*
* @return {{@code true}} when distributed classloading is enabled
* @return {{@code true}} when User Code Deployment is enabled
*/
public boolean isEnabled() {
return enabled;
}

/**
* Filter to constraint members to be used for classloading request when a class
* Filter to constraint members to be used for classloading request when a user class
* is not available locally.
*
* Filter format: <code>HAS_ATTRIBUTE:foo</code> this will send classloading requests
* only to members which has a member attribute <code>foo</code> set. Value is ignored,
* it can be any type. A present of the attribute is sufficient.
*
* This facility allows to have a control on classloading. You can e.g. start Hazelcast lite
* This facility allows to have a fine grained control on classloading. You can e.g. start Hazelcast lite
* members dedicated for class-serving.
*
* Example usage:
Expand All @@ -113,8 +113,8 @@ public boolean isEnabled() {
* <code>
* Config hazelcastConfig = new Config();
*
* DistributedClassloadingConfig distributedClassloadingConfig = hazelcastConfig.getDistributedClassloadingConfig();
* distributedClassloadingConfig.setProviderFilter(HAS_ATTRIBUTE:class-provider);
* UserCodeDeploymentConfig userCodeDeploymentConfig = hazelcastConfig.getUserCodeDeploymentConfig();
* userCodeDeploymentConfig.setProviderFilter(HAS_ATTRIBUTE:class-provider);
*
* HazecastInstance instance = Hazelcast.newHazelcastInstance(hazelcastConfig);
* </code>
Expand All @@ -139,9 +139,9 @@ public boolean isEnabled() {
*
* @see {@link com.hazelcast.core.Member#setStringAttribute(String, String)}
* @param providerFilter
* @return this instance of DistributedClassloadingConfig for easy method-chaining.
* @return this instance of UserCodeDeploymentConfig for easy method-chaining.
*/
public DistributedClassloadingConfig setProviderFilter(String providerFilter) {
public UserCodeDeploymentConfig setProviderFilter(String providerFilter) {
this.providerFilter = providerFilter;
return this;
}
Expand Down Expand Up @@ -171,9 +171,9 @@ public String getProviderFilter() {
* Default: {{@code null}}
*
* @param blacklistedPrefixes
* @return this instance of DistributedClassloadingConfig for easy method-chaining.
* @return this instance of UserCodeDeploymentConfig for easy method-chaining.
*/
public DistributedClassloadingConfig setBlacklistedPrefixes(String blacklistedPrefixes) {
public UserCodeDeploymentConfig setBlacklistedPrefixes(String blacklistedPrefixes) {
this.blacklistedPrefixes = blacklistedPrefixes;
return this;
}
Expand All @@ -191,7 +191,7 @@ public String getBlacklistedPrefixes() {
/**
* Comma separated list of prefixes of classes which will be loaded remotely.
*
* Use this to enable distributed loading of selected classes only and disable remote loading for all
* Use this to enable User Code Deployment of selected classes only and disable remote loading for all
* other classes. This gives you a nice control over classloading.
*
* The prefixes are interpreted by using the same rules as desribed at {{@link #setBlacklistedPrefixes(String)}}
Expand All @@ -200,9 +200,9 @@ public String getBlacklistedPrefixes() {
* to load from remote members.
*
* @param whitelistedPrefixes
* @return this instance of DistributedClassloadingConfig for easy method-chaining.
* @return this instance of UserCodeDeploymentConfig for easy method-chaining.
*/
public DistributedClassloadingConfig setWhitelistedPrefixes(String whitelistedPrefixes) {
public UserCodeDeploymentConfig setWhitelistedPrefixes(String whitelistedPrefixes) {
this.whitelistedPrefixes = whitelistedPrefixes;
return this;
}
Expand All @@ -223,9 +223,9 @@ public String getWhitelistedPrefixes() {
*
* @see {@link ProviderMode}
* @param providerMode
* @return this instance of DistributedClassloadingConfig for easy method-chaining.
* @return this instance of UserCodeDeploymentConfig for easy method-chaining.
*/
public DistributedClassloadingConfig setProviderMode(ProviderMode providerMode) {
public UserCodeDeploymentConfig setProviderMode(ProviderMode providerMode) {
this.providerMode = providerMode;
return this;
}
Expand All @@ -246,9 +246,9 @@ public ProviderMode getProviderMode() {
*
* @see {@link ClassCacheMode}
* @param classCacheMode
* @return this instance of DistributedClassloadingConfig for easy method-chaining.
* @return this instance of UserCodeDeploymentConfig for easy method-chaining.
*/
public DistributedClassloadingConfig setClassCacheMode(ClassCacheMode classCacheMode) {
public UserCodeDeploymentConfig setClassCacheMode(ClassCacheMode classCacheMode) {
this.classCacheMode = classCacheMode;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
import com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig;
import com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig;
import com.hazelcast.config.CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig.ExpiryPolicyType;
import com.hazelcast.config.DistributedClassloadingConfig.ClassCacheMode;
import com.hazelcast.config.DistributedClassloadingConfig.ProviderMode;
import com.hazelcast.config.EvictionConfig.MaxSizePolicy;
import com.hazelcast.config.LoginModuleConfig.LoginModuleUsage;
import com.hazelcast.config.PartitionGroupConfig.MemberGroupType;
import com.hazelcast.config.PermissionConfig.PermissionType;
import com.hazelcast.config.UserCodeDeploymentConfig.ClassCacheMode;
import com.hazelcast.config.UserCodeDeploymentConfig.ProviderMode;
import com.hazelcast.core.HazelcastException;
import com.hazelcast.logging.ILogger;
import com.hazelcast.logging.Logger;
Expand Down Expand Up @@ -62,7 +62,7 @@
import static com.hazelcast.config.MapStoreConfig.InitialLoadMode;
import static com.hazelcast.config.XmlElements.CACHE;
import static com.hazelcast.config.XmlElements.CARDINALITY_ESTIMATOR;
import static com.hazelcast.config.XmlElements.DISTRIBUTED_CLASSLOADING;
import static com.hazelcast.config.XmlElements.USER_CODE_DEPLOYMENT;
import static com.hazelcast.config.XmlElements.DURABLE_EXECUTOR_SERVICE;
import static com.hazelcast.config.XmlElements.EXECUTOR_SERVICE;
import static com.hazelcast.config.XmlElements.GROUP;
Expand Down Expand Up @@ -367,8 +367,8 @@ private boolean handleXmlNode(Node node, String nodeName) throws Exception {
handleLiteMember(node);
} else if (HOT_RESTART_PERSISTENCE.isEqual(nodeName)) {
handleHotRestartPersistence(node);
} else if (DISTRIBUTED_CLASSLOADING.isEqual(nodeName)) {
handleDistributedClassLoading(node);
} else if (USER_CODE_DEPLOYMENT.isEqual(nodeName)) {
handleUserCodeDeployment(node);
} else if (CARDINALITY_ESTIMATOR.isEqual(nodeName)) {
handleCardinalityEstimator(node);
} else {
Expand All @@ -385,8 +385,8 @@ private void handleInstanceName(Node node) {
config.setInstanceName(instanceName);
}

private void handleDistributedClassLoading(Node dcRoot) {
DistributedClassloadingConfig dcConfig = new DistributedClassloadingConfig();
private void handleUserCodeDeployment(Node dcRoot) {
UserCodeDeploymentConfig dcConfig = new UserCodeDeploymentConfig();
Node attrEnabled = dcRoot.getAttributes().getNamedItem("enabled");
boolean enabled = getBooleanValue(getTextContent(attrEnabled));
dcConfig.setEnabled(enabled);
Expand Down Expand Up @@ -418,7 +418,7 @@ private void handleDistributedClassLoading(Node dcRoot) {
dcConfig.setProviderFilter(value);
}
}
config.setDistributedClassloadingConfig(dcConfig);
config.setUserCodeDeploymentConfig(dcConfig);
}

private void handleHotRestartPersistence(Node hrRoot) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ enum XmlElements {
QUORUM("quorum", true),
LITE_MEMBER("lite-member", false),
HOT_RESTART_PERSISTENCE("hot-restart-persistence", false),
DISTRIBUTED_CLASSLOADING("distributed-classloading", false),
USER_CODE_DEPLOYMENT("user-code-deployment", false),
CARDINALITY_ESTIMATOR("cardinality-estimator", false),
;

Expand Down
14 changes: 7 additions & 7 deletions hazelcast/src/main/java/com/hazelcast/instance/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.hazelcast.cluster.memberselector.MemberSelectors;
import com.hazelcast.config.Config;
import com.hazelcast.config.DiscoveryConfig;
import com.hazelcast.config.DistributedClassloadingConfig;
import com.hazelcast.config.UserCodeDeploymentConfig;
import com.hazelcast.config.JoinConfig;
import com.hazelcast.config.ListenerConfig;
import com.hazelcast.config.MemberAttributeConfig;
Expand All @@ -44,7 +44,7 @@
import com.hazelcast.internal.cluster.impl.MulticastJoiner;
import com.hazelcast.internal.cluster.impl.MulticastService;
import com.hazelcast.internal.cluster.impl.SplitBrainJoinMessage;
import com.hazelcast.internal.distributedclassloading.DistributedClassLoader;
import com.hazelcast.internal.usercodedeployment.UserCodeDeploymentClassLoader;
import com.hazelcast.internal.management.ManagementCenterService;
import com.hazelcast.internal.partition.InternalPartitionService;
import com.hazelcast.internal.partition.impl.InternalMigrationListener;
Expand Down Expand Up @@ -222,15 +222,15 @@ public Node(HazelcastInstanceImpl hazelcastInstance, Config config, NodeContext
}

private ClassLoader getConfigClassloader(Config config) {
DistributedClassloadingConfig distributedClassloadingConfig = config.getDistributedClassloadingConfig();
UserCodeDeploymentConfig userCodeDeploymentConfig = config.getUserCodeDeploymentConfig();
ClassLoader classLoader;
if (distributedClassloadingConfig.isEnabled()) {
if (userCodeDeploymentConfig.isEnabled()) {
ClassLoader parent = config.getClassLoader();
final ClassLoader theParent = parent == null ? Node.class.getClassLoader() : parent;
classLoader = doPrivileged(new PrivilegedAction<DistributedClassLoader>() {
classLoader = doPrivileged(new PrivilegedAction<UserCodeDeploymentClassLoader>() {
@Override
public DistributedClassLoader run() {
return new DistributedClassLoader(theParent);
public UserCodeDeploymentClassLoader run() {
return new UserCodeDeploymentClassLoader(theParent);
}
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.hazelcast.core.HazelcastInstanceNotActiveException;
import com.hazelcast.core.ManagedContext;
import com.hazelcast.core.PartitioningStrategy;
import com.hazelcast.internal.distributedclassloading.impl.ClassLocator;
import com.hazelcast.internal.usercodedeployment.impl.ClassLocator;
import com.hazelcast.internal.serialization.InputOutputFactory;
import com.hazelcast.internal.serialization.InternalSerializationService;
import com.hazelcast.internal.serialization.impl.bufferpool.BufferPool;
Expand Down
Loading

0 comments on commit 43243bf

Please sign in to comment.