use of org.apache.ignite.plugin.AbstractTestPluginProvider 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;
}
use of org.apache.ignite.plugin.AbstractTestPluginProvider in project ignite by apache.
the class IgnitePdsCheckpointMapSnapshotTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String name) throws Exception {
IgniteConfiguration configuration = super.getConfiguration(name);
configuration.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)).setCheckpointFrequency(TimeUnit.HOURS.toMillis(1)));
// Plugin that creates a WAL manager that counts replays
configuration.setPluginProviders(new AbstractTestPluginProvider() {
/**
* {@inheritDoc}
*/
@Override
public String name() {
return "testPlugin";
}
/**
* {@inheritDoc}
*/
@Override
@Nullable
public <T> T createComponent(PluginContext ctx, Class<T> cls) {
if (IgniteWriteAheadLogManager.class.equals(cls))
return (T) new TestFileWriteAheadLogManager(((IgniteEx) ctx.grid()).context());
return null;
}
});
return configuration;
}
Aggregations