├── hive-cube-web └── src │ ├── main │ ├── resources │ │ ├── kms │ │ │ ├── work │ │ │ │ └── Readme.md │ │ │ ├── temp │ │ │ │ └── safeToDelete.tmp │ │ │ ├── webapps │ │ │ │ └── Readme.md │ │ │ ├── lib │ │ │ │ ├── el-api.jar │ │ │ │ ├── jasper.jar │ │ │ │ ├── catalina.jar │ │ │ │ ├── ecj-4.5.1.jar │ │ │ │ ├── jasper-el.jar │ │ │ │ ├── jsp-api.jar │ │ │ │ ├── catalina-ha.jar │ │ │ │ ├── jaspic-api.jar │ │ │ │ ├── servlet-api.jar │ │ │ │ ├── tomcat-api.jar │ │ │ │ ├── tomcat-dbcp.jar │ │ │ │ ├── tomcat-jdbc.jar │ │ │ │ ├── tomcat-jni.jar │ │ │ │ ├── tomcat-util.jar │ │ │ │ ├── catalina-ant.jar │ │ │ │ ├── tomcat-coyote.jar │ │ │ │ ├── tomcat-i18n-es.jar │ │ │ │ ├── tomcat-i18n-fr.jar │ │ │ │ ├── tomcat-i18n-ja.jar │ │ │ │ ├── websocket-api.jar │ │ │ │ ├── annotations-api.jar │ │ │ │ ├── catalina-tribes.jar │ │ │ │ ├── tomcat-util-scan.jar │ │ │ │ ├── tomcat-websocket.jar │ │ │ │ └── catalina-storeconfig.jar │ │ │ ├── bin │ │ │ │ ├── bootstrap.jar │ │ │ │ ├── tomcat-juli.jar │ │ │ │ ├── commons-daemon.jar │ │ │ │ ├── tomcat-native.tar.gz │ │ │ │ ├── commons-daemon-native.tar.gz │ │ │ │ ├── catalina-tasks.xml │ │ │ │ ├── shutdown.sh │ │ │ │ ├── startup.sh │ │ │ │ ├── version.sh │ │ │ │ ├── configtest.sh │ │ │ │ ├── digest.sh │ │ │ │ ├── shutdown.bat │ │ │ │ ├── startup.bat │ │ │ │ ├── version.bat │ │ │ │ ├── configtest.bat │ │ │ │ └── digest.bat │ │ │ └── conf │ │ │ │ ├── jaspic-providers.xml │ │ │ │ ├── context.xml │ │ │ │ └── tomcat-users.xml │ │ ├── log4j.properties │ │ ├── conf │ │ │ ├── log4j.properties │ │ │ └── shiro-ehcache.xml │ │ ├── shiro-ehcache.xml │ │ └── assembly.xml │ ├── webapp │ │ ├── media │ │ │ ├── js │ │ │ │ ├── main │ │ │ │ │ ├── error │ │ │ │ │ │ └── error.js │ │ │ │ │ ├── system │ │ │ │ │ │ └── notice.js │ │ │ │ │ ├── account │ │ │ │ │ │ └── signin.js │ │ │ │ │ ├── applications │ │ │ │ │ │ ├── failed.js │ │ │ │ │ │ ├── finished.js │ │ │ │ │ │ ├── killed.js │ │ │ │ │ │ ├── all.js │ │ │ │ │ │ └── running.js │ │ │ │ │ ├── config │ │ │ │ │ │ ├── hive.js │ │ │ │ │ │ ├── hive.column.js │ │ │ │ │ │ └── hbase.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── storage │ │ │ │ │ │ └── mysql.js │ │ │ │ │ ├── tasks │ │ │ │ │ │ └── hc.json.parse.js │ │ │ │ │ └── metrics │ │ │ │ │ │ └── hadoop.js │ │ │ │ ├── public │ │ │ │ │ └── navbar.js │ │ │ │ └── plugins │ │ │ │ │ └── datatables │ │ │ │ │ └── dataTables.bootstrap.min.js │ │ │ ├── img │ │ │ │ ├── favicon.ico │ │ │ │ └── mf_login.png │ │ │ └── css │ │ │ │ ├── public │ │ │ │ ├── account │ │ │ │ │ ├── hfc.ttf │ │ │ │ │ └── hfd.ttf │ │ │ │ ├── images │ │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ │ ├── ui-icons_454545_256x240.png │ │ │ │ │ ├── ui-icons_888888_256x240.png │ │ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ │ │ ├── ui-bg_glass_75_ffffff_1x400.png │ │ │ │ │ └── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ │ ├── bootstrap-treeview.min.css │ │ │ │ ├── morris.css │ │ │ │ └── show-hint.css │ │ │ │ ├── fonts │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── img │ │ │ │ └── glyphicons-halflings.png │ │ └── WEB-INF │ │ │ └── views │ │ │ ├── public │ │ │ ├── tcss.jsp │ │ │ ├── tagcss.jsp │ │ │ ├── tscript.jsp │ │ │ ├── script.jsp │ │ │ └── css.jsp │ │ │ ├── error │ │ │ ├── 404.jsp │ │ │ ├── 405.jsp │ │ │ ├── 500.jsp │ │ │ ├── 403.jsp │ │ │ ├── 503.jsp │ │ │ └── 100.jsp │ │ │ └── applications │ │ │ ├── failed.jsp │ │ │ ├── killed.jsp │ │ │ └── finished.jsp │ └── java │ │ └── org │ │ └── smartloli │ │ └── hive │ │ └── cube │ │ └── web │ │ ├── dao │ │ ├── ProcessDao.xml │ │ ├── SchedulerDao.xml │ │ ├── ProcessDao.java │ │ ├── ExportDao.java │ │ ├── SchedulerDao.java │ │ ├── RowkeyDao.xml │ │ ├── DashboardDao.java │ │ ├── RowkeyDao.java │ │ ├── HiveDao.java │ │ ├── RoleDao.java │ │ ├── UserDao.java │ │ ├── ResourcesDao.java │ │ ├── StorageDao.java │ │ ├── ExportDao.xml │ │ ├── ResourcesDao.xml │ │ ├── StorageDao.xml │ │ ├── HiveDao.xml │ │ ├── TasksDao.java │ │ └── RoleDao.xml │ │ ├── service │ │ ├── DashboardService.java │ │ ├── EngineService.java │ │ ├── SchedulerService.java │ │ ├── ApplicationsService.java │ │ ├── ExportService.java │ │ ├── MetricsService.java │ │ ├── HdfsService.java │ │ ├── RowkeyService.java │ │ ├── RoleService.java │ │ ├── ResourceService.java │ │ ├── AccountService.java │ │ ├── HiveService.java │ │ ├── TasksService.java │ │ └── StorageService.java │ │ ├── controller │ │ └── BaseController.java │ │ ├── task │ │ ├── TaskFactory.java │ │ ├── ThreadExecutor.java │ │ └── ScheduleTask.java │ │ └── sso │ │ └── pojo │ │ ├── Resources.java │ │ └── SSOAuthenticationToken.java │ └── test │ └── java │ └── org │ └── smartloli │ └── hive │ └── cube │ └── web │ └── util │ └── HiveUtilsTest.java ├── .travis.yml ├── pom.xml ├── hive-cube-plugins ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── smartloli │ │ └── hive │ │ └── cube │ │ └── plugins │ │ ├── util │ │ └── JConstants.java │ │ ├── server │ │ └── TomcatServerListen.java │ │ └── hbase │ │ ├── HBaseRuntimeException.java │ │ └── HBaseSchemaFactory.java │ └── test │ └── java │ └── org │ └── smartloli │ └── hive │ └── cube │ └── plugins │ └── server │ └── TomcatServerListenTest.java ├── hive-cube-core ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── smartloli │ └── hive │ └── cube │ └── core │ └── metrics │ ├── HadoopMetricsProvider.java │ ├── HadoopMetricsFactory.java │ └── HadoopMetricsService.java ├── hive-cube-common └── src │ └── main │ ├── resources │ └── log4j.properties │ └── java │ └── org │ └── smartloli │ └── hive │ └── cube │ └── common │ ├── pojo │ ├── SchedulerTask.java │ ├── D3.java │ ├── UserRole.java │ ├── RoleResource.java │ ├── HBaseSchema.java │ ├── TaskProcess.java │ ├── Role.java │ ├── RegionServer.java │ ├── Queue.java │ ├── HiveJobRecord.java │ ├── HiveTable.java │ ├── Rowkey.java │ ├── Dashboard.java │ ├── HiveSyncStatus.java │ ├── Scheduler.java │ └── Signiner.java │ └── util │ └── FileSystemSingleton.java └── hive-cube-api ├── src ├── test │ └── java │ │ └── org │ │ └── smartloli │ │ └── hive │ │ └── cube │ │ └── api │ │ └── email │ │ └── EmailTest.java └── main │ └── java │ └── org │ └── smartloli │ └── hive │ └── cube │ └── api │ └── email │ └── MyAuthenticator.java └── pom.xml /hive-cube-web/src/main/resources/kms/work/Readme.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/temp/safeToDelete.tmp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/webapps/Readme.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/error/error.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/system/notice.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/el-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/el-api.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/jasper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/jasper.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/img/favicon.ico -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/bootstrap.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/bin/bootstrap.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/catalina.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/catalina.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/ecj-4.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/ecj-4.5.1.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/jasper-el.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/jasper-el.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/jsp-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/jsp-api.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/img/mf_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/img/mf_login.png -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/tomcat-juli.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/bin/tomcat-juli.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/catalina-ha.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/catalina-ha.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/jaspic-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/jaspic-api.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/servlet-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/servlet-api.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/tomcat-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/tomcat-api.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/tomcat-dbcp.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/tomcat-dbcp.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/tomcat-jdbc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/tomcat-jdbc.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/tomcat-jni.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/tomcat-jni.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/tomcat-util.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/tomcat-util.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/commons-daemon.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/bin/commons-daemon.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/catalina-ant.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/catalina-ant.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/tomcat-coyote.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/tomcat-coyote.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/tomcat-i18n-es.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/tomcat-i18n-es.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/tomcat-i18n-fr.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/tomcat-i18n-fr.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/tomcat-i18n-ja.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/tomcat-i18n-ja.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/websocket-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/websocket-api.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/tomcat-native.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/bin/tomcat-native.tar.gz -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/annotations-api.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/annotations-api.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/catalina-tribes.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/catalina-tribes.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/tomcat-util-scan.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/tomcat-util-scan.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/tomcat-websocket.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/tomcat-websocket.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/public/tcss.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="UTF-8"%> 2 | 3 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/public/account/hfc.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/public/account/hfc.ttf -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/public/account/hfd.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/public/account/hfd.ttf -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/lib/catalina-storeconfig.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/lib/catalina-storeconfig.jar -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/commons-daemon-native.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/resources/kms/bin/commons-daemon-native.tar.gz -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | before_install: 5 | - "echo skipped" 6 | install: 7 | - "echo skipped" 8 | script: 9 | - "echo skipped" 10 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/public/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/public/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/public/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/public/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/public/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/public/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/public/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/public/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/public/images/ui-bg_glass_75_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/public/images/ui-bg_glass_75_ffffff_1x400.png -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/public/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smartloli/hive-cube/HEAD/hive-cube-web/src/main/webapp/media/css/public/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/public/tagcss.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="UTF-8"%> 2 | 3 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/public/bootstrap-treeview.min.css: -------------------------------------------------------------------------------- 1 | .treeview .list-group-item{cursor:pointer}.treeview span.indent{margin-left:10px;margin-right:10px}.treeview span.icon{width:12px;margin-right:5px}.treeview .node-disabled{color:silver;cursor:not-allowed} -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/public/tscript.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="UTF-8" language="java"%> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 3 | 4 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/account/signin.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('#pwd').bind('focus', function() { 3 | $(this).attr('type', 'password'); 4 | }); 5 | 6 | $('#pwd').bind('keypress', function(event) { 7 | if (event.keyCode == "13") { 8 | contextFormValid(); 9 | } 10 | }); 11 | $("a[id='submit']").click(function() { 12 | contextFormValid(); 13 | }); 14 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/public/morris.css: -------------------------------------------------------------------------------- 1 | .morris-hover{position:absolute;z-index:1000}.morris-hover.morris-default-style{border-radius:10px;padding:6px;color:#666;background:rgba(255,255,255,0.8);border:solid 2px rgba(230,230,230,0.8);font-family:sans-serif;font-size:12px;text-align:center}.morris-hover.morris-default-style .morris-hover-row-label{font-weight:bold;margin:0.25em 0} 2 | .morris-hover.morris-default-style .morris-hover-point{white-space:nowrap;margin:0.1em 0} 3 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | org.smartloli.hive.cube 5 | hive-cube 6 | 1.0.0 7 | pom 8 | 9 | hive-cube-api 10 | hive-cube-common 11 | hive-cube-core 12 | hive-cube-plugins 13 | hive-cube-web 14 | 15 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/ProcessDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | replace into 14 | process(task_id,app_id,`log`) value(#{taskId},#{appId},#{log}) 15 | 16 | 17 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/css/public/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | white-space: pre; 29 | color: black; 30 | cursor: pointer; 31 | } 32 | 33 | li.CodeMirror-hint-active { 34 | background: #08f; 35 | color: white; 36 | } 37 | -------------------------------------------------------------------------------- /hive-cube-plugins/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.smartloli.hive.cube 8 | hive-cube 9 | 1.0.0 10 | 11 | hive-cube-plugins 12 | 13 | UTF-8 14 | 15 | 16 | 17 | org.smartloli.hive.cube 18 | hive-cube-common 19 | ${project.version} 20 | 21 | 22 | dom4j 23 | dom4j 24 | 1.6.1 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/public/script.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="UTF-8" language="java"%> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | <% 12 | String[] loader = request.getParameterValues("loader"); 13 | if (loader == null) { 14 | return; 15 | } 16 | for (String s : loader) { 17 | %> 18 | 19 | <% 20 | } 21 | %> 22 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/applications/failed.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#result").dataTable({ 3 | "bSort" : false, 4 | "bLengthChange" : false, 5 | "bProcessing" : true, 6 | "bServerSide" : true, 7 | "fnServerData" : retrieveData, 8 | "sAjaxSource" : "/hc/applications/yarn/failed/ajax", 9 | "aoColumns" : [ { 10 | "mData" : 'id' 11 | }, { 12 | "mData" : 'user' 13 | }, { 14 | "mData" : 'name' 15 | }, { 16 | "mData" : 'app_type' 17 | }, { 18 | "mData" : 'start_time' 19 | }, { 20 | "mData" : 'finish_time' 21 | }, { 22 | "mData" : 'state' 23 | }, { 24 | "mData" : 'final_status' 25 | }, { 26 | "mData" : 'progress' 27 | } ] 28 | }); 29 | 30 | function retrieveData(sSource, aoData, fnCallback) { 31 | $.ajax({ 32 | "type" : "get", 33 | "contentType" : "application/json", 34 | "url" : sSource, 35 | "dataType" : "json", 36 | "data" : { 37 | aoData : JSON.stringify(aoData) 38 | }, 39 | "success" : function(data) { 40 | fnCallback(data) 41 | } 42 | }); 43 | } 44 | 45 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/applications/finished.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | $("#result").dataTable({ 4 | "bSort" : false, 5 | "bLengthChange" : false, 6 | "bProcessing" : true, 7 | "bServerSide" : true, 8 | "fnServerData" : retrieveData, 9 | "sAjaxSource" : "/hc/applications/yarn/finished/ajax", 10 | "aoColumns" : [ { 11 | "mData" : 'id' 12 | }, { 13 | "mData" : 'user' 14 | }, { 15 | "mData" : 'name' 16 | }, { 17 | "mData" : 'app_type' 18 | } , { 19 | "mData" : 'start_time' 20 | }, { 21 | "mData" : 'finish_time' 22 | }, { 23 | "mData" : 'state' 24 | }, { 25 | "mData" : 'final_status' 26 | }, { 27 | "mData" : 'progress' 28 | }] 29 | }); 30 | 31 | function retrieveData(sSource, aoData, fnCallback) { 32 | $.ajax({ 33 | "type" : "get", 34 | "contentType" : "application/json", 35 | "url" : sSource, 36 | "dataType" : "json", 37 | "data" : { 38 | aoData : JSON.stringify(aoData) 39 | }, 40 | "success" : function(data) { 41 | fnCallback(data) 42 | } 43 | }); 44 | } 45 | 46 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/applications/killed.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | $("#result").dataTable({ 4 | "bSort" : false, 5 | "bLengthChange" : false, 6 | "bProcessing" : true, 7 | "bServerSide" : true, 8 | "fnServerData" : retrieveData, 9 | "sAjaxSource" : "/hc/applications/yarn/killed/ajax", 10 | "aoColumns" : [ { 11 | "mData" : 'id' 12 | }, { 13 | "mData" : 'user' 14 | }, { 15 | "mData" : 'name' 16 | }, { 17 | "mData" : 'app_type' 18 | } , { 19 | "mData" : 'start_time' 20 | }, { 21 | "mData" : 'finish_time' 22 | }, { 23 | "mData" : 'state' 24 | }, { 25 | "mData" : 'final_status' 26 | }, { 27 | "mData" : 'progress' 28 | }] 29 | }); 30 | 31 | function retrieveData(sSource, aoData, fnCallback) { 32 | $.ajax({ 33 | "type" : "get", 34 | "contentType" : "application/json", 35 | "url" : sSource, 36 | "dataType" : "json", 37 | "data" : { 38 | aoData : JSON.stringify(aoData) 39 | }, 40 | "success" : function(data) { 41 | fnCallback(data) 42 | } 43 | }); 44 | } 45 | 46 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/SchedulerDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | replace into 14 | scheduler(task_id,cron_expression,task_switch) 15 | value(#{taskId},#{cronExpression},#{taskSwitch}) 16 | 17 | 18 | 21 | 22 | 23 | delete from 24 | scheduler where task_id=#{id} 25 | 26 | 27 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/config/hive.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#result").dataTable({ 3 | "bSort" : false, 4 | "bLengthChange" : false, 5 | "bProcessing" : true, 6 | "bServerSide" : true, 7 | "fnServerData" : retrieveData, 8 | "sAjaxSource" : "/hc/config/hive/all/table/ajax", 9 | "aoColumns" : [ { 10 | "mData" : 'tablename' 11 | }, { 12 | "mData" : 'aliasname' 13 | }, { 14 | "mData" : 'status' 15 | }, { 16 | "mData" : 'time' 17 | }, { 18 | "mData" : 'operate' 19 | } ] 20 | }); 21 | 22 | function retrieveData(sSource, aoData, fnCallback) { 23 | $.ajax({ 24 | "type" : "get", 25 | "contentType" : "application/json", 26 | "url" : sSource, 27 | "dataType" : "json", 28 | "data" : { 29 | aoData : JSON.stringify(aoData) 30 | }, 31 | "success" : function(data) { 32 | fnCallback(data) 33 | } 34 | }); 35 | } 36 | 37 | $(document).on('click', 'a[name=operater_modal]', function() { 38 | var href = $(this).attr("href"); 39 | var tableName = href.split("#")[1]; 40 | console.log(tableName); 41 | $("#hc_name_hive_table").val(tableName); 42 | $('#hc_edit_dialog').modal('show'); 43 | }); 44 | 45 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/public/css.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="UTF-8"%> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | <% 15 | String[] loader = request.getParameterValues("css"); 16 | if (loader == null) { 17 | return; 18 | } 19 | for (String s : loader) { 20 | %> 21 | 22 | <% 23 | } 24 | %> -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/error/404.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 9 | 404 - Hive Cube 10 | 11 | 12 |
13 |
14 |
15 | 29 |
30 |
31 |
32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/error/405.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 9 | 405 - Hive Cube 10 | 11 | 12 |
13 |
14 |
15 | 29 |
30 |
31 |
32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/error/500.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 9 | 500 - Hive Cube 10 | 11 | 12 |
13 |
14 |
15 | 29 |
30 |
31 |
32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/error/403.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 9 | 403 - Hive Cube 10 | 11 | 12 |
13 |
14 |
15 | 29 |
30 |
31 |
32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/error/503.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 9 | 503 - Hive Cube 10 | 11 | 12 |
13 |
14 |
15 | 29 |
30 |
31 |
32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/DashboardService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | /** 21 | * Dashboard service interface. 22 | * 23 | * @author smartloli. 24 | * 25 | * Created by Jan 17, 2017. 26 | */ 27 | public interface DashboardService { 28 | 29 | public String getDashboard(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/error/100.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 9 | 100 - Hive Cube 10 | 11 | 12 |
13 |
14 |
15 | 30 |
31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /hive-cube-core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.smartloli.hive.cube 8 | hive-cube 9 | 1.0.0 10 | 11 | hive-cube-core 12 | hive-cube-core 13 | 14 | UTF-8 15 | 16 | 17 | 18 | org.smartloli.hive.cube 19 | hive-cube-common 20 | ${project.version} 21 | 22 | 23 | org.smartloli.hive.cube 24 | hive-cube-api 25 | ${project.version} 26 | 27 | 28 | org.smartloli.hive.cube 29 | hive-cube-plugins 30 | ${project.version} 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /hive-cube-core/src/main/java/org/smartloli/hive/cube/core/metrics/HadoopMetricsProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.core.metrics; 19 | 20 | /** 21 | * Hadoop provider HadoopMetricsProvider visitor enter. 22 | * 23 | * @author smartloli. 24 | * 25 | * Created by Jul 13, 2017 26 | */ 27 | public interface HadoopMetricsProvider { 28 | public HadoopMetricsService create(); 29 | } 30 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/conf/jaspic-providers.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/ProcessDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.dao; 19 | 20 | import org.smartloli.hive.cube.common.pojo.TaskProcess; 21 | 22 | /** 23 | * Proccess dao interface. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 8, 2017 28 | */ 29 | public interface ProcessDao { 30 | 31 | public int updateTaskProcess(TaskProcess taskProcess); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/ExportDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.dao; 19 | 20 | import org.smartloli.hive.cube.common.pojo.Task; 21 | 22 | /** 23 | * Export dao interface. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 2, 2017 28 | */ 29 | public interface ExportDao { 30 | 31 | public int findManualRunningTaskCount(); 32 | 33 | public int insertCustomTask(Task task); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /hive-cube-core/src/main/java/org/smartloli/hive/cube/core/metrics/HadoopMetricsFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.core.metrics; 19 | 20 | /** 21 | * Hadoop factory implements HadoopMetricsProvider service. 22 | * 23 | * @author smartloli. 24 | * 25 | * Created by Jul 13, 2017 26 | */ 27 | public class HadoopMetricsFactory implements HadoopMetricsProvider{ 28 | 29 | @Override 30 | public HadoopMetricsService create() { 31 | return new HadoopMetricsServiceImpl(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/EngineService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | import org.smartloli.hive.cube.common.pojo.Task; 21 | 22 | /** 23 | * Engine service interface. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 8, 2017 28 | */ 29 | public interface EngineService { 30 | 31 | public String executeQuery(int id, String sql, String column); 32 | 33 | public int modifyTaskStatus(Task task); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/SchedulerService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | import org.smartloli.hive.cube.common.pojo.Scheduler; 21 | 22 | /** 23 | * Scheduler service interface 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 12, 2017 28 | */ 29 | public interface SchedulerService { 30 | 31 | public String getSchedulerByTaskId(int id); 32 | 33 | public int updateScheduler(Scheduler scheduler); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/config/hive.column.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | var url = window.location.href; 3 | var tmp = url.split("hive/")[1]; 4 | var tableName = tmp.split("/")[0]; 5 | $("#hc_table_name_head").find("strong").text(tableName); 6 | 7 | $("#result").dataTable({ 8 | "bSort" : false, 9 | "bLengthChange" : false, 10 | "bProcessing" : true, 11 | "bServerSide" : true, 12 | "fnServerData" : retrieveData, 13 | "sAjaxSource" : "/hc/config/hive/columns/table/" + tableName + "/ajax", 14 | "aoColumns" : [ { 15 | "mData" : 'column_name' 16 | }, { 17 | "mData" : 'comment' 18 | }, { 19 | "mData" : 'type' 20 | }, { 21 | "mData" : 'operate' 22 | } ] 23 | }); 24 | 25 | function retrieveData(sSource, aoData, fnCallback) { 26 | $.ajax({ 27 | "type" : "get", 28 | "contentType" : "application/json", 29 | "url" : sSource, 30 | "dataType" : "json", 31 | "data" : { 32 | aoData : JSON.stringify(aoData) 33 | }, 34 | "success" : function(data) { 35 | fnCallback(data) 36 | } 37 | }); 38 | } 39 | 40 | $(document).on('click', 'a[name=operater_modal]', function() { 41 | var href = $(this).attr("href"); 42 | var column = href.split("#")[1]; 43 | $("#hc_name_hive_table").val(tableName); 44 | $("#hc_column_name_hive_table").val(column); 45 | $('#hc_edit_dialog').modal('show'); 46 | }); 47 | 48 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/SchedulerDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.dao; 19 | 20 | import org.smartloli.hive.cube.common.pojo.Scheduler; 21 | 22 | /** 23 | * Scheduler dao interface. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 12, 2017 28 | */ 29 | public interface SchedulerDao { 30 | 31 | public int deleteSchedulerById(int id); 32 | 33 | public Scheduler getSchedulerByTaskId(int id); 34 | 35 | public int updateScheduler(Scheduler scheduler); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, SLOG, CONSOLE, SERROR 2 | 3 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 4 | log4j.appender.CONSOLE.Target=System.out 5 | log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p [%c{1}.%t] - %m%n 7 | 8 | ############################## 9 | # SLOG Everyday 10 | ############################## 11 | log4j.appender.SLOG=org.apache.log4j.DailyRollingFileAppender 12 | log4j.appender.SLOG.File=logs/log.log 13 | log4j.appender.SLOG.Threshold=DEBUG 14 | log4j.appender.SLOG.Append=true 15 | log4j.appender.SLOG.DatePattern='.'yyyy-MM-dd 16 | log4j.appender.SLOG.layout=org.apache.log4j.PatternLayout 17 | log4j.appender.SLOG.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %c{1}.%t - %-5p - %m%n 18 | log4j.appender.SLOG.Encoding=UTF-8 19 | 20 | ############################## 21 | # SERROR Everyday 22 | ############################## 23 | log4j.appender.SERROR=org.apache.log4j.DailyRollingFileAppender 24 | log4j.appender.SERROR.File=logs/error.log 25 | log4j.appender.SERROR.Threshold=ERROR 26 | log4j.appender.SERROR.Append=true 27 | log4j.appender.SERROR.DatePattern='.'yyyy-MM-dd 28 | log4j.appender.SERROR.layout=org.apache.log4j.PatternLayout 29 | log4j.appender.SERROR.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %c{1}.%t - %-5p - %m%n 30 | log4j.appender.SERROR.Encoding=UTF-8 -------------------------------------------------------------------------------- /hive-cube-common/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, SLOG, CONSOLE, SERROR 2 | 3 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 4 | log4j.appender.CONSOLE.Target=System.out 5 | log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p [%c{1}.%t] - %m%n 7 | 8 | ############################## 9 | # SLOG Everyday 10 | ############################## 11 | log4j.appender.SLOG=org.apache.log4j.DailyRollingFileAppender 12 | log4j.appender.SLOG.File=logs/log.log 13 | log4j.appender.SLOG.Threshold=DEBUG 14 | log4j.appender.SLOG.Append=true 15 | log4j.appender.SLOG.DatePattern='.'yyyy-MM-dd 16 | log4j.appender.SLOG.layout=org.apache.log4j.PatternLayout 17 | log4j.appender.SLOG.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %c{1}.%t - %-5p - %m%n 18 | log4j.appender.SLOG.Encoding=UTF-8 19 | 20 | ############################## 21 | # SERROR Everyday 22 | ############################## 23 | log4j.appender.SERROR=org.apache.log4j.DailyRollingFileAppender 24 | log4j.appender.SERROR.File=logs/error.log 25 | log4j.appender.SERROR.Threshold=ERROR 26 | log4j.appender.SERROR.Append=true 27 | log4j.appender.SERROR.DatePattern='.'yyyy-MM-dd 28 | log4j.appender.SERROR.layout=org.apache.log4j.PatternLayout 29 | log4j.appender.SERROR.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %c{1}.%t - %-5p - %m%n 30 | log4j.appender.SERROR.Encoding=UTF-8 -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/conf/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, SLOG, CONSOLE, SERROR 2 | 3 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 4 | log4j.appender.CONSOLE.Target=System.out 5 | log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p [%c{1}.%t] - %m%n 7 | 8 | ############################## 9 | # SLOG Everyday 10 | ############################## 11 | log4j.appender.SLOG=org.apache.log4j.DailyRollingFileAppender 12 | log4j.appender.SLOG.File=logs/log.log 13 | log4j.appender.SLOG.Threshold=DEBUG 14 | log4j.appender.SLOG.Append=true 15 | log4j.appender.SLOG.DatePattern='.'yyyy-MM-dd 16 | log4j.appender.SLOG.layout=org.apache.log4j.PatternLayout 17 | log4j.appender.SLOG.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %c{1}.%t - %-5p - %m%n 18 | log4j.appender.SLOG.Encoding=UTF-8 19 | 20 | ############################## 21 | # SERROR Everyday 22 | ############################## 23 | log4j.appender.SERROR=org.apache.log4j.DailyRollingFileAppender 24 | log4j.appender.SERROR.File=logs/error.log 25 | log4j.appender.SERROR.Threshold=ERROR 26 | log4j.appender.SERROR.Append=true 27 | log4j.appender.SERROR.DatePattern='.'yyyy-MM-dd 28 | log4j.appender.SERROR.layout=org.apache.log4j.PatternLayout 29 | log4j.appender.SERROR.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %c{1}.%t - %-5p - %m%n 30 | log4j.appender.SERROR.Encoding=UTF-8 -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/applications/all.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#result").dataTable({ 3 | "bSort" : false, 4 | "bLengthChange" : false, 5 | "bProcessing" : true, 6 | "bServerSide" : true, 7 | "fnServerData" : retrieveData, 8 | "sAjaxSource" : "/hc/applications/yarn/all/ajax", 9 | "aoColumns" : [ { 10 | "mData" : 'id' 11 | }, { 12 | "mData" : 'user' 13 | }, { 14 | "mData" : 'name' 15 | }, { 16 | "mData" : 'app_type' 17 | }, { 18 | "mData" : 'start_time' 19 | }, { 20 | "mData" : 'finish_time' 21 | }, { 22 | "mData" : 'state' 23 | }, { 24 | "mData" : 'final_status' 25 | }, { 26 | "mData" : 'progress' 27 | }, { 28 | "mData" : 'operate' 29 | } ] 30 | }); 31 | 32 | function retrieveData(sSource, aoData, fnCallback) { 33 | $.ajax({ 34 | "type" : "get", 35 | "contentType" : "application/json", 36 | "url" : sSource, 37 | "dataType" : "json", 38 | "data" : { 39 | aoData : JSON.stringify(aoData) 40 | }, 41 | "success" : function(data) { 42 | fnCallback(data) 43 | } 44 | }); 45 | } 46 | 47 | $(document).on('click', 'a[name=killed]', function() { 48 | var href = $(this).attr("href"); 49 | var appId = href.split("#")[1]; 50 | $("#killed_div").html(""); 51 | $("#killed_div").append("Killed"); 52 | $('#doc_info').modal('show'); 53 | }); 54 | 55 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/RowkeyDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | replace into 15 | rowkey(tname,regular,author) value(#{tname},#{regular},#{author}) 16 | 17 | 18 | 19 | delete from 20 | rowkey 21 | where tname=#{tname} 22 | 23 | 24 | 33 | 34 | 37 | 38 | 42 | 43 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/applications/running.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | $("#result").dataTable({ 4 | "bSort" : false, 5 | "bLengthChange" : false, 6 | "bProcessing" : true, 7 | "bServerSide" : true, 8 | "fnServerData" : retrieveData, 9 | "sAjaxSource" : "/hc/applications/yarn/running/ajax", 10 | "aoColumns" : [ { 11 | "mData" : 'id' 12 | }, { 13 | "mData" : 'user' 14 | }, { 15 | "mData" : 'name' 16 | }, { 17 | "mData" : 'app_type' 18 | }, { 19 | "mData" : 'start_time' 20 | }, { 21 | "mData" : 'finish_time' 22 | }, { 23 | "mData" : 'state' 24 | }, { 25 | "mData" : 'final_status' 26 | }, { 27 | "mData" : 'progress' 28 | }, { 29 | "mData" : 'operate' 30 | } ] 31 | }); 32 | 33 | function retrieveData(sSource, aoData, fnCallback) { 34 | $.ajax({ 35 | "type" : "get", 36 | "contentType" : "application/json", 37 | "url" : sSource, 38 | "dataType" : "json", 39 | "data" : { 40 | aoData : JSON.stringify(aoData) 41 | }, 42 | "success" : function(data) { 43 | fnCallback(data) 44 | } 45 | }); 46 | } 47 | 48 | $(document).on('click', 'a[name=killed]', function() { 49 | var href = $(this).attr("href"); 50 | var appId = href.split("#")[1]; 51 | $("#killed_div").html(""); 52 | $("#killed_div").append("SHUTDOWN"); 53 | $('#doc_info').modal('show'); 54 | }); 55 | 56 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/DashboardDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.dao; 19 | 20 | import java.util.List; 21 | 22 | import org.smartloli.hive.cube.common.pojo.D3; 23 | import org.smartloli.hive.cube.common.pojo.Dashboard; 24 | import org.smartloli.hive.cube.common.pojo.Task; 25 | 26 | /** 27 | * Dashboard dao interface. 28 | * 29 | * @author smartloli. 30 | * 31 | * Created by Jun 21, 2017 32 | */ 33 | public interface DashboardDao { 34 | 35 | public List chart(); 36 | 37 | public List lastest10(); 38 | 39 | public Dashboard panel(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/ApplicationsService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | /** 21 | * Yarn applications task interface. 22 | * 23 | * @author smartloli. 24 | * 25 | * Created by Jul 6, 2017 26 | */ 27 | public interface ApplicationsService { 28 | 29 | /** Get yarn applications data by type. */ 30 | public String getApplications(String type); 31 | 32 | /** Kill application by id. */ 33 | public boolean killApplication(String appId); 34 | 35 | /** Check application id whether exist. */ 36 | public boolean exist(String appId); 37 | } 38 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/conf/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | WEB-INF/web.xml 24 | ${catalina.base}/conf/web.xml 25 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /hive-cube-api/src/test/java/org/smartloli/hive/cube/api/email/EmailTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.api.email; 19 | 20 | import junit.framework.TestCase; 21 | 22 | /** 23 | * Unit test for simple MailUtils. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 28, 2017 28 | */ 29 | public class EmailTest extends TestCase{ 30 | 31 | /** Send email message. */ 32 | public static void send() { 33 | MailUtils mail = new MailUtils(); 34 | mail.setAddress("smartloli.org@gmail.com"); 35 | mail.setContent("Test mail message."); 36 | mail.setSubject("*** Test ***"); 37 | mail.start(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /hive-cube-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.smartloli.hive.cube 8 | hive-cube 9 | 1.0.0 10 | 11 | hive-cube-api 12 | hive-cube-api 13 | 14 | UTF-8 15 | 16 | 17 | 18 | org.smartloli.hive.cube 19 | hive-cube-common 20 | ${project.version} 21 | 22 | 23 | commons-httpclient 24 | commons-httpclient 25 | 3.0 26 | 27 | 28 | commons-logging 29 | commons-logging 30 | 1.1.2 31 | 32 | 33 | javax.mail 34 | mail 35 | 1.4.7 36 | 37 | 38 | commons-lang 39 | commons-lang 40 | 2.6 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/ExportService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | import org.smartloli.hive.cube.common.pojo.Task; 21 | 22 | import com.alibaba.fastjson.JSONObject; 23 | 24 | /** 25 | * Export service interface. 26 | * 27 | * @author smartloli. 28 | * 29 | * Created by May 28, 2017 30 | */ 31 | public interface ExportService { 32 | 33 | public int findManualRunningTaskCount(); 34 | 35 | public JSONObject getHivePartOfTable(String name); 36 | 37 | public String getHiveTableColumnsByTableName(String tableName); 38 | 39 | public int insertCustomTask(Task task); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/index.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | var chart = Morris.Area({ 3 | element : 'morris-area-chart', 4 | data : [], 5 | xkey : 'period', 6 | ykeys : [ 'New Tasks' ], 7 | labels : [ 'New Tasks' ], 8 | lineColors : [ '#7cb47c' ], 9 | pointSize : 2, 10 | hideHover : 'auto', 11 | resize : true 12 | }); 13 | 14 | function dashboard() { 15 | $.ajax({ 16 | type : 'get', 17 | dataType : 'json', 18 | url : '/hc/dash/tasks/ajax', 19 | success : function(datas) { 20 | $('#task_finished_count').text(datas.panel.finished); 21 | $('#task_running_count').text(datas.panel.running); 22 | $('#task_queue_count').text(datas.panel.queue); 23 | $('#task_failed_count').text(datas.panel.failed); 24 | chart.setData(datas.chart); 25 | lastest10(datas.lastest); 26 | } 27 | }); 28 | } 29 | 30 | function lastest10(datas) { 31 | var tab = "IDNameOwnerStatusSizeStart TimeEnd Time"; 32 | for (var i = 0; i < datas.length; i++) { 33 | tab += "" + datas[i].id + "" + datas[i].name + "" + datas[i].owner + "" + datas[i].status + "" + datas[i].size + "" + datas[i].stime + "" + datas[i].etime + "" 34 | } 35 | tab += "" 36 | $('#result').html(""); 37 | $('#result').append(tab); 38 | } 39 | 40 | dashboard(); 41 | setInterval(dashboard, 1000 * 60 * 1); 42 | 43 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/RowkeyDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.dao; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.smartloli.hive.cube.common.pojo.Rowkey; 24 | 25 | /** 26 | * Rowkey dao interface. 27 | * 28 | * @author smartloli. 29 | * 30 | * Created by Jun 15, 2017 31 | */ 32 | public interface RowkeyDao { 33 | 34 | public int count(); 35 | 36 | public int deleteRowkeyByName(String tname); 37 | 38 | public Rowkey findRowkeyByName(String tname); 39 | 40 | public List getRowkeys(Map params); 41 | 42 | public int replace(Rowkey rowkey); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/MetricsService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | /** 21 | * Metrics hadoop node healthy and yarn resource used. 22 | * 23 | * @author smartloli. 24 | * 25 | * Created by Jul 7, 2017 26 | */ 27 | public interface MetricsService { 28 | 29 | /** Get yarn resource interface. */ 30 | public String getYarnResource(); 31 | 32 | /** Get hadoop nodes interface. */ 33 | public String getHadoopNodes(); 34 | 35 | /** Get hadoop chart interface. */ 36 | public String getHadoopChart(); 37 | 38 | /** Get hbase region server. */ 39 | public String getHBaseRegionServer(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/SchedulerTask.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * SchedulerTask pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 12, 2017 28 | */ 29 | public class SchedulerTask extends Task { 30 | 31 | private String cronExpression = ""; 32 | 33 | public String getCronExpression() { 34 | return cronExpression; 35 | } 36 | 37 | public void setCronExpression(String cronExpression) { 38 | this.cronExpression = cronExpression; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | return new Gson().toJson(this); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/public/navbar.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | var url = window.location.href; 3 | var ret = url.split("hc")[1]; 4 | if (ret.indexOf("/tasks") > -1) { 5 | $("#demo2").addClass('collapse in'); 6 | $("#demo2").attr("aria-expanded", true); 7 | } else if (ret == "/consumers") { 8 | $("div[id='navbar_click'] li").removeClass('active') 9 | $("#navbar_consumers").addClass('active'); 10 | } else if (ret == "/") { 11 | $("div[id='navbar_click'] li").removeClass('active') 12 | $("#navbar_dash").addClass('active'); 13 | } else if (ret.indexOf("/export") > -1) { 14 | $("#demo").addClass('collapse in'); 15 | $("#demo").attr("aria-expanded", true); 16 | } else if (ret.indexOf("/system") > -1) { 17 | $("#demo1").addClass('collapse in'); 18 | $("#demo1").attr("aria-expanded", true); 19 | }else if (ret.indexOf("/config") > -1) { 20 | $("#demo3").addClass('collapse in'); 21 | $("#demo3").attr("aria-expanded", true); 22 | }else if (ret.indexOf("/metrics") > -1) { 23 | $("#demo4").addClass('collapse in'); 24 | $("#demo4").attr("aria-expanded", true); 25 | }else if (ret.indexOf("/storage") > -1) { 26 | $("#demo5").addClass('collapse in'); 27 | $("#demo5").attr("aria-expanded", true); 28 | }else if (ret.indexOf("/applications") > -1) { 29 | $("#demo6").addClass('collapse in'); 30 | $("#demo6").attr("aria-expanded", true); 31 | } 32 | 33 | $(document).on('click', 'a[name=hc_account_reset]', function() { 34 | $('#hc_account_reset_dialog').modal('show'); 35 | $(".modal-backdrop").css({ 36 | "z-index": "999" 37 | }); 38 | }); 39 | 40 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/shiro-ehcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 23 | 24 | 25 | 32 | 33 | 34 | 41 | 42 | 43 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/conf/shiro-ehcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 23 | 24 | 25 | 32 | 33 | 34 | 41 | 42 | 43 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/storage/mysql.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#result").dataTable({ 3 | "bSort" : false, 4 | "bLengthChange" : false, 5 | "bProcessing" : true, 6 | "bServerSide" : true, 7 | "fnServerData" : retrieveData, 8 | "sAjaxSource" : "/hc/storage/plugins/mysql/table/ajax", 9 | "aoColumns" : [ { 10 | "mData" : 'host' 11 | }, { 12 | "mData" : 'port' 13 | }, { 14 | "mData" : 'modify' 15 | }, { 16 | "mData" : 'operate' 17 | } ] 18 | }); 19 | 20 | function retrieveData(sSource, aoData, fnCallback) { 21 | $.ajax({ 22 | "type" : "get", 23 | "contentType" : "application/json", 24 | "url" : sSource, 25 | "dataType" : "json", 26 | "data" : { 27 | aoData : JSON.stringify(aoData) 28 | }, 29 | "success" : function(data) { 30 | fnCallback(data) 31 | } 32 | }); 33 | } 34 | 35 | $("#hc-add-mysql-btn").click(function() { 36 | $('#hc_user_mysql_dialog').modal('show'); 37 | }); 38 | 39 | $(document).on('click', 'a[name=operater_modal]', function() { 40 | var href = $(this).attr("href"); 41 | var id = href.split("#")[1]; 42 | $('#hc_user_mysql_dialog').modal('show'); 43 | $.ajax({ 44 | type : 'get', 45 | dataType : 'json', 46 | url : '/hc/storage/find/' + id + '/ajax', 47 | success : function(datas) { 48 | console.log(datas) 49 | $("#hc_mysql_id").val(datas.id); 50 | $("#hc_mysql_host").val(datas.host); 51 | $("#hc_mysql_port").val(datas.port); 52 | $("#hc_mysql_username").val(datas.username); 53 | $("#hc_mysql_password").val(datas.password); 54 | } 55 | }); 56 | }) 57 | }); -------------------------------------------------------------------------------- /hive-cube-api/src/main/java/org/smartloli/hive/cube/api/email/MyAuthenticator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.api.email; 19 | 20 | import javax.mail.Authenticator; 21 | import javax.mail.PasswordAuthentication; 22 | 23 | /** 24 | * @author smartloli. 25 | * 26 | * Created by Oct 11, 2016 27 | */ 28 | public class MyAuthenticator extends Authenticator { 29 | String userName = null; 30 | String password = null; 31 | 32 | public MyAuthenticator() { 33 | } 34 | 35 | public MyAuthenticator(String username, String password) { 36 | this.userName = username; 37 | this.password = password; 38 | } 39 | 40 | protected PasswordAuthentication getPasswordAuthentication() { 41 | return new PasswordAuthentication(userName, password); 42 | } 43 | } -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/D3.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * D3 graph pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 21, 2017 28 | */ 29 | public class D3 { 30 | 31 | private String hour; 32 | private int size; 33 | 34 | public String getHour() { 35 | return hour; 36 | } 37 | 38 | public void setHour(String hour) { 39 | this.hour = hour; 40 | } 41 | 42 | public int getSize() { 43 | return size; 44 | } 45 | 46 | public void setSize(int size) { 47 | this.size = size; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return new Gson().toJson(this); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/HdfsService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | import java.io.InputStream; 21 | 22 | import com.alibaba.fastjson.JSONArray; 23 | 24 | /** 25 | * Hadoop hdfs menu service interface. 26 | * 27 | * @author smartloli. 28 | * 29 | * Created by Jan 19, 2017 30 | */ 31 | public interface HdfsService { 32 | 33 | /** List hdfs menu interface. */ 34 | public JSONArray dir(String path); 35 | 36 | /** Delete file or menu from hdfs interface. */ 37 | public void delete(String path); 38 | 39 | /** Download file from hdfs interface. */ 40 | public InputStream download(String fileName); 41 | 42 | /** Read content from hdfs interface. */ 43 | public String read(String path); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/UserRole.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * UserRole pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by May 25, 2017 28 | */ 29 | public class UserRole { 30 | 31 | private int userId; 32 | private int roleId; 33 | 34 | public int getUserId() { 35 | return userId; 36 | } 37 | 38 | public void setUserId(int userId) { 39 | this.userId = userId; 40 | } 41 | 42 | public int getRoleId() { 43 | return roleId; 44 | } 45 | 46 | public void setRoleId(int roleId) { 47 | this.roleId = roleId; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return new Gson().toJson(this); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/RowkeyService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.smartloli.hive.cube.common.pojo.Rowkey; 24 | 25 | import com.alibaba.fastjson.JSONObject; 26 | 27 | /** 28 | * Rowkey service interface. 29 | * 30 | * @author smartloli. 31 | * 32 | * Created by Jun 15, 2017 33 | */ 34 | public interface RowkeyService { 35 | 36 | public int count(); 37 | 38 | public int deleteRowkeyByName(String tname); 39 | 40 | public String findRowkeyByName(String tname); 41 | 42 | public JSONObject findHBaseSchemaByName(String tname); 43 | 44 | public List getRowkeys(Map params); 45 | 46 | public int replace(Rowkey rowkey); 47 | } 48 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/RoleResource.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * RoleResource pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by May 24, 2017 28 | */ 29 | public class RoleResource { 30 | 31 | private int roleId; 32 | private int resourceId; 33 | 34 | public int getRoleId() { 35 | return roleId; 36 | } 37 | 38 | public void setRoleId(int roleId) { 39 | this.roleId = roleId; 40 | } 41 | 42 | public int getResourceId() { 43 | return resourceId; 44 | } 45 | 46 | public void setResourceId(int resourceId) { 47 | this.resourceId = resourceId; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return new Gson().toJson(this); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/tasks/hc.json.parse.js: -------------------------------------------------------------------------------- 1 | function formatJsonParser(txt, compress) { 2 | var indentChar = ' '; 3 | if (/^\s*$/.test(txt)) { 4 | console.log('数据为空,无法格式化! '); 5 | return; 6 | } 7 | try { 8 | var data = eval('(' + txt + ')'); 9 | } catch (e) { 10 | console.log('数据源语法错误,格式化失败! 错误信息: ' + e.description, 'err'); 11 | return; 12 | } 13 | var draw = [], last = false, This = this, line = compress ? '' : '\n', nodeCount = 0, maxDepth = 0; 14 | 15 | var notify = function(name, value, isLast, indent, formObj) { 16 | nodeCount++; 17 | for (var i = 0, tab = ''; i < indent; i++) 18 | tab += indentChar; 19 | tab = compress ? '' : tab; 20 | maxDepth = ++indent; 21 | if (value && value.constructor == Array) { 22 | draw.push(tab + (formObj ? ('"' + name + '":') : '') + '[' + line); 23 | for (var i = 0; i < value.length; i++) 24 | notify(i, value[i], i == value.length - 1, indent, false); 25 | draw.push(tab + ']' + (isLast ? line : (',' + line))); 26 | } else if (value && typeof value == 'object') { 27 | draw.push(tab + (formObj ? ('"' + name + '":') : '') + '{' + line); 28 | var len = 0, i = 0; 29 | for ( var key in value) 30 | len++; 31 | for ( var key in value) 32 | notify(key, value[key], ++i == len, indent, true); 33 | draw.push(tab + '}' + (isLast ? line : (',' + line))); 34 | } else { 35 | if (typeof value == 'string') 36 | value = '"' + value + '"'; 37 | draw.push(tab + (formObj ? ('"' + name + '":') : '') + value + (isLast ? '' : ',') + line); 38 | } 39 | ; 40 | }; 41 | var isLast = true, indent = 0; 42 | notify('', data, isLast, indent, false); 43 | return draw.join(''); 44 | } -------------------------------------------------------------------------------- /hive-cube-plugins/src/main/java/org/smartloli/hive/cube/plugins/util/JConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.plugins.util; 19 | 20 | /** 21 | * JDBC constants. 22 | * 23 | * @author smartloli. 24 | * 25 | * Created by Jul 7, 2017 26 | */ 27 | public interface JConstants { 28 | 29 | /** Get databases. */ 30 | public static final String SHOW_DATABASES = "SHOW DATABASES"; 31 | 32 | /** Constant property. */ 33 | public static final String DB = "db"; 34 | public static final String COLUMN = "column"; 35 | public static final String DATASETS = "datasets"; 36 | 37 | /** MySql type. */ 38 | public static final String MYSQL = "mysql"; 39 | 40 | /** MySql driver name. */ 41 | public static final String MYSQL_DRIVER = "com.mysql.jdbc.Driver"; 42 | 43 | /** HBase type. */ 44 | public static final String HBASE = "hbase"; 45 | } 46 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/HiveDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.dao; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.smartloli.hive.cube.common.pojo.HiveSyncStatus; 24 | import org.smartloli.hive.cube.common.pojo.HiveTable; 25 | 26 | /** 27 | * Hive dao interface. 28 | * 29 | * @author smartloli. 30 | * 31 | * Created by May 27, 2017 32 | */ 33 | public interface HiveDao { 34 | 35 | public int count(); 36 | 37 | public int findTableByTableName(String tableName); 38 | 39 | public List getHiveSyncStatus(Map params); 40 | 41 | public HiveTable getHiveTableColumnByName(String tableName); 42 | 43 | public int replaceIntoTable(HiveTable hiveTable); 44 | 45 | public int replaceIntoSyncTable(HiveSyncStatus hiveSyncStatus); 46 | } 47 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/HBaseSchema.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | /** 19 | * 20 | */ 21 | package org.smartloli.hive.cube.common.pojo; 22 | 23 | import com.alibaba.fastjson.JSONObject; 24 | import com.google.gson.Gson; 25 | 26 | /** 27 | * HBaseSchema pojo. 28 | * 29 | * @author smartloli. 30 | * 31 | * Created by Jul 10, 2017 32 | */ 33 | public class HBaseSchema { 34 | 35 | private JSONObject schema; 36 | private String sql; 37 | 38 | public JSONObject getSchema() { 39 | return schema; 40 | } 41 | 42 | public void setSchema(JSONObject schema) { 43 | this.schema = schema; 44 | } 45 | 46 | public String getSql() { 47 | return sql; 48 | } 49 | 50 | public void setSql(String sql) { 51 | this.sql = sql; 52 | } 53 | 54 | @Override 55 | public String toString() { 56 | return new Gson().toJson(this); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /hive-cube-plugins/src/test/java/org/smartloli/hive/cube/plugins/server/TomcatServerListenTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | /** 19 | * 20 | */ 21 | package org.smartloli.hive.cube.plugins.server; 22 | 23 | import java.io.File; 24 | 25 | import org.smartloli.hive.cube.plugins.util.DomUtils; 26 | 27 | import junit.framework.TestCase; 28 | 29 | /** 30 | * Unit test for simple TomcatServerListen. 31 | * 32 | * @author smartloli. 33 | * 34 | * Created by Jun 28, 2017 35 | */ 36 | public class TomcatServerListenTest extends TestCase { 37 | 38 | /** Set webui port. */ 39 | public static void setPort() throws Exception { 40 | String docBase = "/test/doc"; 41 | if (!docBase.endsWith(File.separator)) { 42 | docBase += File.separator; 43 | } 44 | DomUtils.setPort("/Users/dengjie/Documents/workspace/hive-cube/hive-cube-plugins/src/main/resources/server.xml", "9092",docBase); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/RoleService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | import java.util.List; 21 | 22 | import org.smartloli.hive.cube.common.pojo.Role; 23 | import org.smartloli.hive.cube.common.pojo.RoleResource; 24 | import org.smartloli.hive.cube.common.pojo.UserRole; 25 | 26 | /** 27 | * RoleService 28 | * 29 | * @author smartloli. 30 | * 31 | * Created by May 24, 2017 32 | */ 33 | public interface RoleService { 34 | public int deleteUserRole(UserRole userRole); 35 | 36 | public int deleteRoleResource(RoleResource roleResource); 37 | 38 | public List findRoleByUserId(int userId); 39 | 40 | public List getRoles(); 41 | 42 | public String getRoleTree(int roleId); 43 | 44 | public int insertRoleResource(RoleResource roleResource); 45 | 46 | public int insertUserRole(UserRole userRole); 47 | } 48 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/RoleDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.dao; 19 | 20 | import java.util.List; 21 | 22 | import org.smartloli.hive.cube.common.pojo.Role; 23 | import org.smartloli.hive.cube.common.pojo.RoleResource; 24 | import org.smartloli.hive.cube.common.pojo.UserRole; 25 | 26 | /** 27 | * Role dao interface. 28 | * 29 | * @author smartloli. 30 | * 31 | * Created by May 24, 2017 32 | */ 33 | public interface RoleDao { 34 | 35 | public int deleteRoleResource(RoleResource roleResource); 36 | 37 | public int deleteUserRole(UserRole userRole); 38 | 39 | public List findRoleByUserId(int userId); 40 | 41 | public List findRoleResourcesByRoleId(int roleId); 42 | 43 | public List getRoles(); 44 | 45 | public int insertRoleResource(RoleResource roleResource); 46 | 47 | public int insertUserRole(UserRole userRole); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.dao; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.smartloli.hive.cube.common.pojo.Signiner; 24 | 25 | /** 26 | * User dao interface. 27 | * 28 | * @author smartloli. 29 | * 30 | * Created by May 16, 2017 31 | */ 32 | public interface UserDao { 33 | 34 | public int delete(Signiner signin); 35 | 36 | public List findUserByRtxNo(int rtxno); 37 | 38 | public List findUserBySearch(Map params); 39 | 40 | public int insertUser(Signiner signin); 41 | 42 | public int modify(Signiner signin); 43 | 44 | public Signiner login(Signiner signin); 45 | 46 | public int reset(Signiner signin); 47 | 48 | public int userCounts(); 49 | 50 | public Signiner findUserById(int id); 51 | 52 | public List getUserEmails(); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/ResourceService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.smartloli.hive.cube.web.sso.pojo.Resources; 24 | 25 | /** 26 | * Resource service interface. 27 | * 28 | * @author smartloli. 29 | * 30 | * Created by May 18, 2017 31 | */ 32 | public interface ResourceService { 33 | public int deleteParentOrChildByResId(Map params); 34 | 35 | public List findRoleIdByUserId(int userId); 36 | 37 | public List findResourceIdByRole(int roleId); 38 | 39 | public List findResourceByParentId(int parentId); 40 | 41 | public List getUserResources(int userId); 42 | 43 | public String getResourcesTree(); 44 | 45 | public List getResourceParent(); 46 | 47 | public int insertResource(Map params); 48 | } 49 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/ResourcesDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.dao; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.smartloli.hive.cube.web.sso.pojo.Resources; 24 | 25 | /** 26 | * Resources dao interface. 27 | * 28 | * @author smartloli. 29 | * 30 | * Created by May 18, 2017 31 | */ 32 | public interface ResourcesDao { 33 | 34 | public int deleteParentOrChildByResId(Map params); 35 | 36 | public List findResourceByParentId(int parentId); 37 | 38 | public List findResourceIdByRole(int roleId); 39 | 40 | public List findRoleIdByUserId(int userId); 41 | 42 | public List getResourceParent(); 43 | 44 | public List getResourcesTree(); 45 | 46 | public Resources getUserResources(int resourceId); 47 | 48 | public int insertResource(Map params); 49 | 50 | } 51 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/TaskProcess.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * TaskProcess pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 8, 2017 28 | */ 29 | public class TaskProcess { 30 | 31 | private int taskId; 32 | private String appId; 33 | private String log; 34 | 35 | public int getTaskId() { 36 | return taskId; 37 | } 38 | 39 | public void setTaskId(int taskId) { 40 | this.taskId = taskId; 41 | } 42 | 43 | public String getAppId() { 44 | return appId; 45 | } 46 | 47 | public void setAppId(String appId) { 48 | this.appId = appId; 49 | } 50 | 51 | public String getLog() { 52 | return log; 53 | } 54 | 55 | public void setLog(String log) { 56 | this.log = log; 57 | } 58 | 59 | @Override 60 | public String toString() { 61 | return new Gson().toJson(this); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/AccountService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.smartloli.hive.cube.common.pojo.Signiner; 24 | 25 | /** 26 | * Account service interface. 27 | * 28 | * @author smartloli. 29 | * 30 | * Created by May 16, 2017 31 | */ 32 | public interface AccountService { 33 | 34 | public int delete(Signiner signin); 35 | 36 | public Signiner findUserByRtxNo(int rtxno); 37 | 38 | public List findUserBySearch(Map params); 39 | 40 | public String findUserById(int id); 41 | 42 | public int insertUser(Signiner signin); 43 | 44 | public int modify(Signiner signin); 45 | 46 | public Signiner login(String username, String password); 47 | 48 | public int reset(Signiner signin); 49 | 50 | public int userCounts(); 51 | 52 | public List getUserEmails(); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/StorageDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.dao; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.smartloli.hive.cube.common.pojo.OdpsContent; 24 | 25 | /** 26 | * StorageDao interface. 27 | * 28 | * @author smartloli. 29 | * 30 | * Created by Jul 7, 2017 31 | */ 32 | public interface StorageDao { 33 | 34 | /** Get page count. */ 35 | public int count(Map param); 36 | 37 | /** Delete storage plugins by id. */ 38 | public int delete(int id); 39 | 40 | /** Checked id whether exist. */ 41 | public int exist(int id); 42 | 43 | /** Find storage by id. */ 44 | public OdpsContent findStorageById(int id); 45 | 46 | /** Get storage plugins data from mysql table. */ 47 | public List get(Map param); 48 | 49 | /** Add or modify storage plugins information. */ 50 | public int replace(OdpsContent odps); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/Role.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * Role pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by May 24, 2017 28 | */ 29 | public class Role { 30 | 31 | private int id; 32 | private String roleName; 33 | private String roleDescriber; 34 | 35 | public int getId() { 36 | return id; 37 | } 38 | 39 | public void setId(int id) { 40 | this.id = id; 41 | } 42 | 43 | public String getRoleName() { 44 | return roleName; 45 | } 46 | 47 | public void setRoleName(String roleName) { 48 | this.roleName = roleName; 49 | } 50 | 51 | public String getRoleDescriber() { 52 | return roleDescriber; 53 | } 54 | 55 | public void setRoleDescriber(String roleDescriber) { 56 | this.roleDescriber = roleDescriber; 57 | } 58 | 59 | @Override 60 | public String toString() { 61 | return new Gson().toJson(this); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/ExportDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | insert into 27 | tasks(`name`,owner,`status`,`log`,`result`,`fileSize`,start_time,end_time,`download`,email,create_time,is_auto,content,parent_id,`rank`) 28 | value(#{name},#{owner},#{status},#{log},#{result},#{fileSize},#{startTime},#{endTime},#{download},#{email},now(),#{isAuto},#{content},#{parentId},#{rank}) 29 | 30 | 31 | 35 | 36 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/catalina-tasks.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 23 | 24 | Catalina Ant Manager, JMX and JSPC Tasks 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /hive-cube-core/src/main/java/org/smartloli/hive/cube/core/metrics/HadoopMetricsService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | /** 19 | * 20 | */ 21 | package org.smartloli.hive.cube.core.metrics; 22 | 23 | import java.util.List; 24 | 25 | import org.smartloli.hive.cube.common.pojo.DataNode; 26 | import org.smartloli.hive.cube.common.pojo.HdfsDir; 27 | import org.smartloli.hive.cube.common.pojo.NameNode; 28 | import org.smartloli.hive.cube.common.pojo.RegionServer; 29 | 30 | /** 31 | * Hadoop cluster information,such as namenode,datanode etc. 32 | * 33 | * @author smartloli. 34 | * 35 | * Created by Jul 13, 2017 36 | */ 37 | public interface HadoopMetricsService { 38 | 39 | /** Get hadoop datanodes information. */ 40 | public List datanodes(); 41 | 42 | /** Get hadoop namenodes information. */ 43 | public NameNode namenodes(); 44 | 45 | /** Get hbase region servers. */ 46 | public List regionServers(); 47 | 48 | /** Get hdfs menu. */ 49 | public List browseDirectory(String path); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/HiveService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.smartloli.hive.cube.common.pojo.HiveSyncStatus; 24 | 25 | import com.alibaba.fastjson.JSONArray; 26 | import com.alibaba.fastjson.JSONObject; 27 | 28 | /** 29 | * Hive service interface. 30 | * 31 | * @author smartloli. 32 | * 33 | * Created by May 27, 2017 34 | */ 35 | public interface HiveService { 36 | 37 | public int count(); 38 | 39 | public int findTableByName(String tableName); 40 | 41 | public List getHiveSyncStatus(Map params); 42 | 43 | public JSONArray getHiveTableColumnByName(String tableName); 44 | 45 | public int modifyColumnCommentByName(String tableName, String columnName, String comment); 46 | 47 | public JSONArray synchronizeAllTableFromHive(); 48 | 49 | public JSONObject synchronizeTableFromHiveByName(String tableName, String aliasName); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/controller/BaseController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.controller; 19 | 20 | import java.io.IOException; 21 | import java.io.OutputStream; 22 | 23 | import javax.servlet.http.HttpServletResponse; 24 | 25 | /** 26 | * Extract returns to common method. 27 | * 28 | * @author smartloli. 29 | * 30 | * Created by Jun 2, 2017 31 | */ 32 | public class BaseController { 33 | 34 | /** Response data to request url. */ 35 | public static void response(byte[] output, HttpServletResponse response) throws IOException { 36 | response.setContentType("text/html;charset=utf-8"); 37 | response.setCharacterEncoding("utf-8"); 38 | response.setHeader("Charset", "utf-8"); 39 | response.setHeader("Cache-Control", "no-cache"); 40 | 41 | output = output == null ? "".getBytes() : output; 42 | response.setContentLength(output.length); 43 | OutputStream out = response.getOutputStream(); 44 | out.write(output); 45 | 46 | out.flush(); 47 | out.close(); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/assembly.xml: -------------------------------------------------------------------------------- 1 | 5 | bin 6 | 7 | tar.gz 8 | 9 | 10 | 11 | src/main/resources/bash/ 12 | /bin 13 | 14 | *.sh 15 | 16 | 17 | 18 | src/main/resources/conf/ 19 | /conf 20 | 21 | *.properties 22 | 23 | 24 | 25 | src/main/resources/sql/ 26 | /sql 27 | 28 | *.sql 29 | 30 | 31 | 32 | src/main/resources 33 | /logs 34 | 35 | 36 | 37 | 38 | 39 | src/main/resources 40 | / 41 | 42 | kms/** 43 | 44 | 45 | 46 | ${project.basedir}/target 47 | /kms/webapps 48 | 49 | hc.war 50 | 51 | 52 | 53 | src/main/resources/plugins/ 54 | /lib 55 | 56 | *.jar 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/task/TaskFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.task; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | import org.smartloli.hive.cube.common.pojo.Queue; 24 | import org.smartloli.hive.cube.common.pojo.Task; 25 | import org.smartloli.hive.cube.common.util.CalendarUtils; 26 | 27 | /** 28 | * The task modifies the factory class and modifies the state of the submission 29 | * to the task queue. 30 | * 31 | * @author smartloli. 32 | * 33 | * Created by Jun 6, 2017 34 | */ 35 | public class TaskFactory { 36 | 37 | /** Modify commit task. */ 38 | public static List modify() { 39 | List queues = TaskQueue.getQueues(); 40 | List tasks = new ArrayList<>(); 41 | for (Queue queue : queues) { 42 | if (queue.getRank() == 0) { 43 | queue.getTask().setStartTime(CalendarUtils.today()); 44 | } 45 | queue.getTask().setStatus(queue.getStatus()); 46 | tasks.add(queue.getTask()); 47 | } 48 | return tasks; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/RegionServer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | /** 19 | * 20 | */ 21 | package org.smartloli.hive.cube.common.pojo; 22 | 23 | import com.google.gson.Gson; 24 | 25 | /** 26 | * RegionServer pojo. 27 | * 28 | * @author smartloli. 29 | * 30 | * Created by Jul 7, 2017 31 | */ 32 | public class RegionServer { 33 | private String regionName; 34 | private String startTime; 35 | private boolean isLive = false; 36 | 37 | public String getRegionName() { 38 | return regionName; 39 | } 40 | 41 | public void setRegionName(String regionName) { 42 | this.regionName = regionName; 43 | } 44 | 45 | public String getStartTime() { 46 | return startTime; 47 | } 48 | 49 | public void setStartTime(String startTime) { 50 | this.startTime = startTime; 51 | } 52 | 53 | public boolean isLive() { 54 | return isLive; 55 | } 56 | 57 | public void setLive(boolean isLive) { 58 | this.isLive = isLive; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return new Gson().toJson(this); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/Queue.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * Queue pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 6, 2017 28 | */ 29 | public class Queue { 30 | 31 | private int rank; 32 | private Task task; 33 | private String status; 34 | private int vip; 35 | 36 | public int getVip() { 37 | return vip; 38 | } 39 | 40 | public void setVip(int vip) { 41 | this.vip = vip; 42 | } 43 | 44 | public String getStatus() { 45 | return status; 46 | } 47 | 48 | public void setStatus(String status) { 49 | this.status = status; 50 | } 51 | 52 | public int getRank() { 53 | return rank; 54 | } 55 | 56 | public void setRank(int rank) { 57 | this.rank = rank; 58 | } 59 | 60 | public Task getTask() { 61 | return task; 62 | } 63 | 64 | public void setTask(Task task) { 65 | this.task = task; 66 | } 67 | 68 | @Override 69 | public String toString() { 70 | return new Gson().toJson(this); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/HiveJobRecord.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * HiveJobRecord pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 8, 2017 28 | */ 29 | public class HiveJobRecord { 30 | private String jobMessage = ""; 31 | private String jobResult = ""; 32 | private String applicationId = ""; 33 | 34 | public String getJobMessage() { 35 | return jobMessage; 36 | } 37 | 38 | public void setJobMessage(String jobMessage) { 39 | this.jobMessage = jobMessage; 40 | } 41 | 42 | public String getJobResult() { 43 | return jobResult; 44 | } 45 | 46 | public void setJobResult(String jobResult) { 47 | this.jobResult = jobResult; 48 | } 49 | 50 | public String getApplicationId() { 51 | return applicationId; 52 | } 53 | 54 | public void setApplicationId(String applicationId) { 55 | this.applicationId = applicationId; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return new Gson().toJson(this); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/HiveTable.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * HiveTable pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by May 27, 2017 28 | */ 29 | public class HiveTable { 30 | 31 | private String tableNameEn; 32 | private String tableNameZh; 33 | private String tableColumnsZh; 34 | 35 | public String getTableNameEn() { 36 | return tableNameEn; 37 | } 38 | 39 | public void setTableNameEn(String tableNameEn) { 40 | this.tableNameEn = tableNameEn; 41 | } 42 | 43 | public String getTableNameZh() { 44 | return tableNameZh; 45 | } 46 | 47 | public void setTableNameZh(String tableNameZh) { 48 | this.tableNameZh = tableNameZh; 49 | } 50 | 51 | public String getTableColumnsZh() { 52 | return tableColumnsZh; 53 | } 54 | 55 | public void setTableColumnsZh(String tableColumnsZh) { 56 | this.tableColumnsZh = tableColumnsZh; 57 | } 58 | 59 | @Override 60 | public String toString() { 61 | return new Gson().toJson(this); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/Rowkey.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * Rowkey pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 15, 2017 28 | */ 29 | public class Rowkey { 30 | 31 | private String tname; 32 | private String regular; 33 | private String author; 34 | private String tm; 35 | 36 | public String getAuthor() { 37 | return author; 38 | } 39 | 40 | public void setAuthor(String author) { 41 | this.author = author; 42 | } 43 | 44 | public String getTname() { 45 | return tname; 46 | } 47 | 48 | public void setTname(String tname) { 49 | this.tname = tname; 50 | } 51 | 52 | public String getRegular() { 53 | return regular; 54 | } 55 | 56 | public void setRegular(String regular) { 57 | this.regular = regular; 58 | } 59 | 60 | public String getTm() { 61 | return tm; 62 | } 63 | 64 | public void setTm(String tm) { 65 | this.tm = tm; 66 | } 67 | 68 | @Override 69 | public String toString() { 70 | return new Gson().toJson(this); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/Dashboard.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * Dashboard pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 21, 2017 28 | */ 29 | public class Dashboard { 30 | 31 | public int finished; 32 | public int running; 33 | public int queue; 34 | public int failed; 35 | 36 | public int getFinished() { 37 | return finished; 38 | } 39 | 40 | public void setFinished(int finished) { 41 | this.finished = finished; 42 | } 43 | 44 | public int getRunning() { 45 | return running; 46 | } 47 | 48 | public void setRunning(int running) { 49 | this.running = running; 50 | } 51 | 52 | public int getQueue() { 53 | return queue; 54 | } 55 | 56 | public void setQueue(int queue) { 57 | this.queue = queue; 58 | } 59 | 60 | public int getFailed() { 61 | return failed; 62 | } 63 | 64 | public void setFailed(int failed) { 65 | this.failed = failed; 66 | } 67 | 68 | @Override 69 | public String toString() { 70 | return new Gson().toJson(this); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/sso/pojo/Resources.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.sso.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * TODO 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by May 17, 2017 28 | */ 29 | public class Resources { 30 | 31 | private int resourceId; 32 | private String name; 33 | private String url; 34 | private int parentId; 35 | 36 | public int getResourceId() { 37 | return resourceId; 38 | } 39 | 40 | public void setResourceId(int resourceId) { 41 | this.resourceId = resourceId; 42 | } 43 | 44 | public String getName() { 45 | return name; 46 | } 47 | 48 | public void setName(String name) { 49 | this.name = name; 50 | } 51 | 52 | public String getUrl() { 53 | return url; 54 | } 55 | 56 | public void setUrl(String url) { 57 | this.url = url; 58 | } 59 | 60 | public int getParentId() { 61 | return parentId; 62 | } 63 | 64 | public void setParentId(int parentId) { 65 | this.parentId = parentId; 66 | } 67 | 68 | @Override 69 | public String toString() { 70 | return new Gson().toJson(this); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/plugins/datatables/dataTables.bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | DataTables Bootstrap 3 integration 3 | ©2011-2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(f.ext.classes, 6 | {sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,m,j,n){var o=new f.Api(a),s=a.oClasses,k=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")}; 7 | l=0;for(h=f.length;l",{"class":s.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("",{href:"#", 8 | "aria-controls":a.sTableId,"aria-label":t[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(u){}q(b(h).empty().html('
    ').children("ul"),m);i&&b(h).find("[data-dt-idx="+i+"]").focus()};return f}); 9 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/config/hbase.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#result").dataTable({ 3 | "bSort" : false, 4 | "bLengthChange" : false, 5 | "bProcessing" : true, 6 | "bServerSide" : true, 7 | "fnServerData" : retrieveData, 8 | "sAjaxSource" : "/hc/config/hbase/rowkey/table/ajax", 9 | "aoColumns" : [ { 10 | "mData" : 'tname' 11 | }, { 12 | "mData" : 'regular' 13 | }, { 14 | "mData" : 'author' 15 | }, { 16 | "mData" : 'time' 17 | }, { 18 | "mData" : 'operate' 19 | } ] 20 | }); 21 | 22 | function retrieveData(sSource, aoData, fnCallback) { 23 | $.ajax({ 24 | "type" : "get", 25 | "contentType" : "application/json", 26 | "url" : sSource, 27 | "dataType" : "json", 28 | "data" : { 29 | aoData : JSON.stringify(aoData) 30 | }, 31 | "success" : function(data) { 32 | fnCallback(data) 33 | } 34 | }); 35 | } 36 | 37 | $(document).on('click', 'a[name=operate_modal_regular]', function() { 38 | $('#hc_see_dialog').modal('show'); 39 | var href = $(this).attr("href"); 40 | var tname = href.split("#")[1]; 41 | $.ajax({ 42 | type : 'get', 43 | dataType : 'json', 44 | url : '/hc/config/hbase/rowkey/regular/' + tname + '/ajax', 45 | success : function(datas) { 46 | $("#hc_hbase_rowkey_see").val(formatJsonParser(datas.regular)); 47 | } 48 | }); 49 | }); 50 | 51 | $(document).on('click', 'a[name=hbase_rowkey_add]', function() { 52 | $('#hc_add_dialog').modal('show'); 53 | }); 54 | 55 | $(document).on('click', 'a[name=operate_modal_edit_rowkey]', function() { 56 | $('#hc_add_dialog').modal('show'); 57 | var href = $(this).attr("href"); 58 | var tname = href.split("#")[1]; 59 | $.ajax({ 60 | type : 'get', 61 | dataType : 'json', 62 | url : '/hc/config/hbase/rowkey/regular/' + tname + '/ajax', 63 | success : function(datas) { 64 | $('#hc_hbase_table').val(datas.tname); 65 | $("#hc_hbase_rowkey_content").val(formatJsonParser(datas.regular)); 66 | } 67 | }); 68 | }); 69 | 70 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/task/ThreadExecutor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.task; 19 | 20 | import java.util.concurrent.PriorityBlockingQueue; 21 | import java.util.concurrent.ThreadPoolExecutor; 22 | import java.util.concurrent.TimeUnit; 23 | 24 | import org.smartloli.hive.cube.common.pojo.Queue; 25 | import org.smartloli.hive.cube.common.util.SystemConfig; 26 | 27 | /** 28 | * The queue thread executes management and allocates thread parameters that 29 | * execute the task queue. 30 | * 31 | * @author smartloli. 32 | * 33 | * Created by Jun 5, 2017 34 | */ 35 | public class ThreadExecutor { 36 | 37 | private static ThreadPoolExecutor executor = null; 38 | 39 | static { 40 | int pool = SystemConfig.getIntProperty("hive.cube.task.thread.pool"); 41 | int maxPool = SystemConfig.getIntProperty("hive.cube.task.thread.max.pool"); 42 | executor = new ThreadPoolExecutor(pool, maxPool, 1, TimeUnit.MILLISECONDS, new PriorityBlockingQueue()); 43 | } 44 | 45 | /** Add task to queue. */ 46 | public static void addTask(int vip, Queue queue) { 47 | executor.execute(new RunnablePriority(vip, queue)); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/HiveSyncStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * HiveSyncStatus pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by May 27, 2017 28 | */ 29 | public class HiveSyncStatus { 30 | 31 | private String tableName; 32 | private String aliasName; 33 | private int code; 34 | private String time; 35 | 36 | public String getAliasName() { 37 | return aliasName; 38 | } 39 | 40 | public void setAliasName(String aliasName) { 41 | this.aliasName = aliasName; 42 | } 43 | 44 | public String getTableName() { 45 | return tableName; 46 | } 47 | 48 | public void setTableName(String tableName) { 49 | this.tableName = tableName; 50 | } 51 | 52 | public int getCode() { 53 | return code; 54 | } 55 | 56 | public void setCode(int code) { 57 | this.code = code; 58 | } 59 | 60 | public String getTime() { 61 | return time; 62 | } 63 | 64 | public void setTime(String time) { 65 | this.time = time; 66 | } 67 | 68 | @Override 69 | public String toString() { 70 | return new Gson().toJson(this); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /hive-cube-web/src/test/java/org/smartloli/hive/cube/web/util/HiveUtilsTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | /** 19 | * 20 | */ 21 | package org.smartloli.hive.cube.web.util; 22 | 23 | import java.sql.ResultSet; 24 | import java.sql.ResultSetMetaData; 25 | import java.sql.SQLException; 26 | import java.util.LinkedHashMap; 27 | import java.util.Map; 28 | 29 | import org.smartloli.hive.cube.common.util.HiveUtils; 30 | 31 | /** 32 | * Test Sample. 33 | * 34 | * @author smartloli. 35 | * 36 | * Created by Jul 4, 2017 37 | */ 38 | public class HiveUtilsTest { 39 | 40 | public static void main(String[] args) throws SQLException { 41 | HiveUtils hive = new HiveUtils(); 42 | ResultSet rs = hive.executeQuery("desc formatted ip_login"); 43 | ResultSetMetaData rsmd = rs.getMetaData(); 44 | int columnCount = rsmd.getColumnCount(); 45 | while (rs.next()) { 46 | Map map = new LinkedHashMap(); 47 | for (int i = 1; i <= columnCount; i++) { 48 | if(rsmd.getColumnName(i).contains("Table Type")){ 49 | } 50 | map.put(rsmd.getColumnName(i), rs.getString(i)); 51 | } 52 | System.out.println(map.toString()); 53 | } 54 | hive.close(rs); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /hive-cube-plugins/src/main/java/org/smartloli/hive/cube/plugins/server/TomcatServerListen.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.plugins.server; 19 | 20 | import java.io.File; 21 | 22 | import org.slf4j.Logger; 23 | import org.slf4j.LoggerFactory; 24 | import org.smartloli.hive.cube.common.util.SystemConfig; 25 | import org.smartloli.hive.cube.plugins.util.DomUtils; 26 | 27 | /** 28 | * Listen tomcat server port 29 | * 30 | * @author smartloli. 31 | * 32 | * Created by Aug 11, 2016 33 | */ 34 | public class TomcatServerListen { 35 | private static Logger LOG = LoggerFactory.getLogger(TomcatServerListen.class); 36 | 37 | public static void main(String[] args) { 38 | try { 39 | String target = System.getProperty("user.dir") + "/kms/conf/server.xml"; 40 | String port = SystemConfig.getProperty("hive.cube.webui.port"); 41 | String docBase = SystemConfig.getProperty("hive.cube.task.export.path"); 42 | if (!docBase.endsWith(File.separator)) { 43 | docBase += File.separator; 44 | } 45 | DomUtils.setPort(target, port, docBase); 46 | } catch (Exception ex) { 47 | ex.printStackTrace(); 48 | LOG.error("Listen Tomcat Server Port Has Error,Msg is " + ex.getMessage()); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/ResourcesDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 17 | 18 | 24 | 25 | 28 | 29 | 32 | 33 | 34 | insert into 35 | resources(name,url,parent_id) value(#{name},#{url},#{parentId}) 36 | 37 | 38 | 43 | 44 | 49 | 50 | 51 | delete from resources 52 | 53 | 54 | resource_id=#{parentId} or parent_id=#{parentId} 55 | 56 | 57 | resource_id=#{resourceId} 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/sso/pojo/SSOAuthenticationToken.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.sso.pojo; 19 | 20 | import org.apache.shiro.authc.AuthenticationToken; 21 | 22 | /** 23 | * TODO 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by May 17, 2017 28 | */ 29 | @SuppressWarnings("unused") 30 | public class SSOAuthenticationToken implements AuthenticationToken { 31 | 32 | /** 33 | * 34 | */ 35 | private static final long serialVersionUID = 1L; 36 | 37 | private int code; 38 | private String realName = ""; 39 | private String userName = ""; 40 | private String email = ""; 41 | 42 | public SSOAuthenticationToken() { 43 | } 44 | 45 | public SSOAuthenticationToken(int code, String realName, String userName, String email) { 46 | this.code = code; 47 | this.realName = realName; 48 | this.userName = userName; 49 | this.email = email; 50 | } 51 | 52 | @Override 53 | public Object getPrincipal() { 54 | return code; 55 | } 56 | 57 | @Override 58 | public Object getCredentials() { 59 | return code; 60 | } 61 | 62 | public int getCode() { 63 | return code; 64 | } 65 | 66 | public void setCode(int code) { 67 | this.code = code; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/StorageDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 29 | 30 | 34 | 35 | 36 | replace into 37 | storage(id,host,port,type,username,password) 38 | value(#{id},#{host},#{port},#{type},#{username},#{password}) 39 | 40 | 41 | 54 | 55 | 58 | 59 | 60 | delete from storage where 61 | id=#{id} 62 | 63 | 64 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/task/ScheduleTask.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.task; 19 | 20 | import org.quartz.Job; 21 | import org.quartz.JobExecutionContext; 22 | import org.quartz.JobExecutionException; 23 | import org.slf4j.Logger; 24 | import org.slf4j.LoggerFactory; 25 | import org.smartloli.hive.cube.common.client.CommonClientConfigs.Scheduler; 26 | import org.smartloli.hive.cube.web.controller.StartupListener; 27 | import org.smartloli.hive.cube.web.service.impl.TasksServiceImpl; 28 | 29 | /** 30 | * Schedule task job. 31 | * 32 | * @author smartloli. 33 | * 34 | * Created by Jun 12, 2017 35 | */ 36 | public class ScheduleTask implements Job { 37 | 38 | private Logger LOG = LoggerFactory.getLogger(ScheduleTask.class); 39 | 40 | @Override 41 | public void execute(JobExecutionContext context) throws JobExecutionException { 42 | int taskId = Integer.parseInt(context.getJobDetail().getJobDataMap().get(Scheduler.NAME).toString()); 43 | TasksServiceImpl taskService = StartupListener.getBean("tasksServiceImpl", TasksServiceImpl.class); 44 | boolean status = taskService.executorPrivateTaskById(taskId); 45 | LOG.info("Schedule task[" + taskId + "] has finished,status[" + status + "]"); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/HiveDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 | replace into 29 | hive_table value(#{tableNameEn},#{tableNameZh},#{tableColumnsZh}) 30 | 31 | 32 | 33 | replace into 34 | hive_sync_status value(#{tableName},#{aliasName},#{code},now()) 35 | 36 | 37 | 41 | 42 | 51 | 52 | 55 | 56 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/TasksService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.smartloli.hive.cube.common.pojo.SchedulerTask; 24 | import org.smartloli.hive.cube.common.pojo.Task; 25 | 26 | 27 | /** 28 | * Tasks service interface. 29 | * 30 | * @author smartloli. 31 | * 32 | * Created by Jun 6, 2017 33 | */ 34 | public interface TasksService { 35 | 36 | public int batchModifyTaskStatus(List tasks); 37 | 38 | public int count(Map params); 39 | 40 | public int deleteTaskById(int id); 41 | 42 | public boolean executorTaskById(int id); 43 | 44 | public boolean executorPrivateTaskById(int id); 45 | 46 | public String findTaskById(int id); 47 | 48 | public List getTasks(Map params); 49 | 50 | public List getPrivateTasks(Map params); 51 | 52 | public String getAppIdByTaskId(int id); 53 | 54 | public String getTaskLogById(int id); 55 | 56 | public int killTaskById(int id); 57 | 58 | public List loadRunningTask(); 59 | 60 | public List loadAutoTask(); 61 | 62 | public int modifyTaskContentByParams(Map params); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/TasksDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.dao; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.smartloli.hive.cube.common.pojo.SchedulerTask; 24 | import org.smartloli.hive.cube.common.pojo.Task; 25 | 26 | /** 27 | * Task dao interface. 28 | * 29 | * @author smartloli. 30 | * 31 | * Created by Jun 6, 2017 32 | */ 33 | public interface TasksDao { 34 | 35 | public int batchModifyTaskStatus(List tasks); 36 | 37 | public int convertOrCancleAutoTask(Map params); 38 | 39 | public int count(Map params); 40 | 41 | public int deleteTaskById(int id); 42 | 43 | public Task findTaskById(int id); 44 | 45 | public String getAppIdByTaskId(int id); 46 | 47 | public List getPrivateTasks(Map params); 48 | 49 | public List getTasks(Map params); 50 | 51 | public String getTaskLogById(int id); 52 | 53 | public List loadRunningTask(); 54 | 55 | public List loadAutoTask(); 56 | 57 | public int modifyTaskContentByParams(Map params); 58 | 59 | public int removeProcessById(int id); 60 | 61 | public int stopTaskById(int id); 62 | 63 | public int startTaskById(int id); 64 | 65 | } 66 | -------------------------------------------------------------------------------- /hive-cube-plugins/src/main/java/org/smartloli/hive/cube/plugins/hbase/HBaseRuntimeException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.plugins.hbase; 19 | 20 | /** 21 | * Run exception information when processing client requests for HBase 22 | * operations. 23 | * 24 | * @author smartloli. 25 | * 26 | * Created by Jun 29, 2017 27 | */ 28 | public class HBaseRuntimeException extends RuntimeException { 29 | 30 | private static final long serialVersionUID = -5026294052354348878L; 31 | 32 | public HBaseRuntimeException() { 33 | super(); 34 | } 35 | 36 | public HBaseRuntimeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 37 | super(message, cause, enableSuppression, writableStackTrace); 38 | } 39 | 40 | public HBaseRuntimeException(String message, Throwable cause) { 41 | super(message, cause); 42 | } 43 | 44 | public HBaseRuntimeException(String message) { 45 | super(message); 46 | } 47 | 48 | public HBaseRuntimeException(Throwable cause) { 49 | super(cause); 50 | } 51 | 52 | public static void format(String format, Object... args) { 53 | format(null, format, args); 54 | } 55 | 56 | public static void format(Throwable cause, String format, Object... args) { 57 | throw new HBaseRuntimeException(String.format(format, args), cause); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/shutdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | # ----------------------------------------------------------------------------- 19 | # Stop script for the CATALINA Server 20 | # ----------------------------------------------------------------------------- 21 | 22 | # Better OS/400 detection: see Bugzilla 31132 23 | os400=false 24 | case "`uname`" in 25 | OS400*) os400=true;; 26 | esac 27 | 28 | # resolve links - $0 may be a softlink 29 | PRG="$0" 30 | 31 | while [ -h "$PRG" ] ; do 32 | ls=`ls -ld "$PRG"` 33 | link=`expr "$ls" : '.*-> \(.*\)$'` 34 | if expr "$link" : '/.*' > /dev/null; then 35 | PRG="$link" 36 | else 37 | PRG=`dirname "$PRG"`/"$link" 38 | fi 39 | done 40 | 41 | PRGDIR=`dirname "$PRG"` 42 | EXECUTABLE=catalina.sh 43 | 44 | # Check that target executable exists 45 | if $os400; then 46 | # -x will Only work on the os400 if the files are: 47 | # 1. owned by the user 48 | # 2. owned by the PRIMARY group of the user 49 | # this will not work if the user belongs in secondary groups 50 | eval 51 | else 52 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then 53 | echo "Cannot find $PRGDIR/$EXECUTABLE" 54 | echo "The file is absent or does not have execute permission" 55 | echo "This file is needed to run this program" 56 | exit 1 57 | fi 58 | fi 59 | 60 | exec "$PRGDIR"/"$EXECUTABLE" stop "$@" 61 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | # ----------------------------------------------------------------------------- 19 | # Start Script for the CATALINA Server 20 | # ----------------------------------------------------------------------------- 21 | 22 | # Better OS/400 detection: see Bugzilla 31132 23 | os400=false 24 | case "`uname`" in 25 | OS400*) os400=true;; 26 | esac 27 | 28 | # resolve links - $0 may be a softlink 29 | PRG="$0" 30 | 31 | while [ -h "$PRG" ] ; do 32 | ls=`ls -ld "$PRG"` 33 | link=`expr "$ls" : '.*-> \(.*\)$'` 34 | if expr "$link" : '/.*' > /dev/null; then 35 | PRG="$link" 36 | else 37 | PRG=`dirname "$PRG"`/"$link" 38 | fi 39 | done 40 | 41 | PRGDIR=`dirname "$PRG"` 42 | EXECUTABLE=catalina.sh 43 | 44 | # Check that target executable exists 45 | if $os400; then 46 | # -x will Only work on the os400 if the files are: 47 | # 1. owned by the user 48 | # 2. owned by the PRIMARY group of the user 49 | # this will not work if the user belongs in secondary groups 50 | eval 51 | else 52 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then 53 | echo "Cannot find $PRGDIR/$EXECUTABLE" 54 | echo "The file is absent or does not have execute permission" 55 | echo "This file is needed to run this program" 56 | exit 1 57 | fi 58 | fi 59 | 60 | exec "$PRGDIR"/"$EXECUTABLE" start "$@" 61 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | # ----------------------------------------------------------------------------- 19 | # Version Script for the CATALINA Server 20 | # ----------------------------------------------------------------------------- 21 | 22 | # Better OS/400 detection: see Bugzilla 31132 23 | os400=false 24 | case "`uname`" in 25 | OS400*) os400=true;; 26 | esac 27 | 28 | # resolve links - $0 may be a softlink 29 | PRG="$0" 30 | 31 | while [ -h "$PRG" ] ; do 32 | ls=`ls -ld "$PRG"` 33 | link=`expr "$ls" : '.*-> \(.*\)$'` 34 | if expr "$link" : '/.*' > /dev/null; then 35 | PRG="$link" 36 | else 37 | PRG=`dirname "$PRG"`/"$link" 38 | fi 39 | done 40 | 41 | PRGDIR=`dirname "$PRG"` 42 | EXECUTABLE=catalina.sh 43 | 44 | # Check that target executable exists 45 | if $os400; then 46 | # -x will Only work on the os400 if the files are: 47 | # 1. owned by the user 48 | # 2. owned by the PRIMARY group of the user 49 | # this will not work if the user belongs in secondary groups 50 | eval 51 | else 52 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then 53 | echo "Cannot find $PRGDIR/$EXECUTABLE" 54 | echo "The file is absent or does not have execute permission" 55 | echo "This file is needed to run this program" 56 | exit 1 57 | fi 58 | fi 59 | 60 | exec "$PRGDIR"/"$EXECUTABLE" version "$@" 61 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/configtest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | # ----------------------------------------------------------------------------- 19 | # Configuration Test Script for the CATALINA Server 20 | # ----------------------------------------------------------------------------- 21 | 22 | # Better OS/400 detection: see Bugzilla 31132 23 | os400=false 24 | case "`uname`" in 25 | OS400*) os400=true;; 26 | esac 27 | 28 | # resolve links - $0 may be a softlink 29 | PRG="$0" 30 | 31 | while [ -h "$PRG" ] ; do 32 | ls=`ls -ld "$PRG"` 33 | link=`expr "$ls" : '.*-> \(.*\)$'` 34 | if expr "$link" : '/.*' > /dev/null; then 35 | PRG="$link" 36 | else 37 | PRG=`dirname "$PRG"`/"$link" 38 | fi 39 | done 40 | 41 | PRGDIR=`dirname "$PRG"` 42 | EXECUTABLE=catalina.sh 43 | 44 | # Check that target executable exists 45 | if $os400; then 46 | # -x will Only work on the os400 if the files are: 47 | # 1. owned by the user 48 | # 2. owned by the PRIMARY group of the user 49 | # this will not work if the user belongs in secondary groups 50 | eval 51 | else 52 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then 53 | echo "Cannot find $PRGDIR/$EXECUTABLE" 54 | echo "The file is absent or does not have execute permission" 55 | echo "This file is needed to run this program" 56 | exit 1 57 | fi 58 | fi 59 | 60 | exec "$PRGDIR"/"$EXECUTABLE" configtest "$@" 61 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/media/js/main/metrics/hadoop.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $.ajax({ 3 | type : 'get', 4 | dataType : 'json', 5 | url : '/hc/metrics/hadoop/nodes/info/ajax', 6 | success : function(datas) { 7 | if (datas != null) { 8 | var nodes = datas.nodes; 9 | $("#nodes_tab").html(""); 10 | 11 | var nodes_tab = "NodeAdmin StateCapacityUsedNon DFS UsedRemainingBlock pool usedLastest Time"; 12 | for (var i = 0; i < nodes.length; i++) { 13 | nodes_tab += " " + nodes[i].hostname + "" + nodes[i].state + "" + nodes[i].capacity + "" + nodes[i].used + "" + nodes[i].non_dfs_used + "" + nodes[i].remaining + "" + nodes[i].block_pool_used + "" + nodes[i].update_date + ""; 14 | } 15 | nodes_tab += "" 16 | $("#nodes_tab").append(nodes_tab); 17 | } 18 | } 19 | }); 20 | 21 | $.ajax({ 22 | type : 'get', 23 | dataType : 'json', 24 | url : '/hc/metrics/hadoop/chart/info/ajax', 25 | success : function(datas) { 26 | if (datas != null) { 27 | console.log(datas); 28 | $("#hdp_version").html("Hadoop "+datas.version); 29 | Morris.Donut({ 30 | element : 'hdp-capacity', 31 | data : [ { 32 | label : "Hadoop Capacity ("+datas.unit+")", 33 | value : datas.capacity 34 | } ], 35 | resize : true 36 | }); 37 | 38 | Morris.Donut({ 39 | element : 'hdp-dfs', 40 | data : [ { 41 | label : "Dfs Used ("+datas.unit+")", 42 | value : datas.dfsUsed 43 | } ,{ 44 | label : "Non DFS Used ("+datas.unit+")", 45 | value : datas.nonDFSUsed 46 | } ,{ 47 | label : "Dfs Remaining ("+datas.unit+")", 48 | value : datas.dfsRemaining 49 | } ], 50 | colors : [ '#3c763d', '#5cb85c','#7cb47c' ], 51 | resize : true 52 | }); 53 | 54 | Morris.Donut({ 55 | element : 'hdp-run-days', 56 | data : [ { 57 | label : "Hadoop Run Days", 58 | value : datas.clusterStartTime 59 | } ], 60 | colors : [ '#6DA398'], 61 | resize : true 62 | }); 63 | } 64 | } 65 | }); 66 | 67 | }); -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/digest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | # ----------------------------------------------------------------------------- 19 | # Script to digest password using the algorithm specified 20 | # ----------------------------------------------------------------------------- 21 | 22 | # Better OS/400 detection: see Bugzilla 31132 23 | os400=false 24 | case "`uname`" in 25 | OS400*) os400=true;; 26 | esac 27 | 28 | # resolve links - $0 may be a softlink 29 | PRG="$0" 30 | 31 | while [ -h "$PRG" ] ; do 32 | ls=`ls -ld "$PRG"` 33 | link=`expr "$ls" : '.*-> \(.*\)$'` 34 | if expr "$link" : '/.*' > /dev/null; then 35 | PRG="$link" 36 | else 37 | PRG=`dirname "$PRG"`/"$link" 38 | fi 39 | done 40 | 41 | PRGDIR=`dirname "$PRG"` 42 | EXECUTABLE=tool-wrapper.sh 43 | 44 | # Check that target executable exists 45 | if $os400; then 46 | # -x will Only work on the os400 if the files are: 47 | # 1. owned by the user 48 | # 2. owned by the PRIMARY group of the user 49 | # this will not work if the user belongs in secondary groups 50 | eval 51 | else 52 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then 53 | echo "Cannot find $PRGDIR/$EXECUTABLE" 54 | echo "The file is absent or does not have execute permission" 55 | echo "This file is needed to run this program" 56 | exit 1 57 | fi 58 | fi 59 | 60 | exec "$PRGDIR"/"$EXECUTABLE" -server org.apache.catalina.realm.RealmBase "$@" 61 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/service/StorageService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.web.service; 19 | 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import javax.servlet.http.HttpServletRequest; 24 | 25 | import org.smartloli.hive.cube.common.pojo.OdpsContent; 26 | 27 | import com.alibaba.fastjson.JSONArray; 28 | 29 | /** 30 | * StorageService interface. 31 | * 32 | * @author smartloli. 33 | * 34 | * Created by Jul 7, 2017 35 | */ 36 | public interface StorageService { 37 | 38 | /** Get page count. */ 39 | public int count(Map param); 40 | 41 | /** Delete storage plugins by id. */ 42 | public int delete(int id); 43 | 44 | /** Checked id whether exist. */ 45 | public boolean exist(int id); 46 | 47 | /** Find storage by id. */ 48 | public String findStorageById(int id); 49 | 50 | /** Get storage plugins data from mysql table. */ 51 | public List get(Map param); 52 | 53 | /** Get hbase sql schema. */ 54 | public String getHBaseSchema(String sql); 55 | 56 | /** Get diff storage dataset. */ 57 | public String getSpecifyById(int id, String action, HttpServletRequest request); 58 | 59 | /** Deal with hbase query. */ 60 | public JSONArray getSpecifyHBase(String sql); 61 | 62 | /** Add or modify storage plugins information. */ 63 | public int replace(OdpsContent odps); 64 | 65 | } 66 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/Scheduler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * Scheduler pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by Jun 12, 2017 28 | */ 29 | public class Scheduler { 30 | 31 | private int taskId; 32 | private String cronExpression; 33 | private int taskSwitch = 0; 34 | private String type = "";// add or modify 35 | public int auto = 0; 36 | 37 | public int getAuto() { 38 | return auto; 39 | } 40 | 41 | public void setAuto(int auto) { 42 | this.auto = auto; 43 | } 44 | 45 | public int getTaskSwitch() { 46 | return taskSwitch; 47 | } 48 | 49 | public void setTaskSwitch(int taskSwitch) { 50 | this.taskSwitch = taskSwitch; 51 | } 52 | 53 | public String getType() { 54 | return type; 55 | } 56 | 57 | public void setType(String type) { 58 | this.type = type; 59 | } 60 | 61 | public int getTaskId() { 62 | return taskId; 63 | } 64 | 65 | public void setTaskId(int taskId) { 66 | this.taskId = taskId; 67 | } 68 | 69 | public String getCronExpression() { 70 | return cronExpression; 71 | } 72 | 73 | public void setCronExpression(String cronExpression) { 74 | this.cronExpression = cronExpression; 75 | } 76 | 77 | @Override 78 | public String toString() { 79 | return new Gson().toJson(this); 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/shutdown.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem Licensed to the Apache Software Foundation (ASF) under one or more 3 | rem contributor license agreements. See the NOTICE file distributed with 4 | rem this work for additional information regarding copyright ownership. 5 | rem The ASF licenses this file to You under the Apache License, Version 2.0 6 | rem (the "License"); you may not use this file except in compliance with 7 | rem the License. You may obtain a copy of the License at 8 | rem 9 | rem http://www.apache.org/licenses/LICENSE-2.0 10 | rem 11 | rem Unless required by applicable law or agreed to in writing, software 12 | rem distributed under the License is distributed on an "AS IS" BASIS, 13 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | rem See the License for the specific language governing permissions and 15 | rem limitations under the License. 16 | 17 | rem --------------------------------------------------------------------------- 18 | rem Stop script for the CATALINA Server 19 | rem --------------------------------------------------------------------------- 20 | 21 | setlocal 22 | 23 | rem Guess CATALINA_HOME if not defined 24 | set "CURRENT_DIR=%cd%" 25 | if not "%CATALINA_HOME%" == "" goto gotHome 26 | set "CATALINA_HOME=%CURRENT_DIR%" 27 | if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome 28 | cd .. 29 | set "CATALINA_HOME=%cd%" 30 | cd "%CURRENT_DIR%" 31 | :gotHome 32 | if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome 33 | echo The CATALINA_HOME environment variable is not defined correctly 34 | echo This environment variable is needed to run this program 35 | goto end 36 | :okHome 37 | 38 | set "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat" 39 | 40 | rem Check that target executable exists 41 | if exist "%EXECUTABLE%" goto okExec 42 | echo Cannot find "%EXECUTABLE%" 43 | echo This file is needed to run this program 44 | goto end 45 | :okExec 46 | 47 | rem Get remaining unshifted command line arguments and save them in the 48 | set CMD_LINE_ARGS= 49 | :setArgs 50 | if ""%1""=="""" goto doneSetArgs 51 | set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 52 | shift 53 | goto setArgs 54 | :doneSetArgs 55 | 56 | call "%EXECUTABLE%" stop %CMD_LINE_ARGS% 57 | 58 | :end 59 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/startup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem Licensed to the Apache Software Foundation (ASF) under one or more 3 | rem contributor license agreements. See the NOTICE file distributed with 4 | rem this work for additional information regarding copyright ownership. 5 | rem The ASF licenses this file to You under the Apache License, Version 2.0 6 | rem (the "License"); you may not use this file except in compliance with 7 | rem the License. You may obtain a copy of the License at 8 | rem 9 | rem http://www.apache.org/licenses/LICENSE-2.0 10 | rem 11 | rem Unless required by applicable law or agreed to in writing, software 12 | rem distributed under the License is distributed on an "AS IS" BASIS, 13 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | rem See the License for the specific language governing permissions and 15 | rem limitations under the License. 16 | 17 | rem --------------------------------------------------------------------------- 18 | rem Start script for the CATALINA Server 19 | rem --------------------------------------------------------------------------- 20 | 21 | setlocal 22 | 23 | rem Guess CATALINA_HOME if not defined 24 | set "CURRENT_DIR=%cd%" 25 | if not "%CATALINA_HOME%" == "" goto gotHome 26 | set "CATALINA_HOME=%CURRENT_DIR%" 27 | if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome 28 | cd .. 29 | set "CATALINA_HOME=%cd%" 30 | cd "%CURRENT_DIR%" 31 | :gotHome 32 | if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome 33 | echo The CATALINA_HOME environment variable is not defined correctly 34 | echo This environment variable is needed to run this program 35 | goto end 36 | :okHome 37 | 38 | set "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat" 39 | 40 | rem Check that target executable exists 41 | if exist "%EXECUTABLE%" goto okExec 42 | echo Cannot find "%EXECUTABLE%" 43 | echo This file is needed to run this program 44 | goto end 45 | :okExec 46 | 47 | rem Get remaining unshifted command line arguments and save them in the 48 | set CMD_LINE_ARGS= 49 | :setArgs 50 | if ""%1""=="""" goto doneSetArgs 51 | set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 52 | shift 53 | goto setArgs 54 | :doneSetArgs 55 | 56 | call "%EXECUTABLE%" start %CMD_LINE_ARGS% 57 | 58 | :end 59 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/version.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem Licensed to the Apache Software Foundation (ASF) under one or more 3 | rem contributor license agreements. See the NOTICE file distributed with 4 | rem this work for additional information regarding copyright ownership. 5 | rem The ASF licenses this file to You under the Apache License, Version 2.0 6 | rem (the "License"); you may not use this file except in compliance with 7 | rem the License. You may obtain a copy of the License at 8 | rem 9 | rem http://www.apache.org/licenses/LICENSE-2.0 10 | rem 11 | rem Unless required by applicable law or agreed to in writing, software 12 | rem distributed under the License is distributed on an "AS IS" BASIS, 13 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | rem See the License for the specific language governing permissions and 15 | rem limitations under the License. 16 | 17 | rem --------------------------------------------------------------------------- 18 | rem Version script for the CATALINA Server 19 | rem --------------------------------------------------------------------------- 20 | 21 | setlocal 22 | 23 | rem Guess CATALINA_HOME if not defined 24 | set "CURRENT_DIR=%cd%" 25 | if not "%CATALINA_HOME%" == "" goto gotHome 26 | set "CATALINA_HOME=%CURRENT_DIR%" 27 | if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome 28 | cd .. 29 | set "CATALINA_HOME=%cd%" 30 | cd "%CURRENT_DIR%" 31 | :gotHome 32 | if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome 33 | echo The CATALINA_HOME environment variable is not defined correctly 34 | echo This environment variable is needed to run this program 35 | goto end 36 | :okHome 37 | 38 | set "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat" 39 | 40 | rem Check that target executable exists 41 | if exist "%EXECUTABLE%" goto okExec 42 | echo Cannot find "%EXECUTABLE%" 43 | echo This file is needed to run this program 44 | goto end 45 | :okExec 46 | 47 | rem Get remaining unshifted command line arguments and save them in the 48 | set CMD_LINE_ARGS= 49 | :setArgs 50 | if ""%1""=="""" goto doneSetArgs 51 | set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 52 | shift 53 | goto setArgs 54 | :doneSetArgs 55 | 56 | call "%EXECUTABLE%" version %CMD_LINE_ARGS% 57 | 58 | :end 59 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/java/org/smartloli/hive/cube/web/dao/RoleDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 35 | 36 | 37 | insert into 38 | role_resource(role_id,resource_id) value(#{roleId},#{resourceId}) 39 | 40 | 41 | 42 | delete from 43 | role_resource where role_id=#{roleId} and resource_id=#{resourceId} 44 | 45 | 46 | 49 | 50 | 51 | insert into 52 | user_role(user_id,role_id) value(#{userId},#{roleId}) 53 | 54 | 55 | 56 | delete from 57 | user_role 58 | where user_id=#{userId} and role_id=#{roleId} 59 | 60 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/applications/failed.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 9 | Failed - Hive Cube 10 | 11 | 12 | 13 | 14 | 15 | 16 |
    17 |
    18 |
    19 |
    20 |

    21 | Failed Applications overview 22 |

    23 |
    24 | 25 |
    26 | 27 |
    28 |
    29 |
    30 | 32 | Show the killed 33 | of tasks for yarn. 34 |
    35 |
    36 |
    37 |
    38 |
    39 |
    40 |
    41 | Failed Jobs Info 42 |
    43 |
    44 | 45 |
    46 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
    IDUserNameApp TypeStartTimeFinishTimeStateFinalStatusProgress
    62 |
    63 |
    64 |
    65 |
    66 |
    67 |
    68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/applications/killed.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 9 | Killed - Hive Cube 10 | 11 | 12 | 13 | 14 | 15 | 16 |
    17 |
    18 |
    19 |
    20 |

    21 | Killed Applications overview 22 |

    23 |
    24 | 25 |
    26 | 27 |
    28 |
    29 |
    30 | 32 | Show the killed 33 | of tasks for yarn. 34 |
    35 |
    36 |
    37 |
    38 |
    39 |
    40 |
    41 | Killed Jobs Info 42 |
    43 |
    44 | 45 |
    46 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
    IDUserNameApp TypeStartTimeFinishTimeStateFinalStatusProgress
    62 |
    63 |
    64 |
    65 |
    66 |
    67 |
    68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/configtest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem Licensed to the Apache Software Foundation (ASF) under one or more 3 | rem contributor license agreements. See the NOTICE file distributed with 4 | rem this work for additional information regarding copyright ownership. 5 | rem The ASF licenses this file to You under the Apache License, Version 2.0 6 | rem (the "License"); you may not use this file except in compliance with 7 | rem the License. You may obtain a copy of the License at 8 | rem 9 | rem http://www.apache.org/licenses/LICENSE-2.0 10 | rem 11 | rem Unless required by applicable law or agreed to in writing, software 12 | rem distributed under the License is distributed on an "AS IS" BASIS, 13 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | rem See the License for the specific language governing permissions and 15 | rem limitations under the License. 16 | 17 | rem --------------------------------------------------------------------------- 18 | rem Configuration test script for the CATALINA Server 19 | rem --------------------------------------------------------------------------- 20 | 21 | setlocal 22 | 23 | rem Guess CATALINA_HOME if not defined 24 | set "CURRENT_DIR=%cd%" 25 | if not "%CATALINA_HOME%" == "" goto gotHome 26 | set "CATALINA_HOME=%CURRENT_DIR%" 27 | if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome 28 | cd .. 29 | set "CATALINA_HOME=%cd%" 30 | cd "%CURRENT_DIR%" 31 | :gotHome 32 | if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome 33 | echo The CATALINA_HOME environment variable is not defined correctly 34 | echo This environment variable is needed to run this program 35 | goto end 36 | :okHome 37 | 38 | set "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat" 39 | 40 | rem Check that target executable exists 41 | if exist "%EXECUTABLE%" goto okExec 42 | echo Cannot find "%EXECUTABLE%" 43 | echo This file is needed to run this program 44 | goto end 45 | :okExec 46 | 47 | rem Get remaining unshifted command line arguments and save them in the 48 | set CMD_LINE_ARGS= 49 | :setArgs 50 | if ""%1""=="""" goto doneSetArgs 51 | set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 52 | shift 53 | goto setArgs 54 | :doneSetArgs 55 | 56 | call "%EXECUTABLE%" configtest %CMD_LINE_ARGS% 57 | 58 | :end 59 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/webapp/WEB-INF/views/applications/finished.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | 5 | 6 | 7 | 8 | 9 | Finished - Hive Cube 10 | 11 | 12 | 13 | 14 | 15 | 16 |
    17 |
    18 |
    19 |
    20 |

    21 | Finished Applications overview 22 |

    23 |
    24 | 25 |
    26 | 27 |
    28 |
    29 |
    30 | 32 | Show the 33 | Finished of tasks for yarn. 34 |
    35 |
    36 |
    37 |
    38 |
    39 |
    40 |
    41 | Finished Jobs Info 42 |
    43 |
    44 | 45 |
    46 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
    IDUserNameApp TypeStartTimeFinishTimeStateFinalStatusProgress
    62 |
    63 |
    64 |
    65 |
    66 |
    67 |
    68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/util/FileSystemSingleton.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.util; 19 | 20 | import java.net.URI; 21 | 22 | import org.apache.hadoop.conf.Configuration; 23 | import org.apache.hadoop.fs.FileSystem; 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | import org.smartloli.hive.cube.common.client.CommonClientConfigs.Hadoop; 27 | 28 | /** 29 | * HDFS object instance. 30 | * 31 | * @author smartloli. 32 | * 33 | * Created by Oct 9, 2016 34 | * 35 | */ 36 | public class FileSystemSingleton { 37 | 38 | private final static Logger LOG = LoggerFactory.getLogger(FileSystemSingleton.class); 39 | 40 | private static class FileSystemHolder { 41 | private static FileSystem fs; 42 | static { 43 | try { 44 | Configuration conf = new Configuration(); 45 | conf.setBooleanIfUnset(Hadoop.DFS_SUPPORT_APPEND, true); 46 | conf.setInt(Hadoop.IO_FILE_BUFFER_SIZE, 4194304); 47 | conf.set(Hadoop.DFS_POLICY, "NEVER"); 48 | conf.set(Hadoop.DFS_ENABLE, "true"); 49 | String uri = SystemConfig.getProperty("hive.cube.hdfs.uri"); 50 | String user = SystemConfig.getProperty("hive.cube.hadoop.user"); 51 | fs = FileSystem.get(new URI(uri), conf, user); 52 | } catch (Exception e) { 53 | LOG.error("Create hadoop file system failure, msg is " + e.getMessage()); 54 | } 55 | } 56 | } 57 | 58 | public static FileSystem create() { 59 | return FileSystemHolder.fs; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/bin/digest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem Licensed to the Apache Software Foundation (ASF) under one or more 3 | rem contributor license agreements. See the NOTICE file distributed with 4 | rem this work for additional information regarding copyright ownership. 5 | rem The ASF licenses this file to You under the Apache License, Version 2.0 6 | rem (the "License"); you may not use this file except in compliance with 7 | rem the License. You may obtain a copy of the License at 8 | rem 9 | rem http://www.apache.org/licenses/LICENSE-2.0 10 | rem 11 | rem Unless required by applicable law or agreed to in writing, software 12 | rem distributed under the License is distributed on an "AS IS" BASIS, 13 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | rem See the License for the specific language governing permissions and 15 | rem limitations under the License. 16 | 17 | rem --------------------------------------------------------------------------- 18 | rem Script to digest password using the algorithm specified 19 | rem --------------------------------------------------------------------------- 20 | 21 | setlocal 22 | 23 | rem Guess CATALINA_HOME if not defined 24 | set "CURRENT_DIR=%cd%" 25 | if not "%CATALINA_HOME%" == "" goto gotHome 26 | set "CATALINA_HOME=%CURRENT_DIR%" 27 | if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome 28 | cd .. 29 | set "CATALINA_HOME=%cd%" 30 | cd "%CURRENT_DIR%" 31 | :gotHome 32 | if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome 33 | echo The CATALINA_HOME environment variable is not defined correctly 34 | echo This environment variable is needed to run this program 35 | goto end 36 | :okHome 37 | 38 | set "EXECUTABLE=%CATALINA_HOME%\bin\tool-wrapper.bat" 39 | 40 | rem Check that target executable exists 41 | if exist "%EXECUTABLE%" goto okExec 42 | echo Cannot find "%EXECUTABLE%" 43 | echo This file is needed to run this program 44 | goto end 45 | :okExec 46 | 47 | rem Get remaining unshifted command line arguments and save them in the 48 | set CMD_LINE_ARGS= 49 | :setArgs 50 | if ""%1""=="""" goto doneSetArgs 51 | set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 52 | shift 53 | goto setArgs 54 | :doneSetArgs 55 | 56 | call "%EXECUTABLE%" -server org.apache.catalina.realm.RealmBase %CMD_LINE_ARGS% 57 | 58 | :end 59 | -------------------------------------------------------------------------------- /hive-cube-web/src/main/resources/kms/conf/tomcat-users.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 30 | 37 | 44 | 45 | -------------------------------------------------------------------------------- /hive-cube-common/src/main/java/org/smartloli/hive/cube/common/pojo/Signiner.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.common.pojo; 19 | 20 | import com.google.gson.Gson; 21 | 22 | /** 23 | * Signiner pojo. 24 | * 25 | * @author smartloli. 26 | * 27 | * Created by May 17, 2017 28 | */ 29 | public class Signiner { 30 | private int id; 31 | private int rtxno; 32 | private String username = ""; 33 | private String realname = ""; 34 | private String password = ""; 35 | private String email = ""; 36 | 37 | public int getRtxno() { 38 | return rtxno; 39 | } 40 | 41 | public void setRtxno(int rtxno) { 42 | this.rtxno = rtxno; 43 | } 44 | 45 | public int getId() { 46 | return id; 47 | } 48 | 49 | public void setId(int id) { 50 | this.id = id; 51 | } 52 | 53 | public String getUsername() { 54 | return username; 55 | } 56 | 57 | public void setUsername(String username) { 58 | this.username = username; 59 | } 60 | 61 | public String getRealname() { 62 | return realname; 63 | } 64 | 65 | public void setRealname(String realname) { 66 | this.realname = realname; 67 | } 68 | 69 | public String getPassword() { 70 | return password; 71 | } 72 | 73 | public void setPassword(String password) { 74 | this.password = password; 75 | } 76 | 77 | public String getEmail() { 78 | return email; 79 | } 80 | 81 | public void setEmail(String email) { 82 | this.email = email; 83 | } 84 | 85 | @Override 86 | public String toString() { 87 | return new Gson().toJson(this); 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /hive-cube-plugins/src/main/java/org/smartloli/hive/cube/plugins/hbase/HBaseSchemaFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.smartloli.hive.cube.plugins.hbase; 19 | 20 | import org.apache.hadoop.hbase.TableName; 21 | import org.apache.hadoop.hbase.client.Table; 22 | 23 | import com.alibaba.fastjson.JSON; 24 | import com.alibaba.fastjson.JSONObject; 25 | 26 | /** 27 | * Mapping the HBase table structure to construct a structured data model for 28 | * SQL queries. 29 | * 30 | * @author smartloli. 31 | * 32 | * Created by Jun 29, 2017 33 | */ 34 | public class HBaseSchemaFactory { 35 | 36 | // public static JSONObject build(String table) { 37 | // RowkeyServiceImpl rowkeyService = StartupListener.getBean("rowkeyServiceImpl", RowkeyServiceImpl.class); 38 | // JSONObject schema = JSON.parseObject(rowkeyService.findRowkeyByName(table)).getJSONObject(HConstants.ROW_KEY_REGULAR).getJSONObject(HConstants.TABLE_SCHEMA); 39 | // schema.put(HConstants.ROW_KEY, HConstants.ROW_KEY_TYPE); 40 | // return schema; 41 | // } 42 | 43 | public static JSONObject getTableDescribe(String tableName) { 44 | HBaseStoragePlugin storagePlugin = new HBaseStoragePlugin(); 45 | try { 46 | Table table = storagePlugin.getConnection().getTable(TableName.valueOf(tableName)); 47 | String value = table.getTableDescriptor().getFamilies().toString(); 48 | String qualifier = value.replace("[", "").replace("]", "").replaceAll("=>", ":"); 49 | return JSON.parseObject(qualifier); 50 | } catch (Exception e) { 51 | e.printStackTrace(); 52 | } 53 | return null; 54 | } 55 | 56 | } 57 | --------------------------------------------------------------------------------