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

org.vertexium.elasticsearch5.Elasticsearch5ExceptionHandler Maven / Gradle / Ivy

There is a newer version: 4.10.0
Show newest version
package org.vertexium.elasticsearch5;

import org.elasticsearch.action.bulk.BulkItemResponse;
import org.vertexium.Graph;
import org.vertexium.elasticsearch5.bulk.BulkItem;
import org.vertexium.util.VertexiumLoggerFactory;

import java.util.concurrent.atomic.AtomicBoolean;

public interface Elasticsearch5ExceptionHandler {
    default void handleBulkFailure(
        Graph graph,
        Elasticsearch5SearchIndex elasticsearch5SearchIndex,
        BulkItem bulkItem,
        BulkItemResponse bulkItemResponse,
        AtomicBoolean retry
    ) throws Exception {
        VertexiumLoggerFactory.getLogger(Elasticsearch5ExceptionHandler.class)
            .error("bulk failure: %s: %s", bulkItem, bulkItemResponse.getFailureMessage());
        retry.set(true);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy