File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
src/main/java/org/radarcns/hdfs Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ public void start(String directoryName) throws IOException {
204204
205205 logger .info ("Converting {} files" , toProcessFileCount );
206206
207- ProgressBar progressBar = new ProgressBar (toProcessFileCount , 10 );
207+ ProgressBar progressBar = new ProgressBar (toProcessFileCount , 80 );
208208 progressBar .update (0 );
209209
210210 // Actually process the files
Original file line number Diff line number Diff line change @@ -44,15 +44,15 @@ public void update(long remain) {
4444 }
4545 int remainPercent ;
4646 if (total > 0 ) {
47- remainPercent = ( int ) ((100 * remain ) / total );
47+ remainPercent = Math . min (( int ) ((100 * remain ) / total ), 100 );
4848 } else {
4949 remainPercent = 100 ;
5050 }
5151 if (remainPercent == previousPercentage ) {
5252 return ;
5353 }
5454 previousPercentage = remainPercent ;
55- int stripesFilled = remainPercent / numStripes ;
55+ int stripesFilled = numStripes * remainPercent / 100 ;
5656 char notFilled = '-' ;
5757 char filled = '*' ;
5858 // 2 init + numStripes + 2 end + 4 percentage
You can’t perform that action at this time.
0 commit comments