Search in sources :

Example 6 with NoopEncryptionSpi

use of org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi in project ignite by apache.

the class BPlusTreeReuseListPageMemoryImplTest method createPageMemory.

/**
 * {@inheritDoc}
 */
@Override
protected PageMemory createPageMemory() throws Exception {
    long[] sizes = new long[CPUS + 1];
    for (int i = 0; i < sizes.length; i++) sizes[i] = 1024 * MB / CPUS;
    sizes[CPUS] = 10 * MB;
    DirectMemoryProvider provider = new UnsafeMemoryProvider(log);
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setEncryptionSpi(new NoopEncryptionSpi());
    cfg.setMetricExporterSpi(new NoopMetricExporterSpi());
    cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi());
    cfg.setDataStorageConfiguration(new DataStorageConfiguration());
    GridTestKernalContext cctx = new GridTestKernalContext(log, cfg);
    cctx.add(new IgnitePluginProcessor(cctx, cfg, Collections.emptyList()));
    cctx.add(new GridInternalSubscriptionProcessor(cctx));
    cctx.add(new PerformanceStatisticsProcessor(cctx));
    cctx.add(new GridEncryptionManager(cctx));
    cctx.add(new GridMetricManager(cctx));
    cctx.add(new GridSystemViewManager(cctx));
    GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(cctx, null, null, null, new NoOpPageStoreManager(), new NoOpWALManager(), null, new IgniteCacheDatabaseSharedManager(), null, null, null, null, null, null, null, null, null, null, null, null, null);
    IgniteOutClosure<CheckpointProgress> clo = new IgniteOutClosure<CheckpointProgress>() {

        @Override
        public CheckpointProgress apply() {
            return Mockito.mock(CheckpointProgressImpl.class);
        }
    };
    PageMemory mem = new PageMemoryImpl(provider, sizes, sharedCtx, sharedCtx.pageStore(), PAGE_SIZE, (fullPageId, byteBuf, tag) -> {
        assert false : "No page replacement (rotation with disk) should happen during the test";
    }, new GridInClosure3X<Long, FullPageId, PageMemoryEx>() {

        @Override
        public void applyx(Long page, FullPageId fullPageId, PageMemoryEx pageMem) {
        }
    }, () -> true, new DataRegionMetricsImpl(new DataRegionConfiguration(), cctx), PageMemoryImpl.ThrottlingPolicy.DISABLED, clo);
    mem.start();
    return mem;
}
Also used : IgnitePluginProcessor(org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor) CheckpointProgress(org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgress) GridTestKernalContext(org.apache.ignite.testframework.junits.GridTestKernalContext) GridCacheSharedContext(org.apache.ignite.internal.processors.cache.GridCacheSharedContext) DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DirectMemoryProvider(org.apache.ignite.internal.mem.DirectMemoryProvider) FullPageId(org.apache.ignite.internal.pagemem.FullPageId) GridEncryptionManager(org.apache.ignite.internal.managers.encryption.GridEncryptionManager) NoopEncryptionSpi(org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi) GridInternalSubscriptionProcessor(org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor) PageMemory(org.apache.ignite.internal.pagemem.PageMemory) IgniteOutClosure(org.apache.ignite.lang.IgniteOutClosure) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl) JmxSystemViewExporterSpi(org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi) PerformanceStatisticsProcessor(org.apache.ignite.internal.processors.performancestatistics.PerformanceStatisticsProcessor) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) GridSystemViewManager(org.apache.ignite.internal.managers.systemview.GridSystemViewManager) NoopMetricExporterSpi(org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi) GridMetricManager(org.apache.ignite.internal.processors.metric.GridMetricManager) UnsafeMemoryProvider(org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager)

Example 7 with NoopEncryptionSpi

use of org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi in project ignite by apache.

the class IgnitePageMemReplaceDelayedWriteUnitTest method getConfiguration.

/**
 * @param overallSize default region size in bytes
 * @return configuration for test.
 */
@NotNull
private IgniteConfiguration getConfiguration(long overallSize) {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setEncryptionSpi(new NoopEncryptionSpi());
    cfg.setMetricExporterSpi(new NoopMetricExporterSpi());
    cfg.setEventStorageSpi(new NoopEventStorageSpi());
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(overallSize)));
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) NoopEncryptionSpi(org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi) NoopMetricExporterSpi(org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi) NoopEventStorageSpi(org.apache.ignite.spi.eventstorage.NoopEventStorageSpi) NotNull(org.jetbrains.annotations.NotNull)

Example 8 with NoopEncryptionSpi

use of org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi in project ignite by apache.

the class PlatformConfigurationUtils method writeEncryptionConfiguration.

/**
 * Writes encryption configuration.
 *
 * @param w Writer.
 * @param enc Encryption Spi.
 */
private static void writeEncryptionConfiguration(BinaryRawWriter w, EncryptionSpi enc) {
    if (enc instanceof NoopEncryptionSpi) {
        w.writeBoolean(false);
        return;
    }
    KeystoreEncryptionSpi keystoreEnc = (KeystoreEncryptionSpi) enc;
    w.writeBoolean(true);
    w.writeString(keystoreEnc.getMasterKeyName());
    w.writeInt(keystoreEnc.getKeySize());
    w.writeString(keystoreEnc.getKeyStorePath());
    w.writeCharArray(keystoreEnc.getKeyStorePwd());
}
Also used : NoopEncryptionSpi(org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi) KeystoreEncryptionSpi(org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi)

Aggregations

NoopEncryptionSpi (org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi)8 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)6 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)6 NoopMetricExporterSpi (org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi)6 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)5 GridEncryptionManager (org.apache.ignite.internal.managers.encryption.GridEncryptionManager)5 GridSystemViewManager (org.apache.ignite.internal.managers.systemview.GridSystemViewManager)5 JmxSystemViewExporterSpi (org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi)5 DirectMemoryProvider (org.apache.ignite.internal.mem.DirectMemoryProvider)5 FullPageId (org.apache.ignite.internal.pagemem.FullPageId)5 GridCacheSharedContext (org.apache.ignite.internal.processors.cache.GridCacheSharedContext)5 DataRegionMetricsImpl (org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl)5 IgniteCacheDatabaseSharedManager (org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager)5 CheckpointProgress (org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgress)5 GridMetricManager (org.apache.ignite.internal.processors.metric.GridMetricManager)5 PerformanceStatisticsProcessor (org.apache.ignite.internal.processors.performancestatistics.PerformanceStatisticsProcessor)5 IgnitePluginProcessor (org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor)5 GridInternalSubscriptionProcessor (org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor)5 GridTestKernalContext (org.apache.ignite.testframework.junits.GridTestKernalContext)5 UnsafeMemoryProvider (org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider)3