Closed GoogleCodeExporter closed 8 years ago
Hi Ryan.
Maybe this is just an artifact for bytesTotal being utterly unreliable untill
all requests have a lenght header.
This is explained better here:
http://code.google.com/p/bulk-loader/wiki/ReportingLoadingProgress
The short story is that when loading more items than the connections you have
open, you need to use
weighted progress, as that will allow for a much better reading.
I am closing this as invalid, since I can't find any solutions to solve this,
but I am very open to working code to
fix this.
Cheers
Arthur Debert
Original comment by debert
on 18 Jan 2009 at 3:26
What I did was change line in BulkLoader.getProgressForItems from
if (item.status == LoadingItem.STATUS_STARTED || item.status ==
LoadingItem.STATUS_FINISHED || item.status == LoadingItem.STATUS_STOPPED){
to
if (item.status != LoadingItem.STATUS_ERROR && item.bytesTotal > -1){
This delays computation of bytesTotal a little longer until all items are
reporting
the correct number.
Here's an example: let's say you have two items that are 1024 bytes each.
Currently
it is possible for one or both of them to initially report -1 for bytesTotal
which
means bulk loader will report POSITIVE_INFINITY at first... then -2, 1023, or
2048
which can cause some odd behavior (and it may behave differently every time you
run it).
My suggestion ensures that it will go straight from POSITIVE_INFINITY to 2048.
It
may sit at POSITIVE_INFINITY for a few frames longer than before, but at least
it
prevents the quirky behavior.
Thanks for the heads up on the weighted progress though, that will be very
useful for
future projects.
Original comment by ryan%rph...@gtempaccount.com
on 21 Jan 2009 at 2:56
Original issue reported on code.google.com by
ryan%rph...@gtempaccount.com
on 30 Dec 2008 at 4:20