This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Refine storage utilization page #2050
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
64d80ce
Set reverse proxy of webpack
archichen 1ef5060
Change original charts to thumbnail and add a universal charts to sho…
archichen c3a0a89
Build release web ui
archichen e9820c3
Build release web ui v2
archichen d6437db
Fix button text
archichen 37856c6
pr
archichen bf8d1ac
pr ready
archichen 61b080e
Delete mock data.
archichen 8c5ebfa
Modify .gitignore
archichen 77035f3
Add get all agent hosts api
archichen a770314
add server conf loader
archichen 9a4d106
Merge branch 'refine-ui' into add-feature-nodeinfopage
archichen 7c30cf9
Node info page almost done. PR ready.
archichen afc5fb9
Replace all host name like localhost to real host name.
archichen e4fb9a8
Change host name to more clearly format when the node dead.
archichen c6e03c5
Add summary table.
archichen d81cd34
Delete pack-lock.json and add this file into git ignore.
archichen 3b487f1
Merge remote-tracking branch 'upstream/trunk' into refine-ui
archichen f34eada
Merge branch 'refine-ui' into add-feature-nodeinfopage
archichen b8afbf7
Fix chart tip tool shown below the modal.
archichen 444ed34
Get agent and server host at ssm start.
archichen a752fd0
Fix bugs
archichen f606187
Fix style
archichen e8a025e
Fix bug "xxx module not available"
archichen 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/** | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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.smartdata; | ||
|
||
import org.smartdata.conf.SmartConf; | ||
import org.smartdata.conf.SmartConfKeys; | ||
|
||
import java.io.File; | ||
import java.io.FileNotFoundException; | ||
import java.net.InetAddress; | ||
import java.net.UnknownHostException; | ||
import java.util.HashSet; | ||
import java.util.Scanner; | ||
import java.util.Set; | ||
|
||
public class NodeHosts { | ||
|
||
private SmartConf conf; | ||
public Set<String> agentHosts; | ||
public Set<String> serverHosts; | ||
|
||
public NodeHosts(SmartConf conf) { | ||
this.conf = conf; | ||
this.serverHosts = init("server"); | ||
this.agentHosts = init("agent"); | ||
} | ||
|
||
public Set<String> init(String role) { | ||
String fileName = "/agents"; | ||
switch (role) { | ||
case "agent": | ||
fileName = "/agents"; | ||
break; | ||
case "server": | ||
fileName = "/servers"; | ||
break; | ||
} | ||
String hostName = ""; | ||
try { | ||
InetAddress address = InetAddress.getLocalHost(); | ||
hostName = address.getHostName(); | ||
} catch (UnknownHostException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
String agentConfFile = conf.get(SmartConfKeys.SMART_CONF_DIR_KEY, | ||
SmartConfKeys.SMART_CONF_DIR_DEFAULT) + fileName; | ||
Scanner sc = null; | ||
HashSet<String> hosts = new HashSet<>(); | ||
try { | ||
sc = new Scanner(new File(agentConfFile)); | ||
} catch (FileNotFoundException ex) { | ||
ex.printStackTrace(); | ||
} | ||
|
||
while (sc != null && sc.hasNextLine()) { | ||
String host = sc.nextLine().trim(); | ||
if (!host.startsWith("#") && !host.isEmpty()) { | ||
if (host.equals("localhost")) { | ||
hosts.add(hostName); | ||
} else { | ||
hosts.add(host); | ||
} | ||
} | ||
} | ||
|
||
return hosts; | ||
} | ||
|
||
public Set<String> getServerHosts() { | ||
return serverHosts; | ||
} | ||
|
||
public Set<String> getAgentHosts() { | ||
return agentHosts; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,16 @@ public Response agents() { | |
// return list of agents and their states | ||
return new JsonResponse<>(Response.Status.OK, smartEngine.getAgents()).build(); | ||
} | ||
|
||
@GET | ||
@Path("/allAgentHosts") | ||
public Response allAgentHosts() { | ||
return new JsonResponse<>(Response.Status.OK, smartEngine.getAgentHosts()).build(); | ||
} | ||
|
||
@GET | ||
@Path("/allServerHosts") | ||
public Response allMasterHosts() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. allServerHosts |
||
return new JsonResponse<>(Response.Status.OK, smartEngine.getServerHosts()).build(); | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
smart-zeppelin/zeppelin-web/src/app/dashboard/views/cluster/nodeinfo/nodeStatus.css
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,11 @@ | ||
.statusPoint { | ||
width: 15px; | ||
height: 15px; | ||
border-radius: 15px; | ||
} | ||
|
||
.statusPoint-container { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} |
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
18 changes: 18 additions & 0 deletions
18
smart-zeppelin/zeppelin-web/src/app/dashboard/views/cluster/storage/bigChart.css
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,18 @@ | ||
.thumbnail-thumbnail-margin-right { | ||
margin-right: 10px; | ||
} | ||
|
||
.storage-thumbnail { | ||
position: relative; | ||
transition: all 0.4s; | ||
cursor: pointer; | ||
} | ||
|
||
.storage-thumbnail:hover { | ||
top: -5px; | ||
box-shadow: 0 5px 25px -6px #8f8f8f ; | ||
} | ||
|
||
.nvtooltip { | ||
z-index: 10003; | ||
} |
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.
Add license declaration as same as other src files.