written[index] = true; File dirtyFile = entry.getDirtyFile(index); FileOutputStream outputStream; try {
/** * Computes the initial size and collects garbage as a part of opening the * cache. Dirty entries are assumed to be inconsistent and will be deleted. */ private void processJournal() throws IOException { deleteIfExists(journalFileTmp); for (Iterator<Entry> i = lruEntries.values().iterator(); i.hasNext(); ) { Entry entry = i.next(); if (entry.currentEditor == null) { for (int t = 0; t < valueCount; t++) { size += entry.lengths[t]; fileCount++; } } else { entry.currentEditor = null; for (int t = 0; t < valueCount; t++) { deleteIfExists(entry.getCleanFile(t)); deleteIfExists(entry.getDirtyFile(t)); } i.remove(); } } }
throw new IllegalStateException("Newly created entry didn't create value for index " + i); if (!entry.getDirtyFile(i).exists()) { editor.abort(); return; File dirty = entry.getDirtyFile(i); if (success) { if (dirty.exists()) {
throw new IllegalStateException("Newly created entry didn't create value for index " + i); if (!entry.getDirtyFile(i).exists()) { editor.abort(); return; File dirty = entry.getDirtyFile(i); if (success) { if (dirty.exists()) {
throw new IllegalStateException("Newly created entry didn't create value for index " + i); if (!entry.getDirtyFile(i).exists()) { editor.abort(); return; File dirty = entry.getDirtyFile(i); if (success) { if (dirty.exists()) {
throw new IllegalStateException("Newly created entry didn't create value for index " + i); if (!entry.getDirtyFile(i).exists()) { editor.abort(); return; File dirty = entry.getDirtyFile(i); if (success) { if (dirty.exists()) {
written[index] = true; File dirtyFile = entry.getDirtyFile(index); FileOutputStream outputStream; try {
written[index] = true; File dirtyFile = entry.getDirtyFile(index); FileOutputStream outputStream; try {
written[index] = true; File dirtyFile = entry.getDirtyFile(index); FileOutputStream outputStream; try {
/** * Computes the initial size and collects garbage as a part of opening the * cache. Dirty entries are assumed to be inconsistent and will be deleted. */ private void processJournal() throws IOException { deleteIfExists(journalFileTmp); for (Iterator<Entry> i = lruEntries.values().iterator(); i.hasNext(); ) { Entry entry = i.next(); if (entry.currentEditor == null) { for (int t = 0; t < valueCount; t++) { size += entry.lengths[t]; fileCount++; } } else { entry.currentEditor = null; for (int t = 0; t < valueCount; t++) { deleteIfExists(entry.getCleanFile(t)); deleteIfExists(entry.getDirtyFile(t)); } i.remove(); } } }
/** * Computes the initial size and collects garbage as a part of opening the * cache. Dirty entries are assumed to be inconsistent and will be deleted. */ private void processJournal() throws IOException { deleteIfExists(journalFileTmp); for (Iterator<Entry> i = lruEntries.values().iterator(); i.hasNext(); ) { Entry entry = i.next(); if (entry.currentEditor == null) { for (int t = 0; t < valueCount; t++) { size += entry.lengths[t]; fileCount++; } } else { entry.currentEditor = null; for (int t = 0; t < valueCount; t++) { deleteIfExists(entry.getCleanFile(t)); deleteIfExists(entry.getDirtyFile(t)); } i.remove(); } } }
/** * Computes the initial size and collects garbage as a part of opening the * cache. Dirty entries are assumed to be inconsistent and will be deleted. */ private void processJournal() throws IOException { deleteIfExists(journalFileTmp); for (Iterator<Entry> i = lruEntries.values().iterator(); i.hasNext(); ) { Entry entry = i.next(); if (entry.currentEditor == null) { for (int t = 0; t < valueCount; t++) { size += entry.lengths[t]; fileCount++; } } else { entry.currentEditor = null; for (int t = 0; t < valueCount; t++) { deleteIfExists(entry.getCleanFile(t)); deleteIfExists(entry.getDirtyFile(t)); } i.remove(); } } }