Lines Matching refs:entry
380 Entry entry = lruEntries.get(key); in readJournalLine() local
381 if (entry == null) { in readJournalLine()
382 entry = new Entry(key); in readJournalLine()
383 lruEntries.put(key, entry); in readJournalLine()
387 entry.readable = true; in readJournalLine()
388 entry.currentEditor = null; in readJournalLine()
389 entry.setLengths(copyOfRange(parts, 2, parts.length)); in readJournalLine()
391 entry.currentEditor = new Editor(entry); in readJournalLine()
406 Entry entry = i.next(); in processJournal() local
407 if (entry.currentEditor == null) { in processJournal()
409 size += entry.lengths[t]; in processJournal()
412 entry.currentEditor = null; in processJournal()
414 deleteIfExists(entry.getCleanFile(t)); in processJournal()
415 deleteIfExists(entry.getDirtyFile(t)); in processJournal()
442 for (Entry entry : lruEntries.values()) { in rebuildJournal()
443 if (entry.currentEditor != null) { in rebuildJournal()
444 writer.write(DIRTY + ' ' + entry.key + '\n'); in rebuildJournal()
446 writer.write(CLEAN + ' ' + entry.key + entry.getLengths() + '\n'); in rebuildJournal()
476 Entry entry = lruEntries.get(key); in get() local
477 if (entry == null) { in get()
481 if (!entry.readable) { in get()
493 ins[i] = new FileInputStream(entry.getCleanFile(i)); in get()
506 return new Snapshot(key, entry.sequenceNumber, ins); in get()
520 Entry entry = lruEntries.get(key); in edit() local
522 && (entry == null || entry.sequenceNumber != expectedSequenceNumber)) { in edit()
525 if (entry == null) { in edit()
526 entry = new Entry(key); in edit()
527 lruEntries.put(key, entry); in edit()
528 } else if (entry.currentEditor != null) { in edit()
532 Editor editor = new Editor(entry); in edit()
533 entry.currentEditor = editor; in edit()
566 Entry entry = editor.entry; in completeEdit() local
567 if (entry.currentEditor != editor) { in completeEdit()
572 if (success && !entry.readable) { in completeEdit()
574 if (!entry.getDirtyFile(i).exists()) { in completeEdit()
582 File dirty = entry.getDirtyFile(i); in completeEdit()
585 File clean = entry.getCleanFile(i); in completeEdit()
587 long oldLength = entry.lengths[i]; in completeEdit()
589 entry.lengths[i] = newLength; in completeEdit()
598 entry.currentEditor = null; in completeEdit()
599 if (entry.readable | success) { in completeEdit()
600 entry.readable = true; in completeEdit()
601 journalWriter.write(CLEAN + ' ' + entry.key + entry.getLengths() + '\n'); in completeEdit()
603 entry.sequenceNumber = nextSequenceNumber++; in completeEdit()
606 lruEntries.remove(entry.key); in completeEdit()
607 journalWriter.write(REMOVE + ' ' + entry.key + '\n'); in completeEdit()
634 Entry entry = lruEntries.get(key); in remove() local
635 if (entry == null || entry.currentEditor != null) { in remove()
640 File file = entry.getCleanFile(i); in remove()
644 size -= entry.lengths[i]; in remove()
645 entry.lengths[i] = 0; in remove()
688 for (Entry entry : new ArrayList<Entry>(lruEntries.values())) { in close()
689 if (entry.currentEditor != null) { in close()
690 entry.currentEditor.abort(); in close()
775 private final Entry entry; field in DiskLruCache.Editor
778 private Editor(Entry entry) { in Editor() argument
779 this.entry = entry; in Editor()
788 if (entry.currentEditor != this) { in newInputStream()
791 if (!entry.readable) { in newInputStream()
794 return new FileInputStream(entry.getCleanFile(index)); in newInputStream()
816 if (entry.currentEditor != this) { in newOutputStream()
819 return new FaultHidingOutputStream(new FileOutputStream(entry.getDirtyFile(index))); in newOutputStream()
843 remove(entry.key); // the previous entry is stale in commit()