I know that we can do this from the hbase shell as follows:
create 't1', {NAME => 'f1', VERSIONS => 5}
I could not find the corresponding option in the HTableDesctiptor in the Java API. Any ideas how to do this?
HTableDesctiptor
Maximum versions and other parameters of type ttl are specified for each column family. So the maximum versions are on HColumnDescriptor .
I leave the sample code here based on your example as a reference.
HTableDescriptor descriptor = new HTableDescriptor("t1"); HColumnDescriptor cd = new HColumnDescriptor("f1"); cd.setMaxVersions(5); descriptor.addFamily(cd);
Source: https://habr.com/ru/post/1447678/More articles:What are the values ββof the 'on_cpu' field in the struct task_struct and the 'cpu' field in the struct thread_info? - linuxxpath to select items with the last child value - c #ColdFusion & MSSQL: how to insert multiple rows with one unique identifier in one view - coldfusionphp: convert from cp1251 to utf8 - phpOnConnected Task does not start when upgrading to SignalR 1.0.0 alpha2 - c #How to make structure and dependent applications loosely coupled? - c #Is garbage collection performed after an OutOfMemoryError is thrown in java? - javastring length utf8 - stringIs there a way to set all dictionary values ββto zero? - pythonNMEA data analysis in Android 2.3 - androidAll Articles