HBase:使用JavaAPI创建表时指定版本

HBase:使用JavaAPI创建表时指定版本,hbase,Hbase,我知道我们可以通过hbase shell通过以下方式实现: create 't1', {NAME => 'f1', VERSIONS => 5} 我在Java API的HTableDesctiptor中找不到任何相应的选项。你知道怎么做吗 每个列族指定最大版本和其他ttl类型设置。因此,max版本在上。我在这里留下一个基于您的示例的示例代码作为参考 HTableDescriptor descriptor = new HTableDescriptor("t1"); HColumnDe

我知道我们可以通过hbase shell通过以下方式实现:

create 't1', {NAME => 'f1', VERSIONS => 5}

我在Java API的
HTableDesctiptor
中找不到任何相应的选项。你知道怎么做吗

每个列族指定最大版本和其他ttl类型设置。因此,max版本在上。

我在这里留下一个基于您的示例的示例代码作为参考

HTableDescriptor descriptor = new HTableDescriptor("t1");
HColumnDescriptor cd = new HColumnDescriptor("f1");
cd.setMaxVersions(5);
descriptor.addFamily(cd);