[Transform] add debug log for configuration index (#49484)
add debug log for transform creation and disallow partial results for retrieval
This commit is contained in:
parent
8260cba629
commit
5256756879
|
@ -5,6 +5,8 @@
|
|||
*/
|
||||
package org.elasticsearch.xpack.transform.action;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.ElasticsearchStatusException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
|
@ -36,6 +38,8 @@ import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin;
|
|||
|
||||
public class TransportDeleteTransformAction extends TransportMasterNodeAction<Request, AcknowledgedResponse> {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(TransportDeleteTransformAction.class);
|
||||
|
||||
private final TransformConfigManager transformConfigManager;
|
||||
private final TransformAuditor auditor;
|
||||
private final Client client;
|
||||
|
@ -101,6 +105,7 @@ public class TransportDeleteTransformAction extends TransportMasterNodeAction<Re
|
|||
} else {
|
||||
ActionListener<Void> stopTransformActionListener = ActionListener.wrap(
|
||||
stopResponse -> transformConfigManager.deleteTransform(request.getId(), ActionListener.wrap(r -> {
|
||||
logger.debug("[{}] deleted transform", request.getId());
|
||||
auditor.info(request.getId(), "Deleted transform.");
|
||||
listener.onResponse(new AcknowledgedResponse(r));
|
||||
}, listener::onFailure)),
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
package org.elasticsearch.xpack.transform.action;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.ElasticsearchStatusException;
|
||||
import org.elasticsearch.ResourceAlreadyExistsException;
|
||||
import org.elasticsearch.Version;
|
||||
|
@ -60,6 +62,8 @@ import java.util.stream.Collectors;
|
|||
|
||||
public class TransportPutTransformAction extends TransportMasterNodeAction<Request, AcknowledgedResponse> {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(TransportPutTransformAction.class);
|
||||
|
||||
private final XPackLicenseState licenseState;
|
||||
private final Client client;
|
||||
private final TransformConfigManager transformConfigManager;
|
||||
|
@ -263,6 +267,7 @@ public class TransportPutTransformAction extends TransportMasterNodeAction<Reque
|
|||
|
||||
// <3> Return to the listener
|
||||
ActionListener<Boolean> putTransformConfigurationListener = ActionListener.wrap(putTransformConfigurationResult -> {
|
||||
logger.debug("[{}] created transform", config.getId());
|
||||
auditor.info(config.getId(), "Created transform.");
|
||||
listener.onResponse(new AcknowledgedResponse(true));
|
||||
}, listener::onFailure);
|
||||
|
|
|
@ -262,6 +262,7 @@ public class IndexBasedTransformConfigManager implements TransformConfigManager
|
|||
// use sort to get the last
|
||||
.addSort("_index", SortOrder.DESC)
|
||||
.setSize(1)
|
||||
.setAllowPartialSearchResults(false)
|
||||
.request();
|
||||
|
||||
executeAsyncWithOrigin(
|
||||
|
@ -293,6 +294,7 @@ public class IndexBasedTransformConfigManager implements TransformConfigManager
|
|||
// use sort to get the last
|
||||
.addSort("_index", SortOrder.DESC)
|
||||
.setSize(1)
|
||||
.setAllowPartialSearchResults(false)
|
||||
.request();
|
||||
|
||||
executeAsyncWithOrigin(
|
||||
|
@ -327,6 +329,7 @@ public class IndexBasedTransformConfigManager implements TransformConfigManager
|
|||
// use sort to get the last
|
||||
.addSort("_index", SortOrder.DESC)
|
||||
.setSize(1)
|
||||
.setAllowPartialSearchResults(false)
|
||||
.seqNoAndPrimaryTerm(true)
|
||||
.request();
|
||||
|
||||
|
@ -506,6 +509,7 @@ public class IndexBasedTransformConfigManager implements TransformConfigManager
|
|||
// use sort to get the last
|
||||
.addSort("_index", SortOrder.DESC)
|
||||
.setSize(1)
|
||||
.setAllowPartialSearchResults(false)
|
||||
.seqNoAndPrimaryTerm(true)
|
||||
.request();
|
||||
|
||||
|
|
Loading…
Reference in New Issue