diff --git a/hmc/html/cluster.php b/hmc/html/cluster.php deleted file mode 100644 index 918cd76..0000000 --- a/hmc/html/cluster.php +++ /dev/null @@ -1,41 +0,0 @@ - - - Hortonworks Data Platform Portal - - - - - - -
- -
- - - - -
-
-
-
-
- - - - - - - - Installation logs"); ?> - -
- - - diff --git a/hmc/html/displayLogs.php b/hmc/html/displayLogs.php deleted file mode 100644 index 98eda06..0000000 --- a/hmc/html/displayLogs.php +++ /dev/null @@ -1,56 +0,0 @@ - - - Hortonworks Data Platform Portal - - - - - - - -
- -
Hortonworks Data Platform
-
-
- -
- - - - - - - -
- - - - - - -
- - - diff --git a/hmc/html/dummyInitializeCluster.php b/hmc/html/dummyInitializeCluster.php deleted file mode 100755 index da0a677..0000000 --- a/hmc/html/dummyInitializeCluster.php +++ /dev/null @@ -1,278 +0,0 @@ - - - Hortonworks Data Platform Portal - - - - - - -
- -
- - - - - - -
-
-
    -
  1. -
    - - 1 - - Create Cluster -
    -
  2. -
  3. -
    - - 2 - - Initialize Cluster -
    -
  4. -
  5. -
    - - 3 - - Assign Hosts -
    -
  6. -
  7. -
    - - 4 - - Configure Cluster -
    -
  8. -
  9. -
    - - 5 - - Configure Cluster (Advanced) -
    -
  10. -
  11. -
    - - 6 - - Deploy Cluster -
    -
  12. -
-
- -
- -
- - - - -
- - - - - - - - - - - -
-
-
- Review your settings -
-
-

- -

-
-
- - - -
-
- - -
- -
- - -
-
-
-
-
- -
- - - - - - - diff --git a/hmc/html/expandTab.html b/hmc/html/expandTab.html deleted file mode 100644 index 7340969..0000000 --- a/hmc/html/expandTab.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Test - - -

- Here is opening info. -

-

- Here is supplemental info. -

-

- This approach uses Progressive Enhancement. -

-

- Progressive Enhancement allows content to be accessible to all, while also - providing an enhanced version to those that can handle it. -

- - - - diff --git a/hmc/html/history.html b/hmc/html/history.html deleted file mode 100644 index 5594d07..0000000 --- a/hmc/html/history.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - -
- - - - - diff --git a/hmc/html/rez.html b/hmc/html/rez.html deleted file mode 100644 index 2755340..0000000 --- a/hmc/html/rez.html +++ /dev/null @@ -1,119 +0,0 @@ - - - Hortonworks Data Platform Portal - - - - - - - - -
- -
Hortonworks Data Platform
-
-
- -
-
-
-
    -
  1. -
    - - 1 - - Create Cluster -
    -
  2. -
  3. -
    - - 2 - - Initialize Cluster -
    -
  4. -
  5. -
    - - 3 - - Assign Hosts -
    -
  6. -
  7. -
    - - 4 - - Configure Cluster -
    -
  8. -
  9. -
    - - 5 - - Deploy Cluster -
    -
  10. -
-
-
- - - - - - - -
- - - - - - - -
-
Hortonworks © 2012
- diff --git a/hmc/html/rez.html.old b/hmc/html/rez.html.old deleted file mode 100755 index 64bf117..0000000 --- a/hmc/html/rez.html.old +++ /dev/null @@ -1,55 +0,0 @@ - - - HDP Initialize Cluster - - - - - - - - - - - - - - - diff --git a/hmc/html/serviceStatus.html b/hmc/html/serviceStatus.html deleted file mode 100644 index 041610f..0000000 --- a/hmc/html/serviceStatus.html +++ /dev/null @@ -1,45 +0,0 @@ - - - Hortonworks Data Platform Portal - - - - - - - -
- -
Hortonworks Data Platform
-
-
- -
- - - -
-

Checking status for all services

- -
- -
- - - - - - -
-
Hortonworks © 2012
- - diff --git a/hmc/html/summary.html b/hmc/html/summary.html deleted file mode 100644 index f7aa201..0000000 --- a/hmc/html/summary.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - HDP Summay for Deploy Cluster - - - - - -
- Services to be installed -

-

-

-

-

-

-
-
- Host details -
Jobtracker
-
Namenode
-
Secondary Namenode
-
HBase Master
-
HCatalog
-
Ganglia Collector
-
Nagios Server
-
- -
- Confirm Mount Points -
Mount 1
-
Mount 2
-
Mount 3
-
Mount 4
-
- -
-Confirm all configuration -
Namenode Heap Size
-
Jobtracker Heap Size
-
HBase Master Heap Size
-
Hadoop Heap Size
-
Data Node Heap Size
-
- - - - diff --git a/hmc/html/tempHostMapping.html b/hmc/html/tempHostMapping.html deleted file mode 100644 index 6ec2efe..0000000 --- a/hmc/html/tempHostMapping.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - -
-
- -

Services, Node Groups

-
-
-
-
- - - diff --git a/hmc/html/tempHostMapping2.html b/hmc/html/tempHostMapping2.html deleted file mode 100644 index 5cc2208..0000000 --- a/hmc/html/tempHostMapping2.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - -
-
- -

Services, Node Groups

-
-
- - - - diff --git a/hmc/html/tryRadio.html b/hmc/html/tryRadio.html deleted file mode 100644 index 27707f1..0000000 --- a/hmc/html/tryRadio.html +++ /dev/null @@ -1,10 +0,0 @@ - - - Try Radio button - - - - Enable Lzo - - - diff --git a/hmc/html/x.html b/hmc/html/x.html deleted file mode 100644 index 2163ddd..0000000 --- a/hmc/html/x.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - diff --git a/hmc/html/x.txt b/hmc/html/x.txt deleted file mode 100644 index 9e9d22a..0000000 --- a/hmc/html/x.txt +++ /dev/null @@ -1 +0,0 @@ -{ "abc" : "def", "ghi" : "jkl" } diff --git a/hmc/js/assignHosts.js_beforeFancyUI b/hmc/js/assignHosts.js_beforeFancyUI deleted file mode 100644 index 8812f55..0000000 --- a/hmc/js/assignHosts.js_beforeFancyUI +++ /dev/null @@ -1,130 +0,0 @@ -//var globalClusterInfo; - -function generateServiceMasterOptions (Y, masterHost, allHosts) { - - var generatedOptions = ""; - - /* The dropdown hosts are allHosts minus masterHost. */ - Y.Array.each( allHosts, function(host) { - - if( host != masterHost ) { - generatedOptions += ""; - } - }); - - return generatedOptions; -} - -var registeredAssignHostsEventHandlers = false; - -function renderAssignHosts (Y, clusterInfo) { - - //globalClusterInfo = clusterInfo; - // REZ XXX Remove. - //setNavigationContent(Y, "Clusters > New cluster"); - //activateStage(Y, "#masterHostsSideBarId"); - - if( !registeredAssignHostsEventHandlers ) { - - Y.one('#assignHostsSubmitButtonId').on('click', function (e) { - e.target.set('disabled', true); - - var selections = Y.all("#assignHostsFieldSetId select"); - - var assignHostsRequestData = {}; - - selections.each( function(selection) { - - var selectedHostIndex = selection.get('selectedIndex'); - - assignHostsRequestData[ selection.get('name') ] = selection.get('options').item(selectedHostIndex).get('text'); - }); - - Y.io("../php/frontend/assignHosts.php?clusterName="+clusterInfo.clusterName, { - - method: 'POST', - data: Y.JSON.stringify(assignHostsRequestData), - timeout : 10000, - on: { - start: function(x, o) { - showLoadingImg(Y); - //waitPanel.show(); - }, - complete: function(x, o) { - e.target.set('disabled', false); - hideLoadingImg(Y); - //waitPanel.hide(); - }, - - success: function (x,o) { - e.target.set('disabled', false); - Y.log("RAW JSON DATA: " + o.responseText); - - // Process the JSON data returned from the server - try { - clusterConfigJson = Y.JSON.parse(o.responseText); - } - catch (e) { - alert("JSON Parse failed!"); - return; - } - - //Y.log("PARSED DATA: " + Y.Lang.dump(clusterConfigJson)); - - if (clusterConfigJson.result != 0) { - // Error! - alert("Got error!" + clusterConfigJson.error); - return; - } - - clusterConfigJson = clusterConfigJson.response; - - /* Done with this stage, transition to the next. */ - transitionToNextStage( "#assignHostsCoreDivId", assignHostsRequestData, - "#configureClusterCoreDivId", clusterConfigJson, renderConfigureCluster ); - }, - failure: function (x,o) { - e.target.set('disabled', false); - alert("Async call failed!"); - } - } - }); - }); - - registeredAssignHostsEventHandlers = true; - } - - var allHosts = Y.Array( clusterInfo.allHosts.sort(Y.ArraySort.compare) ); - var servicesInfo = Y.Array( clusterInfo.services ); - - var serviceMasterHostsMarkup = ""; - - /* Given recommendations for all the services, generate serviceMasterHostsMarkup - * to contain only those that are actually enabled for this cluster. - */ - Y.Array.each(servicesInfo, function(serviceInfo) { - - if( serviceInfo.enabled == true ) { - - Y.Array.each(serviceInfo.masters, function(masterInfo) { - - var masterHostName = masterInfo.name; - var masterHostNameID = masterHostName + 'Id'; - - /* Inefficient, with all the string concatenations, but clear to read. */ - serviceMasterHostsMarkup += - '
' + - '' + - '' + - '
'; - }); - } - }); - - /* Link the newly-generated serviceMasterHostsMarkup into the DOM. */ - Y.one('#assignHostsDynamicRenderDivId').setContent( serviceMasterHostsMarkup ); -} diff --git a/hmc/js/assignHosts.js_fancyUIV2 b/hmc/js/assignHosts.js_fancyUIV2 deleted file mode 100644 index b1ddc0b..0000000 --- a/hmc/js/assignHosts.js_fancyUIV2 +++ /dev/null @@ -1,236 +0,0 @@ -//var globalClusterInfo; - -function generateServiceMasterOptions (Y, masterHost, allHosts) { - - var generatedOptions = ""; - - /* The dropdown hosts are allHosts minus masterHost. */ - Y.Array.each( allHosts, function(host) { - - if( host != masterHost ) { - generatedOptions += ""; - } - }); - - return generatedOptions; -} - -var registeredAssignHostsEventHandlers = false; - -function renderAssignHosts (Y, clusterInfo) { - - //globalClusterInfo = clusterInfo; - // REZ XXX Remove. - //setNavigationContent(Y, "Clusters > New cluster"); - //activateStage(Y, "#masterHostsSideBarId"); - - if( !registeredAssignHostsEventHandlers ) { - - Y.one('#assignHostsSubmitButtonId').on('click', function (e) { - e.target.set('disabled', true); - - var selections = Y.all("#assignHostsFieldSetId select"); - - var assignHostsRequestData = {}; - - selections.each( function(selection) { - - var selectedHostIndex = selection.get('selectedIndex'); - - assignHostsRequestData[ selection.get('name') ] = selection.get('options').item(selectedHostIndex).get('text'); - }); - - Y.io("../php/frontend/assignHosts.php?clusterName="+clusterInfo.clusterName, { - - method: 'POST', - data: Y.JSON.stringify(assignHostsRequestData), - timeout : 10000, - on: { - start: function(x, o) { - showLoadingImg(Y); - //waitPanel.show(); - }, - complete: function(x, o) { - e.target.set('disabled', false); - hideLoadingImg(Y); - //waitPanel.hide(); - }, - - success: function (x,o) { - e.target.set('disabled', false); - Y.log("RAW JSON DATA: " + o.responseText); - - // Process the JSON data returned from the server - try { - clusterConfigJson = Y.JSON.parse(o.responseText); - } - catch (e) { - alert("JSON Parse failed!"); - return; - } - - //Y.log("PARSED DATA: " + Y.Lang.dump(clusterConfigJson)); - - if (clusterConfigJson.result != 0) { - // Error! - alert("Got error!" + clusterConfigJson.error); - return; - } - - clusterConfigJson = clusterConfigJson.response; - - /* Done with this stage, transition to the next. */ - transitionToNextStage( "#assignHostsCoreDivId", assignHostsRequestData, - "#configureClusterCoreDivId", clusterConfigJson, renderConfigureCluster ); - }, - failure: function (x,o) { - e.target.set('disabled', false); - alert("Async call failed!"); - } - } - }); - }); - - registeredAssignHostsEventHandlers = true; - } - - var allHosts = Y.Array( clusterInfo.allHosts.sort(Y.ArraySort.compare) ); - var servicesInfo = Y.Array( clusterInfo.services ); - - var serviceMasterHostsMarkup = ""; - - /* Given recommendations for all the services, generate serviceMasterHostsMarkup - * to contain only those that are actually enabled for this cluster. - */ - Y.Array.each(servicesInfo, function(serviceInfo) { - - if( serviceInfo.enabled == true ) { - - Y.Array.each(serviceInfo.masters, function(masterInfo) { - - var masterHostName = masterInfo.name; - var masterHostNameID = masterHostName + 'Id'; - - /* Inefficient, with all the string concatenations, but clear to read. */ - serviceMasterHostsMarkup += - '
' + - '' + - '' + - '
'; - }); - } - }); - - /* Link the newly-generated serviceMasterHostsMarkup into the DOM. */ - Y.one('#assignHostsDynamicRenderDivId').setContent( serviceMasterHostsMarkup ); - - - -///////////////////////// New stuff ////////////// - -var currentMaster=""; -var nodeGroups = [ "A", "B"]; -var serviceMasters = [ "NameNode", "JobTracker" , "HBaseMaster" ] -var slotContents = {}; -var serviceLocations = {}; - -function renderSlots(Y) { - for (nodeGroupIndex in nodeGroups) { - for (serviceMasterIndex in serviceMasters) { - var content= ""; - var thisId = 'slotForGroup' + nodeGroups[nodeGroupIndex] + serviceMasterIndex; - for (master in slotContents[thisId]) { - content += master + "
"; - } - Y.one('#' + thisId).setContent(content); - } - } -} - - ////////////////// Render service links /////////////////// - var serviceMastersLinksMarkup =""; - for (key in serviceMasters) { - serviceMastersLinksMarkup += '
'; - } - Y.one("#serviceMastersLinksDivId").setContent(serviceMastersLinksMarkup); - ////////////////// End of rendering service links //////// - - ////////////////// Register click handlers for all masters /////////////////// - for (key in serviceMasters) { - var serviceLinkId = "#" + serviceMasters[key]; - Y.one(serviceLinkId).on('click', function(e) { - if ( currentMaster != this.get('id')) { - activate(Y, this.get('id')); - } - }); - } - ////////////////// End of registering click handlers for all masters /////////////////// - - ////////////////// Render node groups //////// - var nodeGroupsMarkup = '
'; - for (nodeGroupIndex in nodeGroups) { - nodeGroupsMarkup += '

Node group ' + nodeGroups[nodeGroupIndex] + '

'; - - // Number of boxes equal to number of service-masters - for (serviceMasterIndex in serviceMasters) { - nodeGroupsMarkup += '
'; - } - nodeGroupsMarkup += '
'; - } - nodeGroupsMarkup += '
'; - Y.one("#nodeGroupsDivId").setContent(nodeGroupsMarkup); - ////////////////// End of rendering node groups //////// - - // Register click handlers for all node-slots - for (nodeGroupIndex in nodeGroups) { - for (serviceMasterIndex in serviceMasters) { - var slotDivId = '#slotForGroup' + nodeGroups[nodeGroupIndex] + serviceMasterIndex; - Y.log("registering for " + slotDivId); - Y.one(slotDivId).on('click', function(e) { - Y.log("Clicked on " + this.get('id')); - //Y.log(currentMaster + " " + nodeGroups[nodeGroupIndex] + " " + serviceMasterIndex); - //Y.log('#slotForGroup' + nodeGroups[nodeGroupIndex] + serviceMasterIndex); - //Y.one('#slotForGroup' + nodeGroups[nodeGroupIndex] + serviceMasterIndex).setContent("hello"); - // this.setContent(serviceMasters[currentMaster]); - var oldSlotId = serviceLocations[currentMaster]; - if (oldSlotId != this.get('id')) { - delete slotContents[oldSlotId][currentMaster]; - serviceLocations[currentMaster] = this.get('id'); - if (slotContents[this.get('id')] === undefined) { - slotContents[this.get('id')] = {}; - } - slotContents[this.get('id')][currentMaster] = [currentMaster]; - renderSlots(Y); - } - }); - } - } - - ////////////////// Initialize all slots /////////////////// - var thisId = 'slotForGroup' + nodeGroups[0] + 0; - for (serviceMasterIndex in serviceMasters) { - if (slotContents[thisId] === undefined) { - slotContents[thisId] = {}; - } - var masterName = serviceMasters[serviceMasterIndex]; - slotContents[thisId][masterName] = masterName; - serviceLocations[masterName] = thisId; - } - renderSlots(Y); - ////////////////// End of initializing all slots /////////////////// - -function activate(Y, serviceMaster) { - Y.log("Activated " + serviceMaster + " from " + currentMaster); - Y.one("#" + serviceMaster).replaceClass("aServiceMasterLink", "aServiceMasterLinkVisited"); - if (currentMaster != "") { - Y.one("#" + currentMaster).replaceClass("aServiceMasterLinkVisited", "aServiceMasterLink"); - } - currentMaster = serviceMaster; -} - - -} diff --git a/hmc/js/backup_progress.js b/hmc/js/backup_progress.js deleted file mode 100644 index 2525e09..0000000 --- a/hmc/js/backup_progress.js +++ /dev/null @@ -1,207 +0,0 @@ -var tmpY1; - -function generateSingleDiscoverProgressStateMarkup( discoverProgressStateTitle, discoverProgressStateCssClass ) { - - tmpY1.log( 'Generating: ' + discoverProgressStateTitle + '-' + discoverProgressStateCssClass ); - - var markup = - '
  • ' + - '
    ' + - discoverProgressStateTitle + - '
    ' + - '
  • '; - - tmpY1.log("XXX" + markup); - return markup; -} - -var errorInformationPanel; - -function renderProgress (Y, discoverProgressInfo) { - - tmpY1 = Y; - - var discoverProgressDataSource = new Y.DataSource.IO ({ - source: '../php/frontend/fetchDiscoverProgressInfo.php' - }); - - discoverProgressDataSource.plug(Y.Plugin.DataSourceJSONSchema, { - schema: { - metaFields: { - progressStates: 'progressStates', - currentProgressStateIndex: 'currentProgressStateIndex', - encounteredError: 'encounteredError', - stateInfo: 'stateInfo', - nextStageInfo: 'nextStageInfo' - } - } - }); - - var discoverProgressPollHandle = discoverProgressDataSource.setInterval( 3000, { - request: '?clusterName=' + discoverProgressInfo.clusterName, - callback: { - success: function (e) { - - var discoverProgressStates = e.response.meta.progressStates; - -// Y.log(Y.Lang.dump(discoverProgressStates)); -// Y.log(e.response.meta.currentProgressStateIndex); - - var discoverProgressMarkup = '
      '; - - var progressStateIndex = 0; - - /* Generate markup for all the "done" states. */ - for( ; progressStateIndex < e.response.meta.currentProgressStateIndex; ++progressStateIndex ) { - -// Y.log( 'Done loop - ' + progressStateIndex ); - discoverProgressMarkup += generateSingleDiscoverProgressStateMarkup - ( discoverProgressStates[ progressStateIndex ], 'displayProgressStateDone' ); -// Y.log("Currently, markup is:" + discoverProgressMarkup ); - } - - if( progressStateIndex < discoverProgressStates.length ) { - -// Y.log( 'In progress - ' + progressStateIndex ); - - /* Decide upon what CSS class to assign to the currently-in-progress - * state - if an error was marked as having been encountered, assign - * the fitting .discoverProgressStateError, else just annoint it with - * .discoverProgressStateInProgress - */ - var currentProgressStateCssClass = 'displayProgressStateInProgress'; - - if( e.response.meta.encounteredError ) { - - currentProgressStateCssClass = 'displayProgressStateError'; - } - - /* Then generate markup for the "in-progress" state. */ - discoverProgressMarkup += generateSingleDiscoverProgressStateMarkup - ( discoverProgressStates[ progressStateIndex ], currentProgressStateCssClass ); - - ++progressStateIndex; - - /* Finally, generate markup for all the "pending" states. */ - for( ; progressStateIndex < discoverProgressStates.length; ++progressStateIndex ) { - -// Y.log( 'Pending loop - ' + progressStateIndex ); - discoverProgressMarkup += generateSingleDiscoverProgressStateMarkup - ( discoverProgressStates[ progressStateIndex ], 'displayProgressStatePending' ); - } - } - - var noNeedForFurtherPolling = false; - var installationStatusDivContent = ''; - var installationStatusDivCssClass = ''; - - /* We can break this polling cycle in one of 2 ways: - * - * 1) If all the states have been progressed through. - */ - if( e.response.meta.currentProgressStateIndex == (discoverProgressStates.length) ) { - - noNeedForFurtherPolling = true; - - if ( e.response.meta.encounteredError == true) { - installationStatusDivContent = - '

      ' + - 'We found a few wild ones! Take a look at the' + - 'Error Logs' + - '?' + - '

      '; - - installationStatusDivCssClass = 'statusError'; - - } else { - installationStatusDivContent = - '

      ' + - 'All done with discovering nodes! ' + - '' + - 'Great!' + - '' + - '

      '; - installationStatusDivCssClass = 'statusOk'; - } - } - - if( noNeedForFurtherPolling ) { - - /* We've made all the progress we could have, so stop polling. */ - discoverProgressDataSource.clearInterval( discoverProgressPollHandle ); - - var installationStatusDiv = Y.one('#displayProgressStatusDivId'); - - installationStatusDiv.set('className', installationStatusDivCssClass); - installationStatusDiv.setContent(installationStatusDivContent); - installationStatusDiv.setStyle('display', 'block'); - - /* If we stopped polling due to error, we need to do more work. */ - if( installationStatusDivCssClass == 'statusError' ) { - - /* Create the panel that'll display our error info. */ - errorInformationPanel = - createInformationalPanel( Y, '#informationalPanelContainerDivId', 'Deploy Logs' ); - - /* Augment errorInformationPanel with the relevant buttons. */ - var backToInstallationWizardButton = { - value: 'I will tame the wild \'uns!', - action: function (e) { - e.preventDefault(); - Y.one('#displayProgressStatusDivId').setStyle('display', 'none'); - Y.one('#displayProgressCoreDivId').setStyle('display', 'none'); - Y.one('#installationWizardProgressBarDivId').setStyle('display', - 'block'); - Y.one("#initializeClusterCoreDivId").setStyle('display', 'block'); - alert("HIDING!"); - errorInformationPanel.hide(); - }, - section: 'footer' - }; - - var goToServicesSelectPageButton = { - value: 'I dont mind the wild ones!', - action: function (e) { - e.preventDefault(); - Y.one('#installationWizardProgressBarDivId').setStyle('display', 'block'); - Y.one('#displayProgressStatusDivId').setStyle('display', 'none'); - transitionToNextStage( "#displayProgressCoreDivId", discoverProgressInfo, "#selectServicesCoreDivId", discoverProgressInfo, renderSelectServicesBlock); - alert("HIDING!"); - errorInformationPanel.hide(); - errorInformationPanel = null; - }, - section: 'footer' - }; - - errorInformationPanel.addButton( backToInstallationWizardButton ); - errorInformationPanel.addButton( goToServicesSelectPageButton ); - - Y.one("#errorInfoLinkId").on( "click", function(err) { - - Y.log("ERROR LINK RENDER: " + Y.Lang.dump(e.response.meta.stateInfo)); - errorInformationPanel.set( 'bodyContent', Y.Lang.dump( e.response.meta.stateInfo ) ); - alert("SHOWING! " + Y.Lang.dump(errorInformationPanel)); - errorInformationPanel.show(); - }); - } else { - Y.one("#successInfoLinkId").on( "click", function(e) { - Y.one('#installationWizardProgressBarDivId').setStyle('display', 'block'); - Y.one('#displayProgressStatusDivId').setStyle('display', 'none'); - transitionToNextStage( "#displayProgressCoreDivId", discoverProgressInfo, "#selectServicesCoreDivId", discoverProgressInfo, renderSelectServicesBlock); - }); - } - } - - discoverProgressMarkup += '
    '; - -// Y.log('About to generate markup: ' + discoverProgressMarkup); - Y.one('#displayProgressDynamicRenderDivId').setContent( discoverProgressMarkup ); - }, - failure: function (e) { - alert('Failed to fetch more progress!'); - /* No point making any more attempts. */ - discoverProgressDataSource.clearInterval( discoverProgressPollHandle ); - } - } - }); -} diff --git a/hmc/js/deploy_backup.js b/hmc/js/deploy_backup.js deleted file mode 100644 index 5292699..0000000 --- a/hmc/js/deploy_backup.js +++ /dev/null @@ -1,61 +0,0 @@ -function generateServiceMasterOptions (Y, masterHost, allHosts) { - - var generatedOptions = ""; - - /* The dropdown hosts are allHosts minus masterHost. */ - Y.Array.each( allHosts, function(host) { - - if( host != masterHost ) { - generatedOptions += ""; - } - }); - - return generatedOptions; -} - -function renderDeploy (Y, deployInfo) { - - Y.one('#deploySubmitButtonId').on('click',function (e) { - - e.target.set('disabled', true); - - var deployRequestData = {}; - - Y.io("../php/deploy.php?clusterName="+deployInfo.clusterName, { - - method: 'POST', - data: Y.JSON.stringify(deployRequestData), - timeout : 10000, - on: { - success: function (x,o) { - e.target.set('disabled', false); - Y.log("RAW JSON DATA: " + o.responseText); - - // Process the JSON data returned from the server - try { - xxxJson = Y.JSON.parse(o.responseText); - } - catch (e) { - alert("JSON Parse failed!"); - return; - } - - Y.log("PARSED DATA: " + Y.Lang.dump(xxxJson)); - -// /* Done with this stage, hide it. */ -// Y.one("#deployCoreDivId").setStyle('display','none'); -// -// /* Render the next stage. */ -// renderConfigureCluster(Y, xxxJson); -// -// /* Show off our rendering. */ -// Y.one("#configureClusterCoreDivId").setStyle('display','block'); - }, - failure: function (x,o) { - e.target.set('disabled', false); - alert("Async call failed!"); - } - } - }); - }); -} diff --git a/hmc/js/displayLogs.js b/hmc/js/displayLogs.js deleted file mode 100644 index 23a835b..0000000 --- a/hmc/js/displayLogs.js +++ /dev/null @@ -1,100 +0,0 @@ -function getGsInstallLogs(Y, clusterName) { - var errorCount = 0; - var lastSize = 0; - var sizeRepeatedCount = 0; - - YUI().use("node", "io", "dump", "json", "datasource", "datasource-io", "datasource-jsonschema", "datasource-polling", function(Y) { - -/* - var getLogFunction = function() { - Y.io("../php/displayLogs.php?clusterName=" + clusterName + "&lines=all", { - method: 'GET', - timeout : 1000, - on: { - success: function (x,o) { - Y.log("RAW LOG DATA: " + o.responseText); - return o.responseText; - }, - failure: function (x,o) { - alert("Async call failed!"); - } - } - }); - - }; -*/ - - var id; -// var myDataSource = new Y.DataSource.Function({source:getLogFunction}); - var myDataSource = new Y.DataSource.IO({source:"../php/displayLogs.php?clusterName=" + clusterName + "&lines=all"}); - myDataSource.plug(Y.Plugin.DataSourceJSONSchema, { - schema: { - metaFields: {logs:"logs", clusterName:"clusterName", gsInstallDone:"gsInstallDone"} - } - }); - var callback = { - success: function(e){ - var logs = e.response.meta.logs; - Y.log("IN LOG CALLBACK: got logs of length: " + logs.length); - errorCount=0; - var length = logs.length; - var newlogs; - if (length > lastSize ) { - newlogs = logs.split('\n').join('
    '); - } -/* - if (length == lastSize) { - ++sizeRepeatedCount; - } else { - sizeRepeatedCount = 0; - lastSize = length; - } - if (sizeRepeatedCount == 5 ) { - Y.log("In log callback: stopping, repeat count=" + sizeRepeatedCount); - myDataSource.clearInterval(id); // end polling - } -*/ - Y.log("IN LOG CALLBACK: got installdone as " + e.response.meta.gsInstallDone); - if (e.response.meta.gsInstallDone) { - Y.log("In log callback: stopping, got installdone as " + e.response.meta.gsInstallDone); - myDataSource.clearInterval(id); // end polling - newlogs += 'Installation script finished...
    '; - // Y.one("#installDoneDivId").setStyle('display', 'block'); - } else { - newlogs += '
    '; - } - Y.one("#displayLogsContentDivId").setContent(newlogs); - Y.one("#displayLogsContentDivId").scrollTop = Y.one("#displayLogsContentDivId").scrollHeight; - }, - failure: function(e){ - ++errorCount; - Y.log("In log callback: failed, error count=" + errorCount); - if (errorCount > 3 ){ - myDataSource.clearInterval(id); // end polling - } - } - }; - id = myDataSource.setInterval(5000, {'request': {},'callback':callback}); // Starts polling - }); -} - - -function renderDisplayLogs(Y, clusterName) { - /* - Y.one('#installDoneDivId').on('click',function (e) { - - e.target.set('disabled', true); - */ - - /* Done with this stage, hide it. */ - // Y.one("#displayLogsCoreDivId").setStyle('display','none'); - - /* Render the next stage. */ - // getServicesStatus(Y, clusterName); - - // /* Show off our rendering. */ - // Y.one("#displayServiceStatusCoreDivId").setStyle('display','block'); - // }); - - getGsInstallLogs(Y, clusterName); -} diff --git a/hmc/js/initializeCluster_old.js b/hmc/js/initializeCluster_old.js deleted file mode 100644 index 17adee0..0000000 --- a/hmc/js/initializeCluster_old.js +++ /dev/null @@ -1,119 +0,0 @@ -// Create business logic in a YUI sandbox using the 'io' and 'json' modules -function renderInitializeClusterBlockABC(Y, infoInitializeCluster) { - - var clusterName = infoInitializeCluster.clusterName; - - // REZ XXX Remove. - //setNavigationContent(Y, "Clusters > New cluster"); - - // REZ XXX Remove. - //activateStage(Y, "#selectServicesSideBarId"); - - var initializeClusterSubmitButton = Y.one('#initializeClusterSubmitButtonId'); - - initializeClusterSubmitButton.on('click',function (e) { - - initializeClusterSubmitButton.set('disabled', true); - - var initializeClusterFilesForm = Y.one("#initializeClusterFilesFormId"); - - initializeClusterFilesForm.set('action', '../php/frontend/uploadFiles.php?clusterName=' + clusterName); - - /* Set the target of the first form's upload to be a hidden iframe - * on the page so as not to redirect to the PHP page we're POSTing - * to. - * - * See http://www.openjs.com/articles/ajax/ajax_file_upload/ for - * more on this. - */ - initializeClusterFilesForm.set('target', 'fileUploadTarget'); - - /* And then programmatically submit the first of the 2 forms. */ - initializeClusterFilesForm.submit(); - - /* The 2nd form will be sequentially submitted after the first one is - * done (which we are notified of by listening for the 'load' event on - * #fileUploadTargetId). - */ - }); - - /* Only once the #fileUploadTargetId is done loading do we know that the - * first form upload is done, so use this as a trigger to fire off the - * 2nd upload; we need to be sequential to avoid race conditions at the - * back-end. - */ - Y.one("#fileUploadTargetId").on('load', function (e1) { - - var initializeClusterRequestData = { - "ClusterDeployUser" : Y.one("#clusterDeployUserId").get('value'), - "services" : [ - { "serviceName" : "HDFS", "isEnabled" : Y.one("#installHDFSId").get('checked') }, - { "serviceName" : "MAPREDUCE", "isEnabled" : Y.one("#installMRId").get('checked') }, - { "serviceName" : "HBASE", "isEnabled" : Y.one("#installHBaseId").get('checked') }, - { "serviceName" : "HCATALOG", "isEnabled" : Y.one("#installHCatalogId").get('checked') }, - { "serviceName" : "TEMPLETON", "isEnabled" : Y.one("#installTempletonId").get('checked') }, - { "serviceName" : "OOZIE", "isEnabled" : Y.one("#installOozieId").get('checked') }, - { "serviceName" : "PIG", "isEnabled" : Y.one("#installPigId").get('checked') }, - { "serviceName" : "SQOOP", "isEnabled" : Y.one("#installSqoopId").get('checked') } - ] - }; - - Y.io("../php/frontend/initializeCluster.php?clusterName=" + clusterName, { - - method: 'POST', - data: Y.JSON.stringify(initializeClusterRequestData), - timeout : 10000, - on: { - start: function(x, o) { - Y.log("In start function"); - // waitPanel.set('headerContent' ,'Loading, please wait...'); - // waitPanel.set('bodyContent', 'Discovering nodes, doing complicated things which are too hard to explain so please wait ... ( we may get back to you someday)'); - // waitPanel.render(document.body); - // waitPanel.set('display', 'block'); - // Y.one("#initializeClusterStatusDivId").setStyle('background-color','red'); - // Y.one("#initializeClusterStatusDivId").setStyle('font-color','white'); - // Y.one("#initializeClusterStatusDivId").setStyle('border','1px solid'); - showLoadingImg(Y); - //waitPanel.show(); - // Y.one("#initializeClusterStatusDivId").setStyle('visible','true'); - }, - complete: function(x, o) { - initializeClusterSubmitButton.set('disabled', false); - Y.log("In stop function"); - hideLoadingImg(Y); - //waitPanel.hide(); - }, - success: function (x,o) { - initializeClusterSubmitButton.set('disabled', false); - Y.log("RAW JSON DATA: " + o.responseText); - - // Process the JSON data returned from the server - try { - clusterInfoJson = Y.JSON.parse(o.responseText); - } - catch (e) { - alert("JSON Parse failed!"); - return; - } - - Y.log("PARSED DATA: " + Y.Lang.dump(clusterInfoJson)); - - if (clusterInfoJson.result != 0) { - // Error! - alert("Got error!" + clusterInfoJson.error); - return; - } - clusterInfoJson = clusterInfoJson.response; - - /* Done with this stage, transition to the next. */ - transitionToNextStage( "#initializeClusterCoreDivId", initializeClusterRequestData, - "#assignHostsCoreDivId", clusterInfoJson, renderAssignHosts ); - }, - failure: function (x,o) { - initializeClusterSubmitButton.set('disabled', false); - alert("Async call failed!"); - } - } - }); - }); -} diff --git a/hmc/js/rezConfigureCluster_backup.js b/hmc/js/rezConfigureCluster_backup.js deleted file mode 100644 index be28f2a..0000000 --- a/hmc/js/rezConfigureCluster_backup.js +++ /dev/null @@ -1,192 +0,0 @@ -function generateEligibleMountPoints (Y) { - - /* The list we're about to build up. */ - var desiredMountPoints = []; - - var selections = Y.all("#configureClusterMountPointsInputDivId input[type=checkbox]"); - - selections.each( function(selection) { - - if( selection.get('checked') == true ) { - desiredMountPoints.push( selection.get('value') ); - } - }); - - var customMountPointsString = Y.Lang.trim( Y.one("#customMountPointsId").get('value') ); - - if( customMountPointsString.length != 0 ) { - - Y.log("custom string = " + customMountPointsString); - - /* Merge the split version of customMountPointsString into our final list - * of mount points to send back to the server for committing... - */ - desiredMountPoints.push.apply( desiredMountPoints, customMountPointsString.split(',') ); - Y.log(customMountPointsString.split(',').length); - Y.log(desiredMountPoints.join(',')); - } - - /* ...But not before performing a de-dupe, just to be safe. */ - return Y.Array.dedupe( desiredMountPoints ); -} - -function generateServiceDirs (Y, servicesInfo) { - - var generatedServiceDirs = {}; - - var eligibleMountPoints = generateEligibleMountPoints(Y); - - Y.Array.each( servicesInfo, function (serviceInfo) { - - var serviceDirs = []; - - for( currentDirNum = 0; currentDirNum < serviceInfo.maxDirectoriesNeeded; ++currentDirNum ) { - - /* serviceInfo.maxDirectoriesNeeded that we get from the server is a cap - * on how many directories need to be generated for that service - the - * user can always pick fewer than that, so guard against going out of - * bounds. - */ - if( currentDirNum < eligibleMountPoints.length ) { - - var currentDirName = eligibleMountPoints[currentDirNum]; - - /* Add a trailing slash if it doesn't exist already. */ - if( currentDirName.substr(-1) != '/' ) { - currentDirName += '/'; - } - - serviceDirs.push( currentDirName + serviceInfo.suffix ); - } - } - - var serviceDirValue = serviceDirs.join(','); - - generatedServiceDirs[serviceInfo.keyName] = { - 'value' : serviceDirValue, - 'displayName' : serviceInfo.displayName - }; - }); - - return generatedServiceDirs; -} - -function renderEffectiveClusterConfig (Y,generatedClusterConfig) { - - var clusterConfigDisplayMarkup = ""; - - for (var configKey in generatedClusterConfig) { - if (generatedClusterConfig.hasOwnProperty( configKey )) { - - var configElement = generatedClusterConfig[configKey]; - - var configElementName = configKey; - var configElementIdName = configElementName + 'Id'; - - /* Inefficient, with all the string concatenations, but clear to read. */ - clusterConfigDisplayMarkup += - '

    ' + - '' + - '' + - '
    ' + - '

    '; - } - } - - /* Link the newly-generated clusterConfigInputMarkup into the DOM (making - * sure it comes before the existing #configureClusterSubmitButtonId), thus - * rendering it. - */ - Y.one("#configureClusterMountPointsDisplayDivId").setContent( clusterConfigDisplayMarkup ); -} - -/* Modify the working version of generatedClusterConfig to make it fit for - * sending to our backend. - */ -function polishClusterConfig (generatedClusterConfig) { - - var polishedClusterConfig = {}; - - for (var configKey in generatedClusterConfig) { - if (generatedClusterConfig.hasOwnProperty( configKey )) { - polishedClusterConfig[ configKey ] = generatedClusterConfig[configKey].value; - } - } - - return polishedClusterConfig; -} - -function renderConfigureCluster (Y, clusterConfig) { - - var servicesInfo = Y.Array( clusterConfig.servicesInfo ); - - Y.one('#configureClusterSubmitButtonId').on('click',function (e) { - - /* For now, our cluster config consists solely of the generated service directories. */ - var generatedClusterConfig = generateServiceDirs(Y, servicesInfo); - - var configureClusterRequestData = { - mountPoints : generateEligibleMountPoints(Y), - clusterConfig : polishClusterConfig(generatedClusterConfig) - }; - - Y.io("../php/configureCluster.php?clusterName="+clusterConfig.clusterName, { - - method: 'POST', - data: Y.JSON.stringify(configureClusterRequestData), - timeout : 10000, - on: { - success: function (x,o) { - Y.log("RAW JSON DATA: " + o.responseText); - - // Process the JSON data returned from the server - try { - deployInfoJson = Y.JSON.parse(o.responseText); - } - catch (e) { - alert("JSON Parse failed!"); - return; - } - - Y.log("PARSED DATA: " + Y.Lang.dump(deployInfoJson)); - - /* Done with this stage, hide it. */ - // Y.one("#configureClusterCoreDivId").setStyle('display','none'); - - /* Render the next stage. */ - //renderConfigureCluster(Y, clusterConfigJson); - - /* Show off our rendering. */ - // Y.one("#configureClusterCoreDivId").setStyle('display','block'); - }, - failure: function (x,o) { - alert("Async call failed!"); - } - } - }); - }); - - /* Generate the key form elements into clusterConfigInputMarkup. */ - var mountPoints = Y.Array( clusterConfig.mountPoints.sort(Y.ArraySort.compare) ); - - var clusterConfigInputMarkup = ""; - - Y.Array.each(mountPoints, function(mountPoint) { - - /* Inefficient, with all the string concatenations, but clear to read. */ - clusterConfigInputMarkup += - '

    ' + - '' + - mountPoint + - '
    ' + - '

    '; - }); - - /* Link the newly-generated clusterConfigInputMarkup into the DOM (making - * sure it comes before the existing #configureClusterSubmitButtonId), thus - * rendering it. - */ - Y.one("#configureClusterMountPointsInputDivId").prepend( clusterConfigInputMarkup ); - - renderEffectiveClusterConfig(Y, generateServiceDirs(Y, servicesInfo)); -} diff --git a/hmc/js/serviceStatus.js b/hmc/js/serviceStatus.js deleted file mode 100644 index 9eff7b5..0000000 --- a/hmc/js/serviceStatus.js +++ /dev/null @@ -1,73 +0,0 @@ -function getServicesStatus(clusterName) { - YUI().use("node", "dump", "io", "datatable", "json", "arraysort", "datasource", "datasource-io", "datasource-jsonschema", "datasource-polling", function (Y) { - - // setNavigationContent(Y, "Clusters > Cluster - " + clusterName); - - var id; - var errorCount = 0; - var myDataSource = new Y.DataSource.IO({source:"../php/frontend/servicesStatus.php?clusterName=" + clusterName }); - myDataSource.plug(Y.Plugin.DataSourceJSONSchema, { - schema: { - metaFields: { serviceStatus: "serviceStatus" } - } - }); - - Y.one("#displayServiceStatusContentDivId").setContent("Getting status of all services"); - - var callback = { - success: function (e) { - Y.log("RAW DATA: " + e.response.meta.serviceStatus); - - serviceStatusInfo = e.response.meta.serviceStatus; - - /* Render the obtained service status info */ - renderServicesStatus(Y, clusterName, serviceStatusInfo); - }, - failure: function (x,o) { - alert("Async call failed!"); - ++errorCount; - Y.log("In serviceStatus callback: failed, error count=" + errorCount); - if (errorCount > 3 ){ - myDataSource.clearInterval(id); // end polling - } - } - }; - id = myDataSource.setInterval(5000, {'request': {},'callback':callback}); // Starts polling - }); -} - -function renderServicesStatus(Y, clusterName, servicesStatusInfo) { - - var svcStatusMarkup = "" + - "" + - ""; - - for (var svcKey in servicesStatusInfo) { - if (servicesStatusInfo.hasOwnProperty( svcKey )) { - - var statusNum = serviceStatusInfo[svcKey]["statusNum"]; - if (statusNum == 4) { - // Separate tables for installed services - continue; - } - - var status = serviceStatusInfo[svcKey]["status"]; - if (statusNum == 5) { - status = status + ' '; - } - - /* Inefficient, with all the string concatenations, but clear to read. */ - svcStatusMarkup += - '' + - '' + - '' + - '' + - '' + - ''; - } - } - svcStatusMarkup += '
    Installed services
    NameDescriptionStatusManagement
    ' + svcKey + ' ' + serviceStatusInfo[svcKey]["description"] + ' ' + status + ' Management
    '; - - Y.one("#displayServiceStatusContentDivId").setContent( svcStatusMarkup ); - -} diff --git a/hmc/php/frontend/servicesStatus.php b/hmc/php/frontend/servicesStatus.php deleted file mode 100755 index 03f411a..0000000 --- a/hmc/php/frontend/servicesStatus.php +++ /dev/null @@ -1,175 +0,0 @@ - array( - "description" => "The Hadoop distributed file-system", - "statusNum" => getHdfsStatus(), - ), - $servicesInfo["MAPREDUCE"]["displayName"] => array( - "description" => "The Hadoop MapReduce processing platform", - "statusNum" => getMapRedStatus(), - ), - $servicesInfo[$HBaseName]["displayName"] => array( - "description" => "The Hadoop Database", - "statusNum" => getHBaseStatus(), - ), - $servicesInfo[$HCatName]["displayName"] => array( - "description" => "The Hadoop Catalog", - "statusNum" => getHcatStatus(), - ), - $servicesInfo[$TempletonName]["displayName"] => array( - "description" => "Hadoop web-services", - "statusNum" => getTempletonStatus(), - ), - $servicesInfo[$OozieName]["displayName"] => array( - "description" => "Hadoop job-workflow system", - "statusNum" => getOozieStatus(), - ), - ); - -foreach ($serviceStatus as $key=>$status) { - $serviceStatus[$key]["status"] = convertStatusNumToString($serviceStatus[$key]["statusNum"]); -} - -$response = array(); -$response["serviceStatus"] = $serviceStatus; - -header("Content-type: application/json"); -print(json_encode($response)); - -?>