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 | *
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 |
--------------------------------------------------------------------------------