2006-07-19 14:48:16 -04:00
|
|
|
<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
|
2006-11-09 18:13:58 -05:00
|
|
|
<%--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
--%>
|
|
|
|
|
2006-01-26 00:37:29 -05:00
|
|
|
<%@ page import="org.apache.solr.core.SolrCore,
|
|
|
|
org.apache.solr.schema.IndexSchema,
|
|
|
|
java.io.BufferedReader,
|
|
|
|
java.io.File,
|
2006-05-02 13:38:11 -04:00
|
|
|
java.io.FilenameFilter,
|
2006-01-26 00:37:29 -05:00
|
|
|
java.io.FileReader,
|
|
|
|
java.net.InetAddress,
|
|
|
|
java.net.UnknownHostException,
|
|
|
|
java.util.Date"%>
|
|
|
|
|
2006-02-28 11:21:23 -05:00
|
|
|
<%@include file="header.jsp" %>
|
2006-01-26 00:37:29 -05:00
|
|
|
|
2006-02-28 11:21:23 -05:00
|
|
|
<%
|
2007-08-15 16:55:14 -04:00
|
|
|
File slaveinfo = new File(solrHome + "logs/snappuller.status");
|
2006-01-26 00:37:29 -05:00
|
|
|
|
|
|
|
StringBuffer buffer = new StringBuffer();
|
2006-05-02 13:38:11 -04:00
|
|
|
StringBuffer buffer2 = new StringBuffer();
|
2006-01-26 00:37:29 -05:00
|
|
|
String mode = "";
|
|
|
|
|
|
|
|
if (slaveinfo.canRead()) {
|
|
|
|
// Slave instance
|
|
|
|
mode = "Slave";
|
2007-08-15 16:55:14 -04:00
|
|
|
File slavevers = new File(solrHome + "logs/snapshot.current");
|
2006-01-26 00:37:29 -05:00
|
|
|
BufferedReader inforeader = new BufferedReader(new FileReader(slaveinfo));
|
|
|
|
BufferedReader versreader = new BufferedReader(new FileReader(slavevers));
|
|
|
|
buffer.append("<tr>\n" +
|
|
|
|
"<td>\n" +
|
|
|
|
"Version:" +
|
|
|
|
"</td>\n" +
|
|
|
|
"<td>\n")
|
|
|
|
.append( versreader.readLine())
|
|
|
|
.append( "<td>\n" +
|
|
|
|
"</td>\n" +
|
|
|
|
"</tr>\n" +
|
|
|
|
"<tr>\n" +
|
|
|
|
"<td>\n" +
|
|
|
|
"Status:" +
|
|
|
|
"</td>\n" +
|
|
|
|
"<td>\n")
|
|
|
|
.append( inforeader.readLine())
|
|
|
|
.append( "</td>\n" +
|
|
|
|
"</tr>\n");
|
|
|
|
} else {
|
|
|
|
// Master instance
|
|
|
|
mode = "Master";
|
2007-08-15 16:55:14 -04:00
|
|
|
File masterdir = new File(solrHome + "logs/clients");
|
2006-05-02 13:38:11 -04:00
|
|
|
FilenameFilter sfilter = new FilenameFilter() {
|
|
|
|
public boolean accept(File dir, String name) {
|
|
|
|
return name.startsWith("snapshot.status");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
FilenameFilter cfilter = new FilenameFilter() {
|
|
|
|
public boolean accept(File dir, String name) {
|
|
|
|
return name.startsWith("snapshot.current");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
File[] clients = masterdir.listFiles(cfilter);
|
2006-01-26 00:37:29 -05:00
|
|
|
if (clients == null) {
|
|
|
|
buffer.append("<tr>\n" +
|
|
|
|
"<td>\n" +
|
|
|
|
"</td>\n" +
|
|
|
|
"<td>\n" +
|
|
|
|
"No distribution info present" +
|
|
|
|
"</td>\n" +
|
|
|
|
"</tr>\n");
|
|
|
|
} else {
|
2006-05-02 13:38:11 -04:00
|
|
|
buffer.append("<h4>Client Snapshot In Use:</h4>\n" +
|
|
|
|
"<tr>\n" +
|
|
|
|
"<th>\n" +
|
|
|
|
"Client" +
|
|
|
|
"</th>\n" +
|
|
|
|
"<th>\n" +
|
|
|
|
"Version" +
|
|
|
|
"</th>\n" +
|
|
|
|
"</tr>\n");
|
2006-01-26 00:37:29 -05:00
|
|
|
int i = 0;
|
|
|
|
while (i < clients.length) {
|
2006-05-02 13:38:11 -04:00
|
|
|
String fileName=clients[i].toString();
|
|
|
|
int p=fileName.indexOf("snapshot.current");
|
|
|
|
String clientName=fileName.substring(p+17);
|
2006-01-26 00:37:29 -05:00
|
|
|
BufferedReader reader = new BufferedReader(new FileReader(clients[i]));
|
|
|
|
buffer.append("<tr>\n" +
|
|
|
|
"<td>\n" +
|
2006-05-02 13:38:11 -04:00
|
|
|
clientName +
|
2006-01-26 00:37:29 -05:00
|
|
|
"</td>\n" +
|
|
|
|
"<td>\n")
|
|
|
|
.append( reader.readLine())
|
|
|
|
.append( "</td>\n" +
|
|
|
|
"</tr>\n" +
|
|
|
|
"<tr>\n" +
|
|
|
|
"</tr>\n");
|
|
|
|
i++;
|
|
|
|
}
|
2006-05-02 13:38:11 -04:00
|
|
|
clients = masterdir.listFiles(sfilter);
|
|
|
|
if (clients!=null) {
|
|
|
|
buffer.append("</table>\n" +
|
|
|
|
"<h4>Client Snapshot Distribution Status:</h4>\n" +
|
|
|
|
"<table>\n" +
|
|
|
|
"<tr>\n" +
|
|
|
|
"<th>\n" +
|
|
|
|
"Client" +
|
|
|
|
"</th>\n" +
|
|
|
|
"<th>\n" +
|
|
|
|
"Status" +
|
|
|
|
"</th>\n" +
|
|
|
|
"</tr>\n");
|
|
|
|
i = 0;
|
|
|
|
while (i < clients.length) {
|
|
|
|
String fileName=clients[i].toString();
|
|
|
|
int p=fileName.indexOf("snapshot.status");
|
|
|
|
String clientName=fileName.substring(p+16);
|
|
|
|
BufferedReader reader = new BufferedReader(new FileReader(clients[i]));
|
|
|
|
buffer.append("<tr>\n" +
|
|
|
|
"<td>\n" +
|
|
|
|
clientName +
|
|
|
|
"</td>\n" +
|
|
|
|
"<td>\n")
|
|
|
|
.append( reader.readLine())
|
|
|
|
.append( "</td>\n" +
|
|
|
|
"</tr>\n" +
|
|
|
|
"<tr>\n" +
|
|
|
|
"</tr>\n");
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
2006-01-26 00:37:29 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
%>
|
2006-02-28 11:21:23 -05:00
|
|
|
|
|
|
|
|
2006-05-02 13:38:11 -04:00
|
|
|
<br clear="all">
|
2009-09-09 01:10:23 -04:00
|
|
|
<h2>Distribution Info: <%= mode %> Server</h2>
|
|
|
|
<br clear="all" />
|
|
|
|
(<a href="http://wiki.apache.org/solr/CollectionDistribution">What Is This Page?</a>)
|
|
|
|
<br clear="all" />
|
2006-05-02 13:38:11 -04:00
|
|
|
<table>
|
|
|
|
<%= buffer %>
|
|
|
|
</table>
|
|
|
|
<br><br>
|
2007-12-21 17:23:39 -05:00
|
|
|
<a href=".">Return to Admin Page</a>
|
2006-01-26 00:37:29 -05:00
|
|
|
</body>
|
|
|
|
</html>
|