- added information about segment count to status_p.xml

- also moved this information from the old index structure, which is
still in use for the RWI/DHT index to that front-end
This commit is contained in:
orbiter 2013-07-23 18:03:33 +02:00
parent 6fb2811e68
commit 056b42f5aa
8 changed files with 41 additions and 2 deletions

View File

@ -72,8 +72,11 @@ public class status_p {
// index size
prop.putNum("urlpublictextSize", segment.fulltext().collectionSize());
prop.putNum("webgraphSize", segment.fulltext().webgraphSize());
prop.putNum("urlpublictextSegmentCount", segment.fulltext().getDefaultConnector().getSegmentCount());
prop.putNum("webgraphSize", segment.fulltext().writeToWebgraph() ? segment.fulltext().webgraphSize() : 0);
prop.putNum("webgraphSegmentCount", segment.fulltext().writeToWebgraph() ? segment.fulltext().getWebgraphConnector().getSegmentCount() : 0);
prop.putNum("rwipublictextSize", segment.RWICount());
prop.putNum("rwipublictextSegmentCount", segment.RWISegmentCount());
// loader queue
prop.putNum("loaderSize", sb.crawlQueues.workerSize());

View File

@ -21,8 +21,11 @@
<dbsize>
<urlpublictext>#[urlpublictextSize]#</urlpublictext>
<urlpublictextSegmentCount>#[urlpublictextSegmentCount]#</urlpublictextSegmentCount>
<webgraph>#[webgraphSize]#</webgraph>
<rwipublictext>#[rwipublictextSize]#</rwipublictext>
<webgraphSegmentCount>#[webgraphSegmentCount]#</webgraphSegmentCount>
<rwipublictext>#[rwipublictextSize]#</rwipublictext>
<rwipublictextSegmentCount>#[rwipublictextSegmentCount]#</rwipublictextSegmentCount>
</dbsize>
<loaderqueue>

View File

@ -306,4 +306,10 @@ public class CachedSolrConnector extends AbstractSolrConnector implements SolrCo
public void optimize(int maxSegments) {
this.solr.optimize(maxSegments);
}
@Override
public int getSegmentCount() {
return this.solr.getSegmentCount();
}
}

View File

@ -246,6 +246,11 @@ public class ConcurrentUpdateSolrConnector implements SolrConnector {
this.connector.optimize(maxSegments);
}
@Override
public int getSegmentCount() {
return this.connector.getSegmentCount();
}
@Override
public void close() {
ensureAliveDeletionHandler();

View File

@ -98,6 +98,13 @@ public class MirrorSolrConnector extends AbstractSolrConnector implements SolrCo
if (this.solr0 != null) this.solr0.optimize(maxSegments);
if (this.solr1 != null) this.solr1.optimize(maxSegments);
}
@Override
public int getSegmentCount() {
int s0 = this.solr0 == null ? 0 : this.solr0.getSegmentCount();
int s1 = this.solr1 == null ? 0 : this.solr1.getSegmentCount();
return Math.max(s0, s1);
}
@Override
public synchronized void close() {

View File

@ -54,6 +54,12 @@ public interface SolrConnector extends Iterable<String> /* Iterable of document
*/
public void optimize(int maxSegments);
/**
* ask the solr subsystem about it's segment number
* @return the segment count, which corresponds to the number of files for an index
*/
public int getSegmentCount();
/**
* close the server connection
*/

View File

@ -595,6 +595,10 @@ public final class IndexCell<ReferenceType extends Reference> extends AbstractBu
return m;
}
public int getSegmentCount() {
return this.array.entries();
}
@Override
public int minMem() {
return 10 * 1024 * 1024;

View File

@ -374,6 +374,11 @@ public class Segment {
if (this.termIndex == null) return 0;
return this.termIndex.sizesMax();
}
public long RWISegmentCount() {
if (this.termIndex == null) return 0;
return this.termIndex.getSegmentCount();
}
public int RWIBufferCount() {
if (this.termIndex == null) return 0;