Search in sources :

Example 11 with GenericRecordQueryReader

use of com.hazelcast.internal.serialization.impl.GenericRecordQueryReader in project hazelcast by hazelcast.

the class ExtractorGetter method getValue.

@Override
@SuppressWarnings("unchecked")
Object getValue(Object target) throws Exception {
    Object extractionTarget = target;
    // This part will be improved in 3.7 to avoid extra allocation
    DefaultValueCollector collector = new DefaultValueCollector();
    if (target instanceof Data) {
        InternalGenericRecord record = serializationService.readAsInternalGenericRecord((Data) target);
        extractionTarget = new GenericRecordQueryReader(record);
    }
    extractor.extract(extractionTarget, arguments, collector);
    return collector.getResult();
}
Also used : DefaultValueCollector(com.hazelcast.query.impl.DefaultValueCollector) GenericRecordQueryReader(com.hazelcast.internal.serialization.impl.GenericRecordQueryReader) Data(com.hazelcast.internal.serialization.Data) InternalGenericRecord(com.hazelcast.internal.serialization.impl.InternalGenericRecord)

Aggregations

GenericRecordQueryReader (com.hazelcast.internal.serialization.impl.GenericRecordQueryReader)11 Data (com.hazelcast.internal.serialization.Data)8 InternalSerializationService (com.hazelcast.internal.serialization.InternalSerializationService)6 DefaultSerializationServiceBuilder (com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder)5 Test (org.junit.Test)5 SerializationConfig (com.hazelcast.config.SerializationConfig)4 QuickTest (com.hazelcast.test.annotation.QuickTest)4 InternalGenericRecord (com.hazelcast.internal.serialization.impl.InternalGenericRecord)3 CompactSerializationConfig (com.hazelcast.config.CompactSerializationConfig)2 SchemaService (com.hazelcast.internal.serialization.impl.compact.SchemaService)2 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)2 CustomSerializationTest (com.hazelcast.internal.serialization.impl.CustomSerializationTest)1 CompactInternalGenericRecord (com.hazelcast.internal.serialization.impl.compact.CompactInternalGenericRecord)1 GroupObject (com.hazelcast.internal.serialization.impl.compact.reader.CompactValueReaderTestStructure.GroupObject)1 NestedGroupObject (com.hazelcast.internal.serialization.impl.compact.reader.CompactValueReaderTestStructure.NestedGroupObject)1 PrimitiveObject (com.hazelcast.internal.serialization.impl.compact.reader.CompactValueReaderTestStructure.PrimitiveObject)1 PortableGenericRecord (com.hazelcast.internal.serialization.impl.portable.PortableGenericRecord)1 TestPortableFactory (com.hazelcast.internal.serialization.impl.portable.portablereader.DefaultPortableReaderTestStructure.TestPortableFactory)1 DefaultValueCollector (com.hazelcast.query.impl.DefaultValueCollector)1 MultiResult (com.hazelcast.query.impl.getters.MultiResult)1