SOLR-1015 -- Incomplete information in replication admin page and http command response when server is both master and slave i.e. when server is a repeater

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@743729 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2009-02-12 13:25:25 +00:00
parent 71e622d422
commit 1371f5b70b
4 changed files with 143 additions and 96 deletions

View File

@ -258,6 +258,9 @@ Bug Fixes
30. SOLR-1016: HTTP 503 error changes 500 in SolrCore (koji) 30. SOLR-1016: HTTP 503 error changes 500 in SolrCore (koji)
31. SOLR-1015: Incomplete information in replication admin page and http command response when server
is both master and slave i.e. when server is a repeater (Akshay Ukey via shalin)
Other Changes Other Changes
---------------------- ----------------------

View File

@ -82,6 +82,8 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
private boolean replicateOnCommit = false; private boolean replicateOnCommit = false;
private boolean replicateOnStart = false;
private int numTimesReplicated = 0; private int numTimesReplicated = 0;
private final Map<String, FileInfo> confFileInfoCache = new HashMap<String, FileInfo>(); private final Map<String, FileInfo> confFileInfoCache = new HashMap<String, FileInfo>();
@ -139,7 +141,8 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
} else if (command.equals(CMD_SHOW_COMMITS)) { } else if (command.equals(CMD_SHOW_COMMITS)) {
rsp.add(CMD_SHOW_COMMITS, getCommits()); rsp.add(CMD_SHOW_COMMITS, getCommits());
} else if (command.equals(CMD_DETAILS)) { } else if (command.equals(CMD_DETAILS)) {
getReplicationDetails(rsp); rsp.add(CMD_DETAILS, getReplicationDetails());
RequestHandlerUtils.addExperimentalFormatWarning(rsp);
} }
} }
@ -443,11 +446,12 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
if (core != null) { if (core != null) {
list.add("indexSize", readableSize(getIndexSize())); list.add("indexSize", readableSize(getIndexSize()));
long[] versionGen = getIndexVersion(); long[] versionGen = getIndexVersion();
list.add(CMD_INDEX_VERSION, versionGen[0]); list.add("indexVersion", versionGen[0]);
list.add(GENERATION, versionGen[1]); list.add(GENERATION, versionGen[1]);
list.add("indexPath", core.getIndexDir()); list.add("indexPath", core.getIndexDir());
list.add("isMaster", String.valueOf(isMaster)); list.add("isMaster", String.valueOf(isMaster));
list.add("isSlave", String.valueOf(isSlave));
SnapPuller snapPuller = tempSnapPuller; SnapPuller snapPuller = tempSnapPuller;
if (snapPuller != null) { if (snapPuller != null) {
@ -461,10 +465,16 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
if (isMaster) { if (isMaster) {
if (includeConfFiles != null) if (includeConfFiles != null)
list.add("confFilesToReplicate", includeConfFiles); list.add("confFilesToReplicate", includeConfFiles);
String replicateAfterString="";
if (replicateOnCommit) if (replicateOnCommit)
list.add(REPLICATE_AFTER, "commit"); replicateAfterString += "commit, ";
if (replicateOnOptimize) if (replicateOnOptimize)
list.add(REPLICATE_AFTER, "optimize"); replicateAfterString += "optimize, ";
if(replicateOnStart)
replicateAfterString += "startup, ";
if(replicateAfterString.lastIndexOf(',') > -1)
replicateAfterString = replicateAfterString.substring(0, replicateAfterString.lastIndexOf(','));
list.add(REPLICATE_AFTER, replicateAfterString);
} }
} }
return list; return list;
@ -473,23 +483,44 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
/** /**
* Used for showing statistics and progress information. * Used for showing statistics and progress information.
*/ */
void getReplicationDetails(SolrQueryResponse resp) { NamedList<Object> getReplicationDetails() {
String timeLastReplicated = "", confFilesReplicated = "", confFilesReplicatedTime = "", timesIndexReplicated = "", timesConfigReplicated = ""; String timeLastReplicated = "", confFilesReplicated = "", confFilesReplicatedTime = "", timesIndexReplicated = "", timesConfigReplicated = "";
NamedList<Object> details = new SimpleOrderedMap<Object>(); NamedList<Object> details = new SimpleOrderedMap<Object>();
NamedList<Object> master = new SimpleOrderedMap<Object>();
NamedList<Object> slave = new SimpleOrderedMap<Object>();
FileInputStream inFile = null; FileInputStream inFile = null;
details.add("indexSize", readableSize(getIndexSize())); details.add("indexSize", readableSize(getIndexSize()));
details.add("indexPath", core.getIndexDir()); details.add("indexPath", core.getIndexDir());
details.add(CMD_SHOW_COMMITS, getCommits()); details.add(CMD_SHOW_COMMITS, getCommits());
details.add("isMaster", String.valueOf(isMaster)); details.add("isMaster", String.valueOf(isMaster));
details.add("isSlave", String.valueOf(isSlave));
long[] versionAndGeneration = getIndexVersion(); long[] versionAndGeneration = getIndexVersion();
details.add(CMD_INDEX_VERSION, versionAndGeneration[0]); details.add("indexVersion", versionAndGeneration[0]);
details.add(GENERATION, versionAndGeneration[1]); details.add(GENERATION, versionAndGeneration[1]);
IndexCommit commit = indexCommitPoint; // make a copy so it won't change IndexCommit commit = indexCommitPoint; // make a copy so it won't change
if (isMaster && commit != null) {
details.add("replicatable" + CMD_INDEX_VERSION, commit.getVersion()); if (isMaster) {
details.add("replicatable" + GENERATION, commit.getGeneration()); if (includeConfFiles != null)
master.add(CONF_FILES, includeConfFiles);
String replicateAfterString="";
if (replicateOnCommit)
replicateAfterString += "commit, ";
if (replicateOnOptimize)
replicateAfterString += "optimize, ";
if(replicateOnStart)
replicateAfterString += "startup, ";
if(replicateAfterString.lastIndexOf(',') > -1)
replicateAfterString = replicateAfterString.substring(0, replicateAfterString.lastIndexOf(','));
master.add(REPLICATE_AFTER, replicateAfterString);
} }
if (isMaster && commit != null) {
master.add("replicatableIndexVersion", commit.getVersion());
master.add("replicatableGeneration", commit.getGeneration());
}
SnapPuller snapPuller = tempSnapPuller; SnapPuller snapPuller = tempSnapPuller;
if (snapPuller != null) { if (snapPuller != null) {
try { try {
@ -515,36 +546,36 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
} }
try { try {
NamedList nl = snapPuller.getCommandResponse(CMD_DETAILS); NamedList nl = snapPuller.getCommandResponse(CMD_DETAILS);
details.add("masterDetails", nl.get(CMD_DETAILS)); slave.add("masterDetails", nl.get(CMD_DETAILS));
} catch (IOException e) { } catch (IOException e) {
LOG.warn("Exception while invoking a 'details' method on master ", e); LOG.warn("Exception while invoking a 'details' method on master ", e);
} }
details.add(MASTER_URL, snapPuller.getMasterUrl()); slave.add(MASTER_URL, snapPuller.getMasterUrl());
if (snapPuller.getPollInterval() != null) { if (snapPuller.getPollInterval() != null) {
details.add(SnapPuller.POLL_INTERVAL, snapPuller.getPollInterval()); slave.add(SnapPuller.POLL_INTERVAL, snapPuller.getPollInterval());
} }
if (snapPuller.getNextScheduledExecTime() != null && !isPollingDisabled()) { if (snapPuller.getNextScheduledExecTime() != null && !isPollingDisabled()) {
Date d = new Date(snapPuller.getNextScheduledExecTime()); Date d = new Date(snapPuller.getNextScheduledExecTime());
details.add("nextExecutionAt", d.toString()); slave.add("nextExecutionAt", d.toString());
} else if (isPollingDisabled()) { } else if (isPollingDisabled()) {
details.add("nextExecutionAt", "Polling disabled"); slave.add("nextExecutionAt", "Polling disabled");
} else } else
details.add("nextExecutionAt", ""); slave.add("nextExecutionAt", "");
if (timeLastReplicated != null && timeLastReplicated.length() > 0) { if (timeLastReplicated != null && timeLastReplicated.length() > 0) {
Date d = new Date(Long.valueOf(timeLastReplicated)); Date d = new Date(Long.valueOf(timeLastReplicated));
details.add("indexReplicatedAt", d.toString()); slave.add("indexReplicatedAt", d.toString());
} else { } else {
details.add("indexReplicatedAt", ""); slave.add("indexReplicatedAt", "");
} }
details.add("timesIndexReplicated", timesIndexReplicated); slave.add("timesIndexReplicated", timesIndexReplicated);
details.add("confFilesReplicated", confFilesReplicated); slave.add("confFilesReplicated", confFilesReplicated);
details.add("timesConfigReplicated", timesConfigReplicated); slave.add("timesConfigReplicated", timesConfigReplicated);
if (confFilesReplicatedTime != null && confFilesReplicatedTime.length() > 0) { if (confFilesReplicatedTime != null && confFilesReplicatedTime.length() > 0) {
Date d = new Date(Long.valueOf(confFilesReplicatedTime)); Date d = new Date(Long.valueOf(confFilesReplicatedTime));
details.add("confFilesReplicatedAt", d.toString()); slave.add("confFilesReplicatedAt", d.toString());
} else { } else {
details.add("confFilesReplicatedAt", confFilesReplicatedTime); slave.add("confFilesReplicatedAt", confFilesReplicatedTime);
} }
try { try {
@ -563,9 +594,9 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
bytesToDownload += (Long) file.get(SIZE); bytesToDownload += (Long) file.get(SIZE);
} }
details.add("filesToDownload", filesToDownload.toString()); slave.add("filesToDownload", filesToDownload.toString());
details.add("numFilesToDownload", String.valueOf(filesToDownload.size())); slave.add("numFilesToDownload", String.valueOf(filesToDownload.size()));
details.add("bytesToDownload", readableSize(bytesToDownload)); slave.add("bytesToDownload", readableSize(bytesToDownload));
long bytesDownloaded = 0; long bytesDownloaded = 0;
List<String> filesDownloaded = new ArrayList<String>(); List<String> filesDownloaded = new ArrayList<String>();
@ -580,8 +611,8 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
bytesDownloaded += (Long) file.get(SIZE); bytesDownloaded += (Long) file.get(SIZE);
} }
details.add("filesDownloaded", filesDownloaded.toString()); slave.add("filesDownloaded", filesDownloaded.toString());
details.add("numFilesDownloaded", String.valueOf(filesDownloaded.size())); slave.add("numFilesDownloaded", String.valueOf(filesDownloaded.size()));
Map<String, Object> currentFile = snapPuller.getCurrentFile(); Map<String, Object> currentFile = snapPuller.getCurrentFile();
String currFile = null; String currFile = null;
@ -605,9 +636,9 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
timeElapsed = (System.currentTimeMillis() - snapPuller.getReplicationStartTime()) / 1000; timeElapsed = (System.currentTimeMillis() - snapPuller.getReplicationStartTime()) / 1000;
} }
if (replicationStartTime != null) { if (replicationStartTime != null) {
details.add("replicationStartTime", replicationStartTime.toString()); slave.add("replicationStartTime", replicationStartTime.toString());
} }
details.add("timeElapsed", String.valueOf(timeElapsed) + "s"); slave.add("timeElapsed", String.valueOf(timeElapsed) + "s");
if (bytesDownloaded > 0) if (bytesDownloaded > 0)
estimatedTimeRemaining = ((bytesToDownload - bytesDownloaded) * timeElapsed) / bytesDownloaded; estimatedTimeRemaining = ((bytesToDownload - bytesDownloaded) * timeElapsed) / bytesDownloaded;
@ -618,31 +649,25 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
if (timeElapsed > 0) if (timeElapsed > 0)
downloadSpeed = (bytesDownloaded / timeElapsed); downloadSpeed = (bytesDownloaded / timeElapsed);
if (currFile != null) if (currFile != null)
details.add("currentFile", currFile); slave.add("currentFile", currFile);
details.add("currentFileSize", readableSize(currFileSize)); slave.add("currentFileSize", readableSize(currFileSize));
details.add("currentFileSizeDownloaded", readableSize(currFileSizeDownloaded)); slave.add("currentFileSizeDownloaded", readableSize(currFileSizeDownloaded));
details.add("currentFileSizePercent", String.valueOf(percentDownloaded)); slave.add("currentFileSizePercent", String.valueOf(percentDownloaded));
details.add("bytesDownloaded", readableSize(bytesDownloaded)); slave.add("bytesDownloaded", readableSize(bytesDownloaded));
details.add("totalPercent", String.valueOf(totalPercent)); slave.add("totalPercent", String.valueOf(totalPercent));
details.add("timeRemaining", String.valueOf(estimatedTimeRemaining) + "s"); slave.add("timeRemaining", String.valueOf(estimatedTimeRemaining) + "s");
details.add("downloadSpeed", readableSize(downloadSpeed)); slave.add("downloadSpeed", readableSize(downloadSpeed));
details.add("isPollingDisabled", String.valueOf(isPollingDisabled())); slave.add("isPollingDisabled", String.valueOf(isPollingDisabled()));
details.add("isReplicating", String.valueOf(isReplicating())); slave.add("isReplicating", String.valueOf(isReplicating()));
} catch (Exception e) { } catch (Exception e) {
LOG.error("Exception while writing details: ", e); LOG.error("Exception while writing details: ", e);
} }
} }
if(isMaster)
if (isMaster) { details.add("master", master);
if (includeConfFiles != null) if(isSlave)
details.add(CONF_FILES, includeConfFiles); details.add("slave", slave);
if (replicateOnCommit) return details;
details.add(REPLICATE_AFTER, "commit");
if (replicateOnOptimize)
details.add(REPLICATE_AFTER, "optimize");
}
resp.add(CMD_DETAILS, details);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -683,6 +708,7 @@ public class ReplicationHandler extends RequestHandlerBase implements SolrCoreAw
core.getUpdateHandler().registerCommitCallback(getEventListener(snapshotOnCommit, replicateOnCommit)); core.getUpdateHandler().registerCommitCallback(getEventListener(snapshotOnCommit, replicateOnCommit));
} }
if (replicateAfter.contains("startup")) { if (replicateAfter.contains("startup")) {
replicateOnStart = true;
RefCounted<SolrIndexSearcher> s = core.getNewestSearcher(false); RefCounted<SolrIndexSearcher> s = core.getNewestSearcher(false);
try { try {
if (core.getUpdateHandler() instanceof DirectUpdateHandler2) { if (core.getUpdateHandler() instanceof DirectUpdateHandler2) {

View File

@ -55,12 +55,11 @@ public NamedList executeCommand(String command, SolrCore core, SolrRequestHandle
%> %>
<% <%
final SolrRequestHandler rh = core.getRequestHandler("/replication"); final SolrRequestHandler rh = core.getRequestHandler("/replication");
NamedList namedlist = executeCommand("details",core,rh); NamedList namedlist = executeCommand("details",core,rh);
NamedList detailsMap = (NamedList)namedlist.get("details"); NamedList detailsMap = (NamedList)namedlist.get("details");
if(detailsMap != null)
if("false".equals((String)detailsMap.get("isMaster"))){ if("true".equals((String)detailsMap.get("isSlave"))){
%> %>
<meta http-equiv="refresh" content="2"/> <meta http-equiv="refresh" content="2"/>
<%}%> <%}%>
@ -70,11 +69,16 @@ if("false".equals((String)detailsMap.get("isMaster"))){
<body> <body>
<a href=".."><img border="0" align="right" height="78" width="142" src="../solr_small.png" alt="Solr"></a> <a href=".."><img border="0" align="right" height="78" width="142" src="../solr_small.png" alt="Solr"></a>
<h1>Solr replication (<%= collectionName %>) <h1>Solr replication (<%= collectionName %>)
<% <%
if("true".equals((String)detailsMap.get("isMaster"))) if(detailsMap != null){
out.println(" Master"); if( "true".equals(detailsMap.get("isMaster")) && "true".equals(detailsMap.get("isSlave")))
else out.println(" Master & Slave");
out.println(" Slave"); else if("true".equals(detailsMap.get("isMaster")))
out.println(" Master");
else if("true".equals(detailsMap.get("isSlave")))
out.println(" Slave");
}
%></h1> %></h1>
<%= hostname %>:<%= port %><br/> <%= hostname %>:<%= port %><br/>

View File

@ -19,8 +19,7 @@
<%-- do a verbatim include so we can use the local vars --%> <%-- do a verbatim include so we can use the local vars --%>
<%@include file="header.jsp" <%@include file="header.jsp"%>
%>
<br clear="all"> <br clear="all">
<table> <table>
@ -31,30 +30,36 @@
%> %>
<% <%
if ("false".equals(detailsMap.get("isMaster"))) NamedList slave = null, master = null;
if (detailsMap != null) {%> if (detailsMap != null)
if ("true".equals(detailsMap.get("isSlave")))
if(detailsMap.get("slave") != null){
slave = (NamedList)detailsMap.get("slave");%>
<tr> <tr>
<td> <td>
<strong>Master</strong> <strong>Master</strong>
</td> </td>
<td> <td>
<% <%
out.println((String) detailsMap.get("masterUrl")); out.println((String) slave.get("masterUrl"));
%> %>
</td> </td>
</tr> </tr>
<tr> <tr>
<% <%
NamedList nl = (NamedList) detailsMap.get("masterDetails"); NamedList nl = (NamedList) slave.get("masterDetails");
if (nl != null) { if (nl != null) {
long masterVersion = (Long) nl.get("indexversion"); long masterVersion = (Long) nl.get("indexVersion");
long masterGeneration = (Long) nl.get("generation"); long masterGeneration = (Long) nl.get("generation");
long replicatableMasterVer = 0, replicatableMasterGen = 0; long replicatableMasterVer = 0, replicatableMasterGen = 0;
if (nl.get("replicatableindexversion") != null) nl = (NamedList) nl.get("master");
replicatableMasterVer = (Long) nl.get("replicatableindexversion"); if(nl != null){
if (nl.get("replicatablegeneration") != null) if (nl.get("replicatableindexversion") != null)
replicatableMasterGen = (Long) nl.get("replicatablegeneration"); replicatableMasterVer = (Long) nl.get("replicatableindexversion");
if (nl.get("replicatablegeneration") != null)
replicatableMasterGen = (Long) nl.get("replicatablegeneration");
}
%> %>
<td> <td>
</td> </td>
@ -75,7 +80,7 @@
</td> </td>
<td> <td>
<% <%
out.println((String) detailsMap.get("pollInterval")); out.println((String) slave.get("pollInterval"));
%> %>
</td> </td>
</tr> </tr>
@ -88,7 +93,7 @@
<td> <td>
<% <%
if (detailsMap != null) if (detailsMap != null)
out.println("Index Version: " + detailsMap.get("indexversion") + ", Generation: " + detailsMap.get("generation")); out.println("Index Version: " + detailsMap.get("indexVersion") + ", Generation: " + detailsMap.get("generation"));
%> %>
</td> </td>
</tr> </tr>
@ -113,34 +118,36 @@
</tr> </tr>
<% <%
if ("true".equals(detailsMap.get("isMaster"))) if (detailsMap != null)
if (detailsMap != null) { if ("true".equals(detailsMap.get("isMaster")))
if(detailsMap.get("master") != null){
master = (NamedList) detailsMap.get("master");
%> %>
<tr> <tr>
<td></td> <td></td>
<td> <td>
<%out.println("Config Files To Replicate: " + detailsMap.get("confFiles"));%> <%out.println("Config Files To Replicate: " + master.get("confFiles"));%>
</td> </td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td> <td>
<%out.println("Trigger Replication On: " + detailsMap.get("replicateAfter")); %> <%out.println("Trigger Replication On: " + master.get("replicateAfter")); %>
</td> </td>
</tr> </tr>
<%}%> <%}%>
<% <%
if ("false".equals(detailsMap.get("isMaster"))) if ("true".equals(detailsMap.get("isSlave")))
if (detailsMap != null) {%> if (slave != null) {%>
<tr> <tr>
<td> <td>
</td> </td>
<td> <td>
<% <%
out.println("Times Replicated Since Startup: " + detailsMap.get("timesIndexReplicated")); out.println("Times Replicated Since Startup: " + slave.get("timesIndexReplicated"));
%> %>
</td> </td>
</tr> </tr>
@ -150,7 +157,7 @@
</td> </td>
<td> <td>
<% <%
out.println("Previous Replication Done At: " + detailsMap.get("indexReplicatedAt")); out.println("Previous Replication Done At: " + slave.get("indexReplicatedAt"));
%> %>
</td> </td>
</tr> </tr>
@ -160,7 +167,7 @@
</td> </td>
<td> <td>
<% <%
out.println("Config Files Replicated At: " + detailsMap.get("confFilesReplicatedAt")); out.println("Config Files Replicated At: " + slave.get("confFilesReplicatedAt"));
%> %>
</td> </td>
</tr> </tr>
@ -170,7 +177,7 @@
</td> </td>
<td> <td>
<% <%
out.println("Config Files Replicated: " + detailsMap.get("confFilesReplicated")); out.println("Config Files Replicated: " + slave.get("confFilesReplicated"));
%> %>
</td> </td>
</tr> </tr>
@ -180,7 +187,7 @@
</td> </td>
<td> <td>
<% <%
out.println("Times Config Files Replicated Since Startup: " + detailsMap.get("timesConfigReplicated")); out.println("Times Config Files Replicated Since Startup: " + slave.get("timesConfigReplicated"));
%> %>
</td> </td>
</tr> </tr>
@ -190,27 +197,31 @@
</td> </td>
<td> <td>
<% <%
if (detailsMap.get("nextExecutionAt") != null) if (slave.get("nextExecutionAt") != null)
if (detailsMap.get("nextExecutionAt") != "") if (slave.get("nextExecutionAt") != "")
out.println("Next Replication Cycle At: " + detailsMap.get("nextExecutionAt")); out.println("Next Replication Cycle At: " + slave.get("nextExecutionAt"));
else if ("true".equals(detailsMap.get("isPollingDisabled"))) else if ("true".equals(slave.get("isPollingDisabled")))
out.println("Next Replication Cycle At: Polling disabled."); out.println("Next Replication Cycle At: Polling disabled.");
else { else {
NamedList nl1 = (NamedList) detailsMap.get("masterDetails"); NamedList nl1 = (NamedList) slave.get("masterDetails");
out.println("Next Replication Cycle At: After " + nl1.get("replicateAfter") + " on master."); if(nl1 != null){
NamedList nl2 = (NamedList) nl1.get("master");
if(nl2 != null)
out.println("Next Replication Cycle At: After " + nl2.get("replicateAfter") + " on master.");
}
} }
%> %>
</td> </td>
</tr> </tr>
<% <%
if ("true".equals(detailsMap.get("isReplicating"))) { if ("true".equals(slave.get("isReplicating"))) {
%> %>
<tr> <tr>
<td><strong>Current Replication Status</strong> <td><strong>Current Replication Status</strong>
<td> <td>
<%out.println("Start Time: " + detailsMap.get("replicationStartTime"));%> <%out.println("Start Time: " + slave.get("replicationStartTime"));%>
</td> </td>
</tr> </tr>
@ -218,7 +229,7 @@
<td></td> <td></td>
<td> <td>
<% <%
out.println("Files Downloaded: " + detailsMap.get("numFilesDownloaded") + " / " + detailsMap.get("numFilesToDownload"));%> out.println("Files Downloaded: " + slave.get("numFilesDownloaded") + " / " + slave.get("numFilesToDownload"));%>
</td> </td>
</tr> </tr>
@ -226,7 +237,7 @@
<td></td> <td></td>
<td> <td>
<% <%
out.println("Downloaded: " + detailsMap.get("bytesDownloaded") + " / " + detailsMap.get("bytesToDownload") + " [" + detailsMap.get("totalPercent") + "%]");%> out.println("Downloaded: " + slave.get("bytesDownloaded") + " / " + slave.get("bytesToDownload") + " [" + slave.get("totalPercent") + "%]");%>
</td> </td>
</tr> </tr>
@ -234,7 +245,7 @@
<td></td> <td></td>
<td> <td>
<% <%
out.println("Downloading File: " + detailsMap.get("currentFile") + ", Downloaded: " + detailsMap.get("currentFileSizeDownloaded") + " / " + detailsMap.get("currentFileSize") + " [" + detailsMap.get("currentFileSizePercent") + "%]");%> out.println("Downloading File: " + slave.get("currentFile") + ", Downloaded: " + slave.get("currentFileSizeDownloaded") + " / " + slave.get("currentFileSize") + " [" + slave.get("currentFileSizePercent") + "%]");%>
</td> </td>
</tr> </tr>
@ -242,7 +253,7 @@
<td></td> <td></td>
<td> <td>
<% <%
out.println("Time Elapsed: " + detailsMap.get("timeElapsed") + ", Estimated Time Remaining: " + detailsMap.get("timeRemaining") + ", Speed: " + detailsMap.get("downloadSpeed") + "/s");%> out.println("Time Elapsed: " + slave.get("timeElapsed") + ", Estimated Time Remaining: " + slave.get("timeRemaining") + ", Speed: " + slave.get("downloadSpeed") + "/s");%>
</td> </td>
</tr> </tr>
<%}%> <%}%>
@ -257,7 +268,8 @@
executeCommand("disablepoll", core, rh); executeCommand("disablepoll", core, rh);
else if (pollVal.equals("enable")) else if (pollVal.equals("enable"))
executeCommand("enablepoll", core, rh); executeCommand("enablepoll", core, rh);
if ("false".equals(detailsMap.get("isPollingDisabled"))) { if(slave != null)
if ("false".equals(slave.get("isPollingDisabled"))) {
%> %>
<form name=polling method="POST" action="./index.jsp" accept-charset="UTF-8"> <form name=polling method="POST" action="./index.jsp" accept-charset="UTF-8">
@ -267,7 +279,8 @@
<%}%> <%}%>
<% <%
if ("true".equals(detailsMap.get("isPollingDisabled"))) { if(slave != null)
if ("true".equals(slave.get("isPollingDisabled"))) {
%> %>
<form name=polling method="POST" action="./index.jsp" accept-charset="UTF-8"> <form name=polling method="POST" action="./index.jsp" accept-charset="UTF-8">
@ -289,7 +302,8 @@
<input name="replicateButton" class="stdbutton" type="submit" value="Replicate Now"> <input name="replicateButton" class="stdbutton" type="submit" value="Replicate Now">
</form> </form>
<% <%
if ("true".equals(detailsMap.get("isReplicating"))) { if(slave != null)
if ("true".equals(slave.get("isReplicating"))) {
%> %>
<script type="text/javascript"> <script type="text/javascript">
document["replicate"].replicateButton.disabled = true; document["replicate"].replicateButton.disabled = true;