Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
issue imixs#373
  • Loading branch information
rsoika committed May 16, 2018
1 parent a721494 commit ad23d7c
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ public void backup(String query, String filePath) throws IOException, QueryExcep
boolean hasMoreData = true;
int JUNK_SIZE = 100;
long totalcount = 0;
int startpos = 0;
int pageIndex = 0;
int icount = 0;

logger.info("backup - starting...");
Expand All @@ -898,12 +898,17 @@ public void backup(String query, String filePath) throws IOException, QueryExcep
while (hasMoreData) {
// read a junk....

Collection<ItemCollection> col = find(query, JUNK_SIZE, startpos);
Collection<ItemCollection> col = find(query, JUNK_SIZE, pageIndex);
totalcount = totalcount + col.size();
logger.info("backup - processing...... "+col.size() + " documents read....");

if (col.size() < JUNK_SIZE)
if (col.size() < JUNK_SIZE) {
hasMoreData = false;
startpos = startpos + col.size();
totalcount = totalcount + col.size();
logger.finest("......all data read.");
} else {
pageIndex++;
logger.finest("......next page...");
}

for (ItemCollection aworkitem : col) {
// get serialized data
Expand All @@ -912,10 +917,9 @@ public void backup(String query, String filePath) throws IOException, QueryExcep
out.writeObject(hmap);
icount++;
}
logger.finest("......"+totalcount + " documents backuped....");
}
out.close();
logger.info("Backup finished - " + icount + " documents read totaly.");
logger.info("backup - finished: " + icount + " documents read totaly.");
}

/**
Expand Down

0 comments on commit ad23d7c

Please sign in to comment.