public List_adp Load(
      Xomp_mgr_db mgr_db, String machine_name, List_adp list, int list_idx, int list_len) {
    List_adp rv = List_adp_.New();

    // add remaining pages from old pool to new_pool;
    for (int i = list_idx; i < list_len; ++i) {
      rv.Add((Xomp_page_itm) list.Get_at(i));
    }

    // load pages into new pool
    Xomp_lock_mgr lock_mgr = mgr_db.Lock_mgr();
    int uid_db = lock_mgr.Uid_prv__get(machine_name);
    if (uid_db == Xomp_lock_mgr__fsys.Uid__eos)
      return rv; // assert that uids must be incrementally larger; handle one machine reaching end,
                 // and putting -1 in queue;
    int uid_new = 0;
    try {
      uid_new = this.Load_from_db(rv, uid_db);
    } finally {
      lock_mgr.Uid_prv__rls(machine_name, uid_new);
    }
    if (show_msg__fetched_pool)
      Gfo_usr_dlg_.Instance.Note_many(
          "", "", "fetched new pool: old=~{0} new=~{1}", uid_db, uid_new);
    return rv;
  }
예제 #2
0
 public static Xow_import_doc New(IoItmDir owner_dir, byte[] dir_cmd) {
   List_adp sub_list = List_adp_.New();
   New_subs(owner_dir.Url(), sub_list, owner_dir.SubDirs(), dir_cmd);
   New_subs(owner_dir.Url(), sub_list, owner_dir.SubFils(), Bry_.Empty);
   Xow_import_doc[] subs = (Xow_import_doc[]) sub_list.To_ary_and_clear(Xow_import_doc.class);
   return new Xow_import_doc(
       Bool_.Y,
       Bool_.N,
       0,
       owner_dir.Url().OwnerDir().RawBry(),
       owner_dir.Url().RawBry(),
       Bry_.new_u8(owner_dir.Name()),
       Bry_.Empty,
       Bry_.Empty,
       dir_cmd,
       subs);
 }
 @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;
 }
 public Xobc_import_step_itm[] Select_by_task_id(int task_id) {
   List_adp list = List_adp_.New();
   Db_rdr rdr =
       conn.Stmt_sql(
               Db_sql_.Make_by_fmt(
                   String_.Ary(
                       "SELECT  s.*",
                       "FROM    import_step s",
                       "        JOIN step_map sm ON s.step_id = sm.step_id",
                       "WHERE   sm.task_id = {0}"),
                   task_id))
           .Exec_select__rls_auto();
   try {
     while (rdr.Move_next()) {
       list.Add(New_itm(rdr));
     }
   } finally {
     rdr.Rls();
   }
   return (Xobc_import_step_itm[]) list.To_ary_and_clear(Xobc_import_step_itm.class);
 }