Exemple #1
0
 public void Test_search(String search_word_str, int... expd) {
   Xowe_wiki wiki = bldr_fxt.Wiki();
   List_adp rv = List_adp_.new_();
   byte[] search_word_bry = Bry_.new_a7(search_word_str);
   wiki.Db_mgr_as_sql().Load_mgr().Load_search(Cancelable_.Never, rv, search_word_bry, 100);
   Tfds.Eq_ary(expd, Xto_int_ary(rv));
 }
Exemple #2
0
 int[] Xto_int_ary(Xoctg_data_ctg ctg) {
   List_adp list = List_adp_.new_();
   byte tid_max = Xoa_ctg_mgr.Tid__max;
   for (byte tid = 0; tid < tid_max; tid++) {
     Xoctg_idx_mgr grp = ctg.Grp_by_tid(tid);
     if (grp == null) continue;
     int len = grp.Itms_len();
     for (int i = 0; i < len; i++) {
       Xoctg_idx_itm itm = grp.Itms_get_at(i);
       list.Add(itm.Id());
     }
   }
   return (int[]) list.To_ary_and_clear(int.class);
 }
 @Override
 public void Cmd_run() {
   Init_bldr_bmks();
   this.time_bgn = System_.Ticks();
   int total_pending = Xob_xfer_regy_tbl.Select_total_pending(bldr_conn);
   // if (total_pending > 250000 && src_bin_mgr__fsdb_version == null)
   usr_dlg.Note_many("", "", "total pending: ~{0}", total_pending);
   List_adp list = List_adp_.New();
   boolean loop = true;
   while (loop) {
     byte rslt = Select_fsdb_itms(list);
     switch (rslt) {
       case Select_rv_stop:
         if (bin_db_mgr.Tier_id_is_last(tier_id_val)) loop = false;
         else {
           ++tier_id_val;
           page_id_val = 0;
           continue;
         }
         break;
       case Select_rv_next_page:
         ++page_id_val;
         lnki_id_val = 0;
         continue;
       case Select_rv_process:
         break;
     }
     if (!loop) break; // no more ttls found
     int len = list.Count();
     usr_dlg.Prog_many("", "", "fetched pages: ~{0}", len);
     for (int i = 0; i < len; ++i) {
       Xodb_tbl_oimg_xfer_itm fsdb = (Xodb_tbl_oimg_xfer_itm) list.Get_at(i);
       Download_itm(fsdb);
       if (exit_now
           || exec_count >= exec_count_max
           || exec_fail >= exec_fail_max
           || page_id_val >= page_id_end) {
         this.Txn_sav();
         return;
       }
     }
   }
   exec_done = true;
 }