Changeset 1640:c35299928c59
- Timestamp:
- 06/03/08 09:57:58 (3 months ago)
- Author:
- sandholm@…
- Branch:
- default
- Message:
-
hadoop ui src update
- Location:
- src/grid/hadoop/gwt/src/com/hp/hpl/tycoon/ui/thundercloud
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r1604
|
r1640
|
|
| 44 | 44 | |
| 45 | 45 | ConfigView config; |
| | 46 | MasterView master; |
| 46 | 47 | Grid grid; |
| 47 | 48 | Button createButton; |
| … |
… |
|
| 75 | 76 | config.setValue("time", Long.toString(time)); |
| 76 | 77 | tycoon.command("asynch create 1"); |
| | 78 | master.startCreation(); |
| 77 | 79 | } |
| 78 | 80 | if (sender == restartButton) { |
| … |
… |
|
| 112 | 114 | } |
| 113 | 115 | } |
| 114 | | public ManageView(ConfigView config, Tycoon tycoon) { |
| | 116 | public ManageView(ConfigView config, MasterView master, Tycoon tycoon) { |
| 115 | 117 | this.config = config; |
| 116 | 118 | this.tycoon = tycoon; |
| | 119 | this.master = master; |
| 117 | 120 | grid = new Grid(5,2); |
| 118 | 121 | panel.add(grid); |
| … |
… |
|
| 143 | 146 | //serverUrl = serverUrl.substring(0,stop); |
| 144 | 147 | createButton = new Button("<img src=\"" + serverUrl +"/create.png\"/> Create", this); |
| 145 | | createButton.setHeight("25px"); |
| | 148 | createButton.setHeight("27px"); |
| | 149 | createButton.setWidth("90px"); |
| 146 | 150 | restartButton = new Button("<img src=\"" + serverUrl +"/restart.png\"/> Restart", this); |
| 147 | | restartButton.setHeight("25px"); |
| | 151 | restartButton.setHeight("27px"); |
| | 152 | restartButton.setWidth("90px"); |
| 148 | 153 | cleanButton = new Button("<img src=\"" + serverUrl +"/clean.png\"/> Clean", this); |
| 149 | | cleanButton.setHeight("25px"); |
| | 154 | cleanButton.setHeight("27px"); |
| | 155 | cleanButton.setWidth("90px"); |
| 150 | 156 | terminateButton = new Button("<img src=\"" + serverUrl +"/delete.png\"/> Terminate", this); |
| 151 | | terminateButton.setHeight("25px"); |
| | 157 | terminateButton.setHeight("27px"); |
| | 158 | terminateButton.setWidth("90px"); |
| 152 | 159 | |
| 153 | 160 | updateNodeButton = new Button("<img src=\"" + serverUrl +"/refresh.png\"/>", this); |
| … |
… |
|
| 168 | 175 | memoryPanel.setText(0,1, "Memory (GiB):"); |
| 169 | 176 | spendingPanel.setWidget(0,0,updateSpendingButton); |
| 170 | | spendingPanel.setText(0,1,"Spending Rate ($/day):"); |
| | 177 | spendingPanel.setText(0,1,"Spending ($/day):"); |
| 171 | 178 | |
| 172 | 179 | grid.setWidget(0,0,nodePanel); |
| … |
… |
|
| 201 | 208 | spendingSlider.getSlider().setValue(0.1); |
| 202 | 209 | grid.setWidget(3,1,spendingSlider); |
| 203 | | HorizontalPanel buttonPanel = new HorizontalPanel(); |
| 204 | | buttonPanel.add(createButton); |
| 205 | | buttonPanel.add(restartButton); |
| 206 | | buttonPanel.add(cleanButton); |
| 207 | | buttonPanel.add(terminateButton); |
| 208 | | grid.setWidget(4,0,buttonPanel); |
| | 210 | HorizontalPanel buttonPanel1 = new HorizontalPanel(); |
| | 211 | buttonPanel1.add(createButton); |
| | 212 | buttonPanel1.add(restartButton); |
| | 213 | grid.setWidget(4,0,buttonPanel1); |
| | 214 | HorizontalPanel buttonPanel2 = new HorizontalPanel(); |
| | 215 | buttonPanel2.add(cleanButton); |
| | 216 | buttonPanel2.add(terminateButton); |
| | 217 | grid.setWidget(4,1,buttonPanel2); |
| 209 | 218 | return panel; |
| 210 | 219 | } |
-
|
r1604
|
r1640
|
|
| 40 | 40 | Tycoon tycoon; |
| 41 | 41 | String status = "down"; |
| | 42 | long progress = 0; |
| | 43 | long tick = 0; |
| | 44 | long progressTick = 0; |
| | 45 | String budget = ""; |
| | 46 | String expires = ""; |
| 42 | 47 | |
| 43 | 48 | public MasterView(Tycoon tycoon) { |
| 44 | 49 | this.tycoon = tycoon; |
| | 50 | this.progress = 0; |
| | 51 | this.tick = 0; |
| | 52 | this.progressTick = -1; |
| 45 | 53 | } |
| 46 | 54 | |
| 47 | 55 | public void run() { |
| 48 | | tycoon.masterStatus(); |
| | 56 | if (tick % 3 == 0) { |
| | 57 | tycoon.masterStatus(); |
| | 58 | } |
| | 59 | if (this.progress < 95 && this.progressTick > 0) { |
| | 60 | this.progress = (this.tick - this.progressTick)/2; |
| | 61 | updateStatus(); |
| | 62 | } |
| | 63 | tick += 10; |
| 49 | 64 | } |
| 50 | 65 | |
| … |
… |
|
| 53 | 68 | this.frame.setContent(new HTML("<center><img src=\"status_down.png\"/></center>" + |
| 54 | 69 | "<br><b>Budget:</b><br>" + |
| | 70 | "<br><b>Creation Progress:</b> " + Long.toString(this.progress) + "%<br>" + |
| 55 | 71 | "<br><b>Expires:</b>")); |
| 56 | 72 | run(); |
| 57 | | scheduleRepeating(30000); |
| | 73 | scheduleRepeating(10000); |
| | 74 | } |
| | 75 | |
| | 76 | public void startCreation() { |
| | 77 | this.progress = 0; |
| | 78 | this.progressTick = this.tick; |
| 58 | 79 | } |
| 59 | 80 | |
| … |
… |
|
| 61 | 82 | String[] stat = new_status.split("\n"); |
| 62 | 83 | //if (!stat[0].equals(this.status)) { |
| 63 | | this.frame.setContent(new HTML("<center><img src=\"status_" + stat[0] + ".png\"/></center>" + |
| 64 | | "<br><b>Budget:</b> $" + stat[1] + "<br>" + |
| 65 | | "<br><b>Expires:</b> " + stat[2])); |
| 66 | 84 | //} |
| 67 | 85 | if (stat[0].equals("up") && !this.status.equals("up")) { |
| 68 | 86 | tycoon.getMaster(); |
| | 87 | this.progress = 100; |
| | 88 | this.tick = 0; |
| | 89 | this.progressTick = -1; |
| 69 | 90 | } |
| 70 | | this.status = new_status; |
| | 91 | this.status = stat[0]; |
| | 92 | this.budget = stat[1]; |
| | 93 | this.expires = stat[2]; |
| | 94 | updateStatus(); |
| | 95 | } |
| | 96 | public void updateStatus() { |
| | 97 | this.frame.setContent(new HTML("<center><img src=\"status_" + this.status + ".png\"/></center>" + |
| | 98 | "<br><b>Budget:</b> $" + this.budget + "<br>" + |
| | 99 | "<br><b>Creation Progress:</b> " + Long.toString(this.progress) + "%<br>" + |
| | 100 | "<br><b>Expires:</b> " + this.expires)); |
| 71 | 101 | } |
| 72 | 102 | } |
-
|
r1604
|
r1640
|
|
| 117 | 117 | masterView = new MasterView(tycoon); |
| 118 | 118 | statusView = new StatusView(tycoon,statusLabel); |
| 119 | | manageView = new ManageView(configView, tycoon); |
| | 119 | manageView = new ManageView(configView, masterView, tycoon); |
| 120 | 120 | hadoopFSView = new HadoopFSView(configView, tycoon); |
| 121 | 121 | hadoopJobView = new HadoopJobView(tycoon); |
| … |
… |
|
| 220 | 220 | image.minimize(); |
| 221 | 221 | |
| 222 | | GInternalFrame master = new DefaultGInternalFrame("Cluster v0010"); |
| | 222 | GInternalFrame master = new DefaultGInternalFrame("Cluster v0025"); |
| 223 | 223 | frames[5] = master; |
| 224 | 224 | desktop.addFrame(master); |
-
|
r1564
|
r1640
|
|
| 4 | 4 | |
| 5 | 5 | .sph-Slider { |
| 6 | | width: 500px; |
| | 6 | width: 200px; |
| 7 | 7 | height: 16px; |
| 8 | 8 | border:none; |