-
Notifications
You must be signed in to change notification settings - Fork 914
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KYUUBI #3653][REST] AdminResource add list kyuubi server api
### _Why are the changes needed?_ Add List Kyuubi Server Api for `AdminResource` ### _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.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request Closes #4670 from zwangsheng/KYUUBI_3653. Closes #3653 b91a6c6 [zwangsheng] fxi 4271d0f [zwangsheng] fix comments e14f8cd [zwangsheng] [KYUUBI #3653][REST] AdminResource add list server api Authored-by: zwangsheng <2213335496@qq.com> Signed-off-by: fwang12 <fwang12@ebay.com>
- Loading branch information
1 parent
8c7b457
commit f6331a2
Showing
4 changed files
with
219 additions
and
59 deletions.
There are no files selected for viewing
129 changes: 129 additions & 0 deletions
129
kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/ServerData.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,129 @@ | ||
/* | ||
* 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.Map; | ||
import java.util.Objects; | ||
|
||
public class ServerData { | ||
private String nodeName; | ||
private String namespace; | ||
private String instance; | ||
private String host; | ||
private int port; | ||
private Map<String, String> attributes; | ||
private String status; | ||
|
||
public ServerData( | ||
String nodeName, | ||
String namespace, | ||
String instance, | ||
String host, | ||
int port, | ||
Map<String, String> attributes, | ||
String status) { | ||
this.nodeName = nodeName; | ||
this.namespace = namespace; | ||
this.instance = instance; | ||
this.host = host; | ||
this.port = port; | ||
this.attributes = attributes; | ||
this.status = status; | ||
} | ||
|
||
public String getNodeName() { | ||
return nodeName; | ||
} | ||
|
||
public ServerData setNodeName(String nodeName) { | ||
this.nodeName = nodeName; | ||
return this; | ||
} | ||
|
||
public String getNamespace() { | ||
return namespace; | ||
} | ||
|
||
public ServerData setNamespace(String namespace) { | ||
this.namespace = namespace; | ||
return this; | ||
} | ||
|
||
public String getInstance() { | ||
return instance; | ||
} | ||
|
||
public ServerData setInstance(String instance) { | ||
this.instance = instance; | ||
return this; | ||
} | ||
|
||
public String getHost() { | ||
return host; | ||
} | ||
|
||
public ServerData setHost(String host) { | ||
this.host = host; | ||
return this; | ||
} | ||
|
||
public int getPort() { | ||
return port; | ||
} | ||
|
||
public ServerData setPort(int port) { | ||
this.port = port; | ||
return this; | ||
} | ||
|
||
public Map<String, String> getAttributes() { | ||
return attributes; | ||
} | ||
|
||
public ServerData setAttributes(Map<String, String> attributes) { | ||
this.attributes = attributes; | ||
return this; | ||
} | ||
|
||
public String getStatus() { | ||
return status; | ||
} | ||
|
||
public ServerData setStatus(String status) { | ||
this.status = status; | ||
return this; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(nodeName, namespace, instance, port, attributes, status); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) return true; | ||
if (obj == null || getClass() != obj.getClass()) return false; | ||
ServerData server = (ServerData) obj; | ||
return port == server.port | ||
&& Objects.equals(nodeName, server.nodeName) | ||
&& Objects.equals(namespace, server.namespace) | ||
&& Objects.equals(instance, server.instance) | ||
&& Objects.equals(host, server.host) | ||
&& Objects.equals(status, server.status); | ||
} | ||
} |
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.