List of usage examples for org.apache.lucene.index SegmentInfos getLastCommitGeneration
public static long getLastCommitGeneration(Directory directory) throws IOException
From source file:org.lahab.clucene.server.indexer.Indexer.java
License:Apache License
@Override public Collection<? extends String> record() { try {//from w w w.java 2 s . c o m int nbDoc = _close ? 0 : _index.numDocs(); List<String> stats = new LinkedList<String>(); stats.add(String.valueOf(nbDoc)); stats.add(String.valueOf(SegmentInfos.getLastCommitGeneration(_directory))); stats.add(String.valueOf(_close ? 0 : _index.ramSizeInBytes())); LOGGER.info("Doc added:" + nbDoc); return stats; } catch (IOException e) { e.printStackTrace(); } return null; }