Browse Source

[beeswax] Increase number or rows fetched during download

Romain Rigaux 13 years ago
parent
commit
c56e4b781f
1 changed files with 4 additions and 4 deletions
  1. 4 4
      apps/beeswax/src/beeswax/data_export.py

+ 4 - 4
apps/beeswax/src/beeswax/data_export.py

@@ -30,7 +30,7 @@ from beeswax import common
 LOG = logging.getLogger(__name__)
 LOG = logging.getLogger(__name__)
 
 
 _DATA_WAIT_SLEEP = 0.1                  # Sleep 0.1 sec before checking for data availability
 _DATA_WAIT_SLEEP = 0.1                  # Sleep 0.1 sec before checking for data availability
-
+FETCH_ROWS = 100000
 
 
 def download(handle, format, db):
 def download(handle, format, db):
   """
   """
@@ -71,12 +71,12 @@ def data_generator(handle, formatter, db):
 
 
   yield formatter.init_doc()
   yield formatter.init_doc()
 
 
-  results = db.fetch(handle, start_over=is_first_row, rows=None)
+  results = db.fetch(handle, start_over=is_first_row, rows=FETCH_ROWS)
 
 
   while results is not None:
   while results is not None:
     while not results.ready:   # For Beeswax
     while not results.ready:   # For Beeswax
       time.sleep(_DATA_WAIT_SLEEP)
       time.sleep(_DATA_WAIT_SLEEP)
-      results = db.fetch(handle, start_over=is_first_row, rows=None)
+      results = db.fetch(handle, start_over=is_first_row, rows=FETCH_ROWS)
 
 
     # TODO Check for concurrent reading when HS2 supports start_row
     # TODO Check for concurrent reading when HS2 supports start_row
     if is_first_row:
     if is_first_row:
@@ -90,7 +90,7 @@ def data_generator(handle, formatter, db):
         LOG.error(ex)
         LOG.error(ex)
 
 
     if results.has_more:
     if results.has_more:
-      results = db.fetch(handle, start_over=is_first_row, rows=None)
+      results = db.fetch(handle, start_over=is_first_row, rows=FETCH_ROWS)
     else:
     else:
       results = None
       results = None