-
Notifications
You must be signed in to change notification settings - Fork 970
Support to get kyuubi server event with RESTful api #7232
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
Open
turboFei
wants to merge
3
commits into
apache:master
Choose a base branch
from
turboFei:server_event
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+226
−2
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
162 changes: 162 additions & 0 deletions
162
kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/KyuubiServerEvent.java
This file contains hidden or 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,162 @@ | ||
| /* | ||
| * 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.Collections; | ||
| import java.util.Map; | ||
| import java.util.Objects; | ||
| import org.apache.commons.lang3.builder.ReflectionToStringBuilder; | ||
| import org.apache.commons.lang3.builder.ToStringStyle; | ||
|
|
||
| public class KyuubiServerEvent { | ||
| private String serverName; | ||
| private Long startTime; | ||
| private Long eventTime; | ||
| private String state; | ||
| private String serverIP; | ||
| private Map<String, String> serverConf; | ||
| private Map<String, String> serverEnv; | ||
| private Map<String, String> buildInfo; | ||
|
|
||
| public KyuubiServerEvent() {} | ||
|
|
||
| public KyuubiServerEvent( | ||
| String serverName, | ||
| Long startTime, | ||
| Long eventTime, | ||
| String state, | ||
| String serverIP, | ||
| Map<String, String> serverConf, | ||
| Map<String, String> serverEnv, | ||
| Map<String, String> buildInfo) { | ||
| this.serverName = serverName; | ||
| this.startTime = startTime; | ||
| this.eventTime = eventTime; | ||
| this.state = state; | ||
| this.serverIP = serverIP; | ||
| this.serverConf = serverConf; | ||
| this.serverEnv = serverEnv; | ||
| this.buildInfo = buildInfo; | ||
| } | ||
|
|
||
| public String getServerName() { | ||
| return serverName; | ||
| } | ||
|
|
||
| public void setServerName(String serverName) { | ||
| this.serverName = serverName; | ||
| } | ||
|
|
||
| public Long getStartTime() { | ||
| return startTime; | ||
| } | ||
|
|
||
| public void setStartTime(Long startTime) { | ||
| this.startTime = startTime; | ||
| } | ||
|
|
||
| public Long getEventTime() { | ||
| return eventTime; | ||
| } | ||
|
|
||
| public void setEventTime(Long eventTime) { | ||
| this.eventTime = eventTime; | ||
| } | ||
|
|
||
| public String getState() { | ||
| return state; | ||
| } | ||
|
|
||
| public void setState(String state) { | ||
| this.state = state; | ||
| } | ||
|
|
||
| public String getServerIP() { | ||
| return serverIP; | ||
| } | ||
|
|
||
| public void setServerIP(String serverIP) { | ||
| this.serverIP = serverIP; | ||
| } | ||
|
|
||
| public Map<String, String> getServerConf() { | ||
| if (null == serverConf) { | ||
| return Collections.emptyMap(); | ||
| } | ||
| return serverConf; | ||
| } | ||
|
|
||
| public void setServerConf(Map<String, String> serverConf) { | ||
| this.serverConf = serverConf; | ||
| } | ||
|
|
||
| public Map<String, String> getServerEnv() { | ||
| if (null == serverEnv) { | ||
| return Collections.emptyMap(); | ||
| } | ||
| return serverEnv; | ||
| } | ||
|
|
||
| public void setServerEnv(Map<String, String> serverEnv) { | ||
| this.serverEnv = serverEnv; | ||
| } | ||
|
|
||
| public Map<String, String> getBuildInfo() { | ||
| if (null == buildInfo) { | ||
| return Collections.emptyMap(); | ||
| } | ||
| return buildInfo; | ||
| } | ||
|
|
||
| public void setBuildInfo(Map<String, String> buildInfo) { | ||
| this.buildInfo = buildInfo; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) return true; | ||
| if (o == null || getClass() != o.getClass()) return false; | ||
| KyuubiServerEvent that = (KyuubiServerEvent) o; | ||
| return Objects.equals(getServerName(), that.getServerName()) | ||
| && Objects.equals(getStartTime(), that.getStartTime()) | ||
| && Objects.equals(getEventTime(), that.getEventTime()) | ||
| && Objects.equals(getState(), that.getState()) | ||
| && Objects.equals(getServerIP(), that.getServerIP()) | ||
| && Objects.equals(getServerConf(), that.getServerConf()) | ||
| && Objects.equals(getServerEnv(), that.getServerEnv()) | ||
| && Objects.equals(getBuildInfo(), that.getBuildInfo()); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash( | ||
| getServerName(), | ||
| getStartTime(), | ||
| getEventTime(), | ||
| getState(), | ||
| getServerIP(), | ||
| getServerConf(), | ||
| getServerEnv(), | ||
| getBuildInfo()); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
for a security perspective, we should redact sensitive info by default, maybe we can have a server side config to control the behavior, the candidate value can be
ORIGINAL,REDACTED,NONEThere 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.
BTW, I remember there was a similar discussion about retrieving batch info