/** Called internally if any index state has changed. */ synchronized void changed() { changeCount.incrementAndGet(); segmentInfos.changed(); }
/** Sets the commit data. */ public void setUserData(Map<String,String> data, boolean doIncrementVersion) { if (data == null) { userData = Collections.<String,String>emptyMap(); } else { userData = data; } if (doIncrementVersion) { changed(); } }
/** * Sets the commit user data iterator, controlling whether to advance the {@link SegmentInfos#getVersion}. * * @see #setLiveCommitData(Iterable) * * @lucene.internal */ public final synchronized void setLiveCommitData(Iterable<Map.Entry<String,String>> commitUserData, boolean doIncrementVersion) { this.commitUserData = commitUserData; if (doIncrementVersion) { segmentInfos.changed(); } changeCount.incrementAndGet(); }
final String newSegmentName() { // Cannot synchronize on IndexWriter because that causes // deadlock synchronized(segmentInfos) { // Important to increment changeCount so that the // segmentInfos is written on close. Otherwise we // could close, re-open and re-return the same segment // name that was previously returned which can cause // problems at least with ConcurrentMergeScheduler. changeCount.incrementAndGet(); segmentInfos.changed(); return "_" + Long.toString(segmentInfos.counter++, Character.MAX_RADIX); } }
/** Repairs the index using previously returned result * from {@link #checkIndex}. Note that this does not * remove any of the unreferenced files after it's done; * you must separately open an {@link IndexWriter}, which * deletes unreferenced files when it's created. * * <p><b>WARNING</b>: this writes a * new segments file into the index, effectively removing * all documents in broken segments from the index. * BE CAREFUL. */ public void exorciseIndex(Status result) throws IOException { ensureOpen(); if (result.partial) { throw new IllegalArgumentException("can only exorcise an index that was fully checked (this status checked a subset of segments)"); } result.newSegments.changed(); result.newSegments.commit(result.dir); }
segmentInfos.changed();
segmentInfos.changed(); globalFieldNumberMap.clear(); success = true;
segmentInfos.changed(); changed();
/** Sets the commit data. */ public void setUserData(Map<String,String> data, boolean doIncrementVersion) { if (data == null) { userData = Collections.<String,String>emptyMap(); } else { userData = data; } if (doIncrementVersion) { changed(); } }
void setUserData(Map<String,String> data) { if (data == null) { userData = Collections.<String,String>emptyMap(); } else { userData = data; } changed(); }
/** Called internally if any index state has changed. */ synchronized void changed() { changeCount.incrementAndGet(); segmentInfos.changed(); }
/** Called internally if any index state has changed. */ synchronized void changed() { changeCount.incrementAndGet(); segmentInfos.changed(); }
/** Called internally if any index state has changed. */ synchronized void changed() { changeCount.incrementAndGet(); segmentInfos.changed(); }
void setUserData(Map<String,String> data) { if (data == null) { userData = Collections.<String,String>emptyMap(); } else { userData = data; } changed(); }
/** * Sets the commit user data iterator, controlling whether to advance the {@link SegmentInfos#getVersion}. * * @see #setLiveCommitData(Iterable) * * @lucene.internal */ public final synchronized void setLiveCommitData(Iterable<Map.Entry<String,String>> commitUserData, boolean doIncrementVersion) { this.commitUserData = commitUserData; if (doIncrementVersion) { segmentInfos.changed(); } changeCount.incrementAndGet(); }
final String newSegmentName() { // Cannot synchronize on IndexWriter because that causes // deadlock synchronized(segmentInfos) { // Important to increment changeCount so that the // segmentInfos is written on close. Otherwise we // could close, re-open and re-return the same segment // name that was previously returned which can cause // problems at least with ConcurrentMergeScheduler. changeCount.incrementAndGet(); segmentInfos.changed(); return "_" + Long.toString(segmentInfos.counter++, Character.MAX_RADIX); } }
public void remove(String[] segs) throws IOException { for (String n : segs) { int idx = getIdx(n); infos.remove(idx); } infos.changed(); infos.commit(fsDir); }
public void remove(String[] segs) throws IOException { for (String n : segs) { int idx = getIdx(n); infos.remove(idx); } infos.changed(); infos.commit(fsDir); }
public void remove(String[] segs) throws IOException { for (String n : segs) { int idx = getIdx(n); infos.remove(idx); } infos.changed(); infos.commit(fsDir); }
public void remove(String[] segs) throws IOException { for (String n : segs) { int idx = getIdx(n); infos.remove(idx); } infos.changed(); infos.commit(fsDir); }