Skip to content

Commit

Permalink
some file lack of apace license. (apache#52)
Browse files Browse the repository at this point in the history
* add license.

* add license

Co-authored-by: nize <unclerangoo@gmail.com>
  • Loading branch information
ni-ze and ni-ze authored Sep 6, 2021
1 parent 9df9a60 commit 2c4285f
Show file tree
Hide file tree
Showing 50 changed files with 100,070 additions and 99,249 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.rocketmq.streams.debug;

import com.alibaba.fastjson.JSONObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.rocketmq.streams.client;

import org.apache.rocketmq.streams.common.utils.FileUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.rocketmq.streams.client.windows;

import com.alibaba.fastjson.JSONObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@
package org.apache.rocketmq.streams.client.windows;

import com.alibaba.fastjson.JSONObject;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.Reader;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

import org.apache.rocketmq.streams.client.StreamBuilder;
import org.apache.rocketmq.streams.client.transform.DataStream;
import org.apache.rocketmq.streams.common.functions.MapFunction;
Expand All @@ -41,9 +49,9 @@
import org.junit.Test;

public class MultiSplitTest extends SingleSplitTest {
protected String topic="TOPIC_DIPPER_SYSTEM_MSG_6";
protected String topic = "TOPIC_DIPPER_SYSTEM_MSG_6";

protected DataStream createSourceDataStream(){
protected DataStream createSourceDataStream() {
// String dir="/tmp/rockstmq-streams-1";
// FileUtil.deleteFile(dir);
// ComponentCreator.getProperties().setProperty("window.debug","true");
Expand All @@ -52,52 +60,50 @@ protected DataStream createSourceDataStream(){
//
//
return StreamBuilder.dataStream("namespace", "name1")
.fromRocketmq(topic,"window_test",true,null);
.fromRocketmq(topic, "window_test", true, null);
}


protected int getSourceCount(){
protected int getSourceCount() {
return 88121;
}

/**
* validate the window result meet expectations
* validate the window result meet expectations
*/
@Test
public void testWindowResult(){
public void testWindowResult() {
super.testWindowResult(getSourceCount());
}

/**
*
* @throws InterruptedException
*/
@Test
public void testFireMode0() throws InterruptedException {

super.executeWindowStream(false,5, IWindow.DEFAULTFIRE_MODE,0,20l);
super.executeWindowStream(false, 5, IWindow.DEFAULTFIRE_MODE, 0, 20l);
}



@Test
public void testFireMode1() throws InterruptedException {
super.executeWindowStream(false,5,IWindow.MULTI_WINDOW_INSTANCE_MODE,0,20l);
super.executeWindowStream(false, 5, IWindow.MULTI_WINDOW_INSTANCE_MODE, 0, 20l);
}



@Test
public void testMutilWindow() {
super.testMutilWindow(false);
}

@Test
public void testRoketmqConsumner(){
AtomicInteger count=new AtomicInteger(0);
public void testRoketmqConsumner() {
AtomicInteger count = new AtomicInteger(0);
createSourceDataStream().map(new MapFunction<JSONObject, JSONObject>() {

@Override public JSONObject map(JSONObject message) throws Exception {
@Override
public JSONObject map(JSONObject message) throws Exception {
System.out.println(count.incrementAndGet());
return message;
}
Expand All @@ -106,9 +112,9 @@ public void testRoketmqConsumner(){


@Test
public void testInsertWindowMsg(){
public void testInsertWindowMsg() {
StreamBuilder.dataStream("namespace", "name1")
.fromFile(filePath,true).toRocketmq(topic).start();
.fromFile(filePath, true).toRocketmq(topic).start();
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.rocketmq.streams.client.windows;

import com.alibaba.fastjson.JSONObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.rocketmq.streams.client.windows;

import com.alibaba.fastjson.JSONObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.rocketmq.streams.client.windows;

import com.alibaba.fastjson.JSONObject;
Expand Down
37 changes: 27 additions & 10 deletions rocketmq-streams-clients/src/test/resources/window_msg_10
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
{"InFlow":"474592","ProjectName":"lggUIv7Svbuz1BAhVVGVjw==","LogStore":"lnrhzoywRu7nYhJFp5ojUg==","OutFlow":"0","logTime":"1622109259"}
{"InFlow":"0","ProjectName":"IYril9E4mXoaPNJNcq8X8w==","LogStore":"3bshL6vr+kIReUr96vvMeg==","OutFlow":"370464","logTime":"1622109254"}
{"InFlow":"655","ProjectName":"7+rVECigPbLWPw55ugMqgg==","LogStore":"YmCOCK3Cmo1tvJdU5lnxJQ==","OutFlow":"0","logTime":"1622109258"}
{"InFlow":"6316","ProjectName":"Y97nLAbtt8LwnwoaFygi8g==","LogStore":"8Bk5nD94tNhXHUBVYBlerg==","OutFlow":"0","logTime":"1622109246"}
{"InFlow":"1205","ProjectName":"BUM1XCe6vGJASAlUCfn9GQ==","LogStore":"tHX+P8ChCPDTQLuyu2YuIQ==","OutFlow":"0","logTime":"1622109244"}
{"InFlow":"5862","ProjectName":"g6vsBn7c5rlNHpaM3QzLTQ==","LogStore":"XHY3pl29mI9DO+5vQ3OV7g==","OutFlow":"0","logTime":"1622109243"}
{"InFlow":"0","ProjectName":"fXYbtl3LwvrJYAu26wLzAw==","LogStore":"jQ7aL7ufwFC/WgtuJ8c8fQ==","OutFlow":"135876","logTime":"1622110464"}
{"InFlow":"597","ProjectName":"1B2M2Y8AsgTpgAmY7PhCfg==","LogStore":"1B2M2Y8AsgTpgAmY7PhCfg==","OutFlow":"500","logTime":"1622110467"}
{"InFlow":"291061","ProjectName":"Ka9mZnndeAv+Rt+NnKrwrQ==","LogStore":"Pdop39G2TjhEaehou/FPrQ==","OutFlow":"0","logTime":"1622110462"}
{"InFlow":"474592","ProjectName":"lggUIv7Svbuz1BAhVVGVjw==","LogStore":"lnrhzoywRu7nYhJFp5ojUg==","OutFlow":"0","logTime":"1622109259"}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

{"InFlow":"474592","ProjectName":"project-1","LogStore":"logStore-1","OutFlow":"0","logTime":"1622109259"}
{"InFlow":"0","ProjectName":"project-2","LogStore":"logStore-2","OutFlow":"370464","logTime":"1622109254"}
{"InFlow":"655","ProjectName":"project-3","LogStore":"logStore-3","OutFlow":"0","logTime":"1622109258"}
{"InFlow":"6316","ProjectName":"project-4","LogStore":"logStore-4","OutFlow":"0","logTime":"1622109246"}
{"InFlow":"1205","ProjectName":"project-5","LogStore":"logStore-5","OutFlow":"0","logTime":"1622109244"}
{"InFlow":"5862","ProjectName":"project-6","LogStore":"logStore-6","OutFlow":"0","logTime":"1622109243"}
{"InFlow":"0","ProjectName":"project-7","LogStore":"logStore-7","OutFlow":"135876","logTime":"1622110464"}
{"InFlow":"597","ProjectName":"project-8","LogStore":"logStore-8","OutFlow":"500","logTime":"1622110467"}
{"InFlow":"291061","ProjectName":"project-9","LogStore":"logStore-9","OutFlow":"0","logTime":"1622110462"}
{"InFlow":"474592","ProjectName":"project-10","LogStore":"logStore-10","OutFlow":"0","logTime":"1622109259"}
Loading

0 comments on commit 2c4285f

Please sign in to comment.