-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use multithreading for clean phase using --thread parameter (#108)
- Refactored AbstractSynchronize (removed inner classes) - Fixed ident
- Loading branch information
Showing
8 changed files
with
638 additions
and
574 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package org.lsc.beans; | ||
|
||
/** | ||
* This object is storing counters across all tasks Update methods are specified | ||
* as synchronized to avoid loosing counts of operations | ||
* | ||
* @author Sebastien Bahloul <[email protected]> | ||
*/ | ||
public class InfoCounter { | ||
|
||
private int countAll = 0; | ||
private int countError = 0; | ||
private int countModifiable = 0; | ||
private int countCompleted = 0; | ||
|
||
public synchronized void incrementCountAll() { | ||
countAll++; | ||
} | ||
|
||
public synchronized void incrementCountError() { | ||
countError++; | ||
} | ||
|
||
public synchronized void incrementCountModifiable() { | ||
countModifiable++; | ||
} | ||
|
||
public synchronized void incrementCountCompleted() { | ||
countCompleted++; | ||
} | ||
|
||
/** | ||
* Return the count of all objects concerned by synchronization It does not | ||
* include objects in data source that are not selected by requests or | ||
* filters, but it includes any of the objects retrieved from the data | ||
* source | ||
* | ||
* @return the count of all objects taken from the data source | ||
*/ | ||
public synchronized int getCountAll() { | ||
return countAll; | ||
} | ||
|
||
/** | ||
* Return the count of all objects that have encountered an error while | ||
* synchronizing, either for a technical or for a functional reason | ||
* | ||
* @return the number of objects in error | ||
*/ | ||
public synchronized int getCountError() { | ||
return countError; | ||
} | ||
|
||
/** | ||
* Return the count of all objects that should be modify | ||
* | ||
* @return the count of all updates to do | ||
*/ | ||
public synchronized int getCountModifiable() { | ||
return countModifiable; | ||
} | ||
|
||
/** | ||
* Return the count of all objects that have been embraced in a data | ||
* modification successfully | ||
* | ||
* @return the count of all successful updates | ||
*/ | ||
public synchronized int getCountCompleted() { | ||
return countCompleted; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.lsc.runnable; | ||
|
||
import java.util.Map.Entry; | ||
|
||
import org.lsc.AbstractSynchronize; | ||
import org.lsc.LscDatasets; | ||
import org.lsc.Task; | ||
import org.lsc.beans.InfoCounter; | ||
|
||
public abstract class AbstractEntryRunner implements Runnable { | ||
|
||
protected String syncName; | ||
protected Entry<String, LscDatasets> id; | ||
protected InfoCounter counter; | ||
protected AbstractSynchronize abstractSynchronize; | ||
protected Task task; | ||
|
||
protected AbstractEntryRunner(final Task task, InfoCounter counter, | ||
AbstractSynchronize abstractSynchronize, | ||
Entry<String, LscDatasets> id) { | ||
this.syncName = task.getName(); | ||
this.counter = counter; | ||
this.task = task; | ||
this.abstractSynchronize = abstractSynchronize; | ||
this.id = id; | ||
} | ||
|
||
public String getSyncName() { | ||
return syncName; | ||
} | ||
|
||
public InfoCounter getCounter() { | ||
return counter; | ||
} | ||
|
||
public AbstractSynchronize getAbstractSynchronize() { | ||
return abstractSynchronize; | ||
} | ||
|
||
public Entry<String, LscDatasets> getId() { | ||
return id; | ||
} | ||
} |
Oops, something went wrong.