use of com.hazelcast.memory.MemorySize 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());
}
use of com.hazelcast.memory.MemorySize in project hazelcast by hazelcast.
the class PhoneHomeDifferentConfigTest method testHdStorage.
@Test
public void testHdStorage() {
NativeMemoryConfig nativeMemoryConfig = new NativeMemoryConfig().setEnabled(true).setSize(new MemorySize(64L, MEGABYTES));
Config config = new Config().setNativeMemoryConfig(nativeMemoryConfig);
HazelcastInstance hazelcastInstance = createHazelcastInstance(config);
Node node = getNode(hazelcastInstance);
PhoneHome phoneHome = new PhoneHome(node);
Map<String, String> parameters = phoneHome.phoneHome(true);
assertThat(parameters.get(PhoneHomeMetrics.HD_MEMORY_ENABLED.getRequestParameterName())).isEqualTo("true");
assertThat(parameters.get(PhoneHomeMetrics.MEMORY_USED_HEAP_SIZE.getRequestParameterName())).isGreaterThan("0");
assertThat(parameters.get(PhoneHomeMetrics.MEMORY_USED_NATIVE_SIZE.getRequestParameterName())).isEqualTo("0");
assertThat(parameters.get(PhoneHomeMetrics.TIERED_STORAGE_ENABLED.getRequestParameterName())).isEqualTo("false");
assertThat(parameters.get(PhoneHomeMetrics.DATA_MEMORY_COST.getRequestParameterName())).isEqualTo("0");
}
Aggregations