Java Code Examples for org.apache.ignite.configuration.CacheConfiguration#isManagementEnabled()

The following examples show how to use org.apache.ignite.configuration.CacheConfiguration#isManagementEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CacheMetricsImpl.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public boolean isManagementEnabled() {
    CacheConfiguration ccfg = cctx.config();

    return ccfg != null && ccfg.isManagementEnabled();
}
 
Example 2
Source File: VisorCacheConfiguration.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * Create data transfer object for cache configuration properties.
 *
 * @param ignite Grid.
 * @param ccfg Cache configuration.
 * @param dynamicDeploymentId Dynamic deployment ID.
 */
public VisorCacheConfiguration(IgniteEx ignite, CacheConfiguration ccfg, IgniteUuid dynamicDeploymentId) {
    name = ccfg.getName();
    grpName = ccfg.getGroupName();
    this.dynamicDeploymentId = dynamicDeploymentId;
    mode = ccfg.getCacheMode();
    atomicityMode = ccfg.getAtomicityMode();
    eagerTtl = ccfg.isEagerTtl();
    writeSynchronizationMode = ccfg.getWriteSynchronizationMode();
    invalidate = ccfg.isInvalidate();
    maxConcurrentAsyncOps = ccfg.getMaxConcurrentAsyncOperations();
    interceptor = compactClass(ccfg.getInterceptor());
    dfltLockTimeout = ccfg.getDefaultLockTimeout();
    qryEntities = VisorQueryEntity.list(ccfg.getQueryEntities());
    jdbcTypes = VisorCacheJdbcType.list(ccfg.getCacheStoreFactory());
    statisticsEnabled = ccfg.isStatisticsEnabled();
    mgmtEnabled = ccfg.isManagementEnabled();
    ldrFactory = compactClass(ccfg.getCacheLoaderFactory());
    writerFactory = compactClass(ccfg.getCacheWriterFactory());
    expiryPlcFactory = compactClass(ccfg.getExpiryPolicyFactory());

    sys = ignite.context().cache().systemCache(ccfg.getName());
    storeKeepBinary = ccfg.isStoreKeepBinary();
    onheapCache = ccfg.isOnheapCacheEnabled();
    partLossPlc = ccfg.getPartitionLossPolicy();
    qryParallelism = ccfg.getQueryParallelism();

    affinityCfg = new VisorCacheAffinityConfiguration(ccfg);
    rebalanceCfg = new VisorCacheRebalanceConfiguration(ccfg);
    evictCfg = new VisorCacheEvictionConfiguration(ccfg);
    nearCfg = new VisorCacheNearConfiguration(ccfg);

    storeCfg = new VisorCacheStoreConfiguration(ignite, ccfg);

    qryCfg = new VisorQueryConfiguration(ccfg);

    cpOnRead = ccfg.isCopyOnRead();
    evictFilter = compactClass(ccfg.getEvictionFilter());
    lsnrConfigurations = compactIterable(ccfg.getCacheEntryListenerConfigurations());
    loadPrevVal = ccfg.isLoadPreviousValue();
    dataRegName = ccfg.getDataRegionName();
    sqlIdxMaxInlineSize = ccfg.getSqlIndexMaxInlineSize();
    nodeFilter = compactClass(ccfg.getNodeFilter());
    qryDetailMetricsSz = ccfg.getQueryDetailMetricsSize();
    readFromBackup = ccfg.isReadFromBackup();
    tmLookupClsName = ccfg.getTransactionManagerLookupClassName();
    topValidator = compactClass(ccfg.getTopologyValidator());

    diskPageCompression = ccfg.getDiskPageCompression();
    diskPageCompressionLevel = ccfg.getDiskPageCompressionLevel();
}
 
Example 3
Source File: CacheManager.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public <K, V, C extends Configuration<K, V>> Cache<K, V> createCache(String cacheName, C cacheCfg)
    throws IllegalArgumentException {
    kernalGateway.readLock();

    try {
        if (cacheCfg == null)
            throw new NullPointerException();

        if (cacheName == null)
            throw new NullPointerException();

        CacheConfiguration<K, V> igniteCacheCfg;

        if (cacheCfg instanceof CompleteConfiguration)
            igniteCacheCfg = new CacheConfiguration<>((CompleteConfiguration<K, V>)cacheCfg);
        else {
            igniteCacheCfg = new CacheConfiguration<>();

            igniteCacheCfg.setTypes(cacheCfg.getKeyType(), cacheCfg.getValueType());
        }

        igniteCacheCfg.setName(cacheName);

        IgniteCache<K, V> res = ignite.createCache(igniteCacheCfg);

        if (res == null)
            throw new CacheException();

        ((GatewayProtectedCacheProxy<K, V>)res).setCacheManager(this);

        if (igniteCacheCfg.isManagementEnabled())
            enableManagement(cacheName, true);

        if (igniteCacheCfg.isStatisticsEnabled())
            enableStatistics(cacheName, true);

        return res;
    }
    finally {
        kernalGateway.readUnlock();
    }
}