%@ page import="org.apache.solr.core.SolrCore,
org.apache.solr.schema.IndexSchema,
java.io.BufferedReader,
java.io.File,
java.io.FilenameFilter,
java.io.FileReader,
java.net.InetAddress,
java.net.UnknownHostException,
java.util.Date"%>
<%@include file="header.jsp" %>
<%
File slaveinfo = new File(cwd + "/solr/logs/snappuller.status");
StringBuffer buffer = new StringBuffer();
StringBuffer buffer2 = new StringBuffer();
String mode = "";
if (slaveinfo.canRead()) {
// Slave instance
mode = "Slave";
File slavevers = new File(cwd + "/solr/logs/snapshot.current");
BufferedReader inforeader = new BufferedReader(new FileReader(slaveinfo));
BufferedReader versreader = new BufferedReader(new FileReader(slavevers));
buffer.append("
\n" +
"\n" +
"Version:" +
" | \n" +
"\n")
.append( versreader.readLine())
.append( " | \n" +
" | \n" +
"
\n" +
"\n" +
"\n" +
"Status:" +
" | \n" +
"\n")
.append( inforeader.readLine())
.append( " | \n" +
"
\n");
} else {
// Master instance
mode = "Master";
File masterdir = new File(cwd + "/solr/logs/clients");
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);
if (clients == null) {
buffer.append("\n" +
"\n" +
" | \n" +
"\n" +
"No distribution info present" +
" | \n" +
"
\n");
} else {
buffer.append("Client Snapshot In Use:
\n" +
"\n" +
"\n" +
"Client" +
" | \n" +
"\n" +
"Version" +
" | \n" +
"
\n");
int i = 0;
while (i < clients.length) {
String fileName=clients[i].toString();
int p=fileName.indexOf("snapshot.current");
String clientName=fileName.substring(p+17);
BufferedReader reader = new BufferedReader(new FileReader(clients[i]));
buffer.append("\n" +
"\n" +
clientName +
" | \n" +
"\n")
.append( reader.readLine())
.append( " | \n" +
"
\n" +
"\n" +
"
\n");
i++;
}
clients = masterdir.listFiles(sfilter);
if (clients!=null) {
buffer.append("\n" +
"Client Snapshot Distribution Status:
\n" +
"\n" +
"\n" +
"\n" +
"Client" +
" | \n" +
"\n" +
"Status" +
" | \n" +
"
\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("\n" +
"\n" +
clientName +
" | \n" +
"\n")
.append( reader.readLine())
.append( " | \n" +
"
\n" +
"\n" +
"
\n");
i++;
}
}
}
}
%>
Distribution Info
<%= mode %> Server
Return to Admin Page