I'm a bit confused by your questions, but when you insert multiple rows into tables, lookups are made to the .META.
table to find which region should get the mutations and the client then sends it to the corresponding hbase regionserver.
HFiles are indeed sorted files with keyvalues, which look more like
<keylength> <valuelength> <rowlength> <row> <columnfamilylength> <columnfamily> <columnqualifier> <timestamp> <keytype> <value>
http://hbase.apache.org/book/hfilev2.html
http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/KeyValue.html
Sorting occurs in all compactions i.e. when you add a row it is added to the memtable
, which once filled with enough rows in the memtable
it will sort them and dump them to a HFile
(i.e Merge compaction). When multiple HFiles exist for a region
HBase will merge them all together in a sorted fashion (called Major Compaction).
The META Table maintains Region information, such as table name, region start key, end key, and which server is serving it.