public int size() {
      if (isHashMapOnDisk()) {
        // Rows are in a combination of the on-disk hashmap and the sidefile
        return rowsOnDisk + (sidefileKVContainer != null ? sidefileKVContainer.size() : 0);
      } else {
        // All rows should be in the in-memory hashmap
        return hashMap.size();
      }
    }
This class encapsulates the triplet together since they are closely related to each other
The triplet: hashmap (either in memory or on disk), small table container, big table container
ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/HybridHashTableContainer.java