Skip to content

Commit

Permalink
Bug.. Merging column family parts having issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinashak committed Mar 27, 2013
1 parent 5c033b4 commit f1ba4a9
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=hsearch-core
version=0.94.2.206
version=0.94.2.207

company=Bizosys Technologies Pvt Ltd.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

"value":
{
"name": "weight",
"datatype": "Float"
"name": "positions",
"datatype": "byte[]"
},

"partitions": {
"names": "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z",
"ranges": "[a:b],[b:c],[c:d],[d:e],[e:f],[f:g],[g:h],[h:i],[i:j],[j:k],[k:l],[l:m],[m:n],[n:o],[o:p],[p:q],[q:r],[r:s],[s:t],[t:u],[u:v],[v:w],[w:x],[x:y],[y:z],[z:~]",
"ranges": "[*:b],[b:c],[c:d],[d:e],[e:f],[f:g],[g:h],[h:i],[i:j],[j:k],[k:l],[l:m],[m:n],[n:o],[o:p],[p:q],[q:r],[r:s],[s:t],[t:u],[u:v],[v:w],[w:x],[x:y],[y:z],[z:*]",
"column" : 1,
"type" : "text"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

"value":
{
"name": "weight",
"datatype": "Float"
"name": "positions",
"datatype": "byte[]"
},

"partitions": {
"names": "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z",
"ranges": "[a:b],[b:c],[c:d],[d:e],[e:f],[f:g],[g:h],[h:i],[i:j],[j:k],[k:l],[l:m],[m:n],[n:o],[o:p],[p:q],[q:r],[r:s],[s:t],[t:u],[u:v],[v:w],[w:x],[x:y],[y:z],[z:~]",
"ranges": "[*:b],[b:c],[c:d],[d:e],[e:f],[f:g],[g:h],[h:i],[i:j],[j:k],[k:l],[l:m],[m:n],[n:o],[o:p],[p:q],[q:r],[r:s],[s:t],[t:u],[u:v],[v:w],[w:x],[x:y],[y:z],[z:*]",
"column" : 1,
"type" : "text"
}
Binary file modified hsearch-core.jar
Binary file not shown.
Binary file modified src-hsearch-core.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

"value":
{
"name": "weight",
"datatype": "Float"
"name": "positions",
"datatype": "byte[]"
},

"partitions": {
"names": "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z",
"ranges": "[a:b],[b:c],[c:d],[d:e],[e:f],[f:g],[g:h],[h:i],[i:j],[j:k],[k:l],[l:m],[m:n],[n:o],[o:p],[p:q],[q:r],[r:s],[s:t],[t:u],[u:v],[v:w],[w:x],[x:y],[y:z],[z:~]",
"ranges": "[*:b],[b:c],[c:d],[d:e],[e:f],[f:g],[g:h],[h:i],[i:j],[j:k],[k:l],[l:m],[m:n],[n:o],[o:p],[p:q],[q:r],[r:s],[s:t],[t:u],[u:v],[v:w],[w:x],[x:y],[y:z],[z:*]",
"column" : 1,
"type" : "text"
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ colNameQuolonId, new QueryPart(filtersPipeSeparated,
}
}

/**
* TODO:
* If we have a query as FieldA OR FieldB
* FieldA, tableparts should only contain byte[] of family FieldA_*
* and FieldB byte[] of family FieldB_*
*/
@Override
public void filterRow(List<KeyValue> kvL) {
if ( null == kvL) return;
Expand Down Expand Up @@ -368,14 +374,15 @@ public byte[] serialize( List<FederatedFacade<String, String>.IRowId> matchedIds
HbaseLog.l.debug("HSearchGenericFilter:serialize : with matchedIds " + matchedIdsT);
}

//Collect data from the independent plugins

Collection<byte[]> merged = new ArrayList<byte[]>();
Collection<byte[]> append = new ArrayList<byte[]>(1);

/**
* - Iterate through all the parts and find the values.
* - Collect the data for multiple queries
*/
HSearchReducer reducer = getReducer();

int totalQueries = queryPayload.values().size();

Collection<byte[]> merged = new ArrayList<byte[]>();
Collection<byte[]> append = new ArrayList<byte[]>(1);

for (QueryPart part : queryPayload.values()) {
Object pluginO = part.getParams().get(HSearchTableMultiQueryExecutor.PLUGIN);
Expand All @@ -384,11 +391,8 @@ public byte[] serialize( List<FederatedFacade<String, String>.IRowId> matchedIds
if ( totalQueries == 1) {
plugin.getResultSingleQuery(merged);
} else {
//Merge the data
plugin.getResultMultiQuery(matchedIds, merged);
if ( null != reducer) {
reducer.appendCols(merged, append);
}
plugin.getResultMultiQuery(matchedIds, append);
if ( null != reducer) reducer.appendCols(merged, append);
append.clear();
}
}
Expand Down

0 comments on commit f1ba4a9

Please sign in to comment.