@Override protected long getKeyStorageMemoryCost(K key) { if (key instanceof Data) { return // reference to this key data inside map ("store" field) REFERENCE_SIZE // heap cost of this key data + ((Data) key).getHeapCost(); } else { // memory cost for non-data typed instance is not supported return 0L; } }
@Override protected long getKeyStorageMemoryCost(K key) { if (key instanceof Data) { return // reference to this key data inside map ("store" field) REFERENCE_SIZE // heap cost of this key data + ((Data) key).getHeapCost(); } else { // memory cost for non-data typed instance is not supported return 0L; } }
/** * Get record size in bytes. */ @Override public long getCost() { return super.getCost() + REFERENCE_COST_IN_BYTES + (value == null ? 0L : value.getHeapCost()); }
public long calculateEntryCost(Data key, Record value) { long totalMapEntryCost = 0L; totalMapEntryCost += HASH_ENTRY_COST_IN_BYTES; totalMapEntryCost += key.getHeapCost(); totalMapEntryCost += value.getCost(); return totalMapEntryCost; }
@Override public long getCost() { return super.getCost() + REFERENCE_COST_IN_BYTES + (value == null ? 0 : value.getHeapCost()); }
/** * Get record size in bytes. */ @Override public long getCost() { return super.getCost() + REFERENCE_COST_IN_BYTES + (value == null ? 0L : value.getHeapCost()); }
@Override public long getCost() { return super.getCost() + REFERENCE_COST_IN_BYTES + (value == null ? 0 : value.getHeapCost()); }
public long calculateEntryCost(Data key, Record value) { long totalMapEntryCost = 0L; totalMapEntryCost += HASH_ENTRY_COST_IN_BYTES; totalMapEntryCost += key.getHeapCost(); totalMapEntryCost += value.getCost(); return totalMapEntryCost; }
@Override protected long getRecordStorageMemoryCost(NearCacheDataRecord record) { if (record == null) { return 0L; } // TODO: we don't handle object header (mark, class definition) for heap memory cost Data value = record.getValue(); // reference to this record inside map ("store" field) return REFERENCE_SIZE // reference to "value" field + REFERENCE_SIZE // partition Id + (Integer.SIZE / Byte.SIZE) // "uuid" ref size + 2 long in uuid + REFERENCE_SIZE + (2 * (Long.SIZE / Byte.SIZE)) // heap cost of this value data + (value != null ? value.getHeapCost() : 0) + NUMBER_OF_LONG_FIELD_TYPES * (Long.SIZE / Byte.SIZE) + NUMBER_OF_INTEGER_FIELD_TYPES * (Integer.SIZE / Byte.SIZE); }
@Override protected long getRecordStorageMemoryCost(NearCacheDataRecord record) { if (record == null) { return 0L; } // TODO: we don't handle object header (mark, class definition) for heap memory cost Data value = record.getValue(); // reference to this record inside map ("store" field) return REFERENCE_SIZE // reference to "value" field + REFERENCE_SIZE // partition Id + (Integer.SIZE / Byte.SIZE) // "uuid" ref size + 2 long in uuid + REFERENCE_SIZE + (2 * (Long.SIZE / Byte.SIZE)) // heap cost of this value data + (value != null ? value.getHeapCost() : 0) + NUMBER_OF_LONG_FIELD_TYPES * (Long.SIZE / Byte.SIZE) + NUMBER_OF_INTEGER_FIELD_TYPES * (Integer.SIZE / Byte.SIZE); }