Source:
private PartitionedMapTable createTable(MapServiceContext context, String name) { try { MapContainer mapContainer = context.getMapContainer(name); if (mapContainer == null) { return null; } MapConfig config = mapContainer.getMapConfig(); if (config.getInMemoryFormat() == InMemoryFormat.NATIVE) { throw QueryException.error("IMap with InMemoryFormat.NATIVE is not supported: " + name); } boolean binary = config.getInMemoryFormat() == InMemoryFormat.BINARY; for (PartitionContainer partitionContainer : context.getPartitionContainers()) { RecordStore<?> recordStore = partitionContainer.getExistingRecordStore(name); if (recordStore == null) { continue; } Iterator<Map.Entry<Data, Record>> recordStoreIterator = recordStore.iterator(); if (!recordStoreIterator.hasNext()) { continue; } Map.Entry<Data, Record> entry = recordStoreIterator.next(); InternalSerializationService ss = (InternalSerializationService) nodeEngine.getSerializationService(); MapSampleMetadata keyMetadata = MapSampleMetadataResolver.resolve( ss, entry.getKey(), binary, true ); MapSampleMetadata valueMetadata = MapSampleMetadataResolver.resolve( ss, entry.getValue().getValue(), binary, false ); List<TableField> fields = mergeMapFields(keyMetadata.getFields(), valueMetadata.getFields()); long estimatedRowCount = getEstimatedRowCount(name, context); return new PartitionedMapTable( name, fields, new ConstantTableStatistics(estimatedRowCount), keyMetadata.getDescriptor(), valueMetadata.getDescriptor() ); } return emptyMap(name); } catch (QueryException e) { throw e; } catch (Exception e) { throw QueryException.error("Failed to get metadata for IMap " + name + ": " + e.getMessage(), e); } }

Target:
private PartitionedMapTable createTable(MapServiceContext context, String name) { try { MapContainer mapContainer = context.getMapContainer(name); if (mapContainer == null) { return null; } MapConfig config = mapContainer.getMapConfig(); if (config.getInMemoryFormat() == InMemoryFormat.NATIVE) { throw QueryException.error("IMap with InMemoryFormat.NATIVE is not supported: " + name); } boolean binary = config.getInMemoryFormat() == InMemoryFormat.BINARY; for (PartitionContainer partitionContainer : context.getPartitionContainers()) { RecordStore<?> recordStore = partitionContainer.getExistingRecordStore(name); if (recordStore == null) { continue; } Iterator<Map.Entry<Data, Record>> recordStoreIterator = recordStore.iterator(); if (!recordStoreIterator.hasNext()) { continue; } Map.Entry<Data, Record> entry = recordStoreIterator.next(); InternalSerializationService ss = (InternalSerializationService) nodeEngine.getSerializationService(); MapSampleMetadata keyMetadata = MapSampleMetadataResolver.resolve( ss, entry.getKey(), binary, true ); MapSampleMetadata valueMetadata = MapSampleMetadataResolver.resolve( ss, entry.getValue().getValue(), binary, false ); List<TableField> fields = mergeMapFields(keyMetadata.getFields(), valueMetadata.getFields()); long estimatedRowCount = getEstimatedRowCount(name, context); return new PartitionedMapTable( name, fields, new ConstantTableStatistics(estimatedRowCount), keyMetadata.getDescriptor(), valueMetadata.getDescriptor() ); } return emptyMap(name); } catch (QueryException e) { return new PartitionedMapTable(name, e); } catch (Exception e) { QueryException e0 = QueryException.error("Failed to get metadata for IMap " + name + ": " + e.getMessage(), e); return new PartitionedMapTable(name, e0); } }