org.hibernate.search.backend.impl.lucene.Changeset Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-search-engine Show documentation
Show all versions of hibernate-search-engine Show documentation
Core of the Object/Lucene mapper, query engine and index management
/*
* Hibernate Search, full-text search for your domain model
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.search.backend.impl.lucene;
import org.hibernate.search.backend.IndexingMonitor;
import org.hibernate.search.backend.LuceneWork;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.locks.LockSupport;
/**
* A Changeset is a work to be applied to the index and its associated producer
*
* @author gustavonalle
*/
public final class Changeset implements Iterable {
private final List workList;
private final Thread producer;
private final IndexingMonitor monitor;
private volatile boolean processed = false;
public Changeset(List workList, Thread producer, IndexingMonitor monitor) {
this.workList = workList;
this.producer = producer;
this.monitor = monitor;
}
@Override
public Iterator iterator() {
return workList.iterator();
}
IndexingMonitor getMonitor() {
return monitor;
}
boolean isProcessed() {
return processed;
}
public void markProcessed() {
processed = true;
LockSupport.unpark( producer );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy