SOLR-6920, SOLR-6640: Make constant and fix logging.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1658519 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2015-02-09 18:39:36 +00:00
parent 2eaad8e89b
commit 77df3e2333
1 changed files with 5 additions and 5 deletions

View File

@ -122,6 +122,8 @@ import org.slf4j.LoggerFactory;
* @since solr 1.4
*/
public class SnapPuller {
private static final int _100K = 100000;
public static final String INDEX_PROPERTIES = "index.properties";
private static final Logger LOG = LoggerFactory.getLogger(SnapPuller.class.getName());
@ -821,9 +823,9 @@ public class SnapPuller {
private boolean filesToAlwaysDownloadIfNoChecksums(String filename,
long size, CompareResult compareResult) {
// without checksums to compare, we always download .si, .liv, segments_N,
// and any file under 100kb
// and any very small files
return !compareResult.checkSummed && (filename.endsWith(".si") || filename.endsWith(".liv")
|| filename.startsWith("segments_") || size < 100000);
|| filename.startsWith("segments_") || size < _100K);
}
static class CompareResult {
@ -855,9 +857,7 @@ public class SnapPuller {
return compareResult;
} else {
LOG.warn(
"File {} did not match. " + "expected length is {} and actual length is {}",
filename, backupIndexFileChecksum, indexFileChecksum,
backupIndexFileLen, indexFileLen);
"File {} did not match. expected length is {} and actual length is {}", filename, backupIndexFileLen, indexFileLen);
compareResult.equal = false;
return compareResult;
}