Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-15758 Remove legacy service grid implementation #9577

Merged
merged 1 commit into from
Nov 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

import static org.apache.ignite.cache.CacheManager.DFLT_JCACHE_DEFAULT_ISOLATED;
import static org.apache.ignite.configuration.DataStorageConfiguration.DFLT_USE_ASYNC_FILE_IO_FACTORY;
import static org.apache.ignite.internal.IgniteKernal.DFLT_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED;
import static org.apache.ignite.internal.IgniteKernal.DFLT_LOG_CLASSPATH_CONTENT_ON_STARTUP;
import static org.apache.ignite.internal.IgniteKernal.DFLT_LONG_OPERATIONS_DUMP_TIMEOUT;
import static org.apache.ignite.internal.IgniteKernal.DFLT_PERIODIC_STARVATION_CHECK_FREQ;
Expand Down Expand Up @@ -1633,24 +1632,6 @@ public final class IgniteSystemProperties {
@SystemProperty(value = "Storage page size - DataStorageConfiguration#setPageSize", type = Integer.class)
public static final String IGNITE_DEFAULT_DATA_STORAGE_PAGE_SIZE = "IGNITE_DEFAULT_DATA_STORAGE_PAGE_SIZE";

/**
* Manages the type of the implementation of the service processor (implementation of the {@link IgniteServices}).
* All nodes in the cluster must have the same value of this property.
* <p/>
* If the property is {@code true} then event-driven implementation of the service processor will be used.
* <p/>
* If the property is {@code false} then internal cache based implementation of service processor will be used.
* <p/>
* Default is {@code true}.
*/
@SystemProperty(value = "Manages the type of the implementation of the service processor " +
"(implementation of the IgniteServices). All nodes in the cluster must have the same value of this property. " +
"If the property is true then event-driven implementation of the service processor will be used. If the " +
"property is false then internal cache based implementation of service processor will be used",
defaults = "" + DFLT_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED)
public static final String IGNITE_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED
= "IGNITE_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED";

/**
* When set to {@code true}, cache metrics are not included into the discovery metrics update message (in this
* case message contains only cluster metrics). By default cache metrics are included into the message and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
import org.apache.ignite.internal.processors.schedule.IgniteScheduleProcessorAdapter;
import org.apache.ignite.internal.processors.security.IgniteSecurity;
import org.apache.ignite.internal.processors.segmentation.GridSegmentationProcessor;
import org.apache.ignite.internal.processors.service.ServiceProcessorAdapter;
import org.apache.ignite.internal.processors.service.IgniteServiceProcessor;
import org.apache.ignite.internal.processors.session.GridTaskSessionProcessor;
import org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor;
import org.apache.ignite.internal.processors.task.GridTaskProcessor;
Expand Down Expand Up @@ -268,7 +268,7 @@ public interface GridKernalContext extends Iterable<GridComponent> {
*
* @return Service processor.
*/
public ServiceProcessorAdapter service();
public IgniteServiceProcessor service();

/**
* Gets port processor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.util.UUID;
import java.util.concurrent.Executor;
import java.util.concurrent.ForkJoinPool;

import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteLogger;
Expand Down Expand Up @@ -93,7 +92,7 @@
import org.apache.ignite.internal.processors.schedule.IgniteScheduleProcessorAdapter;
import org.apache.ignite.internal.processors.security.IgniteSecurity;
import org.apache.ignite.internal.processors.segmentation.GridSegmentationProcessor;
import org.apache.ignite.internal.processors.service.ServiceProcessorAdapter;
import org.apache.ignite.internal.processors.service.IgniteServiceProcessor;
import org.apache.ignite.internal.processors.session.GridTaskSessionProcessor;
import org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor;
import org.apache.ignite.internal.processors.task.GridTaskProcessor;
Expand Down Expand Up @@ -235,7 +234,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable

/** */
@GridToStringInclude
private ServiceProcessorAdapter srvcProc;
private IgniteServiceProcessor srvcProc;

/** */
@GridToStringInclude
Expand Down Expand Up @@ -541,8 +540,8 @@ else if (comp instanceof GridPortProcessor)
portProc = (GridPortProcessor)comp;
else if (comp instanceof GridClosureProcessor)
closProc = (GridClosureProcessor)comp;
else if (comp instanceof ServiceProcessorAdapter)
srvcProc = (ServiceProcessorAdapter)comp;
else if (comp instanceof IgniteServiceProcessor)
srvcProc = (IgniteServiceProcessor)comp;
else if (comp instanceof IgniteScheduleProcessorAdapter)
scheduleProc = (IgniteScheduleProcessorAdapter)comp;
else if (comp instanceof GridSegmentationProcessor)
Expand Down Expand Up @@ -726,7 +725,7 @@ public void addHelper(Object helper) {
}

/** {@inheritDoc} */
@Override public ServiceProcessorAdapter service() {
@Override public IgniteServiceProcessor service() {
return srvcProc;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
import org.apache.ignite.internal.managers.tracing.GridTracingManager;
import org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller;
import org.apache.ignite.internal.processors.GridProcessor;
import org.apache.ignite.internal.processors.GridProcessorAdapter;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.affinity.GridAffinityProcessor;
import org.apache.ignite.internal.processors.authentication.IgniteAuthenticationProcessor;
Expand Down Expand Up @@ -185,7 +184,6 @@
import org.apache.ignite.internal.processors.security.IgniteSecurityProcessor;
import org.apache.ignite.internal.processors.security.NoOpIgniteSecurityProcessor;
import org.apache.ignite.internal.processors.segmentation.GridSegmentationProcessor;
import org.apache.ignite.internal.processors.service.GridServiceProcessor;
import org.apache.ignite.internal.processors.service.IgniteServiceProcessor;
import org.apache.ignite.internal.processors.session.GridTaskSessionProcessor;
import org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor;
Expand Down Expand Up @@ -238,7 +236,6 @@
import static org.apache.ignite.IgniteSystemProperties.IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_CONFIG_URL;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_DAEMON;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_LOG_CLASSPATH_CONTENT_ON_STARTUP;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_NO_ASCII;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID;
Expand All @@ -263,7 +260,6 @@
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DATA_STREAMER_POOL_SIZE;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DEPLOYMENT_MODE;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DYNAMIC_CACHE_START_ROLLBACK_SUPPORTED;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IGNITE_FEATURES;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IGNITE_INSTANCE_NAME;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IPS;
Expand Down Expand Up @@ -407,9 +403,6 @@ public class IgniteKernal implements IgniteEx, Externalizable {
*/
public static final long DFLT_LONG_OPERATIONS_DUMP_TIMEOUT = 60_000L;

/** @see IgniteSystemProperties#IGNITE_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED */
public static final boolean DFLT_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED = true;

/** @see IgniteSystemProperties#IGNITE_LOG_CLASSPATH_CONTENT_ON_STARTUP */
public static final boolean DFLT_LOG_CLASSPATH_CONTENT_ON_STARTUP = true;

Expand Down Expand Up @@ -1231,7 +1224,7 @@ public void start(
startProcessor(new IndexProcessor(ctx));
startProcessor(new GridQueryProcessor(ctx));
startProcessor(new ClientListenerProcessor(ctx));
startProcessor(createServiceProcessor());
startProcessor(new IgniteServiceProcessor(ctx));
startProcessor(new GridTaskSessionProcessor(ctx));
startProcessor(new GridJobProcessor(ctx));
startProcessor(new GridTaskProcessor(ctx));
Expand Down Expand Up @@ -1583,21 +1576,6 @@ else if (execSvc instanceof StripedExecutor) {
return execSvcName + " [active=" + poolActiveThreads + ", idle=" + poolIdleThreads + ", qSize=" + poolQSize + "]";
}

/**
* Creates service processor depend on {@link IgniteSystemProperties#IGNITE_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED}.
*
* @return The service processor. See {@link IgniteServiceProcessor} for details.
*/
private GridProcessorAdapter createServiceProcessor() {
final boolean srvcProcMode = getBoolean(IGNITE_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED,
DFLT_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED);

if (srvcProcMode)
return new IgniteServiceProcessor(ctx);

return new GridServiceProcessor(ctx);
}

/**
* Validates common configuration parameters.
*
Expand Down Expand Up @@ -1901,9 +1879,6 @@ private void fillNodeAttributes(boolean notifyEnabled) throws IgniteCheckedExcep
ctx.addNodeAttribute(e.getKey(), e.getValue());
}
}

ctx.addNodeAttribute(ATTR_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED,
ctx.service() instanceof IgniteServiceProcessor);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,6 @@ public final class IgniteNodeAttributes {
/** Supported features. */
public static final String ATTR_IGNITE_FEATURES = ATTR_PREFIX + ".features";

/** Ignite services processor mode. */
public static final String ATTR_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED = ATTR_PREFIX +
".event.driven.service.processor.enabled";

/**
* Enforces singleton.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_DISCOVERY_HISTORY_SIZE;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_OPTIMIZED_MARSHALLER_USE_DEFAULT_SUID;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_SECURITY_COMPATIBILITY_MODE;
import static org.apache.ignite.IgniteSystemProperties.getInteger;
Expand All @@ -168,7 +167,6 @@
import static org.apache.ignite.failure.FailureType.SYSTEM_WORKER_TERMINATION;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DATA_REGIONS_OFFHEAP_SIZE;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DEPLOYMENT_MODE;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_LATE_AFFINITY_ASSIGNMENT;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MACS;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MARSHALLER_USE_BINARY_STRING_SER_VER_2;
Expand Down Expand Up @@ -1301,7 +1299,6 @@ private void checkAttributes(Iterable<ClusterNode> nodes) throws IgniteCheckedEx

boolean locDelayAssign = locNode.attribute(ATTR_LATE_AFFINITY_ASSIGNMENT);

Boolean locSrvcProcMode = locNode.attribute(ATTR_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED);
Boolean locSecurityCompatibilityEnabled = locNode.attribute(ATTR_SECURITY_COMPATIBILITY_MODE);

for (ClusterNode n : nodes) {
Expand Down Expand Up @@ -1387,22 +1384,6 @@ private void checkAttributes(Iterable<ClusterNode> nodes) throws IgniteCheckedEx
", rmtAddrs=" + U.addressesAsString(n) + ", rmtNode=" + U.toShortString(n) + "]");
}

Boolean rmtSrvcProcModeAttr = n.attribute(ATTR_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED);

final boolean rmtSrvcProcMode = rmtSrvcProcModeAttr != null ? rmtSrvcProcModeAttr : false;

if (!F.eq(locSrvcProcMode, rmtSrvcProcMode)) {
throw new IgniteCheckedException("Local node's " + IGNITE_EVENT_DRIVEN_SERVICE_PROCESSOR_ENABLED +
" property value differs from remote node's value " +
"(to make sure all nodes in topology have identical service processor mode, " +
"configure system property explicitly) " +
"[locSrvcProcMode=" + locSrvcProcMode +
", rmtSrvcProcMode=" + rmtSrvcProcMode +
", locNodeAddrs=" + U.addressesAsString(locNode) +
", rmtNodeAddrs=" + U.addressesAsString(n) +
", locNodeId=" + locNode.id() + ", rmtNode=" + U.toShortString(n) + "]");
}

ShutdownPolicy rmtShutdownPolicy = n.attribute(ATTR_SHUTDOWN_POLICY) == null ? null :
ShutdownPolicy.fromOrdinal(n.attribute(ATTR_SHUTDOWN_POLICY));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
import org.apache.ignite.internal.processors.query.schema.message.SchemaAbstractDiscoveryMessage;
import org.apache.ignite.internal.processors.query.schema.message.SchemaProposeDiscoveryMessage;
import org.apache.ignite.internal.processors.security.IgniteSecurity;
import org.apache.ignite.internal.processors.service.GridServiceProcessor;
import org.apache.ignite.internal.suggestions.GridPerformanceSuggestions;
import org.apache.ignite.internal.util.F0;
import org.apache.ignite.internal.util.IgniteCollectors;
Expand Down Expand Up @@ -739,9 +738,6 @@ public Collection<CacheGroupContext> cacheGroups() {
if (!active)
return;

if (ctx.service() instanceof GridServiceProcessor)
((GridServiceProcessor)ctx.service()).onUtilityCacheStarted();

awaitRebalance(joinVer).get();
}

Expand Down Expand Up @@ -2980,13 +2976,9 @@ public void onExchangeDone(
if (exchActions == null)
return;

if (exchActions.systemCachesStarting() && exchActions.stateChangeRequest() == null) {
if (exchActions.systemCachesStarting() && exchActions.stateChangeRequest() == null)
ctx.dataStructures().restoreStructuresState(ctx);

if (ctx.service() instanceof GridServiceProcessor)
((GridServiceProcessor)ctx.service()).updateUtilityCache();
}

if (err == null)
processCacheStopRequestOnExchangeDone(exchActions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
import org.apache.ignite.internal.processors.cluster.IgniteChangeGlobalStateSupport;
import org.apache.ignite.internal.processors.metric.GridMetricManager;
import org.apache.ignite.internal.processors.security.SecurityContext;
import org.apache.ignite.internal.processors.service.GridServiceProcessor;
import org.apache.ignite.internal.processors.tracing.NoopSpan;
import org.apache.ignite.internal.processors.tracing.Span;
import org.apache.ignite.internal.processors.tracing.SpanTags;
Expand Down Expand Up @@ -1381,9 +1380,6 @@ private ExchangeType onClusterStateChangeRequest(boolean crd) {
try {
kctx.dataStructures().onDeActivate(kctx);

if (cctx.kernalContext().service() instanceof GridServiceProcessor)
((GridServiceProcessor)kctx.service()).onDeActivate(cctx.kernalContext());

assert registerCachesFuture == null : "No caches registration should be scheduled before new caches have started.";

registerCachesFuture = cctx.affinity().onCacheChangeRequest(this, crd, exchActions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
import org.apache.ignite.internal.processors.schedule.IgniteScheduleProcessorAdapter;
import org.apache.ignite.internal.processors.security.IgniteSecurity;
import org.apache.ignite.internal.processors.segmentation.GridSegmentationProcessor;
import org.apache.ignite.internal.processors.service.GridServiceProcessor;
import org.apache.ignite.internal.processors.service.IgniteServiceProcessor;
import org.apache.ignite.internal.processors.session.GridTaskSessionProcessor;
import org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor;
import org.apache.ignite.internal.processors.task.GridTaskProcessor;
Expand Down Expand Up @@ -373,7 +373,7 @@ private void setField(IgniteEx kernal, String name, Object val) throws NoSuchFie
}

/** {@inheritDoc} */
@Override public GridServiceProcessor service() {
@Override public IgniteServiceProcessor service() {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
import org.apache.ignite.internal.processors.cluster.baseline.autoadjust.BaselineAutoAdjustStatus;
import org.apache.ignite.internal.processors.cluster.baseline.autoadjust.BaselineTopologyUpdater;
import org.apache.ignite.internal.processors.configuration.distributed.DistributePropertyListener;
import org.apache.ignite.internal.processors.service.GridServiceProcessor;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.future.IgniteFinishedFutureImpl;
Expand Down Expand Up @@ -1458,14 +1457,6 @@ private void onFinalActivate(final StateChangeRequest req) {
boolean client = ctx.clientNode();

try {
if (ctx.service() instanceof GridServiceProcessor) {
GridServiceProcessor srvcProc = (GridServiceProcessor)ctx.service();

srvcProc.onUtilityCacheStarted();

srvcProc.onActivate(ctx);
}

ctx.dataStructures().onActivate(ctx);

ctx.task().onActivate(ctx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
import org.apache.ignite.internal.processors.cache.GridCacheProcessor;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionPartialCountersMap;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandler;
import org.apache.ignite.internal.processors.service.GridServiceProcessor;
import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
import org.apache.ignite.internal.util.future.GridFinishedFuture;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
Expand Down Expand Up @@ -313,9 +312,6 @@ public GridContinuousProcessor(GridKernalContext ctx) {

ctx.cacheObjects().onContinuousProcessorStarted(ctx);

if (ctx.service() instanceof GridServiceProcessor)
((GridServiceProcessor)ctx.service()).onContinuousProcessorStarted(ctx);

if (log.isDebugEnabled())
log.debug("Continuous processor started.");
}
Expand Down