Search in sources :

Example 1 with DefaultCompactReader

use of com.hazelcast.internal.serialization.impl.compact.DefaultCompactReader in project hazelcast by hazelcast.

the class JavaRecordSerializer method read.

@Nonnull
@Override
public Object read(@Nonnull CompactReader reader) {
    DefaultCompactReader compactReader = (DefaultCompactReader) reader;
    Class<?> associatedClass = requireNonNull(compactReader.getAssociatedClass(), "AssociatedClass is required for JavaRecordSerializer");
    JavaRecordReader recordReader = readersCache.get(associatedClass);
    if (recordReader == null) {
        populateReadersWriters(associatedClass);
        recordReader = readersCache.get(associatedClass);
    }
    return recordReader.readRecord(compactReader, compactReader.getSchema());
}
Also used : DefaultCompactReader(com.hazelcast.internal.serialization.impl.compact.DefaultCompactReader) Nonnull(javax.annotation.Nonnull)

Aggregations

DefaultCompactReader (com.hazelcast.internal.serialization.impl.compact.DefaultCompactReader)1 Nonnull (javax.annotation.Nonnull)1