private long newTransactionLogId() throws IOException { try { return IndexWriters.rollbackSegmentInfos(indexWriter).getVersion(); } catch (Exception e) { return IndexReader.getCurrentVersion(store.directory()); } }
@Override public ByteSizeValue estimateFlushableMemorySize() { rwl.readLock().lock(); try { long bytes = IndexWriters.estimateRamSize(indexWriter); bytes += translog.estimateMemorySize().bytes(); return new ByteSizeValue(bytes); } catch (Exception e) { return null; } finally { rwl.readLock().unlock(); } }