renamed Chunk to Batch
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@909 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -9,7 +9,7 @@ import net.jini.core.entry.Entry;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Chunk implements Entry {
|
||||
public class Batch implements Entry {
|
||||
|
||||
// routing information
|
||||
public static final Integer DONE = new Integer( 1 );
|
||||
@ -21,9 +21,9 @@ public class Chunk implements Entry {
|
||||
public Integer jobID;
|
||||
public Integer sequenceID;
|
||||
|
||||
public Chunk() {}
|
||||
public Batch() {}
|
||||
|
||||
public Chunk(Integer jobID, List tileWrappers, Integer isDone, Integer sequenceID) {
|
||||
public Batch(Integer jobID, List tileWrappers, Integer isDone, Integer sequenceID) {
|
||||
this.jobID = jobID;
|
||||
this.tileWrappers = tileWrappers;
|
||||
this.isDone = isDone;
|
@ -28,15 +28,15 @@ public class TileExpander {
|
||||
}
|
||||
|
||||
public void expandAvailableTiles() throws RemoteException, UnusableEntryException, TransactionException, InterruptedException{
|
||||
Entry twQuery = space.snapshot(new Chunk(tsw.jobID, null, Chunk.NOT_DONE, null));
|
||||
Entry twQuery = space.snapshot(new Batch(tsw.jobID, null, Batch.NOT_DONE, null));
|
||||
|
||||
Chunk chunk = null;
|
||||
Batch batch = null;
|
||||
int total = 0;
|
||||
while ((chunk = (Chunk)space.take(twQuery, null, 10)) != null) {
|
||||
while ((batch = (Batch)space.take(twQuery, null, 10)) != null) {
|
||||
total++;
|
||||
List wrappers = new ArrayList();
|
||||
for (int j=0; j<chunk.tileWrappers.size(); j++) {
|
||||
TileWrapper tileWrapperToExpand = (TileWrapper)chunk.tileWrappers.get(j);
|
||||
for (int j=0; j<batch.tileWrappers.size(); j++) {
|
||||
TileWrapper tileWrapperToExpand = (TileWrapper)batch.tileWrappers.get(j);
|
||||
//System.out.println("Expanding " + tileWrapperToExpand.tile.getImage());
|
||||
Occurrences results = expand(tileWrapperToExpand, j);
|
||||
int expansionIndex = 0;
|
||||
@ -48,8 +48,8 @@ public class TileExpander {
|
||||
expansionIndex++;
|
||||
}
|
||||
}
|
||||
Chunk chunkToWrite = new Chunk(tsw.jobID, wrappers, Chunk.DONE, chunk.sequenceID);
|
||||
space.write(chunkToWrite, null, Lease.FOREVER);
|
||||
Batch batchToWrite = new Batch(tsw.jobID, wrappers, Batch.DONE, batch.sequenceID);
|
||||
space.write(batchToWrite, null, Lease.FOREVER);
|
||||
}
|
||||
if (total>0) System.out.println("Expanded " + total + " tiles");
|
||||
}
|
||||
|
@ -29,9 +29,9 @@ public class TileHarvester {
|
||||
public Occurrences harvest(int originalOccurrencesCount) throws RemoteException, UnusableEntryException, TransactionException, InterruptedException {
|
||||
Occurrences occ = new Occurrences(new CPDNullListener());
|
||||
for (int i=0;i<originalOccurrencesCount; i++) {
|
||||
Chunk chunk = (Chunk)space.take(new Chunk(job.id, null, Chunk.DONE, new Integer(i)), null, Lease.FOREVER);
|
||||
for (int j=0; j<chunk.tileWrappers.size(); j++) {
|
||||
addTileWrapperToOccurrences((TileWrapper)chunk.tileWrappers.get(j), occ);
|
||||
Batch batch = (Batch)space.take(new Batch(job.id, null, Batch.DONE, new Integer(i)), null, Lease.FOREVER);
|
||||
for (int j=0; j<batch.tileWrappers.size(); j++) {
|
||||
addTileWrapperToOccurrences((TileWrapper)batch.tileWrappers.get(j), occ);
|
||||
}
|
||||
}
|
||||
return occ;
|
||||
|
@ -33,8 +33,8 @@ public class TilePlanter {
|
||||
TileWrapper tw = new TileWrapper(tile, occ.getOccurrencesList(tile), null, null);
|
||||
List wrappers = new ArrayList();
|
||||
wrappers.add(tw);
|
||||
Chunk chunk = new Chunk(job.id, wrappers, Chunk.NOT_DONE, new Integer(tilesSoFar));
|
||||
space.write(chunk, null, Lease.FOREVER);
|
||||
Batch batch = new Batch(job.id, wrappers, Batch.NOT_DONE, new Integer(tilesSoFar));
|
||||
space.write(batch, null, Lease.FOREVER);
|
||||
//System.out.println("Scattering " + tw.tile.getImage() + "->" + tw.occurrences.size());
|
||||
tilesSoFar++;
|
||||
if (tilesSoFar % 100 == 0) {
|
||||
|
Reference in New Issue
Block a user