use of com.hazelcast.config.CompactSerializationConfig in project hazelcast by hazelcast.
the class YamlMemberDomConfigProcessor method handleCompactSerialization.
@Override
protected void handleCompactSerialization(Node node, SerializationConfig serializationConfig) {
CompactSerializationConfig compactSerializationConfig = serializationConfig.getCompactSerializationConfig();
for (Node child : childElements(node)) {
String name = cleanNodeName(child);
if (matches("enabled", name)) {
boolean enabled = getBooleanValue(getTextContent(child));
compactSerializationConfig.setEnabled(enabled);
} else if (matches("registered-classes", name)) {
fillCompactSerializableClasses(child, compactSerializationConfig);
}
}
}
use of com.hazelcast.config.CompactSerializationConfig in project hazelcast by hazelcast.
the class AbstractDomConfigProcessor method handleCompactSerialization.
protected void handleCompactSerialization(Node node, SerializationConfig serializationConfig) {
CompactSerializationConfig compactSerializationConfig = serializationConfig.getCompactSerializationConfig();
Node enabledNode = getNamedItemNode(node, "enabled");
if (enabledNode != null) {
boolean enabled = getBooleanValue(getTextContent(enabledNode));
compactSerializationConfig.setEnabled(enabled);
}
for (Node child : childElements(node)) {
String name = cleanNodeName(child);
if (matches("registered-classes", name)) {
fillCompactSerializableClasses(child, compactSerializationConfig);
}
}
}
use of com.hazelcast.config.CompactSerializationConfig in project hazelcast by hazelcast.
the class SqlCompactTest method beforeClass.
@BeforeClass
public static void beforeClass() {
Config config = new Config();
config.getJetConfig().setEnabled(true);
CompactSerializationConfig compactSerializationConfig = config.getSerializationConfig().getCompactSerializationConfig();
compactSerializationConfig.setEnabled(true);
// registering this class to the member to see it does not affect any of the tests.
// It has a different schema than all the tests
compactSerializationConfig.register(Person.class, PERSON_TYPE_NAME, new CompactSerializer<Person>() {
@Nonnull
@Override
public Person read(@Nonnull CompactReader in) {
Person person = new Person();
person.surname = in.readString("surname", "NotAssigned");
return person;
}
@Override
public void write(@Nonnull CompactWriter out, @Nonnull Person person) {
out.writeString("surname", person.surname);
}
});
ClientConfig clientConfig = new ClientConfig();
clientConfig.getSerializationConfig().getCompactSerializationConfig().setEnabled(true);
initializeWithClient(1, config, clientConfig);
sqlService = instance().getSql();
clientSqlService = client().getSql();
serializationService = Util.getSerializationService(instance());
}
use of com.hazelcast.config.CompactSerializationConfig in project hazelcast by hazelcast.
the class YamlClientDomConfigProcessor method handleCompactSerialization.
@Override
protected void handleCompactSerialization(Node node, SerializationConfig serializationConfig) {
CompactSerializationConfig compactSerializationConfig = serializationConfig.getCompactSerializationConfig();
for (Node child : childElements(node)) {
String name = cleanNodeName(child);
if (matches("enabled", name)) {
boolean enabled = getBooleanValue(getTextContent(child));
compactSerializationConfig.setEnabled(enabled);
} else if (matches("registered-classes", name)) {
fillCompactSerializableClasses(child, compactSerializationConfig);
}
}
}
use of com.hazelcast.config.CompactSerializationConfig in project hazelcast by hazelcast.
the class CompactNullablePrimitiveInteroperabilityTest method createSerializationService.
private SerializationService createSerializationService() {
CompactSerializationConfig compactSerializationConfig = new CompactSerializationConfig();
compactSerializationConfig.setEnabled(true);
return new DefaultSerializationServiceBuilder().setSchemaService(schemaService).setConfig(new SerializationConfig().setCompactSerializationConfig(compactSerializationConfig)).build();
}
Aggregations