Java Code Examples for org.apache.ignite.cache.CacheMode#LOCAL

The following examples show how to use org.apache.ignite.cache.CacheMode#LOCAL . 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: GridCacheReferenceCleanupSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** @throws Exception If failed. */
@Test
public void testAsyncOpsAsyncCommitLocal() throws Exception {
    MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.LOCAL_CACHE);

    mode = CacheMode.LOCAL;

    try {
        checkReferenceCleanup(asyncOpsAsyncCommitCallable());
    }
    finally {
        stopAllGrids();
    }
}
 
Example 2
Source File: GridCacheReferenceCleanupSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** @throws Exception If failed. */
@Test
public void testSyncOpAsyncCommitLocal() throws Exception {
    MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.LOCAL_CACHE);

    mode = CacheMode.LOCAL;

    try {
        checkReferenceCleanup(syncOpAsyncCommitCallable());
    }
    finally {
        stopAllGrids();
    }
}
 
Example 3
Source File: GridCacheReferenceCleanupSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** @throws Exception If failed. */
@Test
public void testSeveralAsyncOpsLocal() throws Exception {
    MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.LOCAL_CACHE);

    mode = CacheMode.LOCAL;

    try {
        checkReferenceCleanup(severalAsyncOpsCallable());
    }
    finally {
        stopAllGrids();
    }
}
 
Example 4
Source File: GridCacheReferenceCleanupSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** @throws Exception If failed. */
@Test
public void testOneAsyncOpLocal() throws Exception {
    MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.LOCAL_CACHE);

    mode = CacheMode.LOCAL;

    try {
        checkReferenceCleanup(oneAsyncOpCallable());
    }
    finally {
        stopAllGrids();
    }
}
 
Example 5
Source File: GridCacheReferenceCleanupSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** @throws Exception If failed. */
@Test
public void testAtomicLongLocal() throws Exception {
    MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.LOCAL_CACHE);

    mode = CacheMode.LOCAL;

    try {
        checkReferenceCleanup(atomicLongCallable());
    }
    finally {
        stopAllGrids();
    }
}
 
Example 6
Source File: GridCacheBinaryObjectsAbstractSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@Test
public void testTransform() throws Exception {
    IgniteCache<Integer, BinaryObject> c = keepBinaryCache();

    checkTransform(primaryKey(c));

    if (cacheMode() != CacheMode.LOCAL) {
        checkTransform(backupKey(c));

        if (nearConfiguration() != null)
            checkTransform(nearKey(c));
    }
}
 
Example 7
Source File: GridCacheReloadSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * Checks that eviction works with reload() on local cache.
 *
 * @throws Exception If error occurs.
 */
@Test
public void testReloadEvictionLocalCache() throws Exception {
    MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.LOCAL_CACHE);

    cacheMode = CacheMode.LOCAL;

    doTest();
}
 
Example 8
Source File: CacheVersionedEntryLocalAtomicSwapDisabledSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
    return CacheMode.LOCAL;
}
 
Example 9
Source File: CacheClientStoreSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * Load cache created on client as LOCAL and see if it only loaded on client
 *
 * @throws Exception If failed.
 */
@Test
public void testLocalLoadClient() throws Exception {
    cacheMode = CacheMode.LOCAL;
    factory = new Factory3();

    startGrids(2);

    Ignite client = startClientGrid("client-1");

    IgniteCache<Object, Object> cache = client.cache(CACHE_NAME);

    cache.loadCache(null);

    assertEquals(10, cache.localSize(CachePeekMode.ALL));

    assertEquals(0, grid(0).cache(CACHE_NAME).localSize(CachePeekMode.ALL));
    assertEquals(0, grid(1).cache(CACHE_NAME).localSize(CachePeekMode.ALL));

    assert loadedFromClient;
}
 
Example 10
Source File: GridLocalCacheStoreManagerDeserializationTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
    return CacheMode.LOCAL;
}
 
Example 11
Source File: CacheVersionedEntryLocalTransactionalSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
    return CacheMode.LOCAL;
}
 
Example 12
Source File: CacheContinuousWithTransformerLocalSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
    return CacheMode.LOCAL;
}
 
Example 13
Source File: GridCacheLocalEvictionEventSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
    return CacheMode.LOCAL;
}
 
Example 14
Source File: GridCacheLocalBasicStoreMultithreadedSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
    return CacheMode.LOCAL;
}
 
Example 15
Source File: GridCacheLocalTxReadTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @return {@code LOCAL} for this test.
 */
@Override protected CacheMode cacheMode() {
    return CacheMode.LOCAL;
}
 
Example 16
Source File: GridCacheEmptyEntriesLocalSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
    return CacheMode.LOCAL;
}
 
Example 17
Source File: CacheTtlAtomicLocalSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
    return CacheMode.LOCAL;
}
 
Example 18
Source File: GridCacheWriteBehindStoreLocalTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
    return CacheMode.LOCAL;
}
 
Example 19
Source File: CommandProcessor.java    From ignite with Apache License 2.0 2 votes vote down vote up
/**
 * Check if table supports DDL statement.
 *
 * @param tbl Table.
 * @throws IgniteSQLException If failed.
 */
private static void ensureDdlSupported(GridH2Table tbl) throws IgniteSQLException {
    if (tbl.cacheInfo().config().getCacheMode() == CacheMode.LOCAL)
        throw new IgniteSQLException("DDL statements are not supported on LOCAL caches",
            IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
}
 
Example 20
Source File: MvccFeatureChecker.java    From ignite with Apache License 2.0 2 votes vote down vote up
/**
 * Check if Cache mode is supported.
 *
 * @param mode Cache mode.
 * @return {@code True} if feature is supported, {@code False} otherwise.
 */
public static boolean isSupported(CacheMode mode) {
    return mode != CacheMode.LOCAL || isSupported(Feature.LOCAL_CACHE);
}