Question : Which staement is correct for versioning
1. The versions are sorted by their timestamp in ascending order 2. The versions are sorted by their timestamp in descending order 3. By default HBase maintains unlimited number of versions 4. Only 1 and 3 are correct 5. Only 2 and 3 are correct
Correct Answer : 2
Table cells are the intersection of a row and column A {row, column, version} tuple specifies a cell in HBase Cell content contains uninterpreted bytes Cells are versioned Unlimited number of versions of a cell Version is specified using a long integer By default, the version is current time - epoch (12pm, 01/01/70) Versions are stored in decreasing order
By default, HBase keeps three versions of a row The versions are sorted by their timestamp (in descending order)
Question : When get and scan operation is performed on the HBase, then by default it will return
1. Cell with largest value for version is returned 2. Cell with smallest value for version is returned 3. It return any random value from the all versions 4. None of the above is correct
Correct Answer : 1
Get or Scan to retrieve data By default, cell with largest value for version is returned Get.setMaxVersions() to return more than one version Get.SetTimeRange() to return versions other than the latest
Question : To retrive the last three versions of the row, which operation needs to be performed
1. get.setMaxVersions(3); 2. get.setMaxVersions("three"); 3. get.setAllVersions(3); 4. htable.get(get); 5. Bydefault it always return latest three versions only
Correct Answers: 1
To return the last three version following code needs to be followd
Get get = new Get(Bytes.toBytes("row1")); get.setMaxVersions(3); Result r = htable.get(get);
And to return the current version of the row Get get = new Get(Bytes.toBytes("row1")); Result r = htable.get(get); byte[] b = r.getValue(Bytes.toBytes("cf"), Bytes.toBytes("attr"));
1. Copies the article txt file 12012014Articles.txt from default HDFS directory into the HDFS directory /hdfs/hive//warehosue/12012014 2. Copies the article txt file 12012014Articles.txt from default HDFS directory into the HDFS directory /hdfs 3. Copies the article txt file 12012014Articles.txt from default HDFS directory into the HDFS directory /hdfs/12012014 4. Copies the article txt file 12012014Articles.txt from local directory into the HDFS directory 12012014
1. It will cache the data so it can give high read throughput
2. It will cache the data so it can give high write throughput
3. If RegionServer fails before persisting the data to final location, data will be always avaibale and avoid any data loss. 4. It helps the even distribution of data across the all data centers.