Search in sources :

Example 1 with LocalDeviceConfig

use of com.hazelcast.config.LocalDeviceConfig in project hazelcast by hazelcast.

the class TestFullApplicationContext method testDevice.

@Test
public void testDevice() {
    String deviceName0 = "device0";
    String deviceName1 = "device1";
    File baseDir0 = new File("/dev/devices/tiered_store_device0");
    File baseDir1 = new File("/dev/devices/tiered_store_device1");
    int blockSize = 8192;
    int readIOThreadCount = 16;
    int writeIOThreadCount0 = 8;
    int writeIOThreadCount1 = 16;
    assertEquals(2, config.getDeviceConfigs().size());
    LocalDeviceConfig localDeviceConfig = config.getDeviceConfig(deviceName0);
    assertEquals(deviceName0, localDeviceConfig.getName());
    assertEquals(baseDir0, localDeviceConfig.getBaseDir());
    assertEquals(blockSize, localDeviceConfig.getBlockSize());
    assertEquals(readIOThreadCount, localDeviceConfig.getReadIOThreadCount());
    assertEquals(writeIOThreadCount0, localDeviceConfig.getWriteIOThreadCount());
    assertEquals(new MemorySize(9321, MemoryUnit.MEGABYTES), localDeviceConfig.getCapacity());
    localDeviceConfig = config.getDeviceConfig(deviceName1);
    assertEquals(deviceName1, localDeviceConfig.getName());
    assertEquals(baseDir1, localDeviceConfig.getBaseDir());
    assertEquals(blockSize, localDeviceConfig.getBlockSize());
    assertEquals(readIOThreadCount, localDeviceConfig.getReadIOThreadCount());
    assertEquals(writeIOThreadCount1, localDeviceConfig.getWriteIOThreadCount());
    assertEquals(LocalDeviceConfig.DEFAULT_CAPACITY, localDeviceConfig.getCapacity());
}
Also used : MemorySize(com.hazelcast.memory.MemorySize) LocalDeviceConfig(com.hazelcast.config.LocalDeviceConfig) File(java.io.File) Test(org.junit.Test) QuickTest(com.hazelcast.test.annotation.QuickTest)

Example 2 with LocalDeviceConfig

use of com.hazelcast.config.LocalDeviceConfig in project hazelcast by hazelcast.

the class MemberDomConfigProcessor method handleLocalDevice.

protected void handleLocalDevice(Node parentNode) {
    String name = getAttribute(parentNode, "name");
    LocalDeviceConfig localDeviceConfig = (LocalDeviceConfig) ConfigUtils.getByNameOrNew(config.getDeviceConfigs(), name, LocalDeviceConfig.class);
    handleLocalDeviceNode(parentNode, localDeviceConfig);
}
Also used : LocalDeviceConfig(com.hazelcast.config.LocalDeviceConfig)

Example 3 with LocalDeviceConfig

use of com.hazelcast.config.LocalDeviceConfig in project hazelcast by hazelcast.

the class YamlMemberDomConfigProcessor method handleLocalDevice.

@Override
protected void handleLocalDevice(Node parentNode) {
    for (Node deviceNode : childElements(parentNode)) {
        String name = deviceNode.getNodeName();
        LocalDeviceConfig localDeviceConfig = (LocalDeviceConfig) ConfigUtils.getByNameOrNew(config.getDeviceConfigs(), name, LocalDeviceConfig.class);
        handleLocalDeviceNode(deviceNode, localDeviceConfig);
    }
}
Also used : Node(org.w3c.dom.Node) YamlNode(com.hazelcast.internal.yaml.YamlNode) LocalDeviceConfig(com.hazelcast.config.LocalDeviceConfig)

Aggregations

LocalDeviceConfig (com.hazelcast.config.LocalDeviceConfig)3 YamlNode (com.hazelcast.internal.yaml.YamlNode)1 MemorySize (com.hazelcast.memory.MemorySize)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 File (java.io.File)1 Test (org.junit.Test)1 Node (org.w3c.dom.Node)1