-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YARN-11273. Federation StateStore: Support storage/retrieval of Reservations With SQL. #4817
Conversation
…ieval of Reservations With SQL.
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
|
||
while (rs.next()) { | ||
// Extract the output for each tuple | ||
String dbReservationId = rs.getString(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way to having indices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your suggestion, I agree with your point of view, the readability of this part of the code is really not very good, I add some comments and name the variables for indices.
// if it is different from 1 it means the call | ||
// had a wrong behavior. Maybe the database is not set correctly. | ||
FederationStateStoreUtils.logAndThrowStoreException(LOG, | ||
"Wrong behavior during deleting the reservation %s.", reservationId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be more specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will describe the exception message in more detail.
...c/main/java/org/apache/hadoop/yarn/server/federation/store/impl/SQLFederationStateStore.java
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@goiri Please help to review the code, thank you very much! |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@goiri Please help to review the code again, thank you very much! I have refactored the code as follows:
|
💔 -1 overall
This message was automatically generated. |
...st/java/org/apache/hadoop/yarn/server/federation/store/impl/TestSQLFederationStateStore.java
Show resolved
Hide resolved
...st/java/org/apache/hadoop/yarn/server/federation/store/impl/TestSQLFederationStateStore.java
Show resolved
Hide resolved
@@ -76,38 +107,479 @@ public void testSqlConnectionsCreatedCount() throws YarnException { | |||
FederationStateStoreClientMetrics.getNumConnections()); | |||
} | |||
|
|||
@Test(expected = NotImplementedException.class) | |||
public void testAddReservationHomeSubCluster() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just remove this?
It will call the parent methods by default right?
We should check the unit test report.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just remove this?
It will call the parent methods by default right?
Your understanding is accurate, we can delete all this method. When the test is executed, it will call the parent methods by default, but deleting it directly will bring some difficulties to the review, because it will be difficult to compare the code. I will later Submit a refactored pr. For code refactoring, these redundant codes will be deleted directly at that time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do this in this PR?
We can check the unit tests results for all this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will modify the code, but when the code is compared, there may be misalignments.
FederationStateStoreUtils.returnToPool(LOG, cstmt); | ||
} | ||
|
||
ReservationHomeSubCluster homeSubCluster = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we get an exception we return null values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for helping to review the code, I will modify the code. In the case of an exception, the exception should be thrown directly, so the handling should be better.
...c/main/java/org/apache/hadoop/yarn/server/federation/store/impl/SQLFederationStateStore.java
Show resolved
Hide resolved
@@ -76,38 +107,479 @@ public void testSqlConnectionsCreatedCount() throws YarnException { | |||
FederationStateStoreClientMetrics.getNumConnections()); | |||
} | |||
|
|||
@Test(expected = NotImplementedException.class) | |||
public void testAddReservationHomeSubCluster() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do this in this PR?
We can check the unit tests results for all this.
💔 -1 overall
This message was automatically generated. |
@goiri Please help to review the code, thank you very much! |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@goiri Thanks for your help reviewing the code! |
…vations With SQL. (apache#4817)
JIRA: YARN-11273. [RESERVATION] Federation StateStore: Support storage/retrieval of Reservations With SQL.