Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

22
LINES

< > BotCompany Repo | #1011919 // ai_indexWebs_parallel - note: indexes in different order - this makes no sense, should make multiple indexes, then merge

JavaX fragment (include)

static MultiMap<S, WebNode> ai_indexWebs_parallel(Collection<Web> webs) ctex {
  print("Making index in parallel.");
  final MultiMap<S, WebNode> index = caseInsensitiveMultiMap();
  
  int queueSize = numberOfCores();
  NotifyingBlockingThreadPoolExecutor e = new(numberOfCores(), queueSize, 15, TimeUnit.SECONDS);
    
  try {
    for (final L<Web> l : chunksOf1000(webs)) {
      e.execute(r { pcall {
        for (Web web : l)
          ai_addWebToIndex(index, web);
      }});
    }
    e.shutdown();
    e.awaitTermination(1, TimeUnit.DAYS);
  } finally {
    e.shutdown();
  }
  
  ret index;
}

Author comment

Began life as a copy of #1011347

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1011919
Snippet name: ai_indexWebs_parallel - note: indexes in different order - this makes no sense, should make multiple indexes, then merge
Eternal ID of this version: #1011919/9
Text MD5: 235531fb20d539813096168dc4d983fb
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-10 03:29:30
Source code size: 622 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 405 / 427
Version history: 8 change(s)
Referenced in: [show references]