public void save() throws IOException { // must own the write lock of the monitor if (!hasChanged()) return; int numberOfChanges = this.memoryIndex.docsToReferences.elementSize; this.diskIndex.separator = this.separator; this.diskIndex = this.diskIndex.mergeWith(this.memoryIndex); this.memoryIndex = new MemoryIndex(); if (numberOfChanges > 1000) System.gc(); // reclaim space if the MemoryIndex was very BIG } public void startQuery() {
public void save() throws IOException { // must own the write lock of the monitor if (!hasChanged()) return; int numberOfChanges = this.memoryIndex.docsToReferences.elementSize; this.diskIndex.separator = this.separator; this.diskIndex = this.diskIndex.mergeWith(this.memoryIndex); this.memoryIndex = new MemoryIndex(); if (numberOfChanges > 1000) System.gc(); // reclaim space if the MemoryIndex was very BIG } public void startQuery() {
public void save() throws IOException { // must own the write lock of the monitor if (!hasChanged()) return; int numberOfChanges = this.memoryIndex.docsToReferences.elementSize; this.diskIndex.separator = this.separator; this.diskIndex = this.diskIndex.mergeWith(this.memoryIndex); this.memoryIndex = new MemoryIndex(); if (numberOfChanges > 1000) System.gc(); // reclaim space if the MemoryIndex was very BIG } public void startQuery() {
public void save() throws IOException { // must own the write lock of the monitor if (!hasChanged()) return; int numberOfChanges = this.memoryIndex.docsToReferences.elementSize; this.diskIndex.separator = this.separator; this.diskIndex = this.diskIndex.mergeWith(this.memoryIndex); this.memoryIndex = new MemoryIndex(); if (numberOfChanges > 1000) System.gc(); // reclaim space if the MemoryIndex was very BIG } public void startQuery() {
public void save() throws IOException { // must own the write lock of the monitor if (!hasChanged()) return; int numberOfChanges = this.memoryIndex.docsToReferences.elementSize; this.diskIndex.separator = this.separator; this.diskIndex = this.diskIndex.mergeWith(this.memoryIndex); this.memoryIndex = new MemoryIndex(); if (numberOfChanges > 1000) System.gc(); // reclaim space if the MemoryIndex was very BIG } public void startQuery() {
public void save() throws IOException { // must own the write lock of the monitor if (!hasChanged()) return; this.diskIndex.separator = this.separator; this.diskIndex = this.diskIndex.mergeWith(this.memoryIndex); this.memoryIndex = new MemoryIndex(); } public void startQuery() {
if (index.hasChanged()) { if (monitor.exitReadEnterWrite()) { try {
if (index.hasChanged()) { if (monitor.exitReadEnterWrite()) { try {
if (index.hasChanged()) { if (monitor.exitReadEnterWrite()) { try {
public void saveIndex(Index index) throws IOException { // must have permission to write from the write monitor if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { IPath containerPath = new Path(index.containerPath); if (this.jobEnd > this.jobStart) { for (int i = this.jobEnd; i > this.jobStart; i--) { // skip the current job IJob job = this.awaitingJobs[i]; if (job instanceof IndexRequest) if (((IndexRequest) job).containerPath.equals(containerPath)) return; } } IndexLocation indexLocation = computeIndexLocation(containerPath); updateIndexState(indexLocation, SAVED_STATE); } } /**
public void saveIndex(Index index) throws IOException { // must have permission to write from the write monitor if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { IPath containerPath = new Path(index.containerPath); if (this.jobEnd > this.jobStart) { for (int i = this.jobEnd; i > this.jobStart; i--) { // skip the current job IJob job = this.awaitingJobs[i]; if (job instanceof IndexRequest) if (((IndexRequest) job).containerPath.equals(containerPath)) return; } } IndexLocation indexLocation = computeIndexLocation(containerPath); updateIndexState(indexLocation, SAVED_STATE); } } /**
public void saveIndex(Index index) throws IOException { // must have permission to write from the write monitor if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { IPath containerPath = new Path(index.containerPath); if (this.jobEnd > this.jobStart) { for (int i = this.jobEnd; i > this.jobStart; i--) { // skip the current job IJob job = this.awaitingJobs[i]; if (job instanceof IndexRequest) if (((IndexRequest) job).containerPath.equals(containerPath)) return; } } IndexLocation indexLocation = computeIndexLocation(containerPath); updateIndexState(indexLocation, SAVED_STATE); } } /**
public void saveIndex(Index index) throws IOException { // must have permission to write from the write monitor if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { IPath containerPath = new Path(index.containerPath); if (this.jobEnd > this.jobStart) { for (int i = this.jobEnd; i > this.jobStart; i--) { // skip the current job IJob job = this.awaitingJobs[i]; if (job instanceof IndexRequest) if (((IndexRequest) job).containerPath.equals(containerPath)) return; } } IndexLocation indexLocation = computeIndexLocation(containerPath); updateIndexState(indexLocation, SAVED_STATE); } } /**
/** * {@link #saveIndex(Index)} will only update the state if there are no other jobs running against the same * underlying resource for this index. Pre-built indexes must be in a {@link #REUSE_STATE} state even if * there is another job to run against it as the subsequent job will find the index and not save it in the * right state. * Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932 */ public void savePreBuiltIndex(Index index) throws IOException { if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving pre-build index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { updateIndexState(index.getIndexLocation(), REUSE_STATE); } } public void saveIndex(Index index) throws IOException {
/** * {@link #saveIndex(Index)} will only update the state if there are no other jobs running against the same * underlying resource for this index. Pre-built indexes must be in a {@link #REUSE_STATE} state even if * there is another job to run against it as the subsequent job will find the index and not save it in the * right state. * Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932 */ public void savePreBuiltIndex(Index index) throws IOException { if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving pre-build index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { updateIndexState(index.getIndexLocation(), REUSE_STATE); } } public void saveIndex(Index index) throws IOException {
public void saveIndex(Index index) throws IOException { // must have permission to write from the write monitor if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { IPath containerPath = new Path(index.containerPath); if (this.jobEnd > this.jobStart) { for (int i = this.jobEnd; i > this.jobStart; i--) { // skip the current job IJob job = this.awaitingJobs[i]; if (job instanceof IndexRequest) if (((IndexRequest) job).containerPath.equals(containerPath)) return; } } IndexLocation indexLocation = computeIndexLocation(containerPath); updateIndexState(indexLocation, SAVED_STATE); } } /**
public void saveIndex(Index index) throws IOException { // must have permission to write from the write monitor if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving index " + index.getIndexFile()); //$NON-NLS-1$ index.save(); } synchronized (this) { IPath containerPath = new Path(index.containerPath); if (this.jobEnd > this.jobStart) { for (int i = this.jobEnd; i > this.jobStart; i--) { // skip the current job IJob job = this.awaitingJobs[i]; if (job instanceof IndexRequest) if (((IndexRequest) job).containerPath.equals(containerPath)) return; } } IPath indexLocation = computeIndexLocation(containerPath); updateIndexState(indexLocation, SAVED_STATE); } } /**
/** * {@link #saveIndex(Index)} will only update the state if there are no other jobs running against the same * underlying resource for this index. Pre-built indexes must be in a {@link #REUSE_STATE} state even if * there is another job to run against it as the subsequent job will find the index and not save it in the * right state. * Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932 */ public void savePreBuiltIndex(Index index) throws IOException { if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving pre-build index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { updateIndexState(index.getIndexLocation(), REUSE_STATE); } } public void saveIndex(Index index) throws IOException {
/** * {@link #saveIndex(Index)} will only update the state if there are no other jobs running against the same * underlying resource for this index. Pre-built indexes must be in a {@link #REUSE_STATE} state even if * there is another job to run against it as the subsequent job will find the index and not save it in the * right state. * Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932 */ public void savePreBuiltIndex(Index index) throws IOException { if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving pre-build index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { updateIndexState(index.getIndexLocation(), REUSE_STATE); } } public void saveIndex(Index index) throws IOException {
/** * {@link #saveIndex(Index)} will only update the state if there are no other jobs running against the same * underlying resource for this index. Pre-built indexes must be in a {@link #REUSE_STATE} state even if * there is another job to run against it as the subsequent job will find the index and not save it in the * right state. * Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932 */ public void savePreBuiltIndex(Index index) throws IOException { if (index.hasChanged()) { if (VERBOSE) Util.verbose("-> saving pre-build index " + index.getIndexLocation()); //$NON-NLS-1$ index.save(); } synchronized (this) { updateIndexState(index.getIndexLocation(), REUSE_STATE); } } public void saveIndex(Index index) throws IOException {