2013-02-11 85 views
1

我已經將HBase 0.94.0啓動並運行在我的HDFS 0.20.0上。我正在做我的家庭作業,我必須把我的列家庭在In-Memory我有兩列家庭否和主題。如何在HBase中設置內存

將它們設置爲In-Memory

new HColumnDescriptor("No").setInMemory(true); 
new HColumnDescriptor("Subject").setInMemory(true); 

當我檢查我的localhost:60010,該表詳細信息仍然顯示IN_MEMORY => 'false'這是怎麼回事後?我不得不超過設定.setInMemory(true)

+1

應該實際上工作。你能告訴我你的代碼嗎? – Tariq 2013-02-11 16:03:52

+0

@Tariq這是我的代碼。我已經發布它在我以前的帖子http://stackoverflow.com/questions/14729779/hbase-read-performance-varying-abnormally/14730543#comment20640568_14730543 – 2013-02-12 05:22:10

回答

1
HTableDescriptor descriptor = new HTableDescriptor("Student92"); 
    HColumnDescriptor col1=new HColumnDescriptor("No".getBytes()); 
    HColumnDescriptor col2=new HColumnDescriptor("Subject".getBytes()); 
    col1.setInMemory(true); 
    col2.setInMemory(true); 

這工作!