the server operations of the search algorithm for JXT @param token1 joinToken(1) in JXT @param token2 joinToken(1) in JXT @param join_column the chosen column of the join attribute @return the matching result
(byte[][] token1, byte[][] token2, int join_column)
| 57 | * @return the matching result |
| 58 | */ |
| 59 | public ArrayList<byte[]> search(byte[][] token1, byte[][] token2, int join_column){ |
| 60 | ArrayList<byte[]> res = new ArrayList<>(); |
| 61 | |
| 62 | ArrayList<tuple> token1_tset = tset.get(stag1); |
| 63 | ArrayList<tuple> token2_tset = tset.get(stag2); |
| 64 | byte[][] xtoken1 = new byte[token1_tset.size()][]; |
| 65 | byte[][] xtoken2 = new byte[token2_tset.size()][]; |
| 66 | for (int i = 0; i < token1_tset.size(); i++) { |
| 67 | xtoken1[i] = tool.Xor(token1_tset.get(i).h_y[join_column], token1[i]); |
| 68 | } |
| 69 | for (int i = 0; i < token2_tset.size(); i++) { |
| 70 | xtoken2[i] = tool.Xor(token2_tset.get(i).h_x[join_column], token2[i]); |
| 71 | } |
| 72 | |
| 73 | for (int i = 0; i < token1_tset.size(); i++) { |
| 74 | for (int j = 0; j < token2_tset.size(); j++) { |
| 75 | long x = tool.bytesToLong(tool.Xor(xtoken1[i], xtoken2[j])); |
| 76 | if (f_2.mayContain(x)){//if contains, the records satisfy the query |
| 77 | res.add(token1_tset.get(i).ct); |
| 78 | res.add(token2_tset.get(j).ct); |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | return res; |
| 83 | } |
| 84 | } |