use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class MapConfigDTO method toJson.
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("name", config.getName());
root.add("memoryFormat", config.getInMemoryFormat().toString());
root.add("backupCount", config.getBackupCount());
root.add("asyncBackupCount", config.getAsyncBackupCount());
root.add("evictionPercentage", config.getEvictionPercentage());
root.add("minEvictionCheckMillis", config.getMinEvictionCheckMillis());
root.add("ttl", config.getTimeToLiveSeconds());
root.add("maxIdle", config.getMaxIdleSeconds());
root.add("maxSize", config.getMaxSizeConfig().getSize());
root.add("maxSizePolicy", config.getMaxSizeConfig().getMaxSizePolicy().toString());
root.add("readBackupData", config.isReadBackupData());
root.add("evictionPolicy", config.getEvictionPolicy().name());
root.add("mergePolicy", config.getMergePolicy());
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class OperationServiceDTO method toJson.
@Override
public JsonObject toJson() {
final JsonObject root = new JsonObject();
root.add("responseQueueSize", responseQueueSize);
root.add("operationExecutorQueueSize", operationExecutorQueueSize);
root.add("runningOperationsCount", runningOperationsCount);
root.add("remoteOperationCount", remoteOperationCount);
root.add("executedOperationCount", executedOperationCount);
root.add("operationThreadCount", operationThreadCount);
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ProxyServiceDTO method toJson.
@Override
public JsonObject toJson() {
final JsonObject root = new JsonObject();
root.add("proxyCount", proxyCount);
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class MemberPartitionStateImplTest method testSerialization.
@Test
public void testSerialization() {
JsonObject serialized = memberPartitionState.toJson();
MemberPartitionStateImpl deserialized = new MemberPartitionStateImpl();
deserialized.fromJson(serialized);
assertTrue(deserialized.isMemberStateSafe());
assertEquals(125342, deserialized.getMigrationQueueSize());
assertNotNull(deserialized.getPartitions());
assertEquals(2, deserialized.getPartitions().size());
assertNotNull(deserialized.toString());
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class LocalMultiMapStatsImplTest method testSerialization.
@Test
public void testSerialization() {
JsonObject serialized = localMapStats.toJson();
LocalMultiMapStatsImpl deserialized = new LocalMultiMapStatsImpl();
deserialized.fromJson(serialized);
assertTrue(deserialized.getCreationTime() > 0);
assertEquals(5, deserialized.getOwnedEntryCount());
assertEquals(3, deserialized.getBackupEntryCount());
assertEquals(4, deserialized.getBackupCount());
assertEquals(1234, deserialized.getOwnedEntryMemoryCost());
assertEquals(4321, deserialized.getBackupEntryMemoryCost());
assertEquals(1231241512, deserialized.getLastAccessTime());
assertEquals(1341412343, deserialized.getLastUpdateTime());
assertEquals(12314, deserialized.getHits());
assertEquals(1231, deserialized.getLockedEntryCount());
assertEquals(4252, deserialized.getDirtyEntryCount());
assertEquals(11, deserialized.total());
assertEquals(2, deserialized.getPutOperationCount());
assertEquals(3, deserialized.getGetOperationCount());
assertEquals(1, deserialized.getRemoveOperationCount());
assertEquals(5632, deserialized.getTotalPutLatency());
assertEquals(1247, deserialized.getTotalGetLatency());
assertEquals(1238, deserialized.getTotalRemoveLatency());
assertEquals(5631, deserialized.getMaxPutLatency());
assertEquals(1233, deserialized.getMaxGetLatency());
assertEquals(1238, deserialized.getMaxRemoveLatency());
assertEquals(5, deserialized.getOtherOperationCount());
assertEquals(2, deserialized.getEventOperationCount());
assertEquals(7461762, deserialized.getHeapCost());
assertNotNull(deserialized.getNearCacheStats());
assertNotNull(deserialized.toString());
}
Aggregations