deniskuzZ commented on code in PR #3608:
URL: https://github.com/apache/hive/pull/3608#discussion_r1003354559
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -3916,56 +3879,59 @@ public ShowCompactResponse
showCompact(ShowCompactRequest rqst) throws MetaExcep
try (Connection dbConn =
getDbConn(Connection.TRANSACTION_READ_COMMITTED);
PreparedStatement stmt =
sqlGenerator.prepareStmtWithParameters(dbConn, query.toString(),
getShowCompactionQueryParamList(rqst))) {
- LOG.debug("Going to execute query <" + query + ">");
- try (ResultSet rs = stmt.executeQuery()) {
- while (rs.next()) {
- ShowCompactResponseElement e = new ShowCompactResponseElement();
- e.setDbname(rs.getString(1));
- e.setTablename(rs.getString(2));
- e.setPartitionname(rs.getString(3));
- e.setState(compactorStateToResponse(rs.getString(4).charAt(0)));
- try {
-
e.setType(dbCompactionType2ThriftType(rs.getString(5).charAt(0)));
- } catch (MetaException ex) {
- //do nothing to handle RU/D if we add another status
- }
- e.setWorkerid(rs.getString(6));
- long start = rs.getLong(7);
- if (!rs.wasNull()) {
- e.setStart(start);
- }
- long endTime = rs.getLong(8);
- if (endTime != -1) {
- e.setEndTime(endTime);
- }
- e.setRunAs(rs.getString(9));
- e.setHadoopJobId(rs.getString(10));
- e.setId(rs.getLong(11));
- e.setErrorMessage(rs.getString(12));
- long enqueueTime = rs.getLong(13);
- if (!rs.wasNull()) {
- e.setEnqueueTime(enqueueTime);
- }
- e.setWorkerVersion(rs.getString(14));
- e.setInitiatorId(rs.getString(15));
- e.setInitiatorVersion(rs.getString(16));
- long cleanerStart = rs.getLong(17);
- if (!rs.wasNull() && (cleanerStart != -1)) {
- e.setCleanerStart(cleanerStart);
- }
- String poolName = rs.getString(18);
- if (isBlank(poolName)) {
- e.setPoolName(DEFAULT_POOL_NAME);
- } else {
- e.setPoolName(poolName);
- }
- e.setTxnId(rs.getLong(19));
- e.setNextTxnId(rs.getLong(20));
- e.setCommitTime(rs.getLong(21));
- e.setHightestTxnId(rs.getLong(22));
- response.addToCompacts(e);
+ if (rqst.isSetId()) {
+ stmt.setLong(getShowCompactionQueryParamList(rqst).size() + 1,
rqst.getId());
Review Comment:
fixed
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnStore.java:
##########
@@ -104,6 +104,33 @@ enum MUTEX_KEY {
String DID_NOT_INITIATE_RESPONSE = "did not initiate";
String REFUSED_RESPONSE = "refused";
+ static final char INITIATED_STATE = 'i';
+ static final char WORKING_STATE = 'w';
+ static final char READY_FOR_CLEANING = 'r';
+ static final char FAILED_STATE = 'f';
+ static final char SUCCEEDED_STATE = 's';
+ static final char DID_NOT_INITIATE = 'a';
+ static final char REFUSED_STATE = 'c';
+
+ // Compactor types
+ static final char MAJOR_TYPE = 'a';
+ static final char MINOR_TYPE = 'i';
+
+
+ static final String COMPACTOR_MAJOR_TYPE = "MAJOR";
+ static final String COMPACTOR_MINOR_TYPE = "MINOR";
+
+ static final String TXN_TMP_STATE = "_";
+
+ static final String DEFAULT_POOL_NAME = "default";
+
+
+ // Lock states
+ static final char LOCK_ACQUIRED = 'a';
+ static final char LOCK_WAITING = 'w';
+
+ static final int ALLOWED_REPEATED_DEADLOCKS = 10;
Review Comment:
fixed
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]