Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

RebieKong RebieKong

🎯
Focusing
View GitHub Profile
@RebieKong
RebieKong / YarnLauncher.java
Created Jul 22, 2019
Java代码中提交spark cluster任务
View YarnLauncher.java
package io.github.spafka.yarn;
import org.apache.spark.launcher.SparkAppHandle;
import org.apache.spark.launcher.SparkLauncher;
import java.util.HashMap;
/**
*
@RebieKong
RebieKong / maven-build-scala.xml
Last active Jan 10, 2019
在maven中构建scala
View maven-build-scala.xml
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.4.4</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
View read-carbon-with-thrift
import org.apache.carbondata.format.BlockIndex;
import org.apache.carbondata.format.FileFooter3;
import org.apache.carbondata.format.IndexHeader;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.transport.TIOStreamTransport;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
@RebieKong
RebieKong / shadowsocks.conf
Created Apr 18, 2018
supervisor-conf-file
View shadowsocks.conf
[program:shadowsocks]
directory = /
command = sslocal -s 1.1.1.1 -p 65536 -k password -m rc4-md5 -l 65536
autostart = true
startsecs = 15
autorestart = true
startretries = 3
user = nobody
redirect_stderr = true
stdout_logfile_maxbytes = 20MB
@RebieKong
RebieKong / Test.java
Created Mar 29, 2018
IPIP.net的DATX遍历进行中
View Test.java
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
public class Test {
private final static Integer INDEX_START = 262148;
@RebieKong
RebieKong / maven-lib.xml
Last active Mar 21, 2018
maven打包时依赖包的处理方法
View maven-lib.xml
<!-- 打包时将依赖放到target/lib目录下 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
@RebieKong
RebieKong / anwser.scala
Created Mar 21, 2018
相同QQ群问题
View anwser.scala
val input: Seq[(String, Seq[String])] = List[(String, List[String])](
("A", List[String]("1", "2", "3")),
("B", List[String]("2", "3")),
("C", List[String]("3", "4"))
)
val output = input
// 转化成 uid => gid
.flatten(i => i._2.map(uid => (uid, i._1)))
// 转化成 uid => set(gid)
.groupBy(i => i._1)
@RebieKong
RebieKong / maven.build.xml
Created Nov 7, 2017
常用的一个maven-build的节点
View maven.build.xml
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>*.xml</include>
<include>*.properties</include>
</includes>
<filtering>false</filtering>
</resource>
@RebieKong
RebieKong / maven-java-version.xml
Created Nov 7, 2017
声明java编译的版本
View maven-java-version.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
@RebieKong
RebieKong / deploy-to-oss.xml
Created Nov 1, 2017
在maven中添加自己的maven库和部署到ossfs指定的目录
View deploy-to-oss.xml
<distributionManagement>
<repository>
<id>mvn-repo</id>
<url>file:/mnt/data/oss-mvn/data</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>rebie-maven</id>
<url>https://mvn.rebiekong.com/</url>
You can’t perform that action at this time.