From e2a0d6438fb8adf023145a10a3e0fe984d37aee1 Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Tue, 23 Dec 2008 06:36:30 +0000 Subject: [PATCH] Simplifying the logic git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@728884 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/solr/handler/SnapPuller.java | 42 ++++++------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/src/java/org/apache/solr/handler/SnapPuller.java b/src/java/org/apache/solr/handler/SnapPuller.java index 86719135f38..59db9fa3fcc 100644 --- a/src/java/org/apache/solr/handler/SnapPuller.java +++ b/src/java/org/apache/solr/handler/SnapPuller.java @@ -319,37 +319,19 @@ public class SnapPuller { if (f.exists()) { inFile = new FileInputStream(f); props.load(inFile); - if (!props.isEmpty()) { - if (props.containsKey("timesIndexReplicated")) - indexCount = Integer.valueOf(props.getProperty("timesIndexReplicated")) + 1; - - props.setProperty("timesIndexReplicated", String.valueOf(indexCount)); - props.setProperty("indexReplicatedAt", String.valueOf(replicationTime)); - - if (modifiedConfFiles != null && !modifiedConfFiles.isEmpty()) { - props.setProperty("confFilesReplicated", confFiles.toString()); - props.setProperty("confFilesReplicatedAt", String.valueOf(replicationTime)); - if (props.containsKey("timesConfigReplicated")) - confFilesCount = Integer.valueOf(props.getProperty("timesConfigReplicated")) + 1; - props.setProperty("timesConfigReplicated", String.valueOf(confFilesCount)); - } - } else { - props.setProperty("timesIndexReplicated", String.valueOf(indexCount)); - props.setProperty("indexReplicatedAt", String.valueOf(replicationTime)); - if (modifiedConfFiles != null && !modifiedConfFiles.isEmpty()) { - props.setProperty("confFilesReplicated", confFiles.toString()); - props.setProperty("confFilesReplicatedAt", String.valueOf(replicationTime)); - props.setProperty("timesConfigReplicated", String.valueOf(confFilesCount)); - } - } - } else { - props.setProperty("timesIndexReplicated", String.valueOf(indexCount)); - props.setProperty("indexReplicatedAt", String.valueOf(replicationTime)); - if (modifiedConfFiles != null && !modifiedConfFiles.isEmpty()) { - props.setProperty("confFilesReplicated", confFiles.toString()); - props.setProperty("confFilesReplicatedAt", String.valueOf(replicationTime)); - props.setProperty("timesConfigReplicated", String.valueOf(confFilesCount)); + } + if (props.containsKey("timesIndexReplicated")) { + indexCount = Integer.valueOf(props.getProperty("timesIndexReplicated")) + 1; + } + props.setProperty("timesIndexReplicated", String.valueOf(indexCount)); + props.setProperty("indexReplicatedAt", String.valueOf(replicationTime)); + if (modifiedConfFiles != null && !modifiedConfFiles.isEmpty()) { + props.setProperty("confFilesReplicated", confFiles.toString()); + props.setProperty("confFilesReplicatedAt", String.valueOf(replicationTime)); + if (props.containsKey("timesConfigReplicated")) { + confFilesCount = Integer.valueOf(props.getProperty("timesConfigReplicated")) + 1; } + props.setProperty("timesConfigReplicated", String.valueOf(confFilesCount)); } outFile = new FileOutputStream(f); props.store(outFile, "Replication details");