[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;
|
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.ElasticsearchStatusException;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.support.ActionFilters;
|
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> {
|
public class TransportDeleteTransformAction extends TransportMasterNodeAction<Request, AcknowledgedResponse> {
|
||||||
|
|
||||||
|
private static final Logger logger = LogManager.getLogger(TransportDeleteTransformAction.class);
|
||||||
|
|
||||||
private final TransformConfigManager transformConfigManager;
|
private final TransformConfigManager transformConfigManager;
|
||||||
private final TransformAuditor auditor;
|
private final TransformAuditor auditor;
|
||||||
private final Client client;
|
private final Client client;
|
||||||
|
@ -101,6 +105,7 @@ public class TransportDeleteTransformAction extends TransportMasterNodeAction<Re
|
||||||
} else {
|
} else {
|
||||||
ActionListener<Void> stopTransformActionListener = ActionListener.wrap(
|
ActionListener<Void> stopTransformActionListener = ActionListener.wrap(
|
||||||
stopResponse -> transformConfigManager.deleteTransform(request.getId(), ActionListener.wrap(r -> {
|
stopResponse -> transformConfigManager.deleteTransform(request.getId(), ActionListener.wrap(r -> {
|
||||||
|
logger.debug("[{}] deleted transform", request.getId());
|
||||||
auditor.info(request.getId(), "Deleted transform.");
|
auditor.info(request.getId(), "Deleted transform.");
|
||||||
listener.onResponse(new AcknowledgedResponse(r));
|
listener.onResponse(new AcknowledgedResponse(r));
|
||||||
}, listener::onFailure)),
|
}, listener::onFailure)),
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
package org.elasticsearch.xpack.transform.action;
|
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.ElasticsearchStatusException;
|
||||||
import org.elasticsearch.ResourceAlreadyExistsException;
|
import org.elasticsearch.ResourceAlreadyExistsException;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
|
@ -60,6 +62,8 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class TransportPutTransformAction extends TransportMasterNodeAction<Request, AcknowledgedResponse> {
|
public class TransportPutTransformAction extends TransportMasterNodeAction<Request, AcknowledgedResponse> {
|
||||||
|
|
||||||
|
private static final Logger logger = LogManager.getLogger(TransportPutTransformAction.class);
|
||||||
|
|
||||||
private final XPackLicenseState licenseState;
|
private final XPackLicenseState licenseState;
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final TransformConfigManager transformConfigManager;
|
private final TransformConfigManager transformConfigManager;
|
||||||
|
@ -263,6 +267,7 @@ public class TransportPutTransformAction extends TransportMasterNodeAction<Reque
|
||||||
|
|
||||||
// <3> Return to the listener
|
// <3> Return to the listener
|
||||||
ActionListener<Boolean> putTransformConfigurationListener = ActionListener.wrap(putTransformConfigurationResult -> {
|
ActionListener<Boolean> putTransformConfigurationListener = ActionListener.wrap(putTransformConfigurationResult -> {
|
||||||
|
logger.debug("[{}] created transform", config.getId());
|
||||||
auditor.info(config.getId(), "Created transform.");
|
auditor.info(config.getId(), "Created transform.");
|
||||||
listener.onResponse(new AcknowledgedResponse(true));
|
listener.onResponse(new AcknowledgedResponse(true));
|
||||||
}, listener::onFailure);
|
}, listener::onFailure);
|
||||||
|
|
|
@ -262,6 +262,7 @@ public class IndexBasedTransformConfigManager implements TransformConfigManager
|
||||||
// use sort to get the last
|
// use sort to get the last
|
||||||
.addSort("_index", SortOrder.DESC)
|
.addSort("_index", SortOrder.DESC)
|
||||||
.setSize(1)
|
.setSize(1)
|
||||||
|
.setAllowPartialSearchResults(false)
|
||||||
.request();
|
.request();
|
||||||
|
|
||||||
executeAsyncWithOrigin(
|
executeAsyncWithOrigin(
|
||||||
|
@ -293,6 +294,7 @@ public class IndexBasedTransformConfigManager implements TransformConfigManager
|
||||||
// use sort to get the last
|
// use sort to get the last
|
||||||
.addSort("_index", SortOrder.DESC)
|
.addSort("_index", SortOrder.DESC)
|
||||||
.setSize(1)
|
.setSize(1)
|
||||||
|
.setAllowPartialSearchResults(false)
|
||||||
.request();
|
.request();
|
||||||
|
|
||||||
executeAsyncWithOrigin(
|
executeAsyncWithOrigin(
|
||||||
|
@ -327,6 +329,7 @@ public class IndexBasedTransformConfigManager implements TransformConfigManager
|
||||||
// use sort to get the last
|
// use sort to get the last
|
||||||
.addSort("_index", SortOrder.DESC)
|
.addSort("_index", SortOrder.DESC)
|
||||||
.setSize(1)
|
.setSize(1)
|
||||||
|
.setAllowPartialSearchResults(false)
|
||||||
.seqNoAndPrimaryTerm(true)
|
.seqNoAndPrimaryTerm(true)
|
||||||
.request();
|
.request();
|
||||||
|
|
||||||
|
@ -506,6 +509,7 @@ public class IndexBasedTransformConfigManager implements TransformConfigManager
|
||||||
// use sort to get the last
|
// use sort to get the last
|
||||||
.addSort("_index", SortOrder.DESC)
|
.addSort("_index", SortOrder.DESC)
|
||||||
.setSize(1)
|
.setSize(1)
|
||||||
|
.setAllowPartialSearchResults(false)
|
||||||
.seqNoAndPrimaryTerm(true)
|
.seqNoAndPrimaryTerm(true)
|
||||||
.request();
|
.request();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue