예제 #1
0
  public void Merge_data(Xow_wiki wiki, Io_url src_url, int idx_cur) {
    long all_time_bgn = gplx.core.envs.System_.Ticks();
    wiki.Init_by_wiki();
    Db_conn src_conn = Db_conn_bldr.Instance.Get_or_autocreate(false, src_url);
    ctx.Init(wiki, src_conn);

    // merge data
    int hash_len = wkr_hash.Len();
    for (int i = 0; i < hash_len; ++i) {
      if (prog_wkr.Canceled()) break;
      Merge2_wkr wkr = (Merge2_wkr) wkr_hash.Get_at(i);
      // if (prog_wkr.Checkpoint__skip_wkr(src_url, wkr.Tbl_name())) continue;
      long wkr_time_bgn = gplx.core.envs.System_.Ticks();
      wkr.Merge_data(ctx, prog_wkr);
      Gfo_log_.Instance.Info(
          "merge.wkr.done",
          "data",
          src_url.NameAndExt()
              + "|"
              + wkr.Tbl().Tbl_name()
              + "|"
              + gplx.core.envs.System_.Ticks__elapsed_in_frac(wkr_time_bgn));
    }
    if (ctx.Heap__copy_to_wiki()) ctx.Heap__increment_nxt();
    Gfo_log_.Instance.Info(
        "merge.wkr.done",
        "data",
        src_url.NameAndExt()
            + "|-1|"
            + gplx.core.envs.System_.Ticks__elapsed_in_frac(all_time_bgn));
    src_conn.Rls_conn(); // NOTE: must close conn else pack_conn will stay open
  }
예제 #2
0
 private static Ordered_hash Make_wkrs(Merge2_wkr... wkrs) {
   Ordered_hash rv = Ordered_hash_.New();
   for (Merge2_wkr wkr : wkrs) rv.Add(wkr.Tbl().Tbl_name(), wkr);
   return rv;
 }