Search in sources :

Example 6 with DiskWriteAttributesFactory

use of org.apache.geode.cache.DiskWriteAttributesFactory in project geode by apache.

the class DiskWriteAttributesJUnitTest method testGetDefaultNonRollingAsync.

/**
   * Test method for 'org.apache.geode.cache.DiskWriteAttributes.getDefaultNonRollingAsync()'
   */
@Test
public void testGetDefaultNonRollingAsync() {
    DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
    dwaf.setRollOplogs(false);
    DiskWriteAttributes dwa = dwaf.create();
    assertTrue(!dwa.isSynchronous());
    assertTrue(!dwa.isRollOplogs());
}
Also used : DiskWriteAttributes(org.apache.geode.cache.DiskWriteAttributes) DiskWriteAttributesFactory(org.apache.geode.cache.DiskWriteAttributesFactory) UnitTest(org.apache.geode.test.junit.categories.UnitTest) Test(org.junit.Test)

Example 7 with DiskWriteAttributesFactory

use of org.apache.geode.cache.DiskWriteAttributesFactory in project geode by apache.

the class DiskWriteAttributesJUnitTest method testGetDefaultRollingSync.

/**
   * Test method for 'org.apache.geode.cache.DiskWriteAttributes.getDefaultRollingSync()'
   */
@Test
public void testGetDefaultRollingSync() {
    DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
    dwaf.setSynchronous(true);
    DiskWriteAttributes dwa = dwaf.create();
    assertTrue(dwa.isSynchronous());
    assertTrue(dwa.isRollOplogs());
}
Also used : DiskWriteAttributes(org.apache.geode.cache.DiskWriteAttributes) DiskWriteAttributesFactory(org.apache.geode.cache.DiskWriteAttributesFactory) UnitTest(org.apache.geode.test.junit.categories.UnitTest) Test(org.junit.Test)

Example 8 with DiskWriteAttributesFactory

use of org.apache.geode.cache.DiskWriteAttributesFactory in project geode by apache.

the class DiskWriteAttributesJUnitTest method testGetDefaultRollingAsync.

/**
   * Test method for 'org.apache.geode.cache.DiskWriteAttributes.getDefaultRollingAsync()'
   */
@Test
public void testGetDefaultRollingAsync() {
    DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
    DiskWriteAttributes dwa = dwaf.create();
    assertTrue(!dwa.isSynchronous());
    assertTrue(dwa.isRollOplogs());
}
Also used : DiskWriteAttributes(org.apache.geode.cache.DiskWriteAttributes) DiskWriteAttributesFactory(org.apache.geode.cache.DiskWriteAttributesFactory) UnitTest(org.apache.geode.test.junit.categories.UnitTest) Test(org.junit.Test)

Example 9 with DiskWriteAttributesFactory

use of org.apache.geode.cache.DiskWriteAttributesFactory in project geode by apache.

the class DiskWriteAttributesJUnitTest method testGetDefaultSync.

/**
   * Test method for 'org.apache.geode.cache.DiskWriteAttributes.getDefaultSync()'
   */
@Test
public void testGetDefaultSync() {
    DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
    dwaf.setSynchronous(true);
    DiskWriteAttributes dwa = dwaf.create();
    assertTrue(dwa.isSynchronous());
    assertTrue(dwa.isRollOplogs());
}
Also used : DiskWriteAttributes(org.apache.geode.cache.DiskWriteAttributes) DiskWriteAttributesFactory(org.apache.geode.cache.DiskWriteAttributesFactory) UnitTest(org.apache.geode.test.junit.categories.UnitTest) Test(org.junit.Test)

Example 10 with DiskWriteAttributesFactory

use of org.apache.geode.cache.DiskWriteAttributesFactory in project geode by apache.

the class CacheXml66DUnitTest method testMaxOplogSize.

@Test
public void testMaxOplogSize() throws Exception {
    CacheCreation cache = new CacheCreation();
    // Set properties for Asynch writes
    RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
    RegionCreation root = (RegionCreation) cache.createRegion("root", attrs);
    {
        attrs = new RegionAttributesCreation(cache);
        DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
        dwaf.setSynchronous(true);
        dwaf.setMaxOplogSize(1);
        attrs.setDiskWriteAttributes(dwaf.create());
        root.createSubregion("sync", attrs);
    }
    {
        attrs = new RegionAttributesCreation(cache);
        DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
        dwaf.setTimeInterval(123L);
        dwaf.setBytesThreshold(456L);
        dwaf.setMaxOplogSize(1);
        attrs.setDiskWriteAttributes(dwaf.create());
        root.createSubregion("async", attrs);
    }
    testXml(cache);
}
Also used : RegionAttributesCreation(org.apache.geode.internal.cache.xmlcache.RegionAttributesCreation) DiskWriteAttributesFactory(org.apache.geode.cache.DiskWriteAttributesFactory) CacheCreation(org.apache.geode.internal.cache.xmlcache.CacheCreation) ClientCacheCreation(org.apache.geode.internal.cache.xmlcache.ClientCacheCreation) RegionCreation(org.apache.geode.internal.cache.xmlcache.RegionCreation) Test(org.junit.Test)

Aggregations

DiskWriteAttributesFactory (org.apache.geode.cache.DiskWriteAttributesFactory)17 Test (org.junit.Test)14 DiskWriteAttributes (org.apache.geode.cache.DiskWriteAttributes)8 UnitTest (org.apache.geode.test.junit.categories.UnitTest)8 AttributesFactory (org.apache.geode.cache.AttributesFactory)4 Region (org.apache.geode.cache.Region)4 CacheCreation (org.apache.geode.internal.cache.xmlcache.CacheCreation)4 ClientCacheCreation (org.apache.geode.internal.cache.xmlcache.ClientCacheCreation)4 RegionAttributesCreation (org.apache.geode.internal.cache.xmlcache.RegionAttributesCreation)4 Set (java.util.Set)3 RegionCreation (org.apache.geode.internal.cache.xmlcache.RegionCreation)3 Cache (org.apache.geode.cache.Cache)2 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)2 File (java.io.File)1 Properties (java.util.Properties)1 EvictionAttributes (org.apache.geode.cache.EvictionAttributes)1 ExpirationAttributes (org.apache.geode.cache.ExpirationAttributes)1 FixedPartitionAttributes (org.apache.geode.cache.FixedPartitionAttributes)1 PartitionAttributes (org.apache.geode.cache.PartitionAttributes)1 PartitionAttributesFactory (org.apache.geode.cache.PartitionAttributesFactory)1