Skip to content

Commit

Permalink
WFLY-6803 Add multi-server support to mod_cluster
Browse files Browse the repository at this point in the history
WFLY-10439 Modernize mod_cluster subsystem
WFLY-10490 Expose ModClusterServiceMBean as a mod_cluster capability

Bugs:
WFLY-10501 mod_cluster "advertise-socket" attribute is missing a capability reference
WFLY-10442 mod_cluster proxy operations' rollback handlers make potentially dangerous assumptions
WFLY-10479 mod_cluster "proxies" attribute is missing a capability reference
WFLY-10441 mod_cluster proxy operations are incorrectly registered at the subsystem level
WFLY-10445 mod_cluster enable/disable/enable-context/disable-context proxy operations do not return the result
WFLY-10473 mod_cluster subsystem add operation attempts to start services prematurely
WFLY-10444 mod_cluster add-proxy operation should not try to resolve the hostname

Tasks:
WFLY-10467 Drop support for mod_cluster subsystem model versions prior 1.5.0
WFLY-10443 Deprecate and schedule for removal redundant mod_cluster add/remove-[custom-]metric operations
  • Loading branch information
rhusar committed Jul 23, 2018
1 parent 41bdce0 commit 4fe8c7c
Show file tree
Hide file tree
Showing 115 changed files with 4,509 additions and 4,592 deletions.
Expand Up @@ -28,7 +28,7 @@
/** /**
* Generic interface for some object capable of execution. * Generic interface for some object capable of execution.
* @author Paul Ferraro * @author Paul Ferraro
* @param C the execution context * @param <C> the execution context
*/ */
public interface Executable<C> { public interface Executable<C> {
/** /**
Expand Down
Expand Up @@ -35,8 +35,8 @@
/** /**
* Generic operation handler for an executable management object. * Generic operation handler for an executable management object.
* @author Paul Ferraro * @author Paul Ferraro
* @param C the execution context * @param <C> the execution context
* @param E the contextual executable * @param <E> the contextual executable
*/ */
public class ExecutionHandler<C, E extends Executable<C>> extends AbstractRuntimeOnlyHandler { public class ExecutionHandler<C, E extends Executable<C>> extends AbstractRuntimeOnlyHandler {


Expand All @@ -48,7 +48,7 @@ public class ExecutionHandler<C, E extends Executable<C>> extends AbstractRuntim
* Constructs a new ExecutionHandler * Constructs a new ExecutionHandler
* @param executor an executor * @param executor an executor
* @param executables the executables sharing this handler * @param executables the executables sharing this handler
* @param name a function returning the name of an executable * @param nameFactory a function returning the name of an executable
*/ */
public ExecutionHandler(Executor<C, E> executor, Collection<? extends E> executables, Function<E, String> nameFactory, Function<ModelNode, String> nameExtractor) { public ExecutionHandler(Executor<C, E> executor, Collection<? extends E> executables, Function<E, String> nameFactory, Function<ModelNode, String> nameExtractor) {
this.executor = executor; this.executor = executor;
Expand All @@ -63,7 +63,7 @@ protected void executeRuntimeStep(OperationContext context, ModelNode operation)
String name = this.nameExtractor.apply(operation); String name = this.nameExtractor.apply(operation);
E executable = this.executables.get(name); E executable = this.executables.get(name);
try { try {
ModelNode result = this.executor.execute(context, executable); ModelNode result = this.executor.execute(context, operation, executable);
if (result != null) { if (result != null) {
context.getResult().set(result); context.getResult().set(result);
} }
Expand Down
Expand Up @@ -28,9 +28,9 @@


/** /**
* Encapsulates the execution of a contextual executable. * Encapsulates the execution of a contextual executable.
* @param <C> the execution context
* @param <E> the contextual executable
* @author Paul Ferraro * @author Paul Ferraro
* @param C the execution context
* @param E the contextual executable
*/ */
public interface Executor<C, E extends Executable<C>> { public interface Executor<C, E extends Executable<C>> {
/** /**
Expand All @@ -40,5 +40,18 @@ public interface Executor<C, E extends Executable<C>> {
* @return the result of the execution (possibly null). * @return the result of the execution (possibly null).
* @throws OperationFailedException if execution fails * @throws OperationFailedException if execution fails
*/ */
@Deprecated
ModelNode execute(OperationContext context, E executable) throws OperationFailedException; ModelNode execute(OperationContext context, E executable) throws OperationFailedException;

/**
* Executes the specified executable against the specified operation context.
* @param context an operation context
* @param operation the operation being executed
* @param executable the contextual executable object
* @return the result of the execution (possibly null).
* @throws OperationFailedException if execution fails
*/
default ModelNode execute(OperationContext context, ModelNode operation, E executable) throws OperationFailedException {
return this.execute(context, executable);
}
} }
Expand Up @@ -53,7 +53,7 @@ public class LegacyPropertyWriteOperationTransformer implements OperationTransfo
private final UnaryOperator<PathAddress> addressTransformer; private final UnaryOperator<PathAddress> addressTransformer;


/** /**
* Constructs a new LegacyPropertyWriteOperationTransformer with no address tranformation. * Constructs a new LegacyPropertyWriteOperationTransformer with no address transformation.
*/ */
public LegacyPropertyWriteOperationTransformer() { public LegacyPropertyWriteOperationTransformer() {
this(UnaryOperator.identity()); this(UnaryOperator.identity());
Expand Down
Expand Up @@ -48,7 +48,6 @@ public class AsyncServiceConfigurator extends SimpleServiceNameProvider implemen
/** /**
* Constructs a new builder for building asynchronous service * Constructs a new builder for building asynchronous service
* @param name the target service name * @param name the target service name
* @param service the target service
*/ */
public AsyncServiceConfigurator(ServiceName name) { public AsyncServiceConfigurator(ServiceName name) {
super(name); super(name);
Expand Down
Expand Up @@ -26,7 +26,7 @@
import org.jboss.msc.service.ServiceTarget; import org.jboss.msc.service.ServiceTarget;


/** /**
* Configures the dependendies of a {@link org.jboss.msc.Service}. * Configures the dependencies of a {@link org.jboss.msc.Service}.
* @author Paul Ferraro * @author Paul Ferraro
*/ */
public interface ServiceConfigurator extends ServiceNameProvider { public interface ServiceConfigurator extends ServiceNameProvider {
Expand Down
Expand Up @@ -4,7 +4,7 @@
<feature-group name="basic-profile"> <feature-group name="basic-profile">
<include feature-id="subsystem.undertow:subsystem=undertow"> <include feature-id="subsystem.undertow:subsystem=undertow">
<feature spec="subsystem.undertow.server"> <feature spec="subsystem.undertow.server">
<param name="server" value="default-server" /> <param name="server" value="default-server"/>
<feature spec="subsystem.undertow.server.ajp-listener"> <feature spec="subsystem.undertow.server.ajp-listener">
<param name="ajp-listener" value="ajp"/> <param name="ajp-listener" value="ajp"/>
<param name="socket-binding" value="ajp"/> <param name="socket-binding" value="ajp"/>
Expand Down
Expand Up @@ -23,7 +23,8 @@
<param name="profile" value="full-ha"/> <param name="profile" value="full-ha"/>
<feature-group name="domain-ha-profile"> <feature-group name="domain-ha-profile">
<feature spec="subsystem.modcluster"> <feature spec="subsystem.modcluster">
<feature spec="subsystem.modcluster.mod-cluster-config.configuration"> <feature spec="subsystem.modcluster.proxy">
<param name="proxy" value="default"/>
<unset param="advertise-socket"/> <unset param="advertise-socket"/>
<param name="advertise" value="false"/> <param name="advertise" value="false"/>
<param name="proxies" value=""/> <param name="proxies" value=""/>
Expand Down
Expand Up @@ -17,7 +17,8 @@
<param name="profile" value="ha"/> <param name="profile" value="ha"/>
<feature-group name="domain-ha-profile"> <feature-group name="domain-ha-profile">
<feature spec="subsystem.modcluster"> <feature spec="subsystem.modcluster">
<feature spec="subsystem.modcluster.mod-cluster-config.configuration"> <feature spec="subsystem.modcluster.proxy">
<param name="proxy" value="default"/>
<unset param="advertise-socket"/> <unset param="advertise-socket"/>
<param name="advertise" value="false"/> <param name="advertise" value="false"/>
<param name="proxies" value=""/> <param name="proxies" value=""/>
Expand Down
7 changes: 4 additions & 3 deletions galleon-pack/src/main/resources/feature_groups/modcluster.xml
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<feature-group-spec name="modcluster" xmlns="urn:jboss:galleon:feature-group:1.0"> <feature-group-spec name="modcluster" xmlns="urn:jboss:galleon:feature-group:1.0">
<feature spec="subsystem.modcluster"> <feature spec="subsystem.modcluster">
<feature spec="subsystem.modcluster.mod-cluster-config.configuration"> <feature spec="subsystem.modcluster.proxy">
<param name="proxy" value="default"/>
<param name="advertise-socket" value="modcluster"/> <param name="advertise-socket" value="modcluster"/>
<param name="connector" value="ajp"/> <param name="connector" value="ajp"/>
<feature spec="subsystem.modcluster.mod-cluster-config.configuration.dynamic-load-provider.configuration"> <feature spec="subsystem.modcluster.proxy.dynamic-load-provider.configuration">
<feature spec="subsystem.modcluster.mod-cluster-config.configuration.dynamic-load-provider.configuration.load-metric"> <feature spec="subsystem.modcluster.proxy.dynamic-load-provider.configuration.load-metric">
<param name="load-metric" value="cpu"/> <param name="load-metric" value="cpu"/>
<param name="type" value="cpu"/> <param name="type" value="cpu"/>
</feature> </feature>
Expand Down
Expand Up @@ -14,7 +14,8 @@


<feature-group name="standalone-ha"> <feature-group name="standalone-ha">
<feature spec="subsystem.modcluster"> <feature spec="subsystem.modcluster">
<feature spec="subsystem.modcluster.mod-cluster-config.configuration"> <feature spec="subsystem.modcluster.proxy">
<param name="proxy" value="default"/>
<unset param="advertise-socket"/> <unset param="advertise-socket"/>
<param name="advertise" value="false"/> <param name="advertise" value="false"/>
<param name="proxies" value=""/> <param name="proxies" value=""/>
Expand Down
Expand Up @@ -29,7 +29,8 @@
</origin> </origin>
<feature-group name="basic-ha-profile"> <feature-group name="basic-ha-profile">
<feature spec="subsystem.modcluster"> <feature spec="subsystem.modcluster">
<feature spec="subsystem.modcluster.mod-cluster-config.configuration"> <feature spec="subsystem.modcluster.proxy">
<param name="proxy" value="default"/>
<unset param="advertise-socket"/> <unset param="advertise-socket"/>
<param name="advertise" value="false"/> <param name="advertise" value="false"/>
<param name="proxies" value=""/> <param name="proxies" value=""/>
Expand Down
Expand Up @@ -14,7 +14,8 @@


<feature-group name="standalone-ha"> <feature-group name="standalone-ha">
<feature spec="subsystem.modcluster"> <feature spec="subsystem.modcluster">
<feature spec="subsystem.modcluster.mod-cluster-config.configuration"> <feature spec="subsystem.modcluster.proxy">
<param name="proxy" value="default"/>
<unset param="advertise-socket"/> <unset param="advertise-socket"/>
<param name="advertise" value="false"/> <param name="advertise" value="false"/>
<param name="proxies" value=""/> <param name="proxies" value=""/>
Expand Down
Expand Up @@ -29,7 +29,8 @@
</origin> </origin>
<feature-group name="basic-ha-profile"> <feature-group name="basic-ha-profile">
<feature spec="subsystem.modcluster"> <feature spec="subsystem.modcluster">
<feature spec="subsystem.modcluster.mod-cluster-config.configuration"> <feature spec="subsystem.modcluster.proxy">
<param name="proxy" value="default"/>
<unset param="advertise-socket"/> <unset param="advertise-socket"/>
<param name="advertise" value="false"/> <param name="advertise" value="false"/>
<param name="proxies" value=""/> <param name="proxies" value=""/>
Expand Down
Expand Up @@ -2,7 +2,8 @@
<feature-group-spec name="standalone-gossip-ha" xmlns="urn:jboss:galleon:feature-group:1.0"> <feature-group-spec name="standalone-gossip-ha" xmlns="urn:jboss:galleon:feature-group:1.0">
<feature-group name="standalone-ha"> <feature-group name="standalone-ha">
<feature spec="subsystem.modcluster"> <feature spec="subsystem.modcluster">
<feature spec="subsystem.modcluster.mod-cluster-config.configuration"> <feature spec="subsystem.modcluster.proxy">
<param name="proxy" value="default"/>
<unset param="advertise-socket"/> <unset param="advertise-socket"/>
<param name="advertise" value="false"/> <param name="advertise" value="false"/>
<param name="proxies" value=""/> <param name="proxies" value=""/>
Expand Down

This file was deleted.

@@ -1,4 +1,4 @@
/** /*
* JBoss, Home of Professional Open Source. * JBoss, Home of Professional Open Source.
* Copyright 2013, Red Hat, Inc., and individual contributors * Copyright 2013, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the * as indicated by the @author tags. See the copyright.txt file in the
Expand Down Expand Up @@ -26,22 +26,16 @@


import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException; import org.jboss.as.controller.OperationFailedException;
import org.jboss.dmr.ModelNode;
import org.jboss.modcluster.load.metric.LoadMetric; import org.jboss.modcluster.load.metric.LoadMetric;


/** /**
* Mechanism to plug in {@link org.jboss.as.server.deployment.DeploymentUnitProcessor} on boot time, e.g. Undertow * Mechanism to plug in {@link org.jboss.as.server.deployment.DeploymentUnitProcessor} on boot time, e.g. Undertow
* {@link io.undertow.server.HttpHandler}. Passes on a reference to Set with enabled {@link LoadMetric}s. * {@link io.undertow.server.HttpHandler}. Passes on a reference to sets with enabled {@link LoadMetric}s and event handler
* adapters.
* *
* @author Radoslav Husar * @author Radoslav Husar
* @version Jan 2014
* @since 8.0 * @since 8.0
*/ */
public interface BoottimeHandlerProvider { public interface BoottimeHandlerProvider {

void performBoottime(OperationContext context, Set<String> adapterNames, Set<LoadMetric> enabledMetrics) throws OperationFailedException;
/**
* @see org.jboss.as.controller.AbstractBoottimeAddStepHandler#performBoottime(org.jboss.as.controller.OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode
*/
void performBoottime(final Set<LoadMetric> enabledMetrics, OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException;

} }

0 comments on commit 4fe8c7c

Please sign in to comment.