Skip to content

Instantly share code, notes, and snippets.

View wuchong's full-sized avatar

Jark Wu wuchong

View GitHub Profile
@wuchong
wuchong / mailFilters.xml
Created May 26, 2020 07:15
Flink 邮件列表收信规则
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<id>tag:mail.google.com,2008:filters:1264494957336728212,1496316621350,1496316638477,1497448917096,156717883876082941,2069423740385579791,5661264952719253618,7921652002135955202,z0000001553135680054*2864075337097443180,z0000001564067377219*3564387070667043888,z0000001573386106330*3349521050078506415</id>
<updated>2020-05-26T07:12:37Z</updated>
<author>
<name>Jark Wu</name>
<email>imjark@gmail.com</email>
</author>
<entry>
@wuchong
wuchong / docker-compose.yml
Last active October 13, 2020 08:41
Flink SQL 1.10 Demo
version: '2.1'
services:
datagen:
image: jark/datagen:0.1
command: "java -classpath /opt/datagen/flink-sql-demo.jar myflink.SourceGenerator --input /opt/datagen/user_behavior.log --output kafka kafka:9094 --speedup 1000"
depends_on:
- kafka
environment:
ZOOKEEPER_CONNECT: zookeeper
KAFKA_BOOTSTRAP: kafka
@wuchong
wuchong / ChangeMode1.java
Last active February 19, 2020 12:15
New Source Sink Interface
public enum ChangelogMode {
/**
* Only contains {@link ChangeType#INSERT} messages.
*/
INSERT_ONLY(true, false, false, false),
/**
* Contains {@link ChangeType#INSERT}, {@link ChangeType#DELETE} and {@link ChangeType#UPDATE_AFTER} messages,
* but without {@link ChangeType#UPDATE_BEFORE}.
public interface TableReader {
/**
* Whether the data is bounded or not.
*/
boolean isBounded();
/**
* Returns what kind of changes are produced by this reader.
*
* @see ChangelogRow.Kind
@wuchong
wuchong / LookupFunctionProvider.java
Last active June 12, 2019 03:59
LookupFunctionProvider
import org.apache.flink.table.functions.AsyncTableFunction;
import org.apache.flink.table.functions.TableFunction;
/**
* A base factory interface to create a lookup function. A lookup function is used to query table
* via key column(s). See {@link LookupableTableSource} for more information.
*
* <p>Currently, a lookup factory can either be {@link TableFunctionProvider} or
* {@link AsyncTableFunction}.
export FLINK_PLANNER_DIR=/Users/wuchong/Workspace/Flink/flink/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table
export FLINK_JAVA_PLANNER_DIR=/Users/wuchong/Workspace/Flink/flink/flink-table/flink-table-planner/src/main/java/org/apache/flink/table
export FLINK_PLANNER_TEST_DIR=/Users/wuchong/Workspace/Flink/flink/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/
export BLINK_PLANNER_DIR=/Users/wuchong/Workspace/Flink/flink/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table
export BLINK_JAVA_PLANNER_DIR=/Users/wuchong/Workspace/Flink/flink/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table
export BLINK_PLANNER_TEST_DIR=/Users/wuchong/Workspace/Flink/flink/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/
rm -rf $BLINK_PLANNER_DIR/*;
rm -rf $BLINK_JAVA_PLANNER_DIR/*;
rm -rf $BLINK_PLANNER_TEST_DIR/*;
/*
* 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
/*
* 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
@wuchong
wuchong / HBaseNewAPI.scala
Created April 6, 2015 15:34
Spark 下 操作 HBase 1.0.0 新版API
import org.apache.hadoop.hbase.util.Bytes
import org.apache.hadoop.hbase.{HColumnDescriptor, HTableDescriptor, TableName, HBaseConfiguration}
import org.apache.hadoop.hbase.client._
import org.apache.spark.SparkContext
import scala.collection.JavaConversions._
/**
* HBase 1.0.0 新版API, CRUD 的基本操作代码示例
**/
object HBaseNewAPI {
@wuchong
wuchong / baozougif.py
Last active January 4, 2016 17:09
Python爬虫:暴走漫画上的GIF趣图
# -*- coding: utf-8 -*-
#---------------------------------------
# 程序:暴走漫画的GIF趣图爬虫
# 版本: 0.1
# 作者:WuChong
# 日期:2014-01-27
# 语言:Python 3.3
# 说明:能自定义下载页数,默认全部下载,未加多线程功能
#---------------------------------------