-
Notifications
You must be signed in to change notification settings - Fork 886
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KYUUBI #2800] Refine batch mode code path
### _Why are the changes needed?_ 1. rename `Metadata` to `SessionMetadata` 2. wrap `CloseBatchResponse` for closeBatchSession 3. remove killApp in closeBatchSession, so every request will kill the app by default 4. correct when to update metadata 5. cleanupMetadataByAge should check state and only cleanup terminated metadata 6. correct the batch session state, we should never get a closed state ### _How was this patch tested?_ - [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2800 from ulysses-you/followup. Closes #2800 a132439 [ulysses-you] comments 0f1c3aa [ulysses-you] fix e79ec50 [ulysses-you] fix e8862f8 [ulysses-you] improve facad17 [ulysses-you] comments 777f00c [ulysses-you] Merge branch 'master' of https://github.com/apache/incubator-kyuubi into followup df71d59 [ulysses-you] address comment 28010cb [ulysses-you] docs dacdc87 [ulysses-you] lock 6516d32 [ulysses-you] cleanup Authored-by: ulysses-you <ulyssesyou18@gmail.com> Signed-off-by: Fei Wang <fwang12@ebay.com>
- Loading branch information
1 parent
2184526
commit bb98aa7
Showing
19 changed files
with
234 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/CloseBatchResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* 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.kyuubi.client.api.v1.dto; | ||
|
||
import java.util.Objects; | ||
|
||
public class CloseBatchResponse { | ||
private boolean success = false; | ||
private String msg = null; | ||
|
||
public CloseBatchResponse() {} | ||
|
||
public CloseBatchResponse(boolean success, String msg) { | ||
this.success = success; | ||
this.msg = msg; | ||
} | ||
|
||
public boolean isSuccess() { | ||
return success; | ||
} | ||
|
||
public void setSuccess(boolean success) { | ||
this.success = success; | ||
} | ||
|
||
public String getMsg() { | ||
return msg; | ||
} | ||
|
||
public void setMsg(String msg) { | ||
this.msg = msg; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
CloseBatchResponse that = (CloseBatchResponse) o; | ||
return success == that.success && Objects.equals(msg, that.msg); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(success, msg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
kyuubi-server/src/main/resources/sql/derby/statestore-schema-derby.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
kyuubi-server/src/main/resources/sql/mysql/statestore-schema-mysql.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.