Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void run() throws IOException, SQLException {

// in a production application we could have more elaborate error
// handling here
.onBatchFailure((failedBatch,exception) -> exception.printStackTrace())
.onFailure((failedBatch,exception) -> exception.printStackTrace())
)

// another onUrisReady listener, this one custom, and just for logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public void transform() throws IOException, SQLException {
ApplyTransformListener transformListener = new ApplyTransformListener()
.withTransform(new ServerTransform("BulkLoadFromJdbcRaw"))
.withApplyResult(ApplyTransformListener.ApplyResult.REPLACE)
.onBatchFailure((batch, throwable) -> throwable.printStackTrace());
.onFailure((batch, throwable) -> throwable.printStackTrace());

// add the ApplyTransformListener to the QueryBatcher
qb.onUrisReady(transformListener);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,6 @@ void writeConfiguration()
* @return a new manager for query options
*/
QueryOptionsManager newQueryOptionsManager();
/**
* Deprecated. To configure namespaces on a MarkLogic server, use Management REST API.
* @return a new manager for namespace bindings
*
* See <a href="https://docs.marklogic.com/REST/management/app-servers">Management REST API</a>
*/
@Deprecated
NamespacesManager newNamespacesManager();
/**
* Creates a manager for listing, reading, writing, and deleting
* resource service extensions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,21 @@
*/
package com.marklogic.client.datamovement;

import com.marklogic.client.impl.DatabaseClientImpl;
import com.marklogic.client.datamovement.impl.QueryBatchImpl;
import com.marklogic.client.document.ServerTransform;
import com.marklogic.client.impl.DatabaseClientImpl;
import com.marklogic.client.impl.RESTServices;
import com.marklogic.client.io.ReaderHandle;
import com.marklogic.client.io.StringHandle;
import com.marklogic.client.util.RequestParameters;
import com.marklogic.client.datamovement.impl.QueryBatchImpl;

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

import java.io.BufferedReader;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

/**
Expand Down Expand Up @@ -93,7 +95,7 @@
* <p>In order to handle such scenarios where we get an empty response, it is
* recommended to add a BatchFailureListener which would take care of apply
* transform failures and retry only for those URIs for which the apply
* transform has failed. If the transform is idempotent, we can just initialize
* transform has failed. If the transform is idempotent, we can just initialize
* the RetryListener of the NoResponseListener by calling
* NoResponseListener.initializeRetryListener(this) and add it to the
* BatchFailureListeners similar to what we have in the other listeners.</p>
Expand All @@ -104,7 +106,6 @@ public class ApplyTransformListener implements QueryBatchListener {
private ApplyResult applyResult = ApplyResult.REPLACE;
private List<QueryBatchListener> successListeners = new ArrayList<>();
private List<QueryBatchListener> skippedListeners = new ArrayList<>();
private List<BatchFailureListener<Batch<String>>> failureListeners = new ArrayList<>();
private List<BatchFailureListener<QueryBatch>> queryBatchFailureListeners = new ArrayList<>();

public ApplyTransformListener() {
Expand Down Expand Up @@ -176,13 +177,6 @@ public void processEvent(QueryBatch batch) {
}
}
} catch (Throwable t) {
for ( BatchFailureListener<Batch<String>> listener : failureListeners ) {
try {
listener.processFailure(batch, t);
} catch (Throwable t2) {
logger.error("Exception thrown by an onBatchFailure listener", t2);
}
}
for ( BatchFailureListener<QueryBatch> queryBatchFailureListener : queryBatchFailureListeners ) {
try {
queryBatchFailureListener.processFailure(batch, t);
Expand Down Expand Up @@ -221,21 +215,6 @@ public ApplyTransformListener onSkipped(QueryBatchListener listener) {
return this;
}

/**
* When a batch fails or a callback throws an Exception, run this listener
* code. Multiple listeners can be registered with this method.
*
* @param listener the code to run when a failure occurs
*
* @return this instance for method chaining
* @deprecated use {@link #onFailure(BatchFailureListener)}
*/
@Deprecated
public ApplyTransformListener onBatchFailure(BatchFailureListener<Batch<String>> listener) {
failureListeners.add(listener);
return this;
}

/**
* When a batch fails or a callback throws an Exception, run this listener
* code. Multiple listeners can be registered with this method.
Expand Down
Loading