2017-02-20 1 views
0

내가 문제가 작동하지 않습니다 HBase와 쉘에 변화가 없습니다HBase를 setMaxVersions 자바 API는

HTableDescriptor descriptor = new HTableDescriptor(TableName.valueOf("shoppingcart")); 
HColumnDescriptor cd = new HColumnDescriptor(Bytes.toBytes("items")); 
cd.setMaxVersions(4); 

. 내가 실행하면 : 그것은 VERSION 반환

decribe 'shoppingcart', 

: 3

이 내 자바 코드입니다. 그게 거짓인가? 또는 HBase 기능을 오해 했습니까?

답변

0

HColumnDescriptor의 업데이트가 HBase 서버로 전파되지 않습니다. 다음 행을 추가하십시오.

HBaseAdmin hBaseAdmin = new HBaseAdmin(conf); 
hBaseAdmin.modifyTable("shoppingcart", descriptor); 
+0

Perfect. 고맙습니다 –

+0

@ 노래 타타 잘, 당신은 대답을 받아 들일 수 있습니다 – AdamSkywalker