如何通过thrift2 CPP API设置HBase单元ttl(生存时间)?

如何通过thrift2 CPP API设置HBase单元ttl(生存时间)?,hbase,thrift,ttl,Hbase,Thrift,Ttl,我试图通过Thrift2API(在cpp中生成的代码)和ttl在HBase中放入一行。正如官方Java测试代码所示,Attribute对象将有如下帮助 long TTLTIMES=2000L; //_ttl属性是此put中键值的ms ttl数。 put(wrap(Bytes.toBytes(“_ttl”)),wrap(Bytes.toBytes(ttltimes)); //附加属性 put.setAttributes(attributes); //发送它。 handler.put(表,put);

我试图通过Thrift2API(在cpp中生成的代码)和ttl在HBase中放入一行。正如官方Java测试代码所示,Attribute对象将有如下帮助

long TTLTIMES=2000L;
//_ttl属性是此put中键值的ms ttl数。
put(wrap(Bytes.toBytes(“_ttl”)),wrap(Bytes.toBytes(ttltimes));
//附加属性
put.setAttributes(attributes);
//发送它。
handler.put(表,put);
然而,当我在Cpp中执行相同的操作时,代码如下所示。它不起作用

std::map val;
val[“_ttl”]=“30000000”//3000000毫秒大约等于9小时
t输出属性(val);
客户机->put(表名,tput);
24小时后该行仍然存在

hbase(main):019:0>扫描“shonejiang1026”{VERSIONS=>99}
行+列+单元格
10010列=cf1:年龄,时间戳=1606124973760,值=1998
damao_ttl_17:48 column=cf1:name,timestamp=1605779312661,value=london
0.0300秒内2行
我检查了HBase日志,这一行的ttl属性是一个比我设置的大得多的长整数

Found row:keyvalues={damao_ttl_17:48/cf1:name/1605779312661/Put/vlen=6/seqid=0}
单元格:damao_ttl_17:48/cf1:name/1605779312661/Put/vlen=6/seqid=0
标签:8 10000000
单元ts=1605779312661,ttl=3544385890265608240
那么,用ttl为Hbase划一行的正确方法是什么

PS:这是Thrift2API,ThriftAPI不适合这个问题