You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "harshal-16 (via GitHub)" <gi...@apache.org> on 2025/07/09 04:21:52 UTC
[PR] HIVE-29077: addendum: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
harshal-16 opened a new pull request, #5946:
URL: https://github.com/apache/hive/pull/5946
Details:
* This is an addendum to HIVE-28976, While abortTxn for list of txnIds instead of 1 HMS call per txnID
* now it will call HMS only 1 time and then pass it down to listners based on txnID
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
3. Ensure you have added or run the appropriate tests for your PR:
4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX: Your PR title ...'.
5. Be sure to keep the PR description updated to reflect all changes.
6. Please write your PR title to summarize what this PR proposes.
7. If possible, provide a concise example to reproduce the issue for a faster review.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master.
If no, write 'No'.
-->
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
-->
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5946:
URL: https://github.com/apache/hive/pull/5946#issuecomment-3053766800
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946)
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on PR #5946:
URL: https://github.com/apache/hive/pull/5946#issuecomment-3059414162
try to rebase
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: addendum: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on PR #5946:
URL: https://github.com/apache/hive/pull/5946#issuecomment-3051581998
@harshal-16 can we drop the `GetWriteIdsForTxnIDHandler`?
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "harshal-16 (via GitHub)" <gi...@apache.org>.
harshal-16 commented on code in PR #5946:
URL: https://github.com/apache/hive/pull/5946#discussion_r2194802139
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -1154,42 +1155,21 @@ private boolean checkIfTableIsUsable(String tableName, boolean configValue) {
}
/**
- * Returns the databases updated by txnId.
- * Queries TXN_TO_WRITE_ID using txnId.
+ * Returns the TxnWriteDetails updated by txnIds.
+ * Queries TXN_TO_WRITE_ID using txnIds.
*
- * @param txnId
- * @throws MetaException
+ * @param txnIds Transaction IDs for which write IDs are requested.
+ * @throws MetaException throws MetaException
*/
- private List<String> getTxnDbsUpdated(long txnId) throws MetaException {
+ public List<TxnWriteDetails> getWriteIdsMappingForTxns(List<Long> txnIds) throws MetaException {
Review Comment:
Done
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/jdbc/queries/GetWriteIdsMappingForTxnIdsHandler.java:
##########
@@ -27,39 +27,35 @@
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.Types;
import java.util.ArrayList;
import java.util.List;
-/**
- * Returns the databases and writeID updated by txnId.
- * Queries TXN_TO_WRITE_ID using txnId.
- */
-public class GetWriteIdsForTxnIDHandler implements QueryHandler<List<TxnWriteDetails>> {
+public class GetWriteIdsMappingForTxnIdsHandler implements QueryHandler<List<TxnWriteDetails>>{
Review Comment:
Added
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "harshal-16 (via GitHub)" <gi...@apache.org>.
harshal-16 commented on PR #5946:
URL: https://github.com/apache/hive/pull/5946#issuecomment-3051820035
> @harshal-16 can we drop the `GetWriteIdsForTxnIDHandler`?
> @harshal-16, can we pass txnId list [here](https://github.com/apache/hive/pull/5946/files#diff-ccc50cf147261af64a10e20359f9c52f1d4797bc8e03e682d6a88891ee941f02R561) as well ?
>
> ```
> public List<TxnWriteDetails> getWriteIdsMappingForTxns(long... txnIds) throws MetaException {
> try {
> return sqlRetryHandler.executeWithRetry(
> new SqlRetryCallProperties().withCallerId("GetWriteIdsMappingForTxnIdsHandler"),
> () -> jdbcResource.execute(new GetWriteIdsMappingForTxnIdsHandler(Arrays.asList(txnIds))));
> } catch (MetaException e) {
> throw e;
> } catch (TException e) {
> throw new MetaException(e.getMessage());
> }
> }
> ```
Both are addressed
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on PR #5946:
URL: https://github.com/apache/hive/pull/5946#issuecomment-3058120308
@harshal-16, please fix the typo in commit message and PR description. No need to restart the build, we can do it during the merge
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5946:
URL: https://github.com/apache/hive/pull/5946#discussion_r2194605430
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/jdbc/queries/GetWriteIdsMappingForTxnIdsHandler.java:
##########
@@ -27,39 +27,35 @@
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.Types;
import java.util.ArrayList;
import java.util.List;
-/**
- * Returns the databases and writeID updated by txnId.
- * Queries TXN_TO_WRITE_ID using txnId.
- */
-public class GetWriteIdsForTxnIDHandler implements QueryHandler<List<TxnWriteDetails>> {
+public class GetWriteIdsMappingForTxnIdsHandler implements QueryHandler<List<TxnWriteDetails>>{
Review Comment:
do we have a test for this?
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5946:
URL: https://github.com/apache/hive/pull/5946#discussion_r2194871107
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -560,8 +560,10 @@ public void abortTxns(AbortTxnsRequest rqst) throws MetaException {
if (transactionalListeners != null) {
//Find the write details for this transaction.
//Doing it here before the metadata tables are updated below.
- for(Long txnId : txnIds)
- txnWriteDetailsMap.put(txnId, getWriteIdsForTxnID(txnId));
+ List<TxnWriteDetails> txnWriteDetails = getWriteIdsMappingForTxns(new HashSet<>(txnIds));
+ txnWriteDetailsMap.putAll(txnWriteDetails.stream()
Review Comment:
why not simply
````
txnWriteDetailsMap = txnWriteDetails.stream()
.collect(Collectors.groupingBy(TxnWriteDetails::getTxnId));
````
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -560,8 +560,10 @@ public void abortTxns(AbortTxnsRequest rqst) throws MetaException {
if (transactionalListeners != null) {
//Find the write details for this transaction.
//Doing it here before the metadata tables are updated below.
- for(Long txnId : txnIds)
- txnWriteDetailsMap.put(txnId, getWriteIdsForTxnID(txnId));
+ List<TxnWriteDetails> txnWriteDetails = getWriteIdsMappingForTxns(new HashSet<>(txnIds));
+ txnWriteDetailsMap.putAll(txnWriteDetails.stream()
Review Comment:
why not simply
````
txnWriteDetailsMap = txnWriteDetails.stream()
.collect(Collectors.groupingBy(TxnWriteDetails::getTxnId));
````
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into the transactionListeners while abortTxn [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ merged PR #5946:
URL: https://github.com/apache/hive/pull/5946
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into the transactionListeners while abortTxn [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5946:
URL: https://github.com/apache/hive/pull/5946#issuecomment-3065025904
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946)
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5946:
URL: https://github.com/apache/hive/pull/5946#discussion_r2194594563
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/jdbc/queries/GetWriteIdsMappingForTxnIdsHandler.java:
##########
@@ -27,39 +27,35 @@
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.Types;
import java.util.ArrayList;
import java.util.List;
-/**
- * Returns the databases and writeID updated by txnId.
- * Queries TXN_TO_WRITE_ID using txnId.
- */
-public class GetWriteIdsForTxnIDHandler implements QueryHandler<List<TxnWriteDetails>> {
+public class GetWriteIdsMappingForTxnIdsHandler implements QueryHandler<List<TxnWriteDetails>>{
- private final long txnId;
+ private final List<Long> txnIds;
Review Comment:
maybe better use Set
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5946:
URL: https://github.com/apache/hive/pull/5946#discussion_r2194871107
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -560,8 +560,10 @@ public void abortTxns(AbortTxnsRequest rqst) throws MetaException {
if (transactionalListeners != null) {
//Find the write details for this transaction.
//Doing it here before the metadata tables are updated below.
- for(Long txnId : txnIds)
- txnWriteDetailsMap.put(txnId, getWriteIdsForTxnID(txnId));
+ List<TxnWriteDetails> txnWriteDetails = getWriteIdsMappingForTxns(new HashSet<>(txnIds));
+ txnWriteDetailsMap.putAll(txnWriteDetails.stream()
Review Comment:
why not simply
````
txnWriteDetailsMap = txnWriteDetails.stream()
.collect(Collectors.groupingBy(TxnWriteDetails::getTxnId));
````
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into the transactionListeners while abortTxn [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5946:
URL: https://github.com/apache/hive/pull/5946#issuecomment-3062448012
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946)
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: addendum: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5946:
URL: https://github.com/apache/hive/pull/5946#issuecomment-3051166318
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946)
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5946:
URL: https://github.com/apache/hive/pull/5946#discussion_r2194582120
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -1154,42 +1155,21 @@ private boolean checkIfTableIsUsable(String tableName, boolean configValue) {
}
/**
- * Returns the databases updated by txnId.
- * Queries TXN_TO_WRITE_ID using txnId.
+ * Returns the TxnWriteDetails updated by txnIds.
+ * Queries TXN_TO_WRITE_ID using txnIds.
*
- * @param txnId
- * @throws MetaException
+ * @param txnIds Transaction IDs for which write IDs are requested.
+ * @throws MetaException throws MetaException
*/
- private List<String> getTxnDbsUpdated(long txnId) throws MetaException {
+ public List<TxnWriteDetails> getWriteIdsMappingForTxns(List<Long> txnIds) throws MetaException {
Review Comment:
why change to public? i don't see any external usages
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5946:
URL: https://github.com/apache/hive/pull/5946#discussion_r2194871107
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -560,8 +560,10 @@ public void abortTxns(AbortTxnsRequest rqst) throws MetaException {
if (transactionalListeners != null) {
//Find the write details for this transaction.
//Doing it here before the metadata tables are updated below.
- for(Long txnId : txnIds)
- txnWriteDetailsMap.put(txnId, getWriteIdsForTxnID(txnId));
+ List<TxnWriteDetails> txnWriteDetails = getWriteIdsMappingForTxns(new HashSet<>(txnIds));
+ txnWriteDetailsMap.putAll(txnWriteDetails.stream()
Review Comment:
why not simply
````
txnWriteDetailsMap = txnWriteDetails.stream()
.collect(Collectors.groupingBy(TxnWriteDetails::getTxnId));
````
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5946:
URL: https://github.com/apache/hive/pull/5946#issuecomment-3052233309
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946)
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5946:
URL: https://github.com/apache/hive/pull/5946#issuecomment-3057662537
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5946&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5946&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5946&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5946)
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29077: addendum: Reduce HMS calls while adding entries into transactionListers while abortTxn [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on PR #5946:
URL: https://github.com/apache/hive/pull/5946#issuecomment-3051541741
@harshal-16, can we pass txnId list [here](https://github.com/apache/hive/pull/5946/files#diff-ccc50cf147261af64a10e20359f9c52f1d4797bc8e03e682d6a88891ee941f02R561) as well ?
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org