From 2aeba5cf2f4325175692ef311dacad5061f0d8c3 Mon Sep 17 00:00:00 2001 From: Anton Vinogradov Date: Tue, 24 Oct 2023 07:22:38 +0300 Subject: [PATCH] IGNITE-20528 Support cache objects transformation for StandaloneKernal (#11001) --- .../AbstractCacheObjectCompressionTest.java | 2 +- .../ignite/internal/GridKernalContext.java | 8 ++ .../internal/GridKernalContextImpl.java | 12 ++ .../apache/ignite/internal/IgniteKernal.java | 12 +- ...a => CacheObjectTransformerProcessor.java} | 4 +- .../apache/ignite/internal/cdc/CdcMain.java | 1 + .../cache/CacheObjectTransformerUtils.java | 29 +++-- .../processors/cache/GridCacheProcessor.java | 6 +- .../cache/GridCacheSharedContext.java | 24 +--- .../snapshot/IgniteSnapshotManager.java | 2 +- .../wal/reader/IgniteWalIteratorFactory.java | 33 +++++- .../reader/StandaloneGridKernalContext.java | 45 ++++++-- .../StandaloneIgnitePluginProcessor.java | 5 +- .../ignite/internal/util/IgniteUtils.java | 11 ++ .../ignite/cdc/TransformedCdcSelfTest.java | 67 ++++++++++++ .../IgniteWalIteratorSwitchSegmentTest.java | 2 - .../pagemem/BPlusTreePageMemoryImplTest.java | 3 +- .../BPlusTreeReuseListPageMemoryImplTest.java | 1 - .../IndexStoragePageMemoryImplTest.java | 3 +- .../pagemem/PageMemoryImplNoLoadTest.java | 1 - .../pagemem/PageMemoryImplTest.java | 1 - ...AbstractCacheObjectTransformationTest.java | 2 +- ...tCacheObjectTransformerManagerAdapter.java | 63 ----------- ...tCacheObjectTransformerPluginProvider.java | 8 +- ...acheObjectTransformerProcessorAdapter.java | 103 ++++++++++++++++++ .../hashmap/GridCacheTestContext.java | 3 +- .../testsuites/IgnitePdsTestSuite2.java | 2 + ...eryCacheKeyValueTransformedFieldsTest.java | 4 +- 28 files changed, 320 insertions(+), 137 deletions(-) rename modules/core/src/main/java/org/apache/ignite/internal/cache/transform/{CacheObjectTransformerManager.java => CacheObjectTransformerProcessor.java} (91%) create mode 100644 modules/core/src/test/java/org/apache/ignite/cdc/TransformedCdcSelfTest.java delete mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerManagerAdapter.java create mode 100644 modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerProcessorAdapter.java diff --git a/modules/compress/src/test/java/org/apache/ignite/internal/processors/cache/transform/AbstractCacheObjectCompressionTest.java b/modules/compress/src/test/java/org/apache/ignite/internal/processors/cache/transform/AbstractCacheObjectCompressionTest.java index a9451d882117b..e1f0dead6a456 100644 --- a/modules/compress/src/test/java/org/apache/ignite/internal/processors/cache/transform/AbstractCacheObjectCompressionTest.java +++ b/modules/compress/src/test/java/org/apache/ignite/internal/processors/cache/transform/AbstractCacheObjectCompressionTest.java @@ -89,7 +89,7 @@ public StringData(String s) { /** * */ - protected static class CompressionTransformer extends TestCacheObjectTransformerManagerAdapter { + protected static class CompressionTransformer extends TestCacheObjectTransformerProcessorAdapter { /** Comptession type. */ protected static volatile CompressionType type = CompressionType.defaultType(); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java index 544b6b5d2eb9e..0de85f965f89e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java @@ -24,6 +24,7 @@ import org.apache.ignite.IgniteLogger; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.cache.query.index.IndexProcessor; +import org.apache.ignite.internal.cache.transform.CacheObjectTransformerProcessor; import org.apache.ignite.internal.managers.checkpoint.GridCheckpointManager; import org.apache.ignite.internal.managers.collision.GridCollisionManager; import org.apache.ignite.internal.managers.communication.GridIoManager; @@ -207,6 +208,13 @@ public interface GridKernalContext extends Iterable { */ public MaintenanceRegistry maintenanceRegistry(); + /** + * Gets transformation processor. + * + * @return Transformation processor. + */ + public CacheObjectTransformerProcessor transformer(); + /** * Gets system view manager. * diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java index 18e70f0326ae6..9bce003e3cc00 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java @@ -39,6 +39,7 @@ import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.failure.FailureType; import org.apache.ignite.internal.cache.query.index.IndexProcessor; +import org.apache.ignite.internal.cache.transform.CacheObjectTransformerProcessor; import org.apache.ignite.internal.maintenance.MaintenanceProcessor; import org.apache.ignite.internal.managers.checkpoint.GridCheckpointManager; import org.apache.ignite.internal.managers.collision.GridCollisionManager; @@ -332,6 +333,10 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable @GridToStringExclude private MaintenanceProcessor maintenanceProc; + /** */ + @GridToStringExclude + private CacheObjectTransformerProcessor transProc; + /** */ @GridToStringExclude private List comps = new LinkedList<>(); @@ -585,6 +590,8 @@ else if (comp instanceof DurableBackgroundTasksProcessor) durableBackgroundTasksProcessor = (DurableBackgroundTasksProcessor)comp; else if (comp instanceof MaintenanceProcessor) maintenanceProc = (MaintenanceProcessor)comp; + else if (comp instanceof CacheObjectTransformerProcessor) + transProc = (CacheObjectTransformerProcessor)comp; else if (comp instanceof PerformanceStatisticsProcessor) perfStatProc = (PerformanceStatisticsProcessor)comp; else if (comp instanceof IndexProcessor) @@ -687,6 +694,11 @@ public void addHelper(Object helper) { return maintenanceProc; } + /** {@inheritDoc} */ + @Override public CacheObjectTransformerProcessor transformer() { + return transProc; + } + /** {@inheritDoc} */ @Override public GridCacheProcessor cache() { return cacheProc; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java index 538840c3bd306..0cafc69d0c4d3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java @@ -91,6 +91,7 @@ import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.cache.query.index.IndexProcessor; +import org.apache.ignite.internal.cache.transform.CacheObjectTransformerProcessor; import org.apache.ignite.internal.cluster.ClusterGroupAdapter; import org.apache.ignite.internal.cluster.IgniteClusterEx; import org.apache.ignite.internal.maintenance.MaintenanceProcessor; @@ -917,8 +918,7 @@ public void start( throw new IgniteCheckedException("User attribute has illegal name: '" + name + "'. Note that all names " + "starting with '" + ATTR_PREFIX + "' are reserved for internal use."); - List plugins = cfg.getPluginProviders() != null && cfg.getPluginProviders().length > 0 ? - Arrays.asList(cfg.getPluginProviders()) : U.allPluginProviders(); + List plugins = U.allPluginProviders(cfg); // Spin out SPIs & managers. try { @@ -1101,6 +1101,11 @@ public void start( startProcessor(new DistributedConfigurationProcessor(ctx)); startProcessor(new DurableBackgroundTasksProcessor(ctx)); + CacheObjectTransformerProcessor transProc = createComponent(CacheObjectTransformerProcessor.class, ctx); + + if (transProc != null) + startProcessor(transProc); + startTimer.finishGlobalStage("Start processors"); // Start plugins. @@ -3321,6 +3326,9 @@ private static T createComponent(Class cls, GridKer if (cls.equals(IgniteRestProcessor.class)) return (T)new GridRestProcessor(ctx); + if (cls.equals(CacheObjectTransformerProcessor.class)) + return null; + Class implCls = null; try { diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cache/transform/CacheObjectTransformerManager.java b/modules/core/src/main/java/org/apache/ignite/internal/cache/transform/CacheObjectTransformerProcessor.java similarity index 91% rename from modules/core/src/main/java/org/apache/ignite/internal/cache/transform/CacheObjectTransformerManager.java rename to modules/core/src/main/java/org/apache/ignite/internal/cache/transform/CacheObjectTransformerProcessor.java index 3d693589559ec..e08258d481595 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/cache/transform/CacheObjectTransformerManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/cache/transform/CacheObjectTransformerProcessor.java @@ -19,13 +19,13 @@ import java.nio.ByteBuffer; import org.apache.ignite.internal.binary.GridBinaryMarshaller; -import org.apache.ignite.internal.processors.cache.GridCacheSharedManager; +import org.apache.ignite.internal.processors.GridProcessor; import org.jetbrains.annotations.Nullable; /** * Provides cache object's bytes transformation (eg. encryption, compression, etc). */ -public interface CacheObjectTransformerManager extends GridCacheSharedManager { +public interface CacheObjectTransformerProcessor extends GridProcessor { /** * Transforms the data. * diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cdc/CdcMain.java b/modules/core/src/main/java/org/apache/ignite/internal/cdc/CdcMain.java index 2e5914d58d273..079b5ed72f624 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/cdc/CdcMain.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/cdc/CdcMain.java @@ -484,6 +484,7 @@ private void consumeSegment(Path segment) { .log(log) .binaryMetadataFileStoreDir(binaryMeta) .marshallerMappingFileStoreDir(marshaller) + .igniteConfigurationModifier((cfg) -> cfg.setPluginProviders(igniteCfg.getPluginProviders())) .keepBinary(cdcCfg.isKeepBinary()) .filesOrDirs(segment.toFile()) .addFilter((type, ptr) -> type == DATA_RECORD_V2 || type == CDC_DATA_RECORD); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectTransformerUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectTransformerUtils.java index d6db1e0f72c02..58eff96b98c9b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectTransformerUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectTransformerUtils.java @@ -19,7 +19,7 @@ import java.nio.ByteBuffer; import org.apache.ignite.events.CacheObjectTransformedEvent; -import org.apache.ignite.internal.cache.transform.CacheObjectTransformerManager; +import org.apache.ignite.internal.cache.transform.CacheObjectTransformerProcessor; import org.apache.ignite.internal.util.typedef.internal.U; import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_TRANSFORMED; @@ -28,12 +28,12 @@ /** */ public class CacheObjectTransformerUtils { /** */ - private static CacheObjectTransformerManager transformer(CacheObjectValueContext ctx) { - return ctx.kernalContext().cache().context().transformer(); + private static CacheObjectTransformerProcessor transformer(CacheObjectValueContext ctx) { + return ctx.kernalContext().transformer(); } /** - * Transforms bytes according to {@link CacheObjectTransformerManager} when specified. + * Transforms bytes according to {@link CacheObjectTransformerProcessor} when specified. * @param bytes Given bytes. * @param ctx Context. * @return Transformed bytes. @@ -43,7 +43,7 @@ public static byte[] transformIfNecessary(byte[] bytes, CacheObjectValueContext } /** - * Transforms bytes according to {@link CacheObjectTransformerManager} when specified. + * Transforms bytes according to {@link CacheObjectTransformerProcessor} when specified. * @param bytes Given bytes. * @param ctx Context. * @return Transformed bytes. @@ -51,7 +51,7 @@ public static byte[] transformIfNecessary(byte[] bytes, CacheObjectValueContext public static byte[] transformIfNecessary(byte[] bytes, int offset, int length, CacheObjectValueContext ctx) { assert bytes[offset] != TRANSFORMED; - CacheObjectTransformerManager transformer = transformer(ctx); + CacheObjectTransformerProcessor transformer = transformer(ctx); if (transformer == null) return bytes; @@ -64,7 +64,7 @@ public static byte[] transformIfNecessary(byte[] bytes, int offset, int length, byte[] res = toArray(transformed); - if (ctx.kernalContext().event().isRecordable(EVT_CACHE_OBJECT_TRANSFORMED)) { + if (recordable(ctx, EVT_CACHE_OBJECT_TRANSFORMED)) { ctx.kernalContext().event().record( new CacheObjectTransformedEvent(ctx.kernalContext().discovery().localNode(), "Object transformed", @@ -79,7 +79,7 @@ public static byte[] transformIfNecessary(byte[] bytes, int offset, int length, else { byte[] res = detachIfNecessary(bytes, offset, length); - if (ctx.kernalContext().event().isRecordable(EVT_CACHE_OBJECT_TRANSFORMED)) { + if (recordable(ctx, EVT_CACHE_OBJECT_TRANSFORMED)) { ctx.kernalContext().event().record( new CacheObjectTransformedEvent(ctx.kernalContext().discovery().localNode(), "Object transformation was cancelled.", @@ -117,14 +117,14 @@ public static byte[] restoreIfNecessary(byte[] bytes, CacheObjectValueContext ct if (bytes[0] != TRANSFORMED) return bytes; - CacheObjectTransformerManager transformer = transformer(ctx); + CacheObjectTransformerProcessor transformer = transformer(ctx); ByteBuffer src = ByteBuffer.wrap(bytes, 1, bytes.length - 1); // Skipping TRANSFORMED. ByteBuffer restored = transformer.restore(src); byte[] res = toArray(restored); - if (ctx.kernalContext().event().isRecordable(EVT_CACHE_OBJECT_TRANSFORMED)) { + if (recordable(ctx, EVT_CACHE_OBJECT_TRANSFORMED)) { ctx.kernalContext().event().record( new CacheObjectTransformedEvent(ctx.kernalContext().discovery().localNode(), "Object restored", @@ -158,4 +158,13 @@ private static byte[] toArray(ByteBuffer buf) { return buf.array(); } } + + /** + * @param ctx Context. + * @param type Type. + */ + private static boolean recordable(CacheObjectValueContext ctx, int type) { + return ctx.kernalContext().event() != null // Can be null at external usage (via StandaloneGridKernalContext) + && ctx.kernalContext().event().isRecordable(type); + } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java index 482ea647e8a54..2a12207311c28 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java @@ -78,7 +78,6 @@ import org.apache.ignite.internal.binary.BinaryContext; import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.internal.binary.GridBinaryMarshaller; -import org.apache.ignite.internal.cache.transform.CacheObjectTransformerManager; import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException; import org.apache.ignite.internal.cluster.DetachedClusterNode; import org.apache.ignite.internal.managers.communication.GridIoPolicy; @@ -3074,8 +3073,6 @@ private GridCacheSharedContext createSharedContext( if (snapshotMgr == null) snapshotMgr = new IgniteSnapshotManager(ctx); - CacheObjectTransformerManager transMgr = ctx.plugins().createComponent(CacheObjectTransformerManager.class); - GridCacheIoManager ioMgr = new GridCacheIoManager(); CacheAffinitySharedManager topMgr = new CacheAffinitySharedManager(); GridCacheSharedTtlCleanupManager ttl = new GridCacheSharedTtlCleanupManager(); @@ -3106,8 +3103,7 @@ private GridCacheSharedContext createSharedContext( jta, storeSesLsnrs, mvccCachingMgr, - diagnosticMgr, - transMgr + diagnosticMgr ); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java index 6811c5d660da8..b0cf6b0b93f36 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java @@ -36,7 +36,6 @@ import org.apache.ignite.configuration.TransactionConfiguration; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.IgniteInternalFuture; -import org.apache.ignite.internal.cache.transform.CacheObjectTransformerManager; import org.apache.ignite.internal.managers.communication.GridIoManager; import org.apache.ignite.internal.managers.deployment.GridDeploymentManager; import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager; @@ -140,9 +139,6 @@ public class GridCacheSharedContext { /** Mvcc caching manager. */ private MvccCachingManager mvccCachingMgr; - /** Cache objects transformation manager. */ - private CacheObjectTransformerManager transMgr; - /** Cache contexts map. */ private final ConcurrentHashMap> ctxMap; @@ -229,8 +225,7 @@ public GridCacheSharedContext( CacheJtaManagerAdapter jtaMgr, Collection storeSesLsnrs, MvccCachingManager mvccCachingMgr, - CacheDiagnosticManager diagnosticMgr, - CacheObjectTransformerManager transMgr + CacheDiagnosticManager diagnosticMgr ) { this.kernalCtx = kernalCtx; @@ -253,8 +248,7 @@ public GridCacheSharedContext( ttlMgr, evictMgr, mvccCachingMgr, - diagnosticMgr, - transMgr + diagnosticMgr ); this.storeSesLsnrs = storeSesLsnrs; @@ -432,8 +426,7 @@ void onReconnected(boolean active) throws IgniteCheckedException { ttlMgr, evictMgr, mvccCachingMgr, - diagnosticMgr, - transMgr + diagnosticMgr ); this.mgrs = mgrs; @@ -482,8 +475,7 @@ private void setManagers( GridCacheSharedTtlCleanupManager ttlMgr, PartitionsEvictManager evictMgr, MvccCachingManager mvccCachingMgr, - CacheDiagnosticManager diagnosticMgr, - CacheObjectTransformerManager transMgr + CacheDiagnosticManager diagnosticMgr ) { this.diagnosticMgr = add(mgrs, diagnosticMgr); this.mvccMgr = add(mgrs, mvccMgr); @@ -506,7 +498,6 @@ private void setManagers( this.ttlMgr = add(mgrs, ttlMgr); this.evictMgr = add(mgrs, evictMgr); this.mvccCachingMgr = add(mgrs, mvccCachingMgr); - this.transMgr = add(mgrs, transMgr); } /** @@ -876,13 +867,6 @@ public CacheDiagnosticManager diagnostic() { return diagnosticMgr; } - /** - * @return Cache objects transformation manager. - */ - public CacheObjectTransformerManager transformer() { - return transMgr; - } - /** * @return Node ID. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java index 29560a7228d54..9776948fc4c7d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java @@ -2645,7 +2645,7 @@ public GridCloseableIterator partitionRowIterator(GridKernalContex GridCacheSharedContext sctx = new GridCacheSharedContext<>(ctx, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null); + null, null, null, null, null); return new DataPageIterator(sctx, coctx, pageStore, partId); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/IgniteWalIteratorFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/IgniteWalIteratorFactory.java index d01a2f8413904..931ac80e245f8 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/IgniteWalIteratorFactory.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/IgniteWalIteratorFactory.java @@ -31,9 +31,11 @@ import java.util.Iterator; import java.util.List; import java.util.TreeSet; +import java.util.function.Consumer; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.configuration.DataStorageConfiguration; +import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.pagemem.wal.WALIterator; import org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType; @@ -393,8 +395,18 @@ private FileDescriptor readFileDescriptor(File file, FileIOFactory ioFactory) { ) throws IgniteCheckedException { GridKernalContext kernalCtx = new StandaloneGridKernalContext(log, iteratorParametersBuilder.binaryMetadataFileStoreDir, - iteratorParametersBuilder.marshallerMappingFileStoreDir - ); + iteratorParametersBuilder.marshallerMappingFileStoreDir) { + @Override protected IgniteConfiguration prepareIgniteConfiguration() { + IgniteConfiguration cfg = super.prepareIgniteConfiguration(); + + Consumer modifier = iteratorParametersBuilder.ignCfgMod; + + if (modifier != null) + modifier.accept(cfg); + + return cfg; + } + }; StandaloneIgniteCacheDatabaseSharedManager dbMgr = new StandaloneIgniteCacheDatabaseSharedManager(kernalCtx); @@ -404,7 +416,7 @@ private FileDescriptor readFileDescriptor(File file, FileIOFactory ioFactory) { kernalCtx, null, null, null, null, null, null, dbMgr, null, null, null, null, null, null, - null, null, null, null, null, null + null, null, null, null, null ); } @@ -457,6 +469,11 @@ public static class IteratorParametersBuilder { * */ @Nullable private GridCacheSharedContext sharedCtx; + /** + * Ignite configuration modifier. + */ + @Nullable private Consumer ignCfgMod; + /** */ @Nullable private IgniteBiPredicate filter; @@ -584,6 +601,16 @@ public IteratorParametersBuilder sharedContext(GridCacheSharedContext sharedCtx) return this; } + /** + * @param ignCfgMod Ignite configuration modifier. + * @return IteratorParametersBuilder Self reference. + */ + public IteratorParametersBuilder igniteConfigurationModifier(Consumer ignCfgMod) { + this.ignCfgMod = ignCfgMod; + + return this; + } + /** * @param filter Record filter for skip records during iteration. * @return IteratorParametersBuilder Self reference. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneGridKernalContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneGridKernalContext.java index 1103f198dde90..a7e2592147977 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneGridKernalContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneGridKernalContext.java @@ -27,6 +27,7 @@ import java.util.UUID; import java.util.concurrent.Executor; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; @@ -40,6 +41,7 @@ import org.apache.ignite.internal.MarshallerContextImpl; import org.apache.ignite.internal.binary.BinaryMarshaller; import org.apache.ignite.internal.cache.query.index.IndexProcessor; +import org.apache.ignite.internal.cache.transform.CacheObjectTransformerProcessor; import org.apache.ignite.internal.managers.checkpoint.GridCheckpointManager; import org.apache.ignite.internal.managers.collision.GridCollisionManager; import org.apache.ignite.internal.managers.communication.GridIoManager; @@ -97,6 +99,7 @@ import org.apache.ignite.internal.processors.tracing.Tracing; import org.apache.ignite.internal.suggestions.GridPerformanceSuggestions; import org.apache.ignite.internal.util.IgniteExceptionRegistry; +import org.apache.ignite.internal.util.tostring.GridToStringExclude; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.internal.worker.WorkersRegistry; import org.apache.ignite.maintenance.MaintenanceRegistry; @@ -135,6 +138,10 @@ public class StandaloneGridKernalContext implements GridKernalContext { /** System view manager. */ private final GridSystemViewManager sysViewMgr; + /** */ + @GridToStringExclude + private CacheObjectTransformerProcessor transProc; + /** * Cache object processor. Used for converting cache objects and keys into binary objects. Null means there is no * convert is configured. All entries in this case will be lazy data entries. @@ -182,24 +189,26 @@ public StandaloneGridKernalContext( ) throws IgniteCheckedException { this.log = log; + marshallerCtx = new MarshallerContextImpl(null, null); + cfg = prepareIgniteConfiguration(); + try { - pluginProc = new StandaloneIgnitePluginProcessor(this, config()); + pluginProc = new StandaloneIgnitePluginProcessor(this, cfg); } catch (IgniteCheckedException e) { throw new IllegalStateException("Must not fail on empty providers list.", e); } - this.marshallerCtx = new MarshallerContextImpl(null, null); - this.cfg = prepareIgniteConfiguration(); - this.rsrcProc = new GridResourceProcessor(this); - this.metricMgr = new GridMetricManager(this); - this.sysViewMgr = new GridSystemViewManager(this); + rsrcProc = new GridResourceProcessor(this); + metricMgr = new GridMetricManager(this); + sysViewMgr = new GridSystemViewManager(this); + transProc = createComponent(CacheObjectTransformerProcessor.class); // Fake folder provided to perform processor startup on empty folder. if (binaryMetadataFileStoreDir == null) binaryMetadataFileStoreDir = new File(DataStorageConfiguration.DFLT_BINARY_METADATA_PATH).getAbsoluteFile(); - this.cacheObjProcessor = binaryProcessor(this, binaryMetadataFileStoreDir); + cacheObjProcessor = binaryProcessor(this, binaryMetadataFileStoreDir); comps.add(rsrcProc); comps.add(cacheObjProcessor); @@ -416,6 +425,11 @@ private void setField(IgniteEx kernal, String name, Object val) throws NoSuchFie return null; } + /** {@inheritDoc} */ + @Override public CacheObjectTransformerProcessor transformer() { + return transProc; + } + /** {@inheritDoc} */ @Override public IgniteRestProcessor rest() { return null; @@ -577,12 +591,25 @@ private void setField(IgniteEx kernal, String name, Object val) throws NoSuchFie /** {@inheritDoc} */ @Override public PluginProvider pluginProvider(String name) throws PluginNotFoundException { - return null; + PluginProvider plugin = pluginProc.pluginProvider(name); + + if (plugin == null) + throw new PluginNotFoundException(name); + + return plugin; } /** {@inheritDoc} */ @Override public T createComponent(Class cls) { - return null; + T res = pluginProc.createComponent(cls); + + if (res != null) + return res; + + if (cls.equals(CacheObjectTransformerProcessor.class)) + return null; + + throw new IgniteException("Unsupported component type: " + cls); } /** {@inheritDoc} */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneIgnitePluginProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneIgnitePluginProcessor.java index 78588ce02c5e8..5ad4623481102 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneIgnitePluginProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneIgnitePluginProcessor.java @@ -17,12 +17,11 @@ package org.apache.ignite.internal.processors.cache.persistence.wal.reader; -import java.util.Collections; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor; -import org.apache.ignite.plugin.PluginProvider; +import org.apache.ignite.internal.util.typedef.internal.U; /** * No operation, empty plugin processor for creating WAL iterator without node start up @@ -33,6 +32,6 @@ class StandaloneIgnitePluginProcessor extends IgnitePluginProcessor { * @param cfg Ignite configuration. */ StandaloneIgnitePluginProcessor(GridKernalContext ctx, IgniteConfiguration cfg) throws IgniteCheckedException { - super(ctx, cfg, Collections.emptyList()); + super(ctx, cfg, U.allPluginProviders(cfg)); } } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index 94af5147336c5..660a89245505a 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -1091,6 +1091,17 @@ public static List allPluginProviders() { return providers; } + /** + * Gets all plugin providers. + * + * @param cfg Configuration. + * @return Plugins. + */ + public static List allPluginProviders(IgniteConfiguration cfg) { + return cfg.getPluginProviders() != null && cfg.getPluginProviders().length > 0 ? + Arrays.asList(cfg.getPluginProviders()) : U.allPluginProviders(); + } + /** * @param svcCls Service class to load. * @param Type of loaded interfaces. diff --git a/modules/core/src/test/java/org/apache/ignite/cdc/TransformedCdcSelfTest.java b/modules/core/src/test/java/org/apache/ignite/cdc/TransformedCdcSelfTest.java new file mode 100644 index 0000000000000..72880aec0a3aa --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/cdc/TransformedCdcSelfTest.java @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.cdc; + +import java.nio.ByteBuffer; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.internal.processors.cache.transform.TestCacheObjectTransformerPluginProvider; +import org.apache.ignite.internal.processors.cache.transform.TestCacheObjectTransformerProcessorAdapter; + +import static org.apache.ignite.internal.binary.GridBinaryMarshaller.TRANSFORMED; + +/** + * + */ +public class TransformedCdcSelfTest extends CdcSelfTest { + /** {@inheritDoc} */ + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + return super.getConfiguration(igniteInstanceName).setPluginProviders( + new TestCacheObjectTransformerPluginProvider(new CacheObjectShiftTransformer())); + } + + /** + * Transforms each object with a shift. + */ + private static final class CacheObjectShiftTransformer extends TestCacheObjectTransformerProcessorAdapter { + /** {@inheritDoc} */ + @Override public ByteBuffer transform(ByteBuffer original) { + ByteBuffer transformed = ByteBuffer.wrap(new byte[original.remaining() + 1]); + + transformed.put(TRANSFORMED); + + while (original.hasRemaining()) + transformed.put((byte)(original.get() + 42)); + + transformed.flip(); + + return transformed; + } + + /** {@inheritDoc} */ + @Override public ByteBuffer restore(ByteBuffer transformed) { + ByteBuffer restored = ByteBuffer.wrap(new byte[transformed.remaining()]); + + while (transformed.hasRemaining()) + restored.put((byte)(transformed.get() - 42)); + + restored.flip(); + + return restored; + } + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalIteratorSwitchSegmentTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalIteratorSwitchSegmentTest.java index 340a8a4b53458..5e7c1a19dd36b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalIteratorSwitchSegmentTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalIteratorSwitchSegmentTest.java @@ -182,7 +182,6 @@ private void checkInvariantSwitchSegmentSize(int serVer) throws Exception { null, null, null, - null, null) ).createSerializer(serVer); @@ -477,7 +476,6 @@ private T2 initiate( null, null, null, - null, null ); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/BPlusTreePageMemoryImplTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/BPlusTreePageMemoryImplTest.java index 0d25bd5442edc..54f8e134fa156 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/BPlusTreePageMemoryImplTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/BPlusTreePageMemoryImplTest.java @@ -95,8 +95,7 @@ public class BPlusTreePageMemoryImplTest extends BPlusTreeSelfTest { null, null, null, - new CacheDiagnosticManager(), - null + new CacheDiagnosticManager() ); IgniteOutClosure clo = new IgniteOutClosure() { diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/BPlusTreeReuseListPageMemoryImplTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/BPlusTreeReuseListPageMemoryImplTest.java index 16ddf83119ead..e1618b665e876 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/BPlusTreeReuseListPageMemoryImplTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/BPlusTreeReuseListPageMemoryImplTest.java @@ -94,7 +94,6 @@ public class BPlusTreeReuseListPageMemoryImplTest extends BPlusTreeReuseSelfTest null, null, null, - null, null ); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IndexStoragePageMemoryImplTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IndexStoragePageMemoryImplTest.java index 0e92905efafd8..ff47f6fe4bbf5 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IndexStoragePageMemoryImplTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IndexStoragePageMemoryImplTest.java @@ -110,8 +110,7 @@ public class IndexStoragePageMemoryImplTest extends IndexStorageSelfTest { null, null, null, - new CacheDiagnosticManager(), - null + new CacheDiagnosticManager() ); IgniteOutClosure clo = () -> Mockito.mock(CheckpointProgressImpl.class); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImplNoLoadTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImplNoLoadTest.java index b67cc8aca8951..7ad03e3343188 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImplNoLoadTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImplNoLoadTest.java @@ -99,7 +99,6 @@ public class PageMemoryImplNoLoadTest extends PageMemoryNoLoadSelfTest { null, null, null, - null, null ); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImplTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImplTest.java index 8090393028d80..ff2c3c439c5a6 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImplTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImplTest.java @@ -630,7 +630,6 @@ private PageMemoryImpl createPageMemory( null, null, null, - null, null ); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/AbstractCacheObjectTransformationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/AbstractCacheObjectTransformationTest.java index fdfe14b5c6943..d3d0db68777c2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/AbstractCacheObjectTransformationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/AbstractCacheObjectTransformationTest.java @@ -277,7 +277,7 @@ public BinarizableData(String str, List list, Integer i, BinarizableData /** * */ - protected static final class ControllableCacheObjectTransformer extends TestCacheObjectTransformerManagerAdapter { + protected static final class ControllableCacheObjectTransformer extends TestCacheObjectTransformerProcessorAdapter { /** Shift. */ private static volatile int shift; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerManagerAdapter.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerManagerAdapter.java deleted file mode 100644 index 25944ef295685..0000000000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerManagerAdapter.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache.transform; - -import org.apache.ignite.IgniteCheckedException; -import org.apache.ignite.internal.cache.transform.CacheObjectTransformerManager; -import org.apache.ignite.internal.processors.cache.GridCacheSharedContext; -import org.apache.ignite.lang.IgniteFuture; - -/** - * - */ -public abstract class TestCacheObjectTransformerManagerAdapter implements CacheObjectTransformerManager { - /** {@inheritDoc} */ - @Override public void start(GridCacheSharedContext cctx) throws IgniteCheckedException { - // No-op. - } - - /** {@inheritDoc} */ - @Override public void onKernalStart(boolean active) { - // No-op. - } - - /** {@inheritDoc} */ - @Override public void stop(boolean cancel) { - // No-op. - } - - /** {@inheritDoc} */ - @Override public void onKernalStop(boolean cancel) { - // No-op. - } - - /** {@inheritDoc} */ - @Override public void onReconnected(boolean active) { - // No-op. - } - - /** {@inheritDoc} */ - @Override public void printMemoryStats() { - // No-op. - } - - /** {@inheritDoc} */ - @Override public void onDisconnected(IgniteFuture reconnectFut) { - // No-op. - } -} diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerPluginProvider.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerPluginProvider.java index 0db5d19230856..32c1cc6acaf03 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerPluginProvider.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerPluginProvider.java @@ -17,7 +17,7 @@ package org.apache.ignite.internal.processors.cache.transform; -import org.apache.ignite.internal.cache.transform.CacheObjectTransformerManager; +import org.apache.ignite.internal.cache.transform.CacheObjectTransformerProcessor; import org.apache.ignite.plugin.AbstractTestPluginProvider; import org.apache.ignite.plugin.PluginContext; import org.jetbrains.annotations.Nullable; @@ -27,12 +27,12 @@ */ public class TestCacheObjectTransformerPluginProvider extends AbstractTestPluginProvider { /** Manager. */ - private final CacheObjectTransformerManager mgr; + private final CacheObjectTransformerProcessor mgr; /** * @param mgr Manager. */ - public TestCacheObjectTransformerPluginProvider(CacheObjectTransformerManager mgr) { + public TestCacheObjectTransformerPluginProvider(CacheObjectTransformerProcessor mgr) { this.mgr = mgr; } @@ -43,7 +43,7 @@ public TestCacheObjectTransformerPluginProvider(CacheObjectTransformerManager mg /** {@inheritDoc} */ @Nullable @Override public T createComponent(PluginContext ctx, Class cls) { - if (CacheObjectTransformerManager.class.equals(cls)) + if (CacheObjectTransformerProcessor.class.equals(cls)) return (T)mgr; return null; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerProcessorAdapter.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerProcessorAdapter.java new file mode 100644 index 0000000000000..6b64756b706af --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transform/TestCacheObjectTransformerProcessorAdapter.java @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache.transform; + +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.cluster.ClusterNode; +import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.cache.transform.CacheObjectTransformerProcessor; +import org.apache.ignite.lang.IgniteFuture; +import org.apache.ignite.spi.IgniteNodeValidationResult; +import org.apache.ignite.spi.discovery.DiscoveryDataBag; +import org.jetbrains.annotations.Nullable; + +/** + * + */ +public abstract class TestCacheObjectTransformerProcessorAdapter implements CacheObjectTransformerProcessor { + /** {@inheritDoc} */ + @Override public void start() throws IgniteCheckedException { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void stop(boolean cancel) throws IgniteCheckedException { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void onKernalStart(boolean active) throws IgniteCheckedException { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void onKernalStop(boolean cancel) { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void collectJoiningNodeData(DiscoveryDataBag dataBag) { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void collectGridNodeData(DiscoveryDataBag dataBag) { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data) { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data) { + // No-op. + } + + /** {@inheritDoc} */ + @Override public void printMemoryStats() { + // No-op. + } + + /** {@inheritDoc} */ + @Override public @Nullable IgniteNodeValidationResult validateNode(ClusterNode node) { + return null; + } + + /** {@inheritDoc} */ + @Override public @Nullable IgniteNodeValidationResult validateNode(ClusterNode node, + DiscoveryDataBag.JoiningNodeDiscoveryData discoData) { + return null; + } + + /** {@inheritDoc} */ + @Override public @Nullable DiscoveryDataExchangeType discoveryDataType() { + return null; + } + + /** {@inheritDoc} */ + @Override public void onDisconnected(IgniteFuture reconnectFut) throws IgniteCheckedException { + // No-op. + } + + /** {@inheritDoc} */ + @Override public @Nullable IgniteInternalFuture onReconnected(boolean clusterRestarted) { + return null; + } +} diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java index 1a632db0fc125..4bf824701b4fe 100644 --- a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java +++ b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java @@ -83,8 +83,7 @@ public GridCacheTestContext(GridTestKernalContext ctx) throws Exception { new CacheNoopJtaManager(), null, null, - new CacheDiagnosticManager(), - null + new CacheDiagnosticManager() ), defaultCacheConfiguration(), null, diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java index 2d3e06fffd475..2848898cadaed 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java @@ -25,6 +25,7 @@ import org.apache.ignite.cdc.CdcNonDefaultWorkDirTest; import org.apache.ignite.cdc.CdcSelfTest; import org.apache.ignite.cdc.RestartWithWalForceArchiveTimeoutTest; +import org.apache.ignite.cdc.TransformedCdcSelfTest; import org.apache.ignite.cdc.WalForCdcTest; import org.apache.ignite.cdc.WalRolloverOnStopTest; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.HistoricalRebalanceCheckpointTest; @@ -154,6 +155,7 @@ public static void addRealPageStoreTests(List> suite, Collection // CDC tests. GridTestUtils.addTestIfNeeded(suite, CdcSelfTest.class, ignoredTests); + GridTestUtils.addTestIfNeeded(suite, TransformedCdcSelfTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, CdcCacheVersionTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, RestartWithWalForceArchiveTimeoutTest.class, ignoredTests); GridTestUtils.addTestIfNeeded(suite, WalRolloverOnStopTest.class, ignoredTests); diff --git a/modules/indexing/src/test/java/org/apache/ignite/cache/query/IndexQueryCacheKeyValueTransformedFieldsTest.java b/modules/indexing/src/test/java/org/apache/ignite/cache/query/IndexQueryCacheKeyValueTransformedFieldsTest.java index 60da8048b9777..25ac8d6ddc096 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/cache/query/IndexQueryCacheKeyValueTransformedFieldsTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/cache/query/IndexQueryCacheKeyValueTransformedFieldsTest.java @@ -20,8 +20,8 @@ import java.nio.ByteBuffer; import java.util.concurrent.ThreadLocalRandom; import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.internal.processors.cache.transform.TestCacheObjectTransformerManagerAdapter; import org.apache.ignite.internal.processors.cache.transform.TestCacheObjectTransformerPluginProvider; +import org.apache.ignite.internal.processors.cache.transform.TestCacheObjectTransformerProcessorAdapter; import static org.apache.ignite.internal.binary.GridBinaryMarshaller.TRANSFORMED; @@ -36,7 +36,7 @@ public class IndexQueryCacheKeyValueTransformedFieldsTest extends IndexQueryCach /** * Transforms each object with a random shift. */ - protected static final class RandomShiftCacheObjectTransformer extends TestCacheObjectTransformerManagerAdapter { + protected static final class RandomShiftCacheObjectTransformer extends TestCacheObjectTransformerProcessorAdapter { /** {@inheritDoc} */ @Override public ByteBuffer transform(ByteBuffer original) { ByteBuffer transformed = ByteBuffer.wrap(new byte[original.remaining() + 5]);