All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.archinnov.achilles.context.ThriftImmediateFlushContext Maven / Gradle / Ivy

package info.archinnov.achilles.context;

import static info.archinnov.achilles.context.AchillesFlushContext.FlushType.IMMEDIATE;
import info.archinnov.achilles.consistency.AchillesConsistencyLevelPolicy;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * ThriftImmediateFlushContext
 * 
 * @author DuyHai DOAN
 * 
 */
public class ThriftImmediateFlushContext extends ThriftAbstractFlushContext
{
	private static final Logger log = LoggerFactory.getLogger(ThriftImmediateFlushContext.class);

	public ThriftImmediateFlushContext(ThriftDaoContext thriftDaoContext,
			AchillesConsistencyLevelPolicy policy)
	{
		super(thriftDaoContext, policy);
	}

	@Override
	public void startBatch()
	{
		throw new UnsupportedOperationException(
				"Cannot start a batch with a normal EntityManager. Please create a BatchingEntityManager instead");
	}

	@Override
	public void flush()
	{
		log.debug("Flush immediatly all pending mutations");
		doFlush();
	}

	@Override
	public void endBatch()
	{
		throw new UnsupportedOperationException(
				"Cannot end a batch with a normal EntityManager. Please create a BatchingEntityManager instead");
	}

	@Override
	public FlushType type()
	{
		return IMMEDIATE;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy