예제 #1
0
 private long newTransactionLogId() throws IOException {
   try {
     return IndexWriters.rollbackSegmentInfos(indexWriter).getVersion();
   } catch (Exception e) {
     return IndexReader.getCurrentVersion(store.directory());
   }
 }
예제 #2
0
 @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();
   }
 }