Question : You have created an HBase application called Acmeshell and from within Acmeshell, you want to create a new table named AcmeLogs. In this AcmeLogs table you will be storing 2 Billion Mobile advertisement and its clickstream information. You start with the following Java code: You have already created HBaseAdmin object ( name of object acmeAdmin)using the configuration as well as HTableDescriptor with table name "AcmeLogs". Now you want to finally create the table using HTableDescriptor, select the correct command. 1. HTable.createTable(acmeTable); 2. HBaseAdmin.createTable(acmeTable); 3. Access Mostly Uused Products by 50000+ Subscribers
4. acmeAdmin.createTable(acmeTable);
Correct Answer : Get Lastest Questions and Answer : Explanation: HBaseAdmin class provides an interface to manage HBase database table metadata and general administrative functions. HBaseAdmin can create, drop, list, enable and disable tables. It can also be used to add and drop table column families. Once you create a table, the table is automatically enabled, so you don't need to callenableTable manually. HBaseAdmin class Configuration configuration = new Configuration(); HBaseAdmin acmeAdmin = new HBaseAdmin(configuration); HTableDescriptor descriptor = new HTableDescriptor(Bytes.toBytes("tablename")); HColumnDescriptor columnDescriptor = new HColumnDescriptor(Bytes.toBytes("columnfamilyname")); descriptor.addFamily(columnDescriptor); acmeAdmin.createTable(descriptor); HBase schemas can be created or updated with shell or by using HBaseAdmin in the Java API. Tables must be disabled when making ColumnFamily modifications, for example: Configuration config = HBaseConfiguration.create(); HBaseAdmin admin = new HBaseAdmin(conf); String table = "myTable"; admin.disableTable(table); HColumnDescriptor cf1 = ...; admin.addColumn(table, cf1); // adding new ColumnFamily HColumnDescriptor cf2 = ...; admin.modifyColumn(table, cf2); // modifying existing ColumnFamily admin.enableTable(table); public static void createSchemaTables (Configuration config) { try { final HBaseAdmin admin = new HBaseAdmin(config); HTableDescriptor table = new HTableDescriptor(TableName.valueOf(TABLE_NAME)); table.addFamily(new HColumnDescriptor(CF_DEFAULT).setCompressionType(Algorithm.SNAPPY)); System.out.print("Creating table. "); createOrOverwrite(admin, table); System.out.println(" Done."); admin.close();
Question : You have created an advertising application based on HBase called Acmeshell in Acmeshell you wish to insert text using the add method, with the add text you also want to store the time when the click happened on the advertisement, in HBase select the correct syntax so that you can also store click timestamp using the Put class? 1. put.add(column_family, column_qualifier, data, click_timestamp)
HBase uses the Put class to write (store data) to an HBase row.
The Put class has add() method with a timestamp input parameter.
The add() method also takes the input parameters: column family, column qualifier, timestamp,and data.
Used to perform Put operations for a single row.
To perform a Put, instantiate a Put object with the row to insert to and for eachumn to be inserted, execute add or add if setting the timestamp. public Put add(byte[] family, byte[] qualifier, long ts, byte[] value) Add the specified column and value, with the specified timestamp as its version to this Put operation. Parameters: family - family name qualifier - column qualifier ts - version timestamp value - column value
Question :
Select the correct statement for deciding number of column families.. 1. Recommend no more than three Column Families 2. Column Families are defined by access scope 3. Access Mostly Uused Products by 50000+ Subscribers 4. All 1,2 and 3 are correct 5. only 1 and 3 are correct
When deciding number of column families - Recommend no more than three Column Families - Flushing and Compaction are per Region basis If one CF is large the other CFs will also be flushed - Compaction is triggered by number of files per CF Not sized-based - The more Column Families the greater the I/O load - Column Families are defined by access scope data across CFs are typically not accessed simultaneously
1. Deleted data is not immediately removed 2. Delete creates a tombstone marker 3. Tombstones masks the deleted values 4. Data is removed at major compaction 5. All of the above
Question : Please select the wrong statement regarding the Version delete 1. Deleting all the versions older than a certain timestamp can be performed on a row, column family or a column 2. Delete version at a specific timestamp and can only be performed on a column 3. For deletion if not timestamp is specified currentTimeMillis is used 4. For deletion if not timestamp is specified all the versions will be deleted