Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 06: Initial drop of pravega connector #7

Merged
Merged
16 changes: 16 additions & 0 deletions .github/workflows/pravega-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Java CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
*.iml
*.ipr
*.iws
.gradle
build/
/var
/*/var/
/presto-product-tests/**/var/
test-output/
test-reports/
out/
/atlassian-ide-plugin.xml
.idea
.DS_Store
.classpath
.settings
.project
temp-testng-customsuite.xml
test-output
.externalToolBuilders
*~
benchmark_outputs
*.pyc
*.class
.checkstyle
.editorconfig
node_modules

100 changes: 100 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
* This file was generated by the Gradle 'init' task.
*/

plugins {
id 'java'
id 'distribution'
id 'checkstyle'
}

repositories {
mavenLocal()
maven {
url = uri('https://oss.jfrog.org/jfrog-dependencies')
}

maven {
url = uri('https://jitpack.io')
}

maven {
url = uri('https://repo.maven.apache.org/maven2')
}
}

dependencies {
compile 'com.facebook.airlift:bootstrap:0.191'
compile 'com.facebook.airlift:json:0.191'
compile 'com.facebook.airlift:log:0.191'
compile 'com.facebook.airlift:configuration:0.191'
compile 'com.google.guava:guava:26.0-jre'
compile 'com.google.inject:guice:4.2.0'
compile 'javax.validation:validation-api:1.1.0.Final'
compile 'javax.inject:javax.inject:1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.10.0'
compile 'io.pravega:pravega-client:0.9.0-2705.09f82eb-SNAPSHOT'
compile 'io.pravega:pravega-common:0.9.0-2705.09f82eb-SNAPSHOT'
compile 'io.pravega:pravega-shared-protocol:0.9.0-2705.09f82eb-SNAPSHOT'
compile 'com.google.protobuf:protobuf-java:3.11.4'
compile 'com.github.everit-org.json-schema:org.everit.json.schema:1.12.1'
compile 'org.apache.avro:avro:1.8.1'
compile 'org.apache.commons:commons-lang3:3.7'
compile 'io.pravega:schemaregistry-contract:0.2.0-50.f1b6734-SNAPSHOT'
compile 'io.pravega:schemaregistry-common:0.2.0-50.f1b6734-SNAPSHOT'
compile 'io.pravega:schemaregistry-client:0.2.0-50.f1b6734-SNAPSHOT'
compile 'io.pravega:schemaregistry-serializers:0.2.0-50.f1b6734-SNAPSHOT'
compile 'io.pravega:schemaregistry-serializers-shared:0.2.0-50.f1b6734-SNAPSHOT'
compile 'io.pravega:schemaregistry-serializers-json:0.2.0-50.f1b6734-SNAPSHOT'

compile 'com.facebook.presto:presto-main:0.247'
compile 'com.facebook.presto:presto-record-decoder:0.247'
compile 'com.facebook.presto:presto-spi:0.247'
compile 'com.facebook.presto:presto-common:0.247'

runtimeOnly 'io.airlift:joda-to-java-time-bridge:3'
runtimeOnly 'com.facebook.airlift:log-manager:0.191'
runtimeOnly 'org.apache.zookeeper:zookeeper:3.5.7'
runtimeOnly 'com.101tec:zkclient:0.10'

testImplementation 'com.facebook.presto:presto-tests:0.247'
testImplementation 'org.testng:testng:7.3.0'
testImplementation 'com.facebook.airlift:testing:0.191'

compileOnly 'io.airlift:slice:0.38'
compileOnly 'io.airlift:units:1.3'
compileOnly 'com.fasterxml.jackson.core:jackson-annotations:2.10.0'
compileOnly 'org.openjdk.jol:jol-core:0.2'
}

group = 'com.facebook.presto'
version = '0.1.0'
description = 'Pravega SQL :: Pravega PrestoDB Connector'
sourceCompatibility = '1.8'

task getHomeDir {
doLast {
println gradle.gradleHomeDir
}
}

plugins.withType(DistributionPlugin) {
distTar {
compression = Compression.GZIP
extension = 'tar.gz'
}
}

distributions {
main {
contents {
distributionBaseName = 'pravega'
from jar
from(project.configurations.runtime)
}
}
}

test {
useTestNG()
}
26 changes: 26 additions & 0 deletions checkstyle.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved.
*
* Licensed 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
*
*/
plugins.withId('checkstyle') {
checkstyle {
toolVersion = checkstyleToolVersion

configFile = new File(rootDir, "checkstyle/checkstyle.xml")
configProperties = [importControlFile: "$rootDir/checkstyle/import-control.xml",
suppressionsFile: "$rootDir/checkstyle/suppressions.xml"]
}

plugins.withId('java') {
checkstyle {
// Exclude generated code from Checkstyle checks
checkstyleMain.exclude '**/rest/generated/**'
}
}
}
222 changes: 222 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
<module name="Checker">
<!--module name="RegexpHeader">
<property name="header" value="/\*\*\n * Copyright \(c\) Dell Inc\.\, or its subsidiaries\. All Rights Reserved\."/>
</module-->
<module name="FileTabCharacter" />
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf" />
</module>
<module name="RegexpMultiline">
<property name="format" value="\r" />
<property name="message" value="Line contains carriage return" />
</module>
<module name="RegexpMultiline">
<property name="format" value=" \n" />
<property name="message" value="Line has trailing whitespace" />
</module>
<module name="RegexpMultiline">
<property name="format" value="\n\n\n" />
<property name="message" value="Multiple consecutive blank lines" />
</module>
<module name="RegexpMultiline">
<property name="format" value="\n\n\Z" />
<property name="message" value="Blank line before end of file" />
</module>

<module name="RegexpMultiline">
<property name="format" value="\{\n\n" />
<property name="message" value="Blank line after opening brace" />
</module>
<module name="RegexpMultiline">
<property name="format" value="\n\n\s*\}" />
<property name="message" value="Blank line before closing brace" />
</module>
<module name="RegexpMultiline">
<property name="format" value="[^;]\s\)+\s*[\{;,]?\s*\n" />
<property name="message" value="Whitespace character before closing parenthesis" />
</module>
<module name="RegexpMultiline">
<property name="format" value="->\s*\{\s+\}" />
<property name="message" value="Whitespace inside empty lambda body" />
</module>
<module name="RegexpSingleline">
<property name="format" value="(class|interface) ([a-zA-Z0-9_])+(&lt;.*&gt;)? (extends|implements)" />
<property name="message" value="No new line before extends/implements" />
</module>

<module name="RegexpSingleline">
<property name="format" value="^import static .*\.(of|copyOf|valueOf);$" />
<property name="message" value="The following methods may not be statically imported: of, copyOf, valueOf" />
</module>
<module name="RegexpSingleline">
<property name="format" value="^import static .*\.(all|none);$" />
<property name="message" value="The following methods may not be statically imported: all, none" />
</module>
<module name="RegexpSingleline">
<property name="format" value="^import static (?!java\.lang\.String\.format;).*\.format;" />
<property name="message" value="Only 'format' from java.lang.String may be statically imported" />
</module>
<module name="RegexpSingleline">
<property name="format" value="^import static java\.util\.Optional\." />
<property name="message" value="Members of Optional may not be statically imported" />
</module>

<module name="RegexpSingleline">
<property name="format" value="^([^i]|i[^m]|im[^p]|imp[^o]|impo[^r]|impor[^t]|import[^ ]).*Objects\.requireNonNull" />
<property name="message" value="Objects.requireNonNull should only be used with static imports" />
</module>
<module name="RegexpSingleline">
<property name="format" value="^([^i]|i[^m]|im[^p]|imp[^o]|impo[^r]|impor[^t]|import[^ ]).*Math\.toIntExact" />
<property name="message" value="Math.toIntExact should only be used with static imports" />
</module>
<module name="RegexpMultiline">
<property name="format" value="^[ \t]*import org\.testng\.Assert;$" />
<property name="message" value="org.testng.Assert should only be used with static imports" />
</module>
<module name="RegexpMultiline">
<property name="format" value="^[ \t]*import com\.google\.common\.base\.MoreObjects;$" />
<property name="message" value="com.google.common.base.MoreObjects should only be used with static imports" />
</module>

<module name="RegexpMultiline">
<property name="format" value="^[ \t]*import org\.jetbrains\.annotations\.NotNull;$" />
<property name="message" value="Not null is the default for the codebase and should not be annotated" />
</module>
<module name="RegexpMultiline">
<property name="format" value="^[ \t]*import org\.jetbrains\.annotations\.Nullable;$" />
<property name="message" value="Use javax.annotation.Nullable instead of org.jetbrains.annotations.Nullable" />
</module>
<module name="RegexpMultiline">
<property name="format" value="^[ \t]*import static org\.testng\.AssertJUnit\." />
<property name="message" value="Use org.testng.Assert instead of org.testng.AssertJUnit" />
</module>

<module name="SuppressWarningsFilter" />

<module name="TreeWalker">
<module name="SuppressWarningsHolder" />

<module name="EmptyBlock">
<property name="option" value="text" />
<property name="tokens" value="
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_IF,
LITERAL_FOR, LITERAL_TRY, LITERAL_WHILE, INSTANCE_INIT, STATIC_INIT" />
</module>
<module name="EmptyStatement" />
<module name="EmptyForInitializerPad" />
<module name="EmptyForIteratorPad">
<property name="option" value="space" />
</module>
<module name="MethodParamPad">
<property name="allowLineBreaks" value="true" />
<property name="option" value="nospace" />
</module>
<module name="ParenPad" />
<module name="TypecastParenPad" />
<module name="NeedBraces" />
<module name="LeftCurly">
<property name="option" value="nl" />
<property name="tokens" value="CLASS_DEF, CTOR_DEF, INTERFACE_DEF, METHOD_DEF" />
</module>
<module name="LeftCurly">
<property name="option" value="eol" />
<property name="tokens" value="
LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR,
LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE" />
</module>
<module name="RightCurly">
<property name="option" value="alone" />
</module>
<module name="GenericWhitespace" />
<module name="WhitespaceAfter" />
<module name="NoWhitespaceAfter" />
<module name="NoWhitespaceBefore" />
<module name="SingleSpaceSeparator" />
<module name="Indentation">
<property name="throwsIndent" value="8" />
<property name="lineWrappingIndentation" value="8" />
</module>

<module name="UpperEll" />
<module name="DefaultComesLast" />
<module name="ArrayTypeStyle" />
<module name="MultipleVariableDeclarations" />
<module name="ModifierOrder" />
<module name="OneStatementPerLine" />
<module name="StringLiteralEquality" />
<module name="MutableException" />
<module name="EqualsHashCode" />
<module name="InnerAssignment" />
<module name="InterfaceIsType" />
<module name="HideUtilityClassConstructor" />
<module name="ExplicitInitialization" />
<module name="OneTopLevelClass" />

<module name="MemberName" />
<module name="LocalVariableName" />
<module name="LocalFinalVariableName" />
<module name="TypeName" />
<module name="PackageName" />
<module name="ParameterName" />
<module name="StaticVariableName" />
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z][0-9]?$" />
</module>
<module name="MethodTypeParameterName">
<property name="format" value="^[A-Z][0-9]?$" />
</module>

<module name="AnnotationUseStyle">
<property name="trailingArrayComma" value="ignore" />
</module>

<module name="AvoidStarImport" />
<module name="RedundantImport" />
<module name="UnusedImports" />
<module name="ImportOrder">
<property name="groups" value="*,javax,java" />
<property name="separated" value="true" />
<property name="option" value="bottom" />
<property name="sortStaticImportsAlphabetically" value="true" />
</module>

<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true" />
<property name="allowEmptyMethods" value="true" />
<property name="allowEmptyLambdas" value="true" />
<property name="ignoreEnhancedForColon" value="false" />
<property name="tokens" value="
ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN,
BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAND,
LAMBDA, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE,
LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH,
LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE,
LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL,
PLUS, PLUS_ASSIGN, QUESTION, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN,
STAR, STAR_ASSIGN, TYPE_EXTENSION_AND" />
</module>

<module name="WhitespaceAfter" />

<module name="NoWhitespaceAfter">
<property name="tokens" value="DOT" />
<property name="allowLineBreaks" value="false" />
</module>

<module name="IllegalImport">
<property name="illegalPkgs" value="org.weakref.jmx.internal" />
<property name="illegalPkgs" value="jersey.repackaged" />
<property name="illegalPkgs" value="jdk.nashorn.internal" />
<property name="illegalPkgs" value="jdk.internal" />
</module>

<module name="IllegalImport">
<property name="illegalPkgs" value=".*\.\$internal" />
<property name="regexp" value="true" />
</module>
</module>
</module>
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading