Revision 7006
Added by ben leinfelder almost 13 years ago
src/edu/ucsb/nceas/metacat/admin/upgrade/dataone/GenerateSystemMetadata.java | ||
---|---|---|
36 | 36 |
import org.apache.commons.logging.LogFactory; |
37 | 37 |
|
38 | 38 |
import edu.ucsb.nceas.metacat.DBUtil; |
39 |
import edu.ucsb.nceas.metacat.IdentifierManager; |
|
39 | 40 |
import edu.ucsb.nceas.metacat.admin.AdminException; |
40 | 41 |
import edu.ucsb.nceas.metacat.admin.upgrade.UpgradeUtilityInterface; |
41 | 42 |
import edu.ucsb.nceas.metacat.dataone.SystemMetadataFactory; |
... | ... | |
99 | 100 |
|
100 | 101 |
try { |
101 | 102 |
|
102 |
// get list of ALL docids at ALL server locations |
|
103 |
List<String> idList = DBUtil.getAllDocidsByType(null, true, serverLocation); |
|
103 |
// the ids for which to generate system metadata |
|
104 |
List<String> idList = null; |
|
105 |
idList = IdentifierManager.getInstance().getLocalIdsWithNoSystemMetadata(true); |
|
104 | 106 |
|
105 | 107 |
// for testing, subset to a limited random number |
106 | 108 |
boolean test = true; |
107 | 109 |
if (test) { |
110 |
//idList = DBUtil.getAllDocidsByType(null, true, serverLocation); |
|
108 | 111 |
int limit = Math.min(idList.size(), 100); |
109 | 112 |
Collections.shuffle(idList); |
110 | 113 |
idList = idList.subList(0, limit); |
111 |
log.debug("limiting list to: " + limit); |
|
114 |
log.debug("limiting random list to: " + limit);
|
|
112 | 115 |
} |
113 |
|
|
116 |
|
|
117 |
// make sure the list is sorted so we can break them into sublists for the threads |
|
114 | 118 |
Collections.sort(idList); |
115 | 119 |
|
116 | 120 |
// executor |
Also available in: Unified diff
use IdMan method to find docids that do not already have system metadata records -- this lets us re-run without re computing system metadata for every entry (in case the process is interrupted). I haven' been using this option because I wanted to continually regenerate all SM for everything in my test DBs, but we are so close to release that I want to get this in there.