簡體   English   中英

cassandra:有沒有辦法獲取以特定前綴開頭的列的所有值?

[英]cassandra : Is there a way to get all value of columns starting with a particular prefix?

我需要獲取鍵的所有column:column_value對。 約束是列具有通用的前綴,是否可以使用Hector獲得它?

您可以執行SliceQuery,並執行從前綴到prefix |的范圍,並提供僅適用的字母數字。

StringSerializer ss = StringSerializer.get();
SliceQuery sliceQuery = HFactory.createSliceQuery(keySpace, rowSerializer, ss, ss);
sliceQuery.setColumnFamily(MY_COLUMN_FAMILY);
sliceQuery.setKey(rowKey);
sliceQuery.setRange("prefix", "prefix|", false, Integer.MAX_INT);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM