Changeset 948
- Timestamp:
- 02/20/10 17:19:34 (7 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
documentation/en/user/source/configuration/xml/exhaustive.rst (modified) (1 diff)
-
geowebcache/src/main/java/org/geowebcache/georss/GeoRSSPollTask.java (modified) (4 diffs)
-
geowebcache/src/main/java/org/geowebcache/rest/GWCTask.java (modified) (1 diff)
-
geowebcache/src/main/resources/org/geowebcache/config/geowebcache.xsd (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/documentation/en/user/source/configuration/xml/exhaustive.rst
r944 r948 196 196 <format>image/png</format> 197 197 <!-- OPTIONAL If the operation is not truncate, specify how many threads 198 should run in parallel? Note that each format is done sequencially. --> 198 should run in parallel? Note that multiple formats are done in parallel, 199 so if you say 2 threads and the layer has 3 formats (and the geoRSsFeed 200 does not specify a format), then the total number of threads will be 201 3x2 = 6 --> 199 202 <seedingThreads>2</seedingThreads> 200 203 <!-- OPTIONAL GWC will render the geometries onto a bitmask and use that -
trunk/geowebcache/src/main/java/org/geowebcache/georss/GeoRSSPollTask.java
r940 r948 39 39 import org.geowebcache.mime.MimeType; 40 40 import org.geowebcache.rest.GWCTask; 41 import org.geowebcache.rest.GWCTask.STATE; 41 42 import org.geowebcache.rest.seed.RasterMask; 42 43 import org.geowebcache.rest.seed.SeedRestlet; … … 74 75 75 76 private final SeedRestlet seedRestlet; 77 78 private LinkedList<GWCTask> seedTasks; 76 79 77 80 /** … … 246 249 247 250 Iterator<MimeType> mimeIter = mimeList.iterator(); 248 249 // We do the truncate synchronously to get rid of stale data as quick as we can 251 252 // Ask any existing seed jobs started by this feed to terminate 253 stopSeeding(true); 254 255 // We do the truncate synchronously to get rid of stale data as quickly as we can 250 256 while(mimeIter.hasNext()) { 251 257 DiscontinuousTileRange dtr = new DiscontinuousTileRange(layer.getName(), gridSetId, … … 272 278 273 279 final int seedingThreads = pollDef.getSeedingThreads(); 274 GWCTask[] seedTasks; 275 seedTasks = seedRestlet.createTasks(dtr, layer, GWCTask.TYPE.SEED, seedingThreads, false); 276 seedRestlet.dispatchTasks(seedTasks); 280 GWCTask[] tasks = seedRestlet.createTasks(dtr, layer, GWCTask.TYPE.SEED, seedingThreads, false); 281 seedRestlet.dispatchTasks(tasks); 282 283 // Save the handles so we can stop them 284 for (GWCTask task : tasks) { 285 seedTasks.add(task); 286 } 287 288 } 289 } 290 291 protected void stopSeeding(boolean checkLiveCount) { 292 if(this.seedTasks != null) { 293 int liveCount = 0; 294 for (GWCTask task : seedTasks) { 295 if(task.getState() != STATE.DEAD || task.getState() != STATE.DONE) { 296 task.terminateNicely(); 297 liveCount++; 298 } 299 } 300 301 try { 302 logger.debug("Found " + liveCount + " running seed threads. Waiting 3s for them to terminate."); 303 Thread.sleep(3000); 304 } catch (InterruptedException e) { 305 e.printStackTrace(); 306 } 307 308 if(! checkLiveCount) { 309 return; 310 } 311 312 liveCount = 0; 313 Iterator<GWCTask> iter = seedTasks.iterator(); 314 while(iter.hasNext()) { 315 GWCTask task = iter.next(); 316 if(task.getState() != STATE.DEAD || task.getState() != STATE.DONE) { 317 liveCount++; 318 } else { 319 iter.remove(); 320 } 321 } 322 logger.debug(liveCount + " seed jobs are still waiting to terminate, proceeding anyway."); 323 324 } else { 325 logger.debug("Found no running seed jobs"); 277 326 } 278 327 } -
trunk/geowebcache/src/main/java/org/geowebcache/rest/GWCTask.java
r908 r948 113 113 return type; 114 114 } 115 116 public STATE getState() { 117 return state; 118 } 115 119 } -
trunk/geowebcache/src/main/resources/org/geowebcache/config/geowebcache.xsd
r942 r948 955 955 <xs:element name="seedingThreads" type="xs:integer" minOccurs="0"> 956 956 <xs:annotation><xs:documentation xml:lang="en"> 957 This controls the number of threads to use while seeding, provided the 958 operation is reseed. Note that the truncate is synchronous and single threaded. 957 This controls the number of threads to use per format while seeding, 958 provided the operation is seed or reseed. (Truncate is synchronous 959 and single threaded.) So if you write 2 threads here, and the layer 960 supports 3 formats, and no format is specified above, then the total 961 number of threads will be 3x2 = 6 959 962 </xs:documentation></xs:annotation> 960 963 </xs:element>