Question-66: When you persist the data in HBase Row, in which two places HBase writes the data to make sure the durability.

Answer: HBase receives the command and persists the change, or throws an exception if the write fails. When a write is made, by default, it goes into two places:

  1. The write-ahead log (WAL), also referred to as the HLog.
  2. And the MemStore

The default behavior of HBase recording the write in both places is in order to maintain data durability. Only after the change is written to and confirmed in both places is the write considered complete.

Question-67: What is MemStore?

Answer: The MemStore is a write buffer where HBase accumulates data in memory before a permanent write. Its contents are flushed to disk to form an HFile when the MemStore fills up. It doesn’t write to an existing HFile but instead forms a new file on every flush. There is one MemStore per column family. (The size of the MemStore is defined by the system-wide property in hbase-site.xml called hbase.hregion.memstore.flush.size)

Question-68: What is HFile ?

Answer:The HFile is the underlying storage format for HBase. HFiles belong to a column family and a column family can have multiple HFiles. But a single HFile can’t have data for multiple column families.

Question-69: How HBase Handles the write failure.

Answer: Failures are common in large distributed systems, and HBase is no exception. Imagine that the server hosting a MemStore that has not yet been flushed crashes. You’ll lose the data that was in memory but not yet persisted. HBase safeguards against that by writing to the WAL before the write completes. Every server that’s part of the. HBase cluster keeps a WAL to record changes as they happen. The WAL is a file on the underlying file system. A write isn’t considered successful until the new WAL entry is successfully written. This guarantee makes HBase as durable as the file system backing it. Most of the time, HBase is backed by the Hadoop Distributed Filesystem (HDFS). If HBase goes down, the data that was not yet flushed from the MemStore to the HFile can be recovered by replaying the WAL.

Question-70. Which of the API command you will use to read data from HBase?

Answer:  Get

exmaple

Get g = new Get(Bytes.toBytes("John Smith"));

Result r = usersTable.get(g);