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

com.thematchbox.river.batch.AppendBatchIndexAction Maven / Gradle / Ivy

Go to download

This project contains an abstract implementation of an ElasticSearch River and is used as a basis for custom river implementations.

There is a newer version: 1.1.3
Show newest version
package com.thematchbox.river.batch;

import com.thematchbox.river.actions.ActionType;
import com.thematchbox.river.actions.IndexJob;
import com.thematchbox.river.data.ContentDelegator;
import com.thematchbox.river.data.PersistentObject;
import com.thematchbox.river.indexers.MatchBoxIndexerManager;
import com.thematchbox.river.sessions.SessionException;
import org.elasticsearch.client.Client;

import java.util.List;

@SuppressWarnings("UnusedDeclaration")
public abstract class AppendBatchIndexAction, T extends PersistentObject> extends AbstractBatchIndexAction {

    public AppendBatchIndexAction(int batchSize, Class clazz, ContentDelegator contentDelegator, ItemContainer itemContainer, MatchBoxIndexerManager indexerManager) {
        super(batchSize, clazz, contentDelegator, itemContainer, indexerManager);
    }

    @Override
    protected List getIdsToReindex(Client client, IndexJob indexJob, BatchSessionDelegator sessionDelegator) throws SessionException {
        return sessionDelegator.getAllIds(getClazz(), client, indexJob);
    }

    @Override
    protected ActionType getActionType() {
        return ActionType.INCREMENTAL_UPDATE;
    }
}