├── node ├── etl │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── protocol.txt │ │ │ ├── protoc.exe │ │ │ └── com │ │ │ │ └── alibaba │ │ │ │ └── otter │ │ │ │ └── node │ │ │ │ └── etl │ │ │ │ ├── load │ │ │ │ └── loader │ │ │ │ │ ├── LoadContext.java │ │ │ │ │ ├── OtterLoader.java │ │ │ │ │ └── db │ │ │ │ │ └── context │ │ │ │ │ └── FileLoadContext.java │ │ │ │ ├── common │ │ │ │ ├── io │ │ │ │ │ ├── download │ │ │ │ │ │ ├── impl │ │ │ │ │ │ │ └── aria2c │ │ │ │ │ │ │ │ └── Aria2cStat.java │ │ │ │ │ │ ├── Download.java │ │ │ │ │ │ └── DownloadStatus.java │ │ │ │ │ └── signature │ │ │ │ │ │ └── ChecksumUtils.java │ │ │ │ └── pipe │ │ │ │ │ ├── impl │ │ │ │ │ └── http │ │ │ │ │ │ └── archive │ │ │ │ │ │ └── ArchiveRetriverCallback.java │ │ │ │ │ └── Pipe.java │ │ │ │ ├── transform │ │ │ │ └── transformer │ │ │ │ │ ├── AbstractOtterTransformer.java │ │ │ │ │ └── OtterTransformer.java │ │ │ │ ├── conflict │ │ │ │ ├── model │ │ │ │ │ └── ConflictEventType.java │ │ │ │ └── FileBatchConflictDetectService.java │ │ │ │ ├── extract │ │ │ │ └── extractor │ │ │ │ │ └── OtterExtractor.java │ │ │ │ └── select │ │ │ │ ├── selector │ │ │ │ └── OtterSelectorFactory.java │ │ │ │ └── exceptions │ │ │ │ └── SelectException.java │ │ └── resources │ │ │ └── spring │ │ │ ├── otter-node-select.xml │ │ │ ├── otter-node-conflict.xml │ │ │ └── otter-node-transform.xml │ │ └── test │ │ ├── resources │ │ └── compress │ │ │ └── geo.protodata │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── otter │ │ └── node │ │ └── etl │ │ └── BaseOtterTest.java ├── canal │ └── src │ │ └── main │ │ └── resources │ │ └── spring │ │ └── tsdb │ │ └── sql-map │ │ └── sqlmap-config.xml ├── extend │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── alibaba │ │ │ └── otter │ │ │ └── node │ │ │ └── extend │ │ │ ├── processor │ │ │ └── HintEventProcessor.java │ │ │ └── fileresolver │ │ │ └── AbstractFileResolver.java │ └── pom.xml ├── deployer │ └── src │ │ └── main │ │ ├── assembly │ │ ├── dev.xml │ │ ├── mvn.xml │ │ └── release.xml │ │ ├── resources │ │ └── otter.properties │ │ └── bin │ │ └── startup.bat └── common │ └── src │ ├── main │ ├── resources │ │ └── spring │ │ │ ├── otter-node-statistics.xml │ │ │ └── otter-node-config.xml │ └── java │ │ └── com │ │ └── alibaba │ │ └── otter │ │ └── node │ │ └── common │ │ └── config │ │ ├── NodeTaskListener.java │ │ ├── impl │ │ └── InternalConfigClientService.java │ │ └── NodeTaskService.java │ └── test │ └── java │ └── com │ └── alibaba │ └── otter │ └── node │ └── common │ └── BaseOtterTest.java ├── lib ├── ojdbc6.jar ├── jtester-1.1.8.jar ├── jmockit-0.999.10.jar ├── jtester-1.1.8-sources.jar ├── jmockit-0.999.10-sources.jar ├── install.bat └── install.sh ├── manager ├── deployer │ └── src │ │ └── main │ │ ├── resources │ │ └── webapp │ │ │ ├── templates │ │ │ └── home │ │ │ │ ├── screen │ │ │ │ ├── zkError.vm │ │ │ │ ├── monitor │ │ │ │ │ ├── getNodes.vm │ │ │ │ │ ├── monitorTrigger.vm │ │ │ │ │ └── ok.vm │ │ │ │ ├── checkDelayStat.vm │ │ │ │ ├── forbidden.vm │ │ │ │ ├── error.vm │ │ │ │ ├── index.vm │ │ │ │ └── systemReduction.vm │ │ │ │ └── layout │ │ │ │ └── default.vm │ │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ │ ├── images │ │ │ ├── Thumbs.db │ │ │ ├── alarm.png │ │ │ ├── down1.png │ │ │ ├── down2.png │ │ │ ├── etl2.png │ │ │ ├── etl3.png │ │ │ ├── etl_1.png │ │ │ ├── exit.png │ │ │ ├── logo.png │ │ │ ├── up1.png │ │ │ ├── up2.png │ │ │ ├── head_bg.png │ │ │ ├── ico_add.png │ │ │ ├── ico_del.png │ │ │ ├── main_bg.png │ │ │ ├── nav_bg.png │ │ │ ├── tab_bg2.png │ │ │ ├── tip_del.png │ │ │ ├── alarm_on.png │ │ │ ├── forbidden.png │ │ │ ├── ico_edit.png │ │ │ ├── login_bg.png │ │ │ ├── login_box.png │ │ │ ├── login_logo.png │ │ │ ├── nav_pass.png │ │ │ ├── pop_close.png │ │ │ ├── pop_left.png │ │ │ ├── pop_right.png │ │ │ ├── search_btn.png │ │ │ ├── search_go.png │ │ │ ├── seeDetail.png │ │ │ ├── tab_active.png │ │ │ ├── button_hover.png │ │ │ ├── login_shadow.png │ │ │ ├── nav_btn_bg22.png │ │ │ ├── nav_btn_bg3.png │ │ │ ├── nav_btn_bg33.png │ │ │ ├── nav_btn_bg44.png │ │ │ ├── nav_selected.png │ │ │ ├── pop_tips_mid.png │ │ │ ├── pop_tips_top.png │ │ │ ├── search_input.png │ │ │ ├── tip_warning.png │ │ │ ├── button_normal.png │ │ │ ├── login_btn_hover.png │ │ │ ├── pop_leftbottom.png │ │ │ ├── pop_midbottom.png │ │ │ ├── pop_rightbottom.png │ │ │ ├── pop_tips_bottom.png │ │ │ ├── search_global_l.png │ │ │ ├── search_global_m.png │ │ │ ├── search_global_r.png │ │ │ ├── table_title_bg.png │ │ │ ├── link_attachment_7.gif │ │ │ ├── login_btn_normal.png │ │ │ ├── pop_lefttop_small.png │ │ │ ├── pop_midtop_small.png │ │ │ ├── search_global_r2.png │ │ │ ├── search_global_r3.png │ │ │ └── pop_righttop_small.png │ │ │ ├── js │ │ │ ├── My97DatePicker │ │ │ │ ├── skin │ │ │ │ │ ├── datePicker.gif │ │ │ │ │ ├── default │ │ │ │ │ │ └── img.gif │ │ │ │ │ ├── whyGreen │ │ │ │ │ │ ├── bg.jpg │ │ │ │ │ │ └── img.gif │ │ │ │ │ └── WdatePicker.css │ │ │ │ ├── config.js │ │ │ │ └── lang │ │ │ │ │ ├── en.js │ │ │ │ │ ├── zh-tw.js │ │ │ │ │ └── zh-cn.js │ │ │ ├── trcolor.js │ │ │ ├── flot │ │ │ │ ├── jquery.flot.symbol.min.js │ │ │ │ ├── jquery.flot.threshold.min.js │ │ │ │ └── jquery.flot.resize.min.js │ │ │ └── nodeCheck.js │ │ │ └── css │ │ │ └── JSONFormatter.css │ │ ├── assembly │ │ ├── dev.xml │ │ ├── release.xml │ │ ├── component.xml │ │ └── mvn.xml │ │ └── bin │ │ └── startup.bat ├── biz │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── alibaba │ │ │ └── otter │ │ │ └── manager │ │ │ └── biz │ │ │ ├── common │ │ │ ├── exceptions │ │ │ │ ├── InvalidConfigureException.java │ │ │ │ ├── RepeatConfigureException.java │ │ │ │ └── ManagerException.java │ │ │ └── alarm │ │ │ │ ├── AlarmService.java │ │ │ │ └── AlarmMessage.java │ │ │ ├── autokeeper │ │ │ └── impl │ │ │ │ └── AutoKeeperPersist.java │ │ │ ├── config │ │ │ ├── node │ │ │ │ ├── NodeService.java │ │ │ │ └── dal │ │ │ │ │ └── NodeDAO.java │ │ │ ├── datamatrix │ │ │ │ └── dal │ │ │ │ │ └── DataMatrixDAO.java │ │ │ ├── datamediasource │ │ │ │ ├── dal │ │ │ │ │ └── DataMediaSourceDAO.java │ │ │ │ └── DataMediaSourceService.java │ │ │ ├── canal │ │ │ │ └── dal │ │ │ │ │ └── CanalDAO.java │ │ │ ├── parameter │ │ │ │ ├── SystemParameterService.java │ │ │ │ └── dal │ │ │ │ │ └── SystemParameterDAO.java │ │ │ ├── channel │ │ │ │ └── dal │ │ │ │ │ └── ChannelDAO.java │ │ │ ├── pipeline │ │ │ │ └── dal │ │ │ │ │ └── PipelineDAO.java │ │ │ ├── datamedia │ │ │ │ └── dal │ │ │ │ │ └── DataMediaDAO.java │ │ │ ├── datamediapair │ │ │ │ └── dal │ │ │ │ │ └── DataMediaPairDAO.java │ │ │ └── record │ │ │ │ └── dal │ │ │ │ └── LogRecordDAO.java │ │ │ ├── statistics │ │ │ ├── delay │ │ │ │ ├── DelayCounter.java │ │ │ │ └── param │ │ │ │ │ └── DelayCountParam.java │ │ │ └── throughput │ │ │ │ └── param │ │ │ │ └── AnalysisType.java │ │ │ └── monitor │ │ │ ├── AlarmController.java │ │ │ ├── PassiveMonitor.java │ │ │ ├── Monitor.java │ │ │ └── MonitorTimer.java │ │ └── test │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── otter │ │ └── manager │ │ └── biz │ │ ├── service │ │ └── PipelineSerivceTest.java │ │ └── monitor │ │ └── AlarmServiceTest.java └── web │ ├── src │ └── main │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── otter │ │ └── manager │ │ └── web │ │ ├── webx │ │ └── valve │ │ │ └── auth │ │ │ ├── url │ │ │ └── URLProtected.java │ │ │ └── action │ │ │ └── ActionProtected.java │ │ ├── common │ │ ├── api │ │ │ ├── ApiAuthService.java │ │ │ └── DefaultApiAuthService.java │ │ └── model │ │ │ ├── SeniorDataMatrix.java │ │ │ ├── SeniorNode.java │ │ │ └── SeniorChannel.java │ │ └── home │ │ └── module │ │ └── screen │ │ └── Ok.java │ └── pom.xml ├── shared ├── common │ └── src │ │ ├── test │ │ ├── resources │ │ │ ├── code │ │ │ │ └── ResourceBundleUtil.properties │ │ │ ├── spring │ │ │ │ └── otter-test-sample.xml │ │ │ ├── otter.properties │ │ │ ├── compiler.txt │ │ │ └── applicationContext.xml │ │ └── java │ │ │ └── com │ │ │ └── alibaba │ │ │ └── otter │ │ │ └── shared │ │ │ └── common │ │ │ ├── BaseOtterTest.java │ │ │ ├── sample │ │ │ ├── TestMockService2.java │ │ │ └── TestMockService3.java │ │ │ └── AddressUtilsTest.java │ │ └── main │ │ ├── resources │ │ └── jtester.properties │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── otter │ │ └── shared │ │ └── common │ │ ├── utils │ │ ├── extension │ │ │ ├── classpath │ │ │ │ ├── ClassFilter.java │ │ │ │ └── ClassScanner.java │ │ │ └── ExtensionFactory.java │ │ ├── meta │ │ │ ├── DdlSchemaFilter.java │ │ │ └── DdlTableNameFilter.java │ │ ├── code │ │ │ └── Code.java │ │ ├── compile │ │ │ ├── JavaSourceCompiler.java │ │ │ └── exception │ │ │ │ └── CompileExprException.java │ │ └── cmd │ │ │ └── StreamCollector.java │ │ └── model │ │ ├── config │ │ ├── ModeValueFilter.java │ │ ├── data │ │ │ ├── ColumnPairMode.java │ │ │ ├── db │ │ │ │ └── DbDataMedia.java │ │ │ ├── mq │ │ │ │ └── MqDataMedia.java │ │ │ └── ExtensionDataType.java │ │ ├── Transient.java │ │ ├── enums │ │ │ └── AreaType.java │ │ ├── node │ │ │ └── NodeStatus.java │ │ └── alarm │ │ │ └── AlarmRuleStatus.java │ │ └── statistics │ │ └── throughput │ │ └── ThroughputType.java ├── etl │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── alibaba │ │ │ └── otter │ │ │ └── shared │ │ │ └── etl │ │ │ ├── model │ │ │ ├── ObjectData.java │ │ │ └── EventColumnIndexComparable.java │ │ │ └── extend │ │ │ ├── processor │ │ │ └── support │ │ │ │ ├── DataSourceFetcherAware.java │ │ │ │ └── DataSourceFetcher.java │ │ │ └── fileresolver │ │ │ └── support │ │ │ ├── RemoteDirectoryFetcherAware.java │ │ │ └── RemoteDirectoryFetcher.java │ └── pom.xml ├── push │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── alibaba │ │ │ └── otter │ │ │ └── common │ │ │ └── push │ │ │ ├── SubscribeType.java │ │ │ ├── SubscribeCallback.java │ │ │ └── supplier │ │ │ └── DatasourceChangeCallback.java │ │ └── resources │ │ └── spring │ │ └── otter-push-common.xml ├── arbitrate │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── alibaba │ │ │ │ └── otter │ │ │ │ └── shared │ │ │ │ └── arbitrate │ │ │ │ ├── impl │ │ │ │ ├── ArbitrateEvent.java │ │ │ │ ├── zookeeper │ │ │ │ │ ├── ZooKeeperOperation.java │ │ │ │ │ └── SessionExpiredNotification.java │ │ │ │ └── setl │ │ │ │ │ ├── lb │ │ │ │ │ ├── LoadBalance.java │ │ │ │ │ ├── TransformStickLoadBalance.java │ │ │ │ │ └── ExtractStickLoadBalance.java │ │ │ │ │ ├── zookeeper │ │ │ │ │ └── termin │ │ │ │ │ │ └── TerminProcess.java │ │ │ │ │ ├── monitor │ │ │ │ │ ├── Monitor.java │ │ │ │ │ └── listener │ │ │ │ │ │ ├── PermitListener.java │ │ │ │ │ │ ├── NodeListener.java │ │ │ │ │ │ └── MainstemListener.java │ │ │ │ │ ├── rpc │ │ │ │ │ ├── monitor │ │ │ │ │ │ └── ProcessListener.java │ │ │ │ │ └── TerminRpcArbitrateEvent.java │ │ │ │ │ ├── TerminArbitrateEvent.java │ │ │ │ │ ├── ExtractArbitrateEvent.java │ │ │ │ │ ├── SelectArbitrateEvent.java │ │ │ │ │ ├── TransformArbitrateEvent.java │ │ │ │ │ └── LoadArbitrateEvent.java │ │ │ │ └── model │ │ │ │ └── PipelineEventData.java │ │ └── resources │ │ │ └── spring │ │ │ └── otter-arbitrate-alarm.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── alibaba │ │ └── otter │ │ └── shared │ │ └── arbitrate │ │ └── demo │ │ └── servcie │ │ └── PipelineLifeCycle.java └── communication │ └── src │ ├── main │ └── java │ │ └── com │ │ └── alibaba │ │ └── otter │ │ └── shared │ │ └── communication │ │ ├── core │ │ ├── model │ │ │ ├── EventType.java │ │ │ └── Callback.java │ │ └── impl │ │ │ └── connection │ │ │ └── CommunicationConnectionFactory.java │ │ └── model │ │ ├── canal │ │ └── CanalEventType.java │ │ ├── statistics │ │ └── StatisticsEventType.java │ │ └── arbitrate │ │ └── ArbitrateEventType.java │ └── test │ ├── java │ └── com │ │ └── alibaba │ │ └── otter │ │ └── shared │ │ └── communication │ │ ├── app │ │ └── event │ │ │ └── AppEventType.java │ │ └── BaseOtterTest.java │ └── resources │ └── applicationContext.xml ├── docker ├── image │ ├── admin │ │ ├── bin │ │ │ └── clean_log │ │ └── health.sh │ └── alidata │ │ ├── bin │ │ ├── lark-wait │ │ ├── exec_rc_local.sh │ │ └── main.sh │ │ ├── init │ │ └── 02init-sshd.sh │ │ └── lib │ │ └── proc.sh ├── build.sh ├── base │ └── Dockerfile └── Dockerfile ├── .gitignore └── HEADER.txt /node/etl/src/main/java/protocol.txt: -------------------------------------------------------------------------------- 1 | protoc --java_out=. Batch.proto -------------------------------------------------------------------------------- /lib/ojdbc6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/lib/ojdbc6.jar -------------------------------------------------------------------------------- /lib/jtester-1.1.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/lib/jtester-1.1.8.jar -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/templates/home/screen/zkError.vm: -------------------------------------------------------------------------------- 1 | zookeeper出现问题,请联系管理员! -------------------------------------------------------------------------------- /lib/jmockit-0.999.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/lib/jmockit-0.999.10.jar -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: -------------------------------------------------------------------------------- /lib/jtester-1.1.8-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/lib/jtester-1.1.8-sources.jar -------------------------------------------------------------------------------- /lib/jmockit-0.999.10-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/lib/jmockit-0.999.10-sources.jar -------------------------------------------------------------------------------- /node/etl/src/main/java/protoc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/node/etl/src/main/java/protoc.exe -------------------------------------------------------------------------------- /shared/common/src/test/resources/code/ResourceBundleUtil.properties: -------------------------------------------------------------------------------- 1 | =value0 2 | key1= 3 | key2=value2 4 | key3=value3,{0} -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/templates/home/screen/monitor/getNodes.vm: -------------------------------------------------------------------------------- 1 | {success:true,data:{url:"http://g.cn/"}} -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/templates/home/screen/checkDelayStat.vm: -------------------------------------------------------------------------------- 1 | $rundata.setLayoutEnabled(false) 2 | 3 | $!result -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/templates/home/screen/monitor/monitorTrigger.vm: -------------------------------------------------------------------------------- 1 | $!rundata.setLayoutEnabled(false) 2 | $!result -------------------------------------------------------------------------------- /docker/image/admin/bin/clean_log: -------------------------------------------------------------------------------- 1 | # cron clean log once per minute 2 | */2 * * * * admin /home/admin/bin/clean_log.sh >>/tmp/clean_log.log 2>&1 3 | -------------------------------------------------------------------------------- /docker/image/alidata/bin/lark-wait: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | chown admin: -R /home/admin/ 5 | source /alidata/lib/proc.sh 6 | waitterm 7 | -------------------------------------------------------------------------------- /node/etl/src/test/resources/compress/geo.protodata: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/node/etl/src/test/resources/compress/geo.protodata -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/Thumbs.db -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/alarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/alarm.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/down1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/down1.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/down2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/down2.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/etl2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/etl2.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/etl3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/etl3.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/etl_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/etl_1.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/exit.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/logo.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/up1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/up1.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/up2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/up2.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/head_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/head_bg.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/ico_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/ico_add.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/ico_del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/ico_del.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/main_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/main_bg.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/nav_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/nav_bg.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/tab_bg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/tab_bg2.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/tip_del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/tip_del.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/alarm_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/alarm_on.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/forbidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/forbidden.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/ico_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/ico_edit.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/login_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/login_bg.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/login_box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/login_box.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/login_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/login_logo.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/nav_pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/nav_pass.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_close.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_left.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_right.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/search_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/search_btn.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/search_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/search_go.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/seeDetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/seeDetail.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/tab_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/tab_active.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/button_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/button_hover.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/login_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/login_shadow.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/nav_btn_bg22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/nav_btn_bg22.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/nav_btn_bg3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/nav_btn_bg3.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/nav_btn_bg33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/nav_btn_bg33.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/nav_btn_bg44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/nav_btn_bg44.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/nav_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/nav_selected.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_tips_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_tips_mid.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_tips_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_tips_top.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/search_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/search_input.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/tip_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/tip_warning.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/button_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/button_normal.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/login_btn_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/login_btn_hover.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_leftbottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_leftbottom.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_midbottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_midbottom.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_rightbottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_rightbottom.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_tips_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_tips_bottom.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/search_global_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/search_global_l.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/search_global_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/search_global_m.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/search_global_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/search_global_r.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/table_title_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/table_title_bg.png -------------------------------------------------------------------------------- /shared/common/src/main/resources/jtester.properties: -------------------------------------------------------------------------------- 1 | SpringModule.ApplicationContextFactory.ImplClassName=com.alibaba.otter.shared.common.utils.test.JTesterxClassPathXmlApplicationContext 2 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/link_attachment_7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/link_attachment_7.gif -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/login_btn_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/login_btn_normal.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_lefttop_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_lefttop_small.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_midtop_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_midtop_small.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/search_global_r2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/search_global_r2.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/search_global_r3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/search_global_r3.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/images/pop_righttop_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/images/pop_righttop_small.png -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/templates/home/screen/forbidden.vm: -------------------------------------------------------------------------------- 1 | $control.setTemplate("home:navigation.vm") 2 | 3 |
4 |
5 |
6 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/My97DatePicker/skin/datePicker.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/js/My97DatePicker/skin/datePicker.gif -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/My97DatePicker/skin/default/img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/js/My97DatePicker/skin/default/img.gif -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/My97DatePicker/skin/whyGreen/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/js/My97DatePicker/skin/whyGreen/bg.jpg -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/My97DatePicker/skin/whyGreen/img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ITxiaoguang/otter/master/manager/deployer/src/main/resources/webapp/js/My97DatePicker/skin/whyGreen/img.gif -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/templates/home/screen/error.vm: -------------------------------------------------------------------------------- 1 | $control.setTemplate("home:navigation.vm") 2 | 3 |
4 |
5 | 对不起,你请求的链接出问题了,可能是超时,没事多刷新一次吧! 6 |
7 |
-------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .svn/ 2 | target/ 3 | test-output/ 4 | *.class 5 | .classpath 6 | .project 7 | .settings/ 8 | tmp 9 | temp 10 | *.log 11 | antx.properties 12 | .idea/ 13 | *.iml 14 | htdocs 15 | package-info.java 16 | .DS_Store 17 | *.tar.gz 18 | docker/data/ 19 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/templates/home/screen/monitor/ok.vm: -------------------------------------------------------------------------------- 1 | $rundata.setLayoutEnabled(false) 2 | 3 | server is ok! 4 | 5 | #if($isAllOk == "Y") 6 | server is ok! 7 | #else 8 | #foreach($r in $results) 9 | $r 10 | #end 11 | #end -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/My97DatePicker/skin/WdatePicker.css: -------------------------------------------------------------------------------- 1 | .Wdate{ 2 | border:#999 1px solid; 3 | height:20px; 4 | background:#fff url(datePicker.gif) no-repeat right; 5 | } 6 | 7 | .WdateFmtErr{ 8 | font-weight:bold; 9 | color:red; 10 | } -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/My97DatePicker/config.js: -------------------------------------------------------------------------------- 1 | var langList = 2 | [ 3 | {name:'en', charset:'UTF-8'}, 4 | {name:'zh-cn', charset:'UTF-8'}, 5 | {name:'zh-tw', charset:'UTF-8'} 6 | ]; 7 | 8 | var skinList = 9 | [ 10 | {name:'default', charset:'UTF-8'}, 11 | {name:'whyGreen', charset:'UTF-8'} 12 | ]; -------------------------------------------------------------------------------- /docker/image/alidata/bin/exec_rc_local.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "${SKIP_EXEC_RC_LOCAL}" = "YES" ] ; then 4 | echo "skip /etc/rc.local: SKIP_EXEC_RC_LOCAL=${SKIP_EXEC_RC_LOCAL}" 5 | exit 6 | fi 7 | 8 | if [ "${DOCKER_DEPLOY_TYPE}" = "HOST" ] ; then 9 | echo "skip /etc/rc.local: DOCKER_DEPLOY_TYPE=${DOCKER_DEPLOY_TYPE}" 10 | exit 11 | fi -------------------------------------------------------------------------------- /docker/image/admin/health.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | CHECK_URL="http://127.0.0.1:8080/ok.htm" 3 | CHECK_POINT="ok" 4 | CHECK_COUNT=`curl -s --connect-timeout 7 --max-time 7 $CHECK_URL | grep -c $CHECK_POINT` 5 | if [ $CHECK_COUNT -eq 0 ]; then 6 | echo "[FAILED]" 7 | status=0 8 | error=1 9 | else 10 | echo "[ OK ]" 11 | status=1 12 | error=0 13 | fi -------------------------------------------------------------------------------- /node/canal/src/main/resources/spring/tsdb/sql-map/sqlmap-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/css/JSONFormatter.css: -------------------------------------------------------------------------------- 1 | table#conflict-table ul li { 2 | margin: 0px 0 0; 3 | padding: 0; 4 | line-height: 20px; 5 | } 6 | table#conflict-table ul li b { 7 | color: black; 8 | font-style: normal; } 9 | table#conflict-table ul { 10 | margin: 8px 0 8px 0; 11 | padding: 5px 0; } 12 | table#conflict-table li { 13 | padding: 0 0 0px; 14 | list-style-type: none; 15 | margin: 0; 16 | color: #666666; } -------------------------------------------------------------------------------- /node/extend/src/main/java/com/alibaba/otter/node/extend/processor/HintEventProcessor.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.otter.node.extend.processor; 2 | 3 | import com.alibaba.otter.shared.etl.model.EventData; 4 | 5 | /** 6 | * 测试下hint 7 | * 8 | * @author jianghang 2014-6-11 下午4:20:32 9 | * @since 5.1.0 10 | */ 11 | public class HintEventProcessor extends AbstractEventProcessor { 12 | 13 | public boolean process(EventData eventData) { 14 | eventData.setHint("/* hint */"); 15 | return true; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/install.bat: -------------------------------------------------------------------------------- 1 | call mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.1.0.7.0 -Dpackaging=jar -Dfile=ojdbc6.jar -DgeneratePom=true 2 | call mvn install:install-file -DgroupId=org.jtester -DartifactId=jtester -Dversion=1.1.8 -Dpackaging=jar -DpomFile=jtester-1.1.8.pom -Dfile=jtester-1.1.8.jar -Dsources=jtester-1.1.8-sources.jar 3 | call mvn install:install-file -DgroupId=mockit -DartifactId=jmockit -Dversion=0.999.10 -Dpackaging=jar -DpomFile=jmockit-0.999.10.pom -Dfile=jmockit-0.999.10.jar -Dsources=jmockit-0.999.10-sources.jar 4 | -------------------------------------------------------------------------------- /lib/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.1.0.7.0 -Dpackaging=jar -Dfile=ojdbc6.jar -DgeneratePom=true 3 | mvn install:install-file -DgroupId=org.jtester -DartifactId=jtester -Dversion=1.1.8 -Dpackaging=jar -DpomFile=jtester-1.1.8.pom -Dfile=jtester-1.1.8.jar -Dsources=jtester-1.1.8-sources.jar 4 | mvn install:install-file -DgroupId=mockit -DartifactId=jmockit -Dversion=0.999.10 -Dpackaging=jar -DpomFile=jmockit-0.999.10.pom -Dfile=jmockit-0.999.10.jar -Dsources=jmockit-0.999.10-sources.jar 5 | -------------------------------------------------------------------------------- /node/deployer/src/main/assembly/dev.xml: -------------------------------------------------------------------------------- 1 | 3 | dev 4 | 5 | dir 6 | 7 | false 8 | 9 | src/main/assembly/component.xml 10 | 11 | 12 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/templates/home/screen/index.vm: -------------------------------------------------------------------------------- 1 | $rundata.setLayoutEnabled(false) 2 | #macro (loginMessage $field) 3 | #if (!$field.valid) $field.message #end 4 | #end 5 | 6 | 7 | 8 | 9 | 10 | Otter Manager 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /node/deployer/src/main/assembly/mvn.xml: -------------------------------------------------------------------------------- 1 | 3 | release 4 | 5 | tar.gz 6 | 7 | false 8 | 9 | src/main/assembly/component.xml 10 | 11 | 12 | -------------------------------------------------------------------------------- /docker/image/alidata/init/02init-sshd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # set port 4 | if [ -z "${SSHD_PORT}" ] ; then 5 | SSHD_PORT=22 6 | [ "${DOCKER_DEPLOY_TYPE}" = "HOST" ] && SSHD_PORT=2222 7 | fi 8 | 9 | sed -r -i '/^OPTIONS=/ d' /etc/sysconfig/sshd 10 | echo 'OPTIONS="-p '"${SSHD_PORT}"'"' >> /etc/sysconfig/sshd 11 | 12 | # set admin ssh pulic key 13 | if [ "${USE_ADMIN_PASSAGE}" = "YES" ] ; then 14 | echo "set admin passage" 15 | mkdir -p /home/admin/.ssh 16 | chown admin:admin /home/admin/.ssh 17 | chown admin:admin /home/admin/.ssh/authorized_keys 18 | chmod 644 /home/admin/.ssh/authorized_keys 19 | fi 20 | -------------------------------------------------------------------------------- /manager/deployer/src/main/assembly/dev.xml: -------------------------------------------------------------------------------- 1 | 5 | dev 6 | 7 | dir 8 | 9 | false 10 | 11 | src/main/assembly/component.xml 12 | 13 | 14 | -------------------------------------------------------------------------------- /manager/deployer/src/main/assembly/release.xml: -------------------------------------------------------------------------------- 1 | 5 | release 6 | 7 | tar.gz 8 | 9 | false 10 | 11 | src/main/assembly/component.xml 12 | 13 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/trcolor.js: -------------------------------------------------------------------------------- 1 | // JavaScript Document 2 | // JavaScript Document 3 | window.onload = function() { 4 | $('.changecolor_g tbody tr:even').addClass('odd'); 5 | $('.changecolor_g tbody tr').hover( 6 | function() {$(this).addClass('highlight');}, 7 | function() {$(this).removeClass('highlight');} 8 | ); 9 | 10 | $('.changecolor_w tbody tr:even').addClass('wh'); 11 | $('.changecolor_w tbody tr').hover( 12 | function() {$(this).addClass('highlight');}, 13 | function() {$(this).removeClass('highlight');} 14 | ); 15 | } 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /node/deployer/src/main/assembly/release.xml: -------------------------------------------------------------------------------- 1 | 3 | release 4 | 5 | tar.gz 6 | 7 | false 8 | 9 | src/main/assembly/component.xml 10 | 11 | 12 | -------------------------------------------------------------------------------- /shared/common/src/test/resources/spring/otter-test-sample.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/common/exceptions/InvalidConfigureException.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.otter.manager.biz.common.exceptions; 2 | 3 | public class InvalidConfigureException extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public static enum INVALID_TYPE { 8 | DDL, HOME 9 | } 10 | 11 | private INVALID_TYPE type; 12 | 13 | public InvalidConfigureException(INVALID_TYPE type){ 14 | super(type.name()); 15 | this.type = type; 16 | } 17 | 18 | public INVALID_TYPE getType() { 19 | return type; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /node/deployer/src/main/resources/otter.properties: -------------------------------------------------------------------------------- 1 | # otter node root dir 2 | otter.nodeHome = ${user.dir}/../ 3 | 4 | ## otter node dir 5 | otter.htdocs.dir = ${otter.nodeHome}/htdocs 6 | otter.download.dir = ${otter.nodeHome}/download 7 | otter.extend.dir= ${otter.nodeHome}/extend 8 | 9 | ## default zookeeper sesstion timeout = 60s 10 | otter.zookeeper.sessionTimeout = 60000 11 | 12 | ## otter communication payload size (default = 8388608) 13 | otter.communication.payload = 8388608 14 | 15 | ## otter communication pool size 16 | otter.communication.pool.size = 10 17 | 18 | ## otter arbitrate & node connect manager config 19 | otter.manager.address = 127.0.0.1:1099 20 | -------------------------------------------------------------------------------- /HEADER.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /docker/image/alidata/bin/main.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ -n "${DOCKER_DEPLOY_TYPE}" ] || DOCKER_DEPLOY_TYPE="VM" 4 | echo "DOCKER_DEPLOY_TYPE=${DOCKER_DEPLOY_TYPE}" 5 | 6 | # run init scripts 7 | for e in $(ls /alidata/init/*) ; do 8 | [ -x "${e}" ] || continue 9 | echo "==> INIT $e" 10 | $e 11 | echo "==> EXIT CODE: $?" 12 | done 13 | 14 | echo "==> INIT DEFAULT" 15 | service sshd start 16 | service crond start 17 | 18 | #echo "check hostname -i: `hostname -i`" 19 | #hti_num=`hostname -i|awk '{print NF}'` 20 | #if [ $hti_num -gt 1 ];then 21 | # echo "hostname -i result error:`hostname -i`" 22 | # exit 120 23 | #fi 24 | 25 | echo "==> INIT DONE" 26 | echo "==> RUN ${*}" 27 | exec "${@}" -------------------------------------------------------------------------------- /shared/common/src/test/resources/otter.properties: -------------------------------------------------------------------------------- 1 | otter.communication.pool.size=10 2 | otter.manager.address=127.0.0.1:1099 3 | otter.zookeeper.cluster.default=127.0.0.1:2181 4 | otter.zookeeper.sessionTimeout=60000 5 | 6 | # otter node root dir 7 | otter.nodeHome = ${java.io.tmpdir} 8 | 9 | ## otter node dir 10 | otter.htdocs.dir = ${otter.nodeHome}/htdocs 11 | otter.download.dir = ${otter.nodeHome}/download 12 | otter.extend.dir= ${otter.nodeHome}/extend 13 | 14 | # manager email user config 15 | otter.manager.monitor.email.host = smtp.gmail.com 16 | otter.manager.monitor.email.username = jianghang115@gmail.com 17 | otter.manager.monitor.email.password = xxxxxxx 18 | otter.manager.monitor.email.stmp.port = 465 -------------------------------------------------------------------------------- /shared/common/src/test/resources/compiler.txt: -------------------------------------------------------------------------------- 1 | package com.alibaba.otter.node.extend.fileresolver; 2 | 3 | import java.util.Map; 4 | 5 | import org.apache.commons.lang.StringUtils; 6 | 7 | import com.alibaba.otter.shared.etl.extend.fileresolver.FileInfo; 8 | 9 | public class TestFileResolver extends AbstractFileResolver { 10 | 11 | public FileInfo[] getFileInfo(Map rowMap) { 12 | 13 | String path = rowMap.get("FIELD"); 14 | FileInfo fileInfo = null; 15 | if (StringUtils.isNotEmpty(path)) { 16 | fileInfo = new FileInfo(path); 17 | return new FileInfo[] { fileInfo }; 18 | } else { 19 | return null; 20 | } 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/My97DatePicker/lang/en.js: -------------------------------------------------------------------------------- 1 | var $lang={ 2 | errAlertMsg: "Invalid date or the date out of range,redo or not?", 3 | aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 4 | aLongWeekStr:["wk","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"], 5 | aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], 6 | aLongMonStr: ["January","February","March","April","May","June","July","August","September","October","November","December"], 7 | clearStr: "Clear", 8 | todayStr: "Today", 9 | okStr: "OK", 10 | updateStr: "OK", 11 | timeStr: "Time", 12 | quickStr: "Quick Selection", 13 | err_1: 'MinDate Cannot be bigger than MaxDate!' 14 | } -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/flot/jquery.flot.symbol.min.js: -------------------------------------------------------------------------------- 1 | (function(b){function a(h,e,g){var d={square:function(k,j,n,i,m){var l=i*Math.sqrt(Math.PI)/2;k.rect(j-l,n-l,l+l,l+l)},diamond:function(k,j,n,i,m){var l=i*Math.sqrt(Math.PI/2);k.moveTo(j-l,n);k.lineTo(j,n-l);k.lineTo(j+l,n);k.lineTo(j,n+l);k.lineTo(j-l,n)},triangle:function(l,k,o,j,n){var m=j*Math.sqrt(2*Math.PI/Math.sin(Math.PI/3));var i=m*Math.sin(Math.PI/3);l.moveTo(k-m/2,o+i/2);l.lineTo(k+m/2,o+i/2);if(!n){l.lineTo(k,o-i/2);l.lineTo(k-m/2,o+i/2)}},cross:function(k,j,n,i,m){var l=i*Math.sqrt(Math.PI)/2;k.moveTo(j-l,n-l);k.lineTo(j+l,n+l);k.moveTo(j-l,n+l);k.lineTo(j+l,n-l)}};var f=e.points.symbol;if(d[f]){e.points.symbol=d[f]}}function c(d){d.hooks.processDatapoints.push(a)}b.plot.plugins.push({init:c,name:"symbols",version:"1.0"})})(jQuery); -------------------------------------------------------------------------------- /docker/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | current_path=`pwd` 4 | case "`uname`" in 5 | Darwin) 6 | bin_abs_path=`cd $(dirname $0); pwd` 7 | ;; 8 | Linux) 9 | bin_abs_path=$(readlink -f $(dirname $0)) 10 | ;; 11 | *) 12 | bin_abs_path=`cd $(dirname $0); pwd` 13 | ;; 14 | esac 15 | BASE=${bin_abs_path} 16 | 17 | if [ "$1" == "base" ] ; then 18 | docker build --no-cache -t canal/otter-osbase $BASE/base 19 | else 20 | rm -rf $BASE/node.*.tar.gz ; 21 | rm -rf $BASE/manager.*.tar.gz ; 22 | cd $BASE/../ && mvn clean package -Dmaven.test.skip -Denv=release && cd $current_path ; 23 | cp $BASE/../target/node.deployer-*.tar.gz $BASE/ 24 | cp $BASE/../target/manager.deployer-*.tar.gz $BASE/ 25 | docker build --no-cache -t canal/otter-all $BASE/ 26 | fi 27 | 28 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/templates/home/screen/systemReduction.vm: -------------------------------------------------------------------------------- 1 | $control.setTemplate("home:navigation.vm") 2 | 7 | 8 |
9 |
10 |

系统初始化

11 |
12 | 13 |
14 |
15 |
16 |
17 |
18 | 解决:zookeeper节点因为人为操作,误删除了channel/pipeline的相关节点,导致manager不可用,可点击进行一键补全 19 |
20 |
21 | #set ($redoZkLink = $homeModule.setTarget("systemReduction.vm").addQueryData("command", "true")) 22 | 23 | 24 |
25 |
26 | 27 | $!resultStr 28 | 29 |
30 | -------------------------------------------------------------------------------- /docker/base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM canal/osbase:v1 2 | 3 | MAINTAINER agapple (jianghang115@gmail.com) 4 | 5 | RUN \ 6 | groupadd -r mysql && useradd -r -g mysql mysql && \ 7 | yum -y install wget mysql-server --nogpgcheck && \ 8 | yum clean all && \ 9 | wget -q https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.13/zookeeper-3.4.13.tar.gz -O /home/admin/zookeeper-3.4.13.tar.gz && \ 10 | tar -xzvf /home/admin/zookeeper-*.tar.gz -C /home/admin && \ 11 | /bin/cp -rf /home/admin/zookeeper-3.4.13/conf/zoo_sample.cfg /home/admin/zookeeper-3.4.13/conf/zoo.cfg && \ 12 | sed -i -e 's/^dataDir=\/tmp\/zookeeper$/dataDir=\/home\/admin\/zkData/' /home/admin/zookeeper-3.4.13/conf/zoo.cfg && \ 13 | sed -i -e 's/^#autopurge/autopurge/' /home/admin/zookeeper-3.4.13/conf/zoo.cfg && \ 14 | /bin/rm -f /home/admin/zookeeper-3.4.13.tar.gz && \ 15 | true 16 | 17 | CMD ["/bin/bash"] 18 | -------------------------------------------------------------------------------- /node/common/src/main/resources/spring/otter-node-statistics.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/templates/home/layout/default.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Otter Manager 6 | 7 | 8 | 9 | 10 | 11 | 12 | $screen_placeholder 13 | 14 | 15 | 21 | 22 | -------------------------------------------------------------------------------- /shared/etl/src/main/java/com/alibaba/otter/shared/etl/model/ObjectData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.etl.model; 18 | 19 | /** 20 | * @author simon 2012-7-6 下午6:43:23 21 | * @version 4.1.0 22 | */ 23 | public interface ObjectData { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/load/loader/LoadContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.load.loader; 18 | 19 | /** 20 | * @author simon 2012-7-3 下午4:16:38 21 | * @version 4.1.0 22 | */ 23 | public interface LoadContext { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/utils/extension/classpath/ClassFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.utils.extension.classpath; 18 | 19 | public interface ClassFilter { 20 | 21 | boolean accept(Class clazz); 22 | } 23 | -------------------------------------------------------------------------------- /shared/push/src/main/java/com/alibaba/otter/common/push/SubscribeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.common.push; 18 | 19 | /** 20 | * @author zebin.xuzb 2012-9-19 下午3:31:07 21 | * @version 4.1.0 22 | */ 23 | public enum SubscribeType { 24 | DIAMOND, MEDIA; 25 | } 26 | -------------------------------------------------------------------------------- /manager/biz/src/test/java/com/alibaba/otter/manager/biz/service/PipelineSerivceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.service; 18 | 19 | import com.alibaba.otter.manager.biz.BaseOtterTest; 20 | 21 | public class PipelineSerivceTest extends BaseOtterTest { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/flot/jquery.flot.threshold.min.js: -------------------------------------------------------------------------------- 1 | (function(B){var A={series:{threshold:null}};function C(D){function E(L,S,M){if(!S.threshold){return }var F=M.pointsize,I,O,N,G,K,H=B.extend({},S);H.datapoints={points:[],pointsize:F};H.label=null;H.color=S.threshold.color;H.threshold=null;H.originSeries=S;H.data=[];var P=S.threshold.below,Q=M.points,R=S.lines.show;threspoints=[];newpoints=[];for(I=0;I0&&Q[I-F]!=null){var J=(O-Q[I-F])/(N-Q[I-F+1])*(P-N)+O;K.push(J);K.push(P);for(m=2;m0){L.getData().push(H)}}D.hooks.processDatapoints.push(E)}B.plot.plugins.push({init:C,options:A,name:"threshold",version:"1.0"})})(jQuery); -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/ArbitrateEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl; 18 | 19 | /** 20 | * 具体的仲裁行为接口 21 | * 22 | * @author jianghang 2011-8-9 下午04:39:20 23 | */ 24 | public interface ArbitrateEvent { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /node/etl/src/main/resources/spring/otter-node-select.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/utils/meta/DdlSchemaFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.utils.meta; 18 | 19 | /** 20 | * @author hatterjiang 21 | */ 22 | public interface DdlSchemaFilter { 23 | 24 | boolean accept(String schemaName); 25 | } 26 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/model/config/ModeValueFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.model.config; 18 | 19 | /** 20 | * @author hatterjiang 21 | */ 22 | public interface ModeValueFilter { 23 | 24 | boolean accept(final String value); 25 | } 26 | -------------------------------------------------------------------------------- /node/etl/src/main/resources/spring/otter-node-conflict.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /shared/push/src/main/java/com/alibaba/otter/common/push/SubscribeCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.common.push; 18 | 19 | /** 20 | * @author zebin.xuzb 2012-9-19 下午3:29:16 21 | * @version 4.1.0 22 | */ 23 | public interface SubscribeCallback { 24 | 25 | void callback(String changedInfo); 26 | } 27 | -------------------------------------------------------------------------------- /shared/arbitrate/src/test/java/com/alibaba/otter/shared/arbitrate/demo/servcie/PipelineLifeCycle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.demo.servcie; 18 | 19 | public interface PipelineLifeCycle { 20 | 21 | public void submit(Long pipelineId); 22 | 23 | public void destory(Long pipelineId); 24 | } 25 | -------------------------------------------------------------------------------- /shared/communication/src/main/java/com/alibaba/otter/shared/communication/core/model/EventType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.communication.core.model; 18 | 19 | /** 20 | * 通讯事件类型 21 | * 22 | * @author jianghang 2011-9-9 下午04:02:13 23 | */ 24 | public interface EventType { 25 | 26 | public String name(); 27 | } 28 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/utils/meta/DdlTableNameFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.utils.meta; 18 | 19 | /** 20 | * @author hatterjiang 21 | */ 22 | public interface DdlTableNameFilter { 23 | 24 | boolean accept(String catalogName, String schemaName, String tableName); 25 | } 26 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/load/loader/OtterLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.load.loader; 18 | 19 | /** 20 | * otter数据loader接口 21 | * 22 | * @author jianghang 2011-10-27 上午11:15:13 23 | * @version 4.0.0 24 | */ 25 | public interface OtterLoader { 26 | 27 | public R load(P data); 28 | } 29 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/common/io/download/impl/aria2c/Aria2cStat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.common.io.download.impl.aria2c; 18 | 19 | /** 20 | * Enum description 21 | */ 22 | public enum Aria2cStat { 23 | // 下载成功 24 | OK, 25 | 26 | // 下载失败 27 | ERR, 28 | 29 | // 下载进程异常终止 30 | INPR, 31 | } 32 | -------------------------------------------------------------------------------- /shared/communication/src/main/java/com/alibaba/otter/shared/communication/core/model/Callback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.communication.core.model; 18 | 19 | /** 20 | * 通讯的异步callback回调接口 21 | * 22 | * @author jianghang 2011-9-9 下午04:16:04 23 | */ 24 | public interface Callback { 25 | 26 | public void call(PARAM event); 27 | } 28 | -------------------------------------------------------------------------------- /manager/biz/src/test/java/com/alibaba/otter/manager/biz/monitor/AlarmServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.otter.manager.biz.monitor; 2 | 3 | import org.apache.commons.lang.exception.ExceptionUtils; 4 | import org.jtester.annotations.SpringBeanByName; 5 | import org.testng.annotations.Test; 6 | 7 | import com.alibaba.otter.manager.biz.BaseOtterTest; 8 | import com.alibaba.otter.manager.biz.common.alarm.AlarmMessage; 9 | import com.alibaba.otter.manager.biz.common.alarm.DefaultAlarmService; 10 | 11 | public class AlarmServiceTest extends BaseOtterTest { 12 | 13 | @SpringBeanByName 14 | private DefaultAlarmService alarmService; 15 | 16 | @Test 17 | public void test_simple() { 18 | AlarmMessage data = new AlarmMessage(); 19 | data.setMessage("this is test"); 20 | data.setReceiveKey("jianghang.loujh@alibaba-inc.com"); 21 | try { 22 | alarmService.doSend(data); 23 | } catch (Exception e) { 24 | want.fail(ExceptionUtils.getFullStackTrace(e)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /manager/web/src/main/java/com/alibaba/otter/manager/web/webx/valve/auth/url/URLProtected.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.web.webx.valve.auth.url; 18 | 19 | /** 20 | * 基于url的匹配 21 | * 22 | * @author jianghang 2011-11-11 下午12:30:43 23 | * @version 4.0.0 24 | */ 25 | public interface URLProtected { 26 | 27 | public boolean check(String requestUrl); 28 | } 29 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/utils/code/Code.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.utils.code; 18 | 19 | /** 20 | * 返回值定义的code对象定义 21 | * 22 | * @author jianghang 2011-9-13 下午04:46:42 23 | */ 24 | public interface Code { 25 | 26 | public String getCode(); 27 | 28 | public String getMessage(String... params); 29 | } 30 | -------------------------------------------------------------------------------- /node/extend/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.alibaba.otter 5 | node 6 | 4.2.19-SNAPSHOT 7 | ../pom.xml 8 | 9 | com.alibaba.otter 10 | node.extend 11 | jar 12 | otter extend module for otter 13 | http://github.com/alibaba/otter 14 | 15 | 16 | com.alibaba.otter 17 | shared.etl 18 | ${project.version} 19 | 20 | 21 | 22 | junit 23 | junit 24 | test 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /manager/web/src/main/java/com/alibaba/otter/manager/web/common/api/ApiAuthService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.web.common.api; 18 | 19 | import com.alibaba.citrus.turbine.TurbineRunData; 20 | 21 | /** 22 | * @author zebin.xuzb @ 2012-5-20 23 | */ 24 | public interface ApiAuthService { 25 | 26 | // 考虑不依赖 webx 27 | public boolean auth(TurbineRunData rundata); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /manager/web/src/main/java/com/alibaba/otter/manager/web/webx/valve/auth/action/ActionProtected.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.web.webx.valve.auth.action; 18 | 19 | /** 20 | * 基于url的匹配 21 | * 22 | * @author jianghang 2011-11-11 下午12:30:43 23 | * @version 4.0.0 24 | */ 25 | public interface ActionProtected { 26 | 27 | public boolean check(String action, String method); 28 | } 29 | -------------------------------------------------------------------------------- /shared/common/src/test/java/com/alibaba/otter/shared/common/BaseOtterTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common; 18 | 19 | import org.jtester.annotations.SpringApplicationContext; 20 | 21 | /** 22 | * @author jianghang 2010-6-2 上午11:48:00 23 | */ 24 | @SpringApplicationContext("applicationContext.xml") 25 | public class BaseOtterTest extends org.jtester.testng.JTester { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /shared/etl/src/main/java/com/alibaba/otter/shared/etl/extend/processor/support/DataSourceFetcherAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.etl.extend.processor.support; 18 | 19 | /** 20 | * @author jianghang 2014-6-11 下午3:15:57 21 | * @since 4.2.10 22 | */ 23 | public interface DataSourceFetcherAware { 24 | 25 | void setDataSourceFetcher(DataSourceFetcher dataSourceFetcher); 26 | } 27 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/transform/transformer/AbstractOtterTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.transform.transformer; 18 | 19 | /** 20 | * @author jianghang 2011-10-27 下午04:09:31 21 | * @version 4.0.0 22 | * @param 23 | * @param 24 | */ 25 | public abstract class AbstractOtterTransformer implements OtterTransformer { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/transform/transformer/OtterTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.transform.transformer; 18 | 19 | /** 20 | * 数据提取过程,T 21 | * 22 | * @author jianghang 2011-10-27 下午04:04:24 23 | * @version 4.0.0 24 | */ 25 | public interface OtterTransformer { 26 | 27 | public S transform(T data, OtterTransformerContext context); 28 | } 29 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/utils/compile/JavaSourceCompiler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.utils.compile; 18 | 19 | import com.alibaba.otter.shared.common.utils.compile.model.JavaSource; 20 | 21 | public interface JavaSourceCompiler { 22 | 23 | Class compile(String sourceString); 24 | 25 | Class compile(JavaSource javaSource); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/utils/extension/classpath/ClassScanner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.utils.extension.classpath; 18 | 19 | /** 20 | * 用于扫描classpath下面和外部文件系统中类. 21 | * 22 | * @author jianghang 2012-10-23 下午04:36:53 23 | * @version 4.1.0 24 | */ 25 | public interface ClassScanner { 26 | 27 | Class scan(String className); 28 | } 29 | -------------------------------------------------------------------------------- /node/etl/src/test/java/com/alibaba/otter/node/etl/BaseOtterTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl; 18 | 19 | import org.jtester.annotations.SpringApplicationContext; 20 | 21 | /** 22 | * @author jianghang 2011-9-16 下午02:58:37 23 | * @version 4.0.0 24 | */ 25 | @SpringApplicationContext("applicationContext.xml") 26 | public class BaseOtterTest extends org.jtester.testng.JTester { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /shared/communication/src/test/java/com/alibaba/otter/shared/communication/app/event/AppEventType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.communication.app.event; 18 | 19 | import com.alibaba.otter.shared.communication.core.model.EventType; 20 | 21 | /** 22 | * @author jianghang 2011-9-13 下午08:28:50 23 | */ 24 | public enum AppEventType implements EventType { 25 | create, update, delete, find; 26 | } 27 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/autokeeper/impl/AutoKeeperPersist.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.autokeeper.impl; 18 | 19 | /** 20 | * 数据持久化接口,会有持久化调度器定时触发 21 | * 22 | * @author jianghang 2012-9-21 下午03:04:37 23 | * @version 4.1.0 24 | */ 25 | public interface AutoKeeperPersist { 26 | 27 | /** 28 | * 会有 29 | */ 30 | public void persist(); 31 | } 32 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/node/NodeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.node; 18 | 19 | import com.alibaba.otter.shared.common.model.config.node.Node; 20 | import com.alibaba.otter.manager.biz.common.baseservice.GenericService; 21 | 22 | /** 23 | * @author simon 24 | */ 25 | public interface NodeService extends GenericService { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/node/dal/NodeDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.node.dal; 18 | 19 | import com.alibaba.otter.manager.biz.common.basedao.GenericDAO; 20 | import com.alibaba.otter.manager.biz.config.node.dal.dataobject.NodeDO; 21 | 22 | /** 23 | * @author simon 24 | */ 25 | public interface NodeDAO extends GenericDAO { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /shared/push/src/main/java/com/alibaba/otter/common/push/supplier/DatasourceChangeCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.common.push.supplier; 18 | 19 | /** 20 | * callback 处理的时间请尽量短,如果时间太长,请使用异步 21 | * 22 | * @author zebin.xuzb 2012-9-25 下午12:14:28 23 | * @version 4.1.0 24 | */ 25 | public interface DatasourceChangeCallback { 26 | 27 | void masterChanged(DatasourceInfo newMaster); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /node/common/src/test/java/com/alibaba/otter/node/common/BaseOtterTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.common; 18 | 19 | import org.jtester.annotations.SpringApplicationContext; 20 | 21 | /** 22 | * @author jianghang 2011-9-16 下午02:58:37 23 | * @version 4.0.0 24 | */ 25 | @SpringApplicationContext("applicationContext.xml") 26 | public class BaseOtterTest extends org.jtester.testng.JTester { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/zookeeper/ZooKeeperOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.zookeeper; 18 | 19 | import org.apache.zookeeper.KeeperException; 20 | 21 | /** 22 | * {@linkplain ZkClientx}的callback接口 23 | */ 24 | public interface ZooKeeperOperation { 25 | 26 | public T execute() throws KeeperException, InterruptedException; 27 | } 28 | -------------------------------------------------------------------------------- /shared/communication/src/test/java/com/alibaba/otter/shared/communication/BaseOtterTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.communication; 18 | 19 | import org.jtester.annotations.SpringApplicationContext; 20 | 21 | /** 22 | * @author jianghang 2010-6-2 上午11:48:00 23 | */ 24 | @SpringApplicationContext("applicationContext.xml") 25 | public class BaseOtterTest extends org.jtester.testng.JTester { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/conflict/model/ConflictEventType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.conflict.model; 18 | 19 | import com.alibaba.otter.shared.communication.core.model.EventType; 20 | 21 | /** 22 | * config交互的事件类型 23 | * 24 | * @author jianghang 25 | */ 26 | public enum ConflictEventType implements EventType { 27 | 28 | /** 文件冲突检测 */ 29 | fileConflictDetect; 30 | } 31 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/model/statistics/throughput/ThroughputType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.model.statistics.throughput; 18 | 19 | /** 20 | * 吞吐量统计类型 21 | * 22 | * @author jianghang 2011-9-8 下午12:57:30 23 | */ 24 | public enum ThroughputType { 25 | /** 数据库行记录 */ 26 | ROW, 27 | /** 文件数据 */ 28 | FILE, 29 | /** MQ记录数据 */ 30 | MQ; 31 | } 32 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/lb/LoadBalance.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl.lb; 18 | 19 | import com.alibaba.otter.shared.common.model.config.node.Node; 20 | 21 | /** 22 | * 负载均衡算法 23 | * 24 | * @author jianghang 2011-8-19 上午10:16:45 25 | */ 26 | public interface LoadBalance { 27 | 28 | public Node next() throws InterruptedException; 29 | } 30 | -------------------------------------------------------------------------------- /shared/etl/src/main/java/com/alibaba/otter/shared/etl/extend/fileresolver/support/RemoteDirectoryFetcherAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.etl.extend.fileresolver.support; 18 | 19 | /** 20 | * @author zebin.xuzb 2013-2-25 上午10:53:55 21 | * @since 4.1.7 22 | */ 23 | public interface RemoteDirectoryFetcherAware { 24 | 25 | void setRemoteDirectoryFetcher(RemoteDirectoryFetcher remoteDirectoryFetcher); 26 | } 27 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/zookeeper/SessionExpiredNotification.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.zookeeper; 18 | 19 | /** 20 | * zookeeper 出现session expired异常后的通知,允许业务实现自处理,比如重建ephemeral对象 21 | * 22 | * @author jianghang 2012-1-13 上午10:46:34 23 | * @version 4.0.0 24 | */ 25 | public interface SessionExpiredNotification { 26 | 27 | public void notification(); 28 | } 29 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/extract/extractor/OtterExtractor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.extract.extractor; 18 | 19 | import com.alibaba.otter.node.etl.extract.exceptions.ExtractException; 20 | 21 | /** 22 | * 组装数据,有多种来源,mysql,oracle,store,file等. 23 | */ 24 | public interface OtterExtractor

{ 25 | 26 | /** 27 | * 数据装配 28 | */ 29 | void extract(P param) throws ExtractException; 30 | } 31 | -------------------------------------------------------------------------------- /shared/common/src/test/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/datamatrix/dal/DataMatrixDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.datamatrix.dal; 18 | 19 | import com.alibaba.otter.manager.biz.common.basedao.GenericDAO; 20 | import com.alibaba.otter.manager.biz.config.datamatrix.dal.dataobject.DataMatrixDO; 21 | 22 | public interface DataMatrixDAO extends GenericDAO { 23 | 24 | public DataMatrixDO findByGroupKey(String groupKey); 25 | } 26 | -------------------------------------------------------------------------------- /node/common/src/main/java/com/alibaba/otter/node/common/config/NodeTaskListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.common.config; 18 | 19 | import java.util.List; 20 | 21 | import com.alibaba.otter.node.common.config.model.NodeTask; 22 | 23 | /** 24 | * 在nodeTask发生变化时,广播通知下 25 | * 26 | * @author jianghang 2012-4-20 下午10:45:17 27 | * @version 4.0.2 28 | */ 29 | public interface NodeTaskListener { 30 | 31 | boolean process(List nodeTasks); 32 | } 33 | -------------------------------------------------------------------------------- /node/common/src/main/resources/spring/otter-node-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /shared/communication/src/test/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /shared/etl/src/main/java/com/alibaba/otter/shared/etl/extend/processor/support/DataSourceFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.etl.extend.processor.support; 18 | 19 | import javax.sql.DataSource; 20 | 21 | /** 22 | * 获取数据库 23 | * 24 | * @author jianghang 2014-6-11 下午3:15:57 25 | * @since 4.2.10 26 | */ 27 | public interface DataSourceFetcher { 28 | 29 | /** 30 | * 获取 DataSource 31 | */ 32 | DataSource fetch(Long tableId); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /manager/web/src/main/java/com/alibaba/otter/manager/web/common/api/DefaultApiAuthService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.web.common.api; 18 | 19 | import com.alibaba.citrus.turbine.TurbineRunData; 20 | 21 | /** 22 | * @author zebin.xuzb @ 2012-5-20 23 | */ 24 | public class DefaultApiAuthService implements ApiAuthService { 25 | 26 | @Override 27 | public boolean auth(TurbineRunData rundata) { 28 | return true; // TODO 需要增加验证逻辑 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/datamediasource/dal/DataMediaSourceDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.datamediasource.dal; 18 | 19 | import com.alibaba.otter.manager.biz.common.basedao.GenericDAO; 20 | import com.alibaba.otter.manager.biz.config.datamediasource.dal.dataobject.DataMediaSourceDO; 21 | 22 | /** 23 | * @author simon 24 | */ 25 | public interface DataMediaSourceDAO extends GenericDAO { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/zookeeper/termin/TerminProcess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl.zookeeper.termin; 18 | 19 | import com.alibaba.otter.shared.arbitrate.model.TerminEventData; 20 | 21 | /** 22 | * 终结信号处理的接口 23 | * 24 | * @author jianghang 2011-9-26 下午01:37:04 25 | * @version 4.0.0 26 | */ 27 | public interface TerminProcess { 28 | 29 | public boolean process(TerminEventData data); 30 | } 31 | -------------------------------------------------------------------------------- /shared/communication/src/main/java/com/alibaba/otter/shared/communication/model/canal/CanalEventType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.communication.model.canal; 18 | 19 | import com.alibaba.otter.shared.communication.core.model.EventType; 20 | 21 | /** 22 | * config交互的事件类型 23 | * 24 | * @author jianghang 25 | */ 26 | public enum CanalEventType implements EventType { 27 | 28 | /** 查询对应canal信息 */ 29 | findCanal, 30 | /** 查询对应的过滤条件 */ 31 | findFilter; 32 | } 33 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/canal/dal/CanalDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.canal.dal; 18 | 19 | import com.alibaba.otter.manager.biz.common.basedao.GenericDAO; 20 | import com.alibaba.otter.manager.biz.config.canal.dal.dataobject.CanalDO; 21 | 22 | /** 23 | * @author sarah.lij 2012-7-25 下午05:05:37 24 | */ 25 | public interface CanalDAO extends GenericDAO { 26 | 27 | public CanalDO findByName(String name); 28 | } 29 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/parameter/SystemParameterService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.parameter; 18 | 19 | import com.alibaba.otter.shared.common.model.config.parameter.SystemParameter; 20 | 21 | /** 22 | * @author sarah.lij 2012-4-13 下午04:28:00 23 | */ 24 | public interface SystemParameterService { 25 | 26 | public void createOrUpdate(SystemParameter systemParameter); 27 | 28 | public SystemParameter find(); 29 | } 30 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/parameter/dal/SystemParameterDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.parameter.dal; 18 | 19 | import com.alibaba.otter.manager.biz.common.basedao.GenericDAO; 20 | import com.alibaba.otter.manager.biz.config.parameter.dal.dataobject.SystemParameterDO; 21 | 22 | /** 23 | * @author sarah.lij 2012-4-13 下午04:44:24 24 | */ 25 | public interface SystemParameterDAO extends GenericDAO { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/statistics/delay/DelayCounter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.statistics.delay; 18 | 19 | /** 20 | * @author jianghang 2011-11-21 下午03:07:35 21 | * @version 4.0.0 22 | */ 23 | public interface DelayCounter { 24 | 25 | public Long incAndGet(Long pipelineId, Long number); 26 | 27 | public Long decAndGet(Long pipelineId, Long number); 28 | 29 | public Long setAndGet(Long pipelineId, Long number); 30 | } 31 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/monitor/Monitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl.monitor; 18 | 19 | /** 20 | * Arbitrate Monitor的统一接口定义,允许进行数据的reload
21 | * 在并发往zookeeper写数据,通过Watcher进行监听时,Watcher响应到重新注册Watcher这段时间的数据不能得到响应, 所以需要定时进行reload,避免死锁 22 | * 23 | * @author jianghang 2011-9-19 下午02:51:36 24 | * @version 4.0.0 25 | */ 26 | public interface Monitor { 27 | 28 | public void reload(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/monitor/listener/PermitListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl.monitor.listener; 18 | 19 | /** 20 | * 监控下permit发生变化,即时处理一些数据(比如select节点的启动) 21 | * 22 | * @author jianghang 2011-12-8 下午04:48:14 23 | * @version 4.0.0 24 | */ 25 | public interface PermitListener { 26 | 27 | /** 28 | * 触发一下permit变化的值 29 | */ 30 | public void processChanged(boolean isPermit); 31 | } 32 | -------------------------------------------------------------------------------- /manager/web/src/main/java/com/alibaba/otter/manager/web/home/module/screen/Ok.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.web.home.module.screen; 18 | 19 | import com.alibaba.citrus.turbine.Context; 20 | import com.alibaba.citrus.turbine.dataresolver.Param; 21 | 22 | /** 23 | * @author jianghang 2011-8-31 下午07:00:19 24 | */ 25 | public class Ok { 26 | 27 | public void execute(@Param(name = "param") String param, Context context) { 28 | context.put("ok", param); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /docker/image/alidata/lib/proc.sh: -------------------------------------------------------------------------------- 1 | # waitterm 2 | # wait TERM/INT signal. 3 | # see: http://veithen.github.io/2014/11/16/sigterm-propagation.html 4 | waitterm() { 5 | local PID 6 | # any process to block 7 | tail -f /dev/null & 8 | PID="$!" 9 | # setup trap, could do nothing, or just kill the blocker 10 | trap "kill -TERM ${PID}" TERM INT 11 | # wait for signal, ignore wait exit code 12 | wait "${PID}" || true 13 | # clear trap 14 | trap - TERM INT 15 | # wait blocker, ignore blocker exit code 16 | wait "${PID}" 2>/dev/null || true 17 | } 18 | 19 | # waittermpid "${PIDFILE}". 20 | # monitor process by pidfile && wait TERM/INT signal. 21 | # if the process disappeared, return 1, means exit with ERROR. 22 | # if TERM or INT signal received, return 0, means OK to exit. 23 | waittermpid() { 24 | local PIDFILE PID do_run error 25 | PIDFILE="${1?}" 26 | do_run=true 27 | error=0 28 | trap "do_run=false" TERM INT 29 | while "${do_run}" ; do 30 | PID="$(cat "${PIDFILE}")" 31 | if ! ps -p "${PID}" >/dev/null 2>&1 ; then 32 | do_run=false 33 | error=1 34 | else 35 | sleep 1 36 | fi 37 | done 38 | trap - TERM INT 39 | return "${error}" 40 | } 41 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/monitor/AlarmController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.monitor; 18 | 19 | import com.alibaba.otter.manager.biz.common.alarm.AlarmMessage; 20 | import com.alibaba.otter.shared.common.model.config.alarm.AlarmRule; 21 | 22 | /** 23 | * @author zebin.xuzb 24 | * @version 4.1.0 25 | */ 26 | public interface AlarmController { 27 | 28 | public AlarmMessage control(AlarmRule rule, String message, AlarmMessage data); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/model/config/data/ColumnPairMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.model.config.data; 18 | 19 | /** 20 | * @author jianghang 2013-1-6 下午05:32:11 21 | * @version 4.1.6 22 | */ 23 | public enum ColumnPairMode { 24 | INCLUDE, EXCLUDE; 25 | 26 | public boolean isInclude() { 27 | return this == INCLUDE; 28 | } 29 | 30 | public boolean isExclude() { 31 | return this == EXCLUDE; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/common/io/download/Download.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.common.io.download; 18 | 19 | //~--- JDK imports ------------------------------------------------------------ 20 | 21 | import java.io.File; 22 | 23 | /** 24 | * @author brave.taoy 25 | */ 26 | public interface Download { 27 | 28 | public long getContentLength(); 29 | 30 | public File getAssociatedLocalFile(); 31 | 32 | public byte[] getAssociatedMemoryData(); 33 | } 34 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/channel/dal/ChannelDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.channel.dal; 18 | 19 | import java.util.List; 20 | 21 | import com.alibaba.otter.manager.biz.common.basedao.GenericDAO; 22 | import com.alibaba.otter.manager.biz.config.channel.dal.dataobject.ChannelDO; 23 | 24 | /** 25 | * @author simon 26 | */ 27 | public interface ChannelDAO extends GenericDAO { 28 | 29 | public List listChannelPks(); 30 | } 31 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/My97DatePicker/lang/zh-tw.js: -------------------------------------------------------------------------------- 1 | var $lang={ 2 | errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u7BC4\u570D,\u9700\u8981\u64A4\u92B7\u55CE?", 3 | aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"], 4 | aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"], 5 | aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"], 6 | aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"], 7 | clearStr: "\u6E05\u7A7A", 8 | todayStr: "\u4ECA\u5929", 9 | okStr: "\u78BA\u5B9A", 10 | updateStr: "\u78BA\u5B9A", 11 | timeStr: "\u6642\u9593", 12 | quickStr: "\u5FEB\u901F\u9078\u64C7", 13 | err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u65BC\u6700\u5927\u65E5\u671F!' 14 | } -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/model/config/data/db/DbDataMedia.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.model.config.data.db; 18 | 19 | import com.alibaba.otter.shared.common.model.config.data.DataMedia; 20 | 21 | /** 22 | * 基于数据库的介质 23 | * 24 | * @author jianghang 25 | */ 26 | public class DbDataMedia extends DataMedia { 27 | 28 | private static final long serialVersionUID = 4466168734406777366L; 29 | 30 | // TODO: 允许定义同步或者过滤的字段信息 31 | 32 | } 33 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/My97DatePicker/lang/zh-cn.js: -------------------------------------------------------------------------------- 1 | var $lang={ 2 | errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u8303\u56F4,\u9700\u8981\u64A4\u9500\u5417?", 3 | aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"], 4 | aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"], 5 | aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"], 6 | aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"], 7 | clearStr: "\u6E05\u7A7A", 8 | todayStr: "\u4ECA\u5929", 9 | okStr: "\u786E\u5B9A", 10 | updateStr: "\u786E\u5B9A", 11 | timeStr: "\u65F6\u95F4", 12 | quickStr: "\u5FEB\u901F\u9009\u62E9", 13 | err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u6700\u5927\u65E5\u671F!' 14 | } -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/model/config/Transient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.model.config; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | @Target({ ElementType.FIELD, ElementType.PARAMETER }) 25 | @Retention(RetentionPolicy.RUNTIME) 26 | public @interface Transient { 27 | 28 | boolean value() default true; 29 | } 30 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/model/config/data/mq/MqDataMedia.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.model.config.data.mq; 18 | 19 | import com.alibaba.otter.shared.common.model.config.data.DataMedia; 20 | 21 | /** 22 | * NapoliSender对象的实现 23 | * 24 | * @author simon 2012-6-19 下午10:49:08 25 | * @version 4.1.0 26 | */ 27 | public class MqDataMedia extends DataMedia { 28 | 29 | private static final long serialVersionUID = 1347886915428919398L; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/common/pipe/impl/http/archive/ArchiveRetriverCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.common.pipe.impl.http.archive; 18 | 19 | import java.io.InputStream; 20 | 21 | /** 22 | * archive数据提取的callback接口 23 | * 24 | * @author jianghang 2011-10-11 下午04:49:05 25 | * @version 4.0.0 26 | */ 27 | public interface ArchiveRetriverCallback { 28 | 29 | /** 30 | * 根据source,打开对应的输入流 31 | */ 32 | public InputStream retrive(SOURCE source); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/statistics/throughput/param/AnalysisType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.statistics.throughput.param; 18 | 19 | /** 20 | * @author jianghang 2011-9-8 下午01:22:51 21 | */ 22 | public enum AnalysisType { 23 | ONE_MINUTE(1), FIVE_MINUTE(5), FIFTEEN_MINUTE(15); 24 | 25 | private final int value; 26 | 27 | public int getValue() { 28 | return value; 29 | } 30 | 31 | AnalysisType(int value){ 32 | this.value = value; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/load/loader/db/context/FileLoadContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.load.loader.db.context; 18 | 19 | import com.alibaba.otter.node.etl.load.loader.AbstractLoadContext; 20 | import com.alibaba.otter.shared.etl.model.FileData; 21 | 22 | public class FileLoadContext extends AbstractLoadContext { 23 | 24 | private static final long serialVersionUID = -6115201462901866481L; 25 | 26 | public FileLoadContext(){ 27 | super(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/monitor/PassiveMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.monitor; 18 | 19 | import java.util.List; 20 | 21 | import com.alibaba.otter.shared.common.model.config.alarm.AlarmRule; 22 | 23 | /** 24 | * 被动监控者,由其他人喂给他需要监控的数据 25 | * 26 | * @author zebin.xuzb @ 2012-8-30 27 | * @version 4.1.0 28 | */ 29 | public interface PassiveMonitor { 30 | 31 | public void feed(Object data, Long pipelineId); 32 | 33 | public void feed(Object data, List rules); 34 | } 35 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/model/config/enums/AreaType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.model.config.enums; 18 | 19 | /** 20 | * 标记一下地区信息,因为不同地区会有不同的配置信息 21 | * 22 | * @author jianghang 2013-6-5 下午04:14:05 23 | * @version 4.1.9 24 | */ 25 | public enum AreaType { 26 | 27 | HZ, US; 28 | 29 | public boolean isHzArea() { 30 | return this.equals(AreaType.HZ); 31 | } 32 | 33 | public boolean isUsArea() { 34 | return this.equals(AreaType.US); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /shared/etl/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.alibaba.otter 5 | shared 6 | 4.2.19-SNAPSHOT 7 | ../pom.xml 8 | 9 | com.alibaba.otter 10 | shared.etl 11 | jar 12 | etl shared module for otter 13 | http://github.com/alibaba/otter 14 | 15 | 16 | 17 | com.alibaba.otter 18 | shared.common 19 | ${project.version} 20 | 21 | 22 | 23 | junit 24 | junit 25 | test 26 | 27 | 28 | org.jtester 29 | jtester 30 | test 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /shared/etl/src/main/java/com/alibaba/otter/shared/etl/extend/fileresolver/support/RemoteDirectoryFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.etl.extend.fileresolver.support; 18 | 19 | /** 20 | * @author zebin.xuzb 2013-2-25 上午10:49:50 21 | * @since 4.1.7 22 | */ 23 | public interface RemoteDirectoryFetcher { 24 | 25 | /** 26 | * 获取 RemoteDirectory, 可能为 null! 27 | * 28 | * @param namespace 29 | * @param path 30 | * @return 31 | */ 32 | RemoteDirectory fetch(String namespace, String path); 33 | } 34 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/model/config/node/NodeStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.model.config.node; 18 | 19 | /** 20 | * Node节点的运行状态 21 | * 22 | * @author jianghang 23 | */ 24 | public enum NodeStatus { 25 | 26 | /** 运行中 */ 27 | START, 28 | /** 停止 */ 29 | STOP; 30 | 31 | public boolean isStart() { 32 | return this.equals(NodeStatus.START); 33 | } 34 | 35 | public boolean isStop() { 36 | return this.equals(NodeStatus.STOP); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /shared/communication/src/main/java/com/alibaba/otter/shared/communication/model/statistics/StatisticsEventType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.communication.model.statistics; 18 | 19 | import com.alibaba.otter.shared.communication.core.model.EventType; 20 | 21 | /** 22 | * 统计数据的事件类型 23 | * 24 | * @author jianghang 25 | */ 26 | public enum StatisticsEventType implements EventType { 27 | /** delayCount */ 28 | delayCount, 29 | /** tableStat */ 30 | tableStat, 31 | /** throughputStat */ 32 | throughputStat; 33 | } 34 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/monitor/Monitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.monitor; 18 | 19 | import java.util.List; 20 | 21 | import com.alibaba.otter.shared.common.model.config.alarm.AlarmRule; 22 | 23 | /** 24 | * 主动监控者,需要自己去寻找数据来进行监控 25 | * 26 | * @author zebin.xuzb @ 2012-8-23 27 | * @version 4.1.0 28 | */ 29 | public interface Monitor { 30 | 31 | public void explore(); 32 | 33 | public void explore(Long... pipelineIds); 34 | 35 | public void explore(List rules); 36 | } 37 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/resources/spring/otter-arbitrate-alarm.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/monitor/MonitorTimer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.monitor; 18 | 19 | import java.util.Date; 20 | import java.util.concurrent.ConcurrentHashMap; 21 | 22 | import com.alibaba.otter.shared.common.model.config.alarm.MonitorName; 23 | 24 | /** 25 | * @author simon 2012-9-11 下午3:25:14 26 | * @version 4.1.0 27 | */ 28 | public class MonitorTimer extends ConcurrentHashMap { 29 | 30 | private static final long serialVersionUID = -2129810461060521223L; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /manager/deployer/src/main/assembly/component.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ./src/main/bin 5 | bin 6 | 7 | **/* 8 | 9 | 0755 10 | 11 | 12 | ./src/main/resources/webapp 13 | webapp 14 | 15 | **/* 16 | 17 | 18 | 19 | 20 | 21 | ./src/main/resources/logback.xml 22 | conf 23 | 24 | 25 | ./src/main/resources/otter.properties 26 | conf 27 | 28 | 29 | ./src/main/resources/jetty.xml 30 | conf 31 | 32 | 33 | ../../lib/ojdbc6.jar 34 | lib 35 | 36 | 37 | 38 | 39 | lib 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/datamediasource/DataMediaSourceService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.datamediasource; 18 | 19 | import com.alibaba.otter.shared.common.model.config.data.DataMediaSource; 20 | import com.alibaba.otter.manager.biz.common.baseservice.GenericService; 21 | 22 | /** 23 | * @author simon 24 | */ 25 | public interface DataMediaSourceService extends GenericService { 26 | 27 | // public List listDataMediaSourceById(Long... dataMediaSourceIds); 28 | } 29 | -------------------------------------------------------------------------------- /node/extend/src/main/java/com/alibaba/otter/node/extend/fileresolver/AbstractFileResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.extend.fileresolver; 18 | 19 | import com.alibaba.otter.shared.etl.extend.fileresolver.FileResolver; 20 | 21 | /** 22 | * @author jianghang 2012-10-23 下午04:11:14 23 | * @version 4.1.0 24 | */ 25 | public abstract class AbstractFileResolver implements FileResolver { 26 | 27 | public boolean isDeleteRequired() { 28 | return false; 29 | } 30 | 31 | public boolean isDistributed() { 32 | return false; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/lb/TransformStickLoadBalance.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl.lb; 18 | 19 | import java.util.List; 20 | 21 | import com.alibaba.otter.shared.common.model.config.node.Node; 22 | 23 | public class TransformStickLoadBalance extends StickLoadBalance { 24 | 25 | public TransformStickLoadBalance(Long pipelineId){ 26 | super(pipelineId); 27 | } 28 | 29 | public List getAliveNodes() { 30 | return getTransformAliveNodes(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/monitor/listener/NodeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl.monitor.listener; 18 | 19 | import java.util.List; 20 | 21 | /** 22 | * dead node的监控处理实现,运行在启动了mainStem的单节点上,避免多个节点同时处理,所以抽取了Listener 23 | * 24 | * @author jianghang 2011-9-26 下午10:33:42 25 | * @version 4.0.0 26 | */ 27 | public interface NodeListener { 28 | 29 | /** 30 | * 触发process变化,传递了变化后最新的processIds列表 31 | */ 32 | public void processChanged(List aliveNodes); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/nodeCheck.js: -------------------------------------------------------------------------------- 1 | function isRunning(nid,pid,stage) { 2 | if(stage == 'SELECT') { 3 | Node.isSelectRunning(nid,pid,callback); 4 | }else if(stage == 'EXTRACT'){ 5 | Node.isExtractRunning(nid,pid,callback); 6 | }else if(stage == 'TRANSFORM') { 7 | Node.isTransformRunning(nid,pid,callback); 8 | }else { 9 | Node.isLoadRunning(nid,pid,callback); 10 | } 11 | } 12 | 13 | function aggregation(nid,pid,stage) { 14 | if(stage == 'SELECT') { 15 | Node.selectStageAggregation(nid,pid,callback); 16 | }else if(stage == 'EXTRACT'){ 17 | Node.extractStageAggregation(nid,pid,callback); 18 | }else if(stage == 'TRANSFORM') { 19 | Node.transformStageAggregation(nid,pid,callback); 20 | }else { 21 | Node.loadStageAggregation(nid,pid,callback); 22 | } 23 | } 24 | 25 | function pending(nid,pid,stage) { 26 | if(stage == 'SELECT') { 27 | Node.selectPendingProcess(nid,pid,callback); 28 | }else if(stage == 'EXTRACT'){ 29 | Node.extractPendingProcess(nid,pid,callback); 30 | }else if(stage == 'TRANSFORM') { 31 | Node.transformPendingProcess(nid,pid,callback); 32 | }else { 33 | Node.loadPendingProcess(nid,pid,callback); 34 | } 35 | } 36 | 37 | function callback(msg) { 38 | alert(msg); 39 | } -------------------------------------------------------------------------------- /shared/communication/src/main/java/com/alibaba/otter/shared/communication/model/arbitrate/ArbitrateEventType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.communication.model.arbitrate; 18 | 19 | import com.alibaba.otter.shared.communication.core.model.EventType; 20 | 21 | public enum ArbitrateEventType implements EventType { 22 | 23 | /** 通知manager关闭 */ 24 | stopChannel, 25 | /** 报警信息 */ 26 | nodeAlarm, 27 | /** 通知manager node需要关闭 */ 28 | stopNode, 29 | /** stage调度通知 */ 30 | stageSingle, 31 | /** fast stage调度通知 */ 32 | fastStageSingle; 33 | } 34 | -------------------------------------------------------------------------------- /manager/web/src/main/java/com/alibaba/otter/manager/web/common/model/SeniorDataMatrix.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.web.common.model; 18 | 19 | import com.alibaba.otter.shared.common.model.config.data.DataMatrix; 20 | 21 | public class SeniorDataMatrix extends DataMatrix { 22 | 23 | private static final long serialVersionUID = -4121314684324595191L; 24 | private boolean used; 25 | 26 | public boolean isUsed() { 27 | return used; 28 | } 29 | 30 | public void setUsed(boolean used) { 31 | this.used = used; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/lb/ExtractStickLoadBalance.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl.lb; 18 | 19 | import java.util.List; 20 | 21 | import com.alibaba.otter.shared.common.model.config.node.Node; 22 | 23 | public class ExtractStickLoadBalance extends StickLoadBalance { 24 | 25 | public ExtractStickLoadBalance(Long pipelineId){ 26 | super(pipelineId); 27 | } 28 | 29 | @Override 30 | public List getAliveNodes() { 31 | return getExtractAliveNodes(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/model/config/data/ExtensionDataType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.model.config.data; 18 | 19 | /** 20 | * 类ResolverType.java的实现描述:TODO 类实现描述 21 | * 22 | * @author simon 2012-10-16 下午7:47:01 23 | * @version 4.1.0 24 | */ 25 | public enum ExtensionDataType { 26 | CLAZZ, SOURCE; 27 | 28 | public boolean isClazz() { 29 | return this.equals(ExtensionDataType.CLAZZ); 30 | } 31 | 32 | public boolean isSource() { 33 | return this.equals(ExtensionDataType.SOURCE); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /node/common/src/main/java/com/alibaba/otter/node/common/config/impl/InternalConfigClientService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.common.config.impl; 18 | 19 | import com.alibaba.otter.node.common.config.ConfigClientService; 20 | import com.alibaba.otter.shared.common.model.config.channel.Channel; 21 | 22 | /** 23 | * 内部config service 24 | * 25 | * @author jianghang 26 | */ 27 | public interface InternalConfigClientService extends ConfigClientService { 28 | 29 | /** 30 | * 创建或者更新本地service的数据 31 | */ 32 | public void createOrUpdateChannel(Channel channel); 33 | } 34 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/monitor/listener/MainstemListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl.monitor.listener; 18 | 19 | /** 20 | * 触发一下mainstem发生切换 21 | * 22 | * @author jianghang 2012-9-11 下午02:26:03 23 | * @version 4.1.0 24 | */ 25 | public interface MainstemListener { 26 | 27 | /** 28 | * 触发现在轮到自己做为active,需要载入上一个active的上下文数据 29 | */ 30 | public void processActiveEnter(); 31 | 32 | /** 33 | * 触发一下当前active模式失败 34 | */ 35 | public void processActiveExit(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/rpc/monitor/ProcessListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl.rpc.monitor; 18 | 19 | import java.util.List; 20 | 21 | /** 22 | *

23 |  * 1. 合并S.E.T.L各类事件的监听,减少和zookeeper的交互
24 |  * 2. 采用观察者事件变化推送的模式
25 |  * 
26 | * 27 | * @author jianghang 2012-9-28 下午09:38:12 28 | * @version 4.1.0 29 | */ 30 | public interface ProcessListener { 31 | 32 | /** 33 | * 触发process变化,传递了变化后最新的processIds列表 34 | */ 35 | public void processChanged(List processIds); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /manager/deployer/src/main/resources/webapp/js/flot/jquery.flot.resize.min.js: -------------------------------------------------------------------------------- 1 | (function(n,p,u){var w=n([]),s=n.resize=n.extend(n.resize,{}),o,l="setTimeout",m="resize",t=m+"-special-event",v="delay",r="throttleWindow";s[v]=250;s[r]=true;n.event.special[m]={setup:function(){if(!s[r]&&this[l]){return false}var a=n(this);w=w.add(a);n.data(this,t,{w:a.width(),h:a.height()});if(w.length===1){q()}},teardown:function(){if(!s[r]&&this[l]){return false}var a=n(this);w=w.not(a);a.removeData(t);if(!w.length){clearTimeout(o)}},add:function(b){if(!s[r]&&this[l]){return false}var c;function a(d,h,g){var f=n(this),e=n.data(this,t);e.w=h!==u?h:f.width();e.h=g!==u?g:f.height();c.apply(this,arguments)}if(n.isFunction(b)){c=b;return a}else{c=b.handler;b.handler=a}}};function q(){o=p[l](function(){w.each(function(){var d=n(this),a=d.width(),b=d.height(),c=n.data(this,t);if(a!==c.w||b!==c.h){d.trigger(m,[c.w=a,c.h=b])}});q()},s[v])}})(jQuery,this);(function(b){var a={};function c(f){function e(){var h=f.getPlaceholder();if(h.width()==0||h.height()==0){return}f.resize();f.setupGrid();f.draw()}function g(i,h){i.getPlaceholder().resize(e)}function d(i,h){i.getPlaceholder().unbind("resize",e)}f.hooks.bindEvents.push(g);f.hooks.shutdown.push(d)}b.plot.plugins.push({init:c,options:a,name:"resize",version:"1.0"})})(jQuery); -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/TerminArbitrateEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl; 18 | 19 | import com.alibaba.otter.shared.arbitrate.model.TerminEventData; 20 | 21 | public interface TerminArbitrateEvent { 22 | 23 | public TerminEventData await(Long pipelineId) throws InterruptedException; 24 | 25 | public void exhaust(Long pipelineId); 26 | 27 | public void ack(TerminEventData data); 28 | 29 | public int size(Long pipelineId); 30 | 31 | public void single(final TerminEventData data); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /manager/deployer/src/main/bin/startup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | @if not "%ECHO%" == "" echo %ECHO% 3 | @if "%OS%" == "Windows_NT" setlocal 4 | 5 | set ENV_PATH=.\ 6 | if "%OS%" == "Windows_NT" set ENV_PATH=%~dp0% 7 | 8 | set conf_dir=%ENV_PATH%\..\conf 9 | set webapp_dir=%ENV_PATH%\..\ 10 | set otter_conf=%conf_dir%\otter.properties 11 | set logback_configurationFile=%conf_dir%\logback.xml 12 | 13 | set CLASSPATH=%webapp_dir%;%conf_dir%;%conf_dir%\..\lib\*;%CLASSPATH% 14 | 15 | set JAVA_MEM_OPTS= -Xms128m -Xmx512m -XX:PermSize=128m 16 | set JAVA_OPTS_EXT= -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dapplication.codeset=UTF-8 -Dfile.encoding=UTF-8 17 | set JAVA_DEBUG_OPT= -server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=7099,server=y,suspend=n 18 | set CANAL_OPTS= -DappName=otter-manager -Ddubbo.application.logger=slf4j -Dlogback.configurationFile="%logback_configurationFile%" -Dotter.conf="%otter_conf%" 19 | 20 | set JAVA_OPTS= %JAVA_MEM_OPTS% %JAVA_OPTS_EXT% %JAVA_DEBUG_OPT% %OTTER_OPTS% 21 | 22 | set CMD_STR= java %JAVA_OPTS% -classpath "%CLASSPATH%" com.alibaba.otter.manager.deployer.OtterManagerLauncher 23 | echo start cmd : %CMD_STR% 24 | 25 | java %JAVA_OPTS% -classpath "%CLASSPATH%" com.alibaba.otter.manager.deployer.OtterManagerLauncher -------------------------------------------------------------------------------- /node/deployer/src/main/bin/startup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | @if not "%ECHO%" == "" echo %ECHO% 3 | @if "%OS%" == "Windows_NT" setlocal 4 | 5 | set ENV_PATH=.\ 6 | if "%OS%" == "Windows_NT" set ENV_PATH=%~dp0% 7 | 8 | set conf_dir=%ENV_PATH%\..\conf 9 | set nid_file=%conf_dir%\nid 10 | set /p nid=<"%nid_file%" 11 | set otter_conf=%conf_dir%\otter.properties 12 | set logback_configurationFile=%conf_dir%\logback.xml 13 | 14 | set CLASSPATH=%conf_dir% 15 | set CLASSPATH=%conf_dir%\..\lib\*;%CLASSPATH% 16 | 17 | set JAVA_MEM_OPTS= -Xms128m -Xmx512m -XX:PermSize=128m 18 | set JAVA_OPTS_EXT= -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dapplication.codeset=UTF-8 -Dfile.encoding=UTF-8 19 | set JAVA_DEBUG_OPT= -server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8099,server=y,suspend=n 20 | set OTTER_OPTS= -DappName=otter-node -Ddubbo.application.logger=slf4j -Dlogback.configurationFile="%logback_configurationFile%" -Dnid=%nid% 21 | 22 | set JAVA_OPTS= %JAVA_MEM_OPTS% %JAVA_OPTS_EXT% %JAVA_DEBUG_OPT% %OTTER_OPTS% 23 | 24 | set CMD_STR= java %JAVA_OPTS% -classpath "%CLASSPATH%" com.alibaba.otter.node.deployer.OtterLauncher 25 | echo start cmd : %CMD_STR% 26 | 27 | java %JAVA_OPTS% -classpath "%CLASSPATH%" com.alibaba.otter.node.deployer.OtterLauncher 28 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/pipeline/dal/PipelineDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.pipeline.dal; 18 | 19 | import java.util.List; 20 | 21 | import com.alibaba.otter.manager.biz.common.basedao.GenericDAO; 22 | import com.alibaba.otter.manager.biz.config.pipeline.dal.dataobject.PipelineDO; 23 | 24 | /** 25 | * @author simon 26 | */ 27 | public interface PipelineDAO extends GenericDAO { 28 | 29 | public List listByChannelIds(Long... channelId); 30 | 31 | public List listByDestinationCondition(String destination); 32 | } 33 | -------------------------------------------------------------------------------- /manager/deployer/src/main/assembly/mvn.xml: -------------------------------------------------------------------------------- 1 | 5 | mvn 6 | 7 | tar.gz 8 | 9 | false 10 | 11 | 12 | ./src/main/bin 13 | bin 14 | 15 | **/* 16 | 17 | 0755 18 | 19 | 20 | 21 | 22 | ./src/main/resources/logback.xml 23 | conf 24 | 25 | 26 | ./src/main/resources/otter.properties 27 | conf 28 | 29 | 30 | ../../lib/ojdbc6.jar 31 | lib 32 | 33 | 34 | 35 | 36 | lib 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /node/etl/src/main/resources/spring/otter-node-transform.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /shared/push/src/main/resources/spring/otter-push-common.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /manager/web/src/main/java/com/alibaba/otter/manager/web/common/model/SeniorNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.web.common.model; 18 | 19 | import com.alibaba.otter.shared.common.model.config.node.Node; 20 | 21 | /** 22 | * @author simon 2011-12-8 下午09:26:01 23 | */ 24 | public class SeniorNode extends Node { 25 | 26 | private static final long serialVersionUID = -4121314684324595191L; 27 | private boolean used; 28 | 29 | public boolean isUsed() { 30 | return used; 31 | } 32 | 33 | public void setUsed(boolean used) { 34 | this.used = used; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/rpc/TerminRpcArbitrateEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl.rpc; 18 | 19 | import com.alibaba.otter.shared.arbitrate.impl.setl.TerminArbitrateEvent; 20 | import com.alibaba.otter.shared.arbitrate.impl.setl.zookeeper.TerminZooKeeperArbitrateEvent; 21 | 22 | /** 23 | * 基于rpc的仲裁调度的termin信号处理,直接使用zookeeper的现有处理机制 24 | * 25 | * @author jianghang 2012-9-29 上午11:06:11 26 | * @version 4.1.0 27 | */ 28 | public class TerminRpcArbitrateEvent extends TerminZooKeeperArbitrateEvent implements TerminArbitrateEvent { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/common/alarm/AlarmService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.common.alarm; 18 | 19 | 20 | /** 21 | * 报警服务service定义,暂时先简单实现:利用dragoon的报警推送机制进行短信,邮件,旺旺信息等报警 22 | * 23 | * @author jianghang 2011-9-26 下午10:27:44 24 | * @version 4.0.0 25 | */ 26 | public interface AlarmService { 27 | 28 | /** 29 | * 发送基于kv的报警信息 30 | * 31 | *
32 |      * Map内容;
33 |      * 1. message : 报警内容
34 |      * 2. receiveKey : 报警接收者信息
35 |      * 
36 | * 37 | * @param data 38 | */ 39 | public void sendAlarm(AlarmMessage data); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /shared/common/src/test/java/com/alibaba/otter/shared/common/sample/TestMockService2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.sample; 18 | 19 | import org.springframework.beans.factory.InitializingBean; 20 | 21 | /** 22 | * 测试的Mock servie2 23 | * 24 | * @author jianghang 2010-6-2 下午12:20:49 25 | */ 26 | public class TestMockService2 implements InitializingBean { 27 | 28 | public String doTestMockService2() { 29 | return "server 2 done!"; 30 | } 31 | 32 | @Override 33 | public void afterPropertiesSet() throws Exception { 34 | System.out.println("TestMockService2 init!"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/ExtractArbitrateEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl; 18 | 19 | import com.alibaba.otter.shared.arbitrate.impl.ArbitrateEvent; 20 | import com.alibaba.otter.shared.arbitrate.model.EtlEventData; 21 | 22 | /** 23 | * 抽象extract模块的调度接口 24 | * 25 | * @author jianghang 2012-9-27 下午09:54:53 26 | * @version 4.1.0 27 | */ 28 | public interface ExtractArbitrateEvent extends ArbitrateEvent { 29 | 30 | public EtlEventData await(Long pipelineId) throws InterruptedException; 31 | 32 | public void single(EtlEventData data); 33 | } 34 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/SelectArbitrateEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl; 18 | 19 | import com.alibaba.otter.shared.arbitrate.impl.ArbitrateEvent; 20 | import com.alibaba.otter.shared.arbitrate.model.EtlEventData; 21 | 22 | /** 23 | * 抽象select模块的调度接口 24 | * 25 | * @author jianghang 2012-9-27 下午09:54:53 26 | * @version 4.1.0 27 | */ 28 | public interface SelectArbitrateEvent extends ArbitrateEvent { 29 | 30 | public EtlEventData await(Long pipelineId) throws InterruptedException; 31 | 32 | public void single(EtlEventData data); 33 | } 34 | -------------------------------------------------------------------------------- /shared/communication/src/main/java/com/alibaba/otter/shared/communication/core/impl/connection/CommunicationConnectionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.communication.core.impl.connection; 18 | 19 | import com.alibaba.otter.shared.communication.core.model.CommunicationParam; 20 | 21 | /** 22 | * {@linkplain CommunicationConnection}链接创建和关闭工厂 23 | * 24 | * @author jianghang 2011-9-9 下午05:24:09 25 | */ 26 | public interface CommunicationConnectionFactory { 27 | 28 | CommunicationConnection createConnection(CommunicationParam params); 29 | 30 | void releaseConnection(CommunicationConnection connection); 31 | } 32 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/common/alarm/AlarmMessage.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.otter.manager.biz.common.alarm; 2 | 3 | import java.io.Serializable; 4 | 5 | import org.apache.commons.lang.builder.ToStringBuilder; 6 | 7 | import com.alibaba.otter.shared.common.utils.OtterToStringStyle; 8 | 9 | public class AlarmMessage implements Serializable { 10 | 11 | private static final long serialVersionUID = 6110474591366995515L; 12 | private String message; 13 | private String receiveKey; 14 | 15 | public AlarmMessage(){ 16 | 17 | } 18 | 19 | public AlarmMessage(String message, String receiveKey){ 20 | this.message = message; 21 | this.receiveKey = receiveKey; 22 | } 23 | 24 | public String getMessage() { 25 | return message; 26 | } 27 | 28 | public void setMessage(String message) { 29 | this.message = message; 30 | } 31 | 32 | public String getReceiveKey() { 33 | return receiveKey; 34 | } 35 | 36 | public void setReceiveKey(String receiveKey) { 37 | this.receiveKey = receiveKey; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return ToStringBuilder.reflectionToString(this, OtterToStringStyle.DEFAULT_STYLE); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/datamedia/dal/DataMediaDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.datamedia.dal; 18 | 19 | import java.util.List; 20 | 21 | import com.alibaba.otter.manager.biz.common.basedao.GenericDAO; 22 | import com.alibaba.otter.manager.biz.config.datamedia.dal.dataobject.DataMediaDO; 23 | 24 | /** 25 | * @author simon 26 | */ 27 | public interface DataMediaDAO extends GenericDAO { 28 | 29 | public List listByDataMediaSourceId(Long dataMediaSourceId); 30 | 31 | public DataMediaDO checkUniqueAndReturnExist(DataMediaDO dataMedia); 32 | } 33 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/conflict/FileBatchConflictDetectService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.conflict; 18 | 19 | import com.alibaba.otter.shared.etl.model.FileBatch; 20 | 21 | /** 22 | * 文件冲突检测service 23 | * 24 | * @author jianghang 2011-11-10 上午09:34:44 25 | * @version 4.0.0 26 | */ 27 | public interface FileBatchConflictDetectService { 28 | 29 | /** 30 | * 和本地的file进行冲突检测,过滤冲突记录,返回无冲突的记录 31 | * 32 | *
33 |      * 注意:在extract之前调用该方法
34 |      * 
35 | */ 36 | public FileBatch detect(FileBatch fileBatch, Long targetNodeId); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/TransformArbitrateEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl; 18 | 19 | import com.alibaba.otter.shared.arbitrate.impl.ArbitrateEvent; 20 | import com.alibaba.otter.shared.arbitrate.model.EtlEventData; 21 | 22 | /** 23 | * 抽象transform模块的调度接口 24 | * 25 | * @author jianghang 2012-9-27 下午09:54:53 26 | * @version 4.1.0 27 | */ 28 | public interface TransformArbitrateEvent extends ArbitrateEvent { 29 | 30 | public EtlEventData await(Long pipelineId) throws InterruptedException; 31 | 32 | public void single(EtlEventData data); 33 | } 34 | -------------------------------------------------------------------------------- /manager/web/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.alibaba.otter 5 | manager 6 | 4.2.19-SNAPSHOT 7 | ../pom.xml 8 | 9 | com.alibaba.otter 10 | manager.web 11 | jar 12 | manager web module for otter 13 | http://github.com/alibaba/otter 14 | 15 | 16 | 17 | com.alibaba.otter 18 | manager.biz 19 | ${project.version} 20 | 21 | 22 | javax.servlet 23 | javax.servlet-api 24 | provided 25 | 26 | 27 | com.alibaba.citrus 28 | citrus-webx-all 29 | 30 | 31 | org.directwebremoting 32 | dwr 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /shared/common/src/test/java/com/alibaba/otter/shared/common/sample/TestMockService3.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.sample; 18 | 19 | import org.springframework.beans.factory.InitializingBean; 20 | 21 | /** 22 | * 测试的Mock servie2,测试lazy-init=true是否正常 23 | * 24 | * @author jianghang 2010-6-2 下午12:20:49 25 | */ 26 | public class TestMockService3 implements InitializingBean { 27 | 28 | public String doTestMockService3() { 29 | return "server 3 done!"; 30 | } 31 | 32 | @Override 33 | public void afterPropertiesSet() throws Exception { 34 | System.out.println("TestMockService3 init!"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/datamediapair/dal/DataMediaPairDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.datamediapair.dal; 18 | 19 | import java.util.List; 20 | 21 | import com.alibaba.otter.manager.biz.common.basedao.GenericDAO; 22 | import com.alibaba.otter.manager.biz.config.datamediapair.dal.dataobject.DataMediaPairDO; 23 | 24 | /** 25 | * @author simon 26 | */ 27 | public interface DataMediaPairDAO extends GenericDAO { 28 | 29 | public List listByPipelineId(Long pipelineId); 30 | 31 | public List listByDataMediaId(Long dataMediaId); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/model/config/alarm/AlarmRuleStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.model.config.alarm; 18 | 19 | /** 20 | * @author simon 2012-8-29 下午7:34:31 21 | * @version 4.1.0 22 | */ 23 | 24 | public enum AlarmRuleStatus { 25 | ENABLE, PAUSED, DISABLE; 26 | 27 | public boolean isEnable() { 28 | return this.equals(AlarmRuleStatus.ENABLE); 29 | } 30 | 31 | public boolean isPaused() { 32 | return this.equals(AlarmRuleStatus.PAUSED); 33 | } 34 | 35 | public boolean isDisable() { 36 | return this.equals(AlarmRuleStatus.DISABLE); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/utils/extension/ExtensionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.utils.extension; 18 | 19 | import com.alibaba.otter.shared.common.model.config.data.ExtensionData; 20 | 21 | /** 22 | * 扩展类获取接口 23 | * 24 | * @author jianghang 2012-10-23 下午04:29:18 25 | * @version 4.1.0 26 | */ 27 | public interface ExtensionFactory { 28 | 29 | /** 30 | * Get extension. 31 | * 32 | * @param type object type. 33 | * @param name object name. 34 | * @return object instance. 35 | */ 36 | T getExtension(Class type, ExtensionData extensionData); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/common/exceptions/RepeatConfigureException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.common.exceptions; 18 | 19 | /** 20 | * @author simon 2011-11-14 下午11:04:32 21 | */ 22 | public class RepeatConfigureException extends RuntimeException { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | public RepeatConfigureException(String cause){ 27 | super(cause); 28 | } 29 | 30 | public RepeatConfigureException(Throwable t){ 31 | super(t); 32 | } 33 | 34 | public RepeatConfigureException(String cause, Throwable t){ 35 | super(cause, t); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/utils/compile/exception/CompileExprException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.utils.compile.exception; 18 | 19 | /** 20 | * 类CompileExprException.java的实现描述:TODO 类实现描述 21 | * 22 | * @author simon 2012-10-18 上午10:36:05 23 | * @version 4.1.0 24 | */ 25 | public class CompileExprException extends RuntimeException { 26 | 27 | private static final long serialVersionUID = 1L; 28 | 29 | public CompileExprException(String message){ 30 | super(message); 31 | } 32 | 33 | public CompileExprException(String message, Throwable cause){ 34 | super(message, cause); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /shared/common/src/test/java/com/alibaba/otter/shared/common/AddressUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common; 18 | 19 | import java.net.InetAddress; 20 | 21 | import org.testng.annotations.Test; 22 | 23 | import com.alibaba.otter.shared.common.utils.AddressUtils; 24 | 25 | public class AddressUtilsTest extends BaseOtterTest { 26 | 27 | @Test 28 | public void testHostIp() { 29 | InetAddress address = AddressUtils.getHostAddress(); 30 | want.bool(address.isLoopbackAddress()).is(false); 31 | } 32 | 33 | @Test 34 | public void testPort() { 35 | want.bool(AddressUtils.isAvailablePort(23)).is(false); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM canal/otter-osbase:v1 2 | 3 | MAINTAINER agapple (jianghang115@gmail.com) 4 | 5 | # install otter 6 | COPY image/ /tmp/docker/ 7 | COPY manager.deployer-*.tar.gz /home/admin/ 8 | COPY node.deployer-*.tar.gz /home/admin/ 9 | 10 | RUN \ 11 | cp -R /tmp/docker/alidata /alidata && \ 12 | chmod +x /alidata/bin/* && \ 13 | mkdir -p /home/admin && \ 14 | cp -R /tmp/docker/admin/* /home/admin/ && \ 15 | /bin/cp -f alidata/bin/lark-wait /usr/bin/lark-wait && \ 16 | mkdir -p /home/admin/manager && \ 17 | tar -xzvf /home/admin/manager.deployer-*.tar.gz -C /home/admin/manager && \ 18 | /bin/rm -f /home/admin/manager.deployer-*.tar.gz && \ 19 | mkdir -p /home/admin/node && \ 20 | tar -xzvf /home/admin/node.deployer-*.tar.gz -C /home/admin/node && \ 21 | /bin/rm -f /home/admin/node.deployer-*.tar.gz && \ 22 | mkdir -p home/admin/manager/logs && \ 23 | mkdir -p home/admin/node/logs && \ 24 | mkdir -p home/admin/zkData && \ 25 | chmod +x /home/admin/*.sh && \ 26 | chmod +x /home/admin/bin/*.sh && \ 27 | chown admin: -R /home/admin && \ 28 | yum clean all && \ 29 | true 30 | 31 | ENV DOCKER_DEPLOY_TYPE=VM PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/scripts 32 | 33 | WORKDIR /home/admin 34 | 35 | ENTRYPOINT [ "/alidata/bin/main.sh" ] 36 | CMD [ "/home/admin/app.sh" ] 37 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/LoadArbitrateEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.impl.setl; 18 | 19 | import com.alibaba.otter.shared.arbitrate.impl.ArbitrateEvent; 20 | import com.alibaba.otter.shared.arbitrate.model.EtlEventData; 21 | 22 | /** 23 | * 抽象load模块的调度接口 24 | * 25 | * @author jianghang 2012-9-27 下午09:54:53 26 | * @version 4.1.0 27 | */ 28 | public interface LoadArbitrateEvent extends ArbitrateEvent { 29 | 30 | public EtlEventData await(Long pipelineId) throws InterruptedException; 31 | 32 | public void single(EtlEventData data); 33 | 34 | // public void release(Long pipelineId); 35 | } 36 | -------------------------------------------------------------------------------- /shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/model/PipelineEventData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.arbitrate.model; 18 | 19 | /** 20 | * 对应pipeline的event data 21 | * 22 | * @author jianghang 2011-8-17 上午10:31:46 23 | */ 24 | public class PipelineEventData extends EventData { 25 | 26 | private static final long serialVersionUID = 4223623194547317751L; 27 | private Long pipelineId; // 通道id 28 | 29 | public Long getPipelineId() { 30 | return pipelineId; 31 | } 32 | 33 | public void setPipelineId(Long pipelineId) { 34 | this.pipelineId = pipelineId; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/common/exceptions/ManagerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.common.exceptions; 18 | 19 | /** 20 | * ManagerException for Manager Model 21 | * 22 | * @author simon 2011-11-13 下午07:38:47 23 | */ 24 | public class ManagerException extends RuntimeException { 25 | 26 | private static final long serialVersionUID = 1L; 27 | 28 | public ManagerException(String cause){ 29 | super(cause); 30 | } 31 | 32 | public ManagerException(Throwable t){ 33 | super(t); 34 | } 35 | 36 | public ManagerException(String cause, Throwable t){ 37 | super(cause, t); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /manager/web/src/main/java/com/alibaba/otter/manager/web/common/model/SeniorChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.web.common.model; 18 | 19 | import com.alibaba.otter.shared.common.model.config.channel.Channel; 20 | 21 | /** 22 | * @author simon 2012-1-13 下午03:34:32 23 | */ 24 | public class SeniorChannel extends Channel { 25 | 26 | private static final long serialVersionUID = -5864547001482768341L; 27 | private boolean processEmpty; 28 | 29 | public boolean isProcessEmpty() { 30 | return processEmpty; 31 | } 32 | 33 | public void setProcessEmpty(boolean processEmpty) { 34 | this.processEmpty = processEmpty; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /node/common/src/main/java/com/alibaba/otter/node/common/config/NodeTaskService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.common.config; 18 | 19 | import java.util.List; 20 | 21 | import com.alibaba.otter.node.common.config.model.NodeTask; 22 | 23 | /** 24 | * Node节点任务分发的服务类 25 | * 26 | * @author jianghang 27 | */ 28 | public interface NodeTaskService { 29 | 30 | /** 31 | * 根据对应的获取任务列表,注意是所有的任务 32 | */ 33 | public List listAllNodeTasks(); 34 | 35 | /** 36 | * 注册监听器 37 | */ 38 | public void addListener(NodeTaskListener listener); 39 | 40 | /** 41 | * 关闭node 42 | */ 43 | public void stopNode(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /shared/etl/src/main/java/com/alibaba/otter/shared/etl/model/EventColumnIndexComparable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.etl.model; 18 | 19 | import java.util.Comparator; 20 | 21 | /** 22 | * 按照EventColumn的index进行排序. 23 | * 24 | * @author xiaoqing.zhouxq 2012-3-8 上午11:38:25 25 | */ 26 | public class EventColumnIndexComparable implements Comparator { 27 | 28 | public int compare(EventColumn o1, EventColumn o2) { 29 | if (o1.getIndex() < o2.getIndex()) { 30 | return -1; 31 | } else if (o1.getIndex() == o2.getIndex()) { 32 | return 0; 33 | } else { 34 | return 1; 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/config/record/dal/LogRecordDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.config.record.dal; 18 | 19 | import java.util.List; 20 | 21 | import com.alibaba.otter.manager.biz.common.basedao.GenericDAO; 22 | import com.alibaba.otter.manager.biz.config.record.dal.dataobject.LogRecordDO; 23 | 24 | /** 25 | * 类LogRecordDao.java的实现描述:TODO 类实现描述 26 | * 27 | * @author simon 2012-6-15 下午1:50:01 28 | */ 29 | public interface LogRecordDAO extends GenericDAO { 30 | 31 | public List listByPipelineId(Long pipelineId); 32 | 33 | public List listByPipelineIdWithoutContent(Long pipelineId); 34 | } 35 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/common/io/download/DownloadStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.common.io.download; 18 | 19 | /** 20 | * Enum description 21 | */ 22 | public enum DownloadStatus { 23 | 24 | RUNNING("Downloading"), EXCEPTION("Error"), COMPLETE("Done"), ABORT("Abort"), CONNECTING("Connecting"), 25 | IDLE("Idle"), PAUSED("Paused"), RETRYING("Retrying"), REDIRECTING("Redirecting"), CONNECTED("Connected"), 26 | PAUSING("Pausing"); 27 | 28 | private String title; 29 | 30 | DownloadStatus(String title){ 31 | this.title = title; 32 | } 33 | 34 | public String title() { 35 | return title; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/common/pipe/Pipe.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.common.pipe; 18 | 19 | import com.alibaba.otter.node.etl.common.pipe.exception.PipeException; 20 | 21 | /** 22 | * S.E.T.L模块之间的数据交互工具 23 | * 24 | * @author jianghang 2011-10-10 下午04:48:44 25 | * @version 4.0.0 26 | */ 27 | public interface Pipe { 28 | 29 | /** 30 | * 向管道中添加数据 31 | * 32 | * @param data 33 | */ 34 | public KEY put(T data) throws PipeException; 35 | 36 | /** 37 | * 通过key获取管道中的数据 38 | * 39 | * @param key 40 | * @return 41 | */ 42 | public T get(KEY key) throws PipeException; 43 | } 44 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/select/selector/OtterSelectorFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.select.selector; 18 | 19 | import com.alibaba.otter.node.etl.OtterContextLocator; 20 | import com.alibaba.otter.node.etl.select.selector.canal.CanalEmbedSelector; 21 | 22 | /** 23 | * 获取对应的selector 24 | * 25 | * @author jianghang 2012-8-1 上午10:25:06 26 | * @version 4.1.0 27 | */ 28 | public class OtterSelectorFactory { 29 | 30 | public OtterSelector getSelector(Long pipelineId) { 31 | CanalEmbedSelector selector = new CanalEmbedSelector(pipelineId); 32 | OtterContextLocator.autowire(selector); 33 | return selector; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /manager/biz/src/main/java/com/alibaba/otter/manager/biz/statistics/delay/param/DelayCountParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.manager.biz.statistics.delay.param; 18 | 19 | /** 20 | * @author danping.yudp 21 | */ 22 | public class DelayCountParam { 23 | 24 | private Long pipelineId; 25 | private Long number; 26 | 27 | public Long getPipelineId() { 28 | return pipelineId; 29 | } 30 | 31 | public void setPipelineId(Long pipelineId) { 32 | this.pipelineId = pipelineId; 33 | } 34 | 35 | public Long getNumber() { 36 | return number; 37 | } 38 | 39 | public void setNumber(Long number) { 40 | this.number = number; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/common/io/signature/ChecksumUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.common.io.signature; 18 | 19 | /** 20 | * 提供基于checksum的签名方式 21 | * 22 | * @author jianghang 2011-10-9 下午05:43:04 23 | * @version 4.0.0 24 | */ 25 | public class ChecksumUtils { 26 | 27 | public static String checksum(byte[] bytes) { 28 | int sum = Crc32C.maskedCrc32c(bytes, 0, bytes.length); 29 | return Integer.toString(sum); 30 | } 31 | 32 | public static String checksum(byte[] bytes, int offset, int length) { 33 | int sum = Crc32C.maskedCrc32c(bytes, offset, length); 34 | return Integer.toString(sum); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /node/etl/src/main/java/com/alibaba/otter/node/etl/select/exceptions/SelectException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.node.etl.select.exceptions; 18 | 19 | /** 20 | * SelectException for select module. 21 | * 22 | * @author xiaoqing.zhouxq 23 | */ 24 | public class SelectException extends RuntimeException { 25 | 26 | /** 27 | * 28 | */ 29 | private static final long serialVersionUID = 1L; 30 | 31 | public SelectException(String cause){ 32 | super(cause); 33 | } 34 | 35 | public SelectException(Throwable t){ 36 | super(t); 37 | } 38 | 39 | public SelectException(String cause, Throwable t){ 40 | super(cause, t); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /shared/common/src/main/java/com/alibaba/otter/shared/common/utils/cmd/StreamCollector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2101 Alibaba Group Holding Limited. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.alibaba.otter.shared.common.utils.cmd; 18 | 19 | import java.io.ByteArrayOutputStream; 20 | import java.io.InputStream; 21 | 22 | /** 23 | * An object that reads a stream asynchronously and collects it into a data buffer. 24 | */ 25 | public class StreamCollector extends StreamCopier { 26 | 27 | public StreamCollector(InputStream stream){ 28 | // 使用alibaba common io,避免byte多次拷贝 29 | super(stream, new ByteArrayOutputStream()); 30 | } 31 | 32 | public String toString() { 33 | return new String(((ByteArrayOutputStream) this.out).toByteArray()); 34 | } 35 | } 36 | --------------------------------------------------------------------------------