Database Reference
In-Depth Information
The table descriptor also provides methods to specify the tables as read only (by
default, all tables are write enabled). Read-only tables cannot be modiied and can
only be used to access the data. The boolean isReadOnly() option checks whether
the read-only lag is set for the table. The void setReadOnly(boolean readOnly)
option sets the table and all the columns in it as read only.
As discussed earlier, the in-memory store is used to buffer the values before
writing them to disk. We can set the buffer size for the in-memory store using
the following methods:
long getMemStoreFlushSize();
void setMemStoreFlushSize(long memstoreFlushSize);
The getter and setter is set for the size of the in-memory store; once this in-memory
store is completely illed, the lush operation to write the in-memory data to disk is
triggered. The default size of the in-memory store is 64 MB.
Like the HTableDescriptor class, we also have the HColumnDescriptor class that
provides methods to specify different settings at the column family level. Using these
methods, a client can create any number of columns at run time where columns are
accessed as a combination of the column family name and the column qualiier (or
column key). The HTableDescriptor class provides a number of constructors, the
following are some of the non deprecated ones:
HColumnDescriptor(byte[] familyName) : This constructs a column
descriptor object by passing the family name as a byte[] parameter
HColumnDescriptor(String familyName) : This constructs a column
descriptor object by passing the family name as a string parameter
Some of the useful methods deined in the HColumnDescriptor class are as follows:
byte[] getName()
String getNameAsString()
The preceding command shows a different getter for getting the column family name.
int getMaxVersions()
HColumnDescriptor setMaxVersions(int maxVersions)
The preceding command shows different getter and setter methods for the maximum
number of versions for a column value (default value 3).
 
Search WWH ::




Custom Search