@Disabled @Test public void testSizeEstimatorPerformance() throws IOException, URISyntaxException { Schema schema = SchemaTestUtil.getSimpleSchema(); List<HoodieRecord> hoodieRecords = SchemaTestUtil.generateHoodieTestRecords(0, 1, schema); HoodieRecordSizeEstimator sizeEstimator = new HoodieRecordSizeEstimator<>(schema); HoodieRecord record = hoodieRecords.remove(0); long startTime = System.currentTimeMillis(); SpillableMapUtils.computePayloadSize(record, sizeEstimator); long timeTaken = System.currentTimeMillis() - startTime; System.out.println("Time taken :" + timeTaken); assertTrue(timeTaken < 100); }
@Override public R remove(Object key) { R value = get(key); valueMetadataMap.remove(key); return value; }
DiskBasedMap implements Map<T, R>, Iterable<R> { @Override public R remove(Object key) { R value = get(key); valueMetadataMap.remove(key); return value; } }
DiskBasedMap implements Map<T, R>, Iterable<R> { @Override public R remove(Object key) { R value = get(key); valueMetadataMap.remove(key); return value; } DiskBasedMap(String baseFilePath); }
DiskBasedMap implements Map<T, R>, Iterable<R> { @Override public R remove(Object key) { R value = get(key); valueMetadataMap.remove(key); return value; } DiskBasedMap(String baseFilePath); @Override Iterator<R> iterator(); long sizeOfFileOnDiskInBytes(); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override R get(Object key); static R get(ValueMetadata entry, RandomAccessFile file); @Override R put(T key, R value); @Override R remove(Object key); @Override void putAll(Map<? extends T, ? extends R> m); @Override void clear(); @Override Set<T> keySet(); @Override Collection<R> values(); Stream<R> valueStream(); @Override Set<Entry<T, R>> entrySet(); }
DiskBasedMap implements Map<T, R>, Iterable<R> { @Override public R remove(Object key) { R value = get(key); valueMetadataMap.remove(key); return value; } DiskBasedMap(String baseFilePath); @Override Iterator<R> iterator(); long sizeOfFileOnDiskInBytes(); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override R get(Object key); static R get(ValueMetadata entry, RandomAccessFile file); @Override R put(T key, R value); @Override R remove(Object key); @Override void putAll(Map<? extends T, ? extends R> m); @Override void clear(); @Override Set<T> keySet(); @Override Collection<R> values(); Stream<R> valueStream(); @Override Set<Entry<T, R>> entrySet(); static final int BUFFER_SIZE; }