Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
Increasing time to allow settling and small altering cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pimotte committed Aug 9, 2014
1 parent f980458 commit f1c2388
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Expand Up @@ -271,7 +271,7 @@ public void onGetFileResponseInternal(GetFileResponseInternal internalResponse)
private Response waitForResponse(int id) throws Exception {
int i = 0;
while (responses.containsKey(id) == false && i < 1000) {
Thread.sleep(10);
Thread.sleep(100);
i++;
}

Expand Down
Expand Up @@ -334,10 +334,15 @@ private void mergeRemoteFiles() throws IOException, StorageException {
List<DatabaseRemoteFile> allToDeleteDatabaseFiles = new ArrayList<DatabaseRemoteFile>();
Map<File, DatabaseRemoteFile> allMergedDatabaseFiles = new TreeMap<File, DatabaseRemoteFile>();

// A client will merge databases if their own machine exceeds the maximum number of database version to be kept
if (allDatabaseFilesMap.get(config.getMachineName()).size() <= MAX_KEEP_DATABASE_VERSIONS) {
logger.log(Level.INFO, "- Merge remote files: Not necessary for client {2} ({0} database files, max. {1})", new Object[] {
allDatabaseFilesMap.get(config.getMachineName()).size(), MAX_KEEP_DATABASE_VERSIONS });
int numberOfDatabaseFiles = 0;
for (String client : allDatabaseFilesMap.keySet()) {
numberOfDatabaseFiles += allDatabaseFilesMap.get(client).size();
}

// A client will merge databases if the number of databases exceeds the maximum number per client times the amount of clients
if (numberOfDatabaseFiles <= MAX_KEEP_DATABASE_VERSIONS*allDatabaseFilesMap.keySet().size()) {
logger.log(Level.INFO, "- Merge remote files: Not necessary ({0} database files, max. {1})", new Object[] {
numberOfDatabaseFiles, MAX_KEEP_DATABASE_VERSIONS*allDatabaseFilesMap.keySet().size() });

return;
}
Expand Down

0 comments on commit f1c2388

Please sign in to comment.