mirror of https://github.com/apache/lucene.git
Simplifying the logic
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@728884 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
65a65ee6a1
commit
e2a0d6438f
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue