SOLR-5441: the null-pointer patch addition

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1542142 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erick Erickson 2013-11-15 00:48:08 +00:00
parent afb1c8d693
commit 7b608c2e1f
2 changed files with 8 additions and 4 deletions

View File

@ -842,8 +842,10 @@ public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreState
lst.add("cumulative_deletesById", deleteByIdCommandsCumulative.get()); lst.add("cumulative_deletesById", deleteByIdCommandsCumulative.get());
lst.add("cumulative_deletesByQuery", deleteByQueryCommandsCumulative.get()); lst.add("cumulative_deletesByQuery", deleteByQueryCommandsCumulative.get());
lst.add("cumulative_errors", numErrorsCumulative.get()); lst.add("cumulative_errors", numErrorsCumulative.get());
if (this.ulog != null) {
lst.add("transaction_logs_total_size", ulog.getTotalLogsSize()); lst.add("transaction_logs_total_size", ulog.getTotalLogsSize());
lst.add("transaction_logs_total_number", ulog.getTotalLogsNumber()); lst.add("transaction_logs_total_number", ulog.getTotalLogsNumber());
}
return lst; return lst;
} }

View File

@ -564,8 +564,11 @@ public class TransactionLog {
} }
public long getLogSize() { public long getLogSize() {
if (tlogFile != null) {
return tlogFile.length(); return tlogFile.length();
} }
return 0;
}
/** Returns a reader that can be used while a log is still in use. /** Returns a reader that can be used while a log is still in use.
* Currently only *one* LogReader may be outstanding, and that log may only * Currently only *one* LogReader may be outstanding, and that log may only
@ -579,7 +582,6 @@ public class TransactionLog {
return new FSReverseReader(); return new FSReverseReader();
} }
public class LogReader { public class LogReader {
private ChannelFastInputStream fis; private ChannelFastInputStream fis;
private LogCodec codec = new LogCodec(resolver); private LogCodec codec = new LogCodec(resolver);