Created with IntelliJ IDEA. @Author: KaiDu @Date: 2023/11/06/16:26 @Description: the setup algorithm of JXT++
| 21 | * @Description: the setup algorithm of JXT++ |
| 22 | */ |
| 23 | public class Setup_JXTpp { |
| 24 | private static String K_aes = "8975924566f6e252"; |
| 25 | private static String K_token = "89b7a92966f6eb32"; |
| 26 | private static String K_w = "7975922666f6eb02"; |
| 27 | private static String K_wp = "787599ac86f2e82"; |
| 28 | private static String K_z = "9862192ad6f6ef65"; |
| 29 | private static String K_h = "9874a22554e7db85"; |
| 30 | private static String K_c = "6574b33984e7fb55"; |
| 31 | private int table_id; |
| 32 | private int key_column; |
| 33 | private int join_column; |
| 34 | private int record_num; |
| 35 | private String condition; |
| 36 | private String[] id; |
| 37 | private String[][] keyword; |
| 38 | private String[][] join_attr; |
| 39 | |
| 40 | private Bloom f; |
| 41 | |
| 42 | private Xor8 xor; |
| 43 | |
| 44 | private int[] l_max; |
| 45 | |
| 46 | private Map<BigInteger, ArrayList<byte[]>> tset = new LinkedHashMap<>(); |
| 47 | |
| 48 | /** |
| 49 | * @param table_id_ the table index |
| 50 | * @param key_column_num the number of columns which are not join attribute |
| 51 | * @param join_column_num the number of column |
| 52 | * @param record the number of records of the table |
| 53 | */ |
| 54 | public Setup_JXTpp(int table_id_, int key_column_num, int join_column_num, int record, String condition_t){ |
| 55 | table_id = table_id_; |
| 56 | key_column = key_column_num; |
| 57 | join_column = join_column_num; |
| 58 | record_num = record; |
| 59 | condition = condition_t; |
| 60 | } |
| 61 | |
| 62 | public void construct() { |
| 63 | //Step 1 read the dataset from the tables |
| 64 | //Step 1.1 prepare the parameters |
| 65 | l_max = new int[join_column]; |
| 66 | id = new String[record_num + 1]; |
| 67 | keyword = new String[record_num + 1][key_column]; |
| 68 | join_attr = new String[record_num + 1][join_column]; |
| 69 | Map<String, ArrayList<Integer>> reverse_id = new LinkedHashMap<>(); |
| 70 | Map<String, Integer> l_max_cnt = new HashMap<>(); |
| 71 | String path = "data/table" + table_id + "/table" + table_id + "_k" + key_column |
| 72 | + "_j" + join_column + "_" + record_num + condition + ".csv"; |
| 73 | //Step 1.2 begin to read dataset and statistics the l_max |
| 74 | try (Reader reader = Files.newBufferedReader(Paths.get(path))) { |
| 75 | Iterable<CSVRecord> records = CSVFormat.DEFAULT.parse(reader); |
| 76 | int counter = 0; |
| 77 | for (CSVRecord record : records) { |
| 78 | id[counter] = record.get(0); |
| 79 | for (int j = 0; j < key_column; j++) { |
| 80 | keyword[counter][j] = record.get(j + 1); |
nothing calls this directly
no outgoing calls
no test coverage detected