use of org.apache.ignite.plugin.AbstractCachePluginProvider in project ignite by apache.
the class CdcCacheVersionTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setDataStorageConfiguration(new DataStorageConfiguration().setCdcEnabled(true).setWalForceArchiveTimeout(WAL_ARCHIVE_TIMEOUT).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
cfg.setPluginProviders(new AbstractTestPluginProvider() {
@Override
public String name() {
return "ConflictResolverProvider";
}
@Override
public CachePluginProvider createCacheProvider(CachePluginContext ctx) {
if (!ctx.igniteCacheConfiguration().getName().equals(DEFAULT_CACHE_NAME))
return null;
return new AbstractCachePluginProvider() {
@Override
@Nullable
public Object createComponent(Class cls) {
if (cls != CacheConflictResolutionManager.class || conflictResolutionMgrSupplier == null)
return null;
return new TestCacheConflictResolutionManager<>();
}
};
}
@Override
@Nullable
public <T> T createComponent(PluginContext ctx, Class<T> cls) {
if (IgniteWriteAheadLogManager.class.equals(cls))
return (T) walProvider.apply(((IgniteEx) ctx.grid()).context());
return null;
}
});
return cfg;
}
Aggregations