/** Returns the committed segments_N filename. */ final String finishCommit(Directory dir) throws IOException { if (pendingCommit == false) { throw new IllegalStateException("prepareCommit was not called"); } boolean success = false; final String dest; try { final String src = IndexFileNames.fileNameFromGeneration(IndexFileNames.PENDING_SEGMENTS, "", generation); dest = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", generation); dir.rename(src, dest); dir.syncMetaData(); success = true; } finally { if (!success) { // deletes pending_segments_N: rollbackCommit(dir); } } pendingCommit = false; lastGeneration = generation; return dest; }
pendingCommit.rollbackCommit(directory); try { deleter.decRef(pendingCommit); pendingCommit.rollbackCommit(directory); deleter.decRef(pendingCommit); } catch (Throwable t) {
pendingCommitSet = false; pendingCommit = null; toSync.rollbackCommit(directory);
/** Returns the committed segments_N filename. */ final String finishCommit(Directory dir) throws IOException { if (pendingCommit == false) { throw new IllegalStateException("prepareCommit was not called"); } boolean success = false; final String dest; try { final String src = IndexFileNames.fileNameFromGeneration(IndexFileNames.PENDING_SEGMENTS, "", generation); dest = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", generation); dir.renameFile(src, dest); success = true; } finally { if (!success) { // deletes pending_segments_N: rollbackCommit(dir); } } pendingCommit = false; lastGeneration = generation; return dest; }
/** Returns the committed segments_N filename. */ final String finishCommit(Directory dir) throws IOException { if (pendingCommit == false) { throw new IllegalStateException("prepareCommit was not called"); } boolean success = false; final String dest; try { final String src = IndexFileNames.fileNameFromGeneration(IndexFileNames.PENDING_SEGMENTS, "", generation); dest = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", generation); dir.renameFile(src, dest); success = true; } finally { if (!success) { // deletes pending_segments_N: rollbackCommit(dir); } } pendingCommit = false; lastGeneration = generation; return dest; }
/** Returns the committed segments_N filename. */ final String finishCommit(Directory dir) throws IOException { if (pendingCommit == false) { throw new IllegalStateException("prepareCommit was not called"); } boolean success = false; final String dest; try { final String src = IndexFileNames.fileNameFromGeneration(IndexFileNames.PENDING_SEGMENTS, "", generation); dest = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", generation); dir.rename(src, dest); dir.syncMetaData(); success = true; } finally { if (!success) { // deletes pending_segments_N: rollbackCommit(dir); } } pendingCommit = false; lastGeneration = generation; return dest; }
pendingCommit.rollbackCommit(directory); try { deleter.decRef(pendingCommit); pendingCommit.rollbackCommit(directory); deleter.decRef(pendingCommit); } catch (Throwable t) {
} finally { if (!success) rollbackCommit(dir);
} finally { if (!success) rollbackCommit(dir);
pendingCommit.rollbackCommit(directory); deleter.decRef(pendingCommit); pendingCommit = null;
pendingCommit.rollbackCommit(directory); try { deleter.decRef(pendingCommit); pendingCommit.rollbackCommit(directory); deleter.decRef(pendingCommit); } catch (Throwable t) {
pendingCommit.rollbackCommit(directory); deleter.decRef(pendingCommit); pendingCommit = null;
pendingCommit.rollbackCommit(directory); try { deleter.decRef(pendingCommit); pendingCommit.rollbackCommit(directory); deleter.decRef(pendingCommit); } catch (Throwable t) {
pendingCommitSet = false; pendingCommit = null; toSync.rollbackCommit(directory);
pendingCommitSet = false; pendingCommit = null; toSync.rollbackCommit(directory);
pendingCommitSet = false; pendingCommit = null; toSync.rollbackCommit(directory);