denis-chudov commented on code in PR #7349: URL: https://github.com/apache/ignite-3/pull/7349#discussion_r2743447897
########## modules/transactions/src/integrationTest/java/org/apache/ignite/internal/tx/impl/ItTransactionLabelLoggingTest.java: ########## @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.tx.impl; + +import static org.awaitility.Awaitility.await; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.is; + +import java.time.Duration; +import java.util.concurrent.atomic.AtomicInteger; +import org.apache.ignite.Ignite; +import org.apache.ignite.internal.ClusterPerTestIntegrationTest; +import org.apache.ignite.internal.testframework.log4j2.LogInspector; +import org.apache.ignite.tx.TransactionOptions; +import org.junit.jupiter.api.Test; + Review Comment: I remember you left a TODO in ItTransactionsSystemViewTest? ########## modules/api/src/main/java/org/apache/ignite/tx/TransactionOptions.java: ########## @@ -80,4 +86,29 @@ public TransactionOptions readOnly(boolean readOnly) { return this; } + + /** + * Returns transaction label. The label is used for identification in logs and system views. + * + * @return Transaction label, or {@code null} if not set. + */ + @Nullable + public String label() { + return label; + } + + /** + * Sets transaction label. The label is used for identification in logs and system views. + * + * <p>Transaction labels help identify and track transactions in system logs and the transaction system view. + * They can be useful for debugging and monitoring purposes. + * + * @param label Transaction label. Can be {@code null} to clear the label. + * @return {@code this} for chaining. + */ Review Comment: Please mention that once a transaction label is set, it's immutable for the transaction. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
