Skip to content

Commit

Permalink
hibernate#21 modify variable naming and javadoc to clarify the analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
mincong-h committed Jun 6, 2016
1 parent 911990f commit 9ccde4f
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -27,8 +27,8 @@ public class LucenePartitionAnalyzer implements PartitionAnalyzer {
*
* Then it shows the total mass index progress in percentage. This method is
* very similar to the current simple progress monitor. Note: concerning
* the "total" number of entities to process, it depends on 2 values : the
* number of row in the db table and the max results to process, defined by
* the number of total entities loaded, it depends on 2 values : the number
* of row in the database table and the max results to process, defined by
* user before the job start. So the minimum between them will be used.
*
* @param fromCollector the checkpoint obtained from partition collector's
Expand All @@ -38,11 +38,11 @@ public class LucenePartitionAnalyzer implements PartitionAnalyzer {
public void analyzeCollectorData(Serializable fromCollector) throws Exception {

long rowCount = (long) jobContext.getTransientUserData();
int total = Math.min((int) rowCount, maxResults);
int entitiesLoaded = Math.min((int) rowCount, maxResults);

workCount += (int) fromCollector;
if (total != 0) {
percentage = 100 * (float) workCount / total;
if (entitiesLoaded != 0) {
percentage = workCount * 100f / entitiesLoaded;
}
System.out.printf("#analyzeCollectorData(): %d works processed (%.1f%%).%n",
workCount, percentage);
Expand Down

0 comments on commit 9ccde4f

Please sign in to comment.