info.archinnov.achilles.iterator.ThriftClusteredEntityIterator Maven / Gradle / Ivy
package info.archinnov.achilles.iterator;
import info.archinnov.achilles.context.ThriftPersistenceContext;
import me.prettyprint.hector.api.beans.Composite;
import me.prettyprint.hector.api.beans.HColumn;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* ThriftClusteredEntityIterator
*
* @author DuyHai DOAN
*
*/
public class ThriftClusteredEntityIterator extends ThriftAbstractClusteredEntityIterator
{
private static final Logger log = LoggerFactory.getLogger(ThriftClusteredEntityIterator.class);
private ThriftAbstractSliceIterator> sliceIterator;
public ThriftClusteredEntityIterator(Class entityClass,
ThriftAbstractSliceIterator> sliceIterator,
ThriftPersistenceContext context)
{
super(entityClass, sliceIterator, context);
this.sliceIterator = sliceIterator;
}
@Override
public T next()
{
log.trace("Get next clustered entity of type {} ", entityClass.getCanonicalName());
HColumn hColumn = this.sliceIterator.next();
T target = transformer.buildClusteredEntity(entityClass, context, hColumn);
return proxifyClusteredEntity(target);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy