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 13: Initial Check in of the S3 Connector #19

Merged
merged 65 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
3271b61
Initial code base commit
karansinghneu May 5, 2021
92f185b
Fixing bugs in the previous PR
karansinghneu May 13, 2021
172d96e
Adding latest event listener logs
karansinghneu May 13, 2021
efe7de7
Fixing license header
karansinghneu Jun 8, 2021
74b580b
Fixing license
karansinghneu Jun 9, 2021
62c395c
Removing log directory and fixing license
karansinghneu Jun 9, 2021
756463a
Removing comments & fixing shell scripts
karansinghneu Jun 9, 2021
0eb70ba
Removing comments from shell scripts
karansinghneu Jun 9, 2021
8924b9e
Adding modified build file
karansinghneu Jun 16, 2021
fa86480
Removing log directory
karansinghneu Jun 16, 2021
9c1c0c3
Change integration tests to use scality s3 server
chipmaurer Jun 16, 2021
edb3629
Adding old gradle build
karansinghneu Jun 16, 2021
02abfba
Merge branch 'presto-karan-s3' of https://github.com/karansinghneu/pr…
chipmaurer Jun 16, 2021
c8875da
Down to 2 failed tests. TestDropTable and TestDropTableJson
chipmaurer Jun 17, 2021
3e72564
Set integration test run to include --info flag
chipmaurer Jun 17, 2021
1d88ff9
Use a profile for aws commands. Make sure to pull schema registry be…
chipmaurer Jun 18, 2021
1c26dbf
Put docker ps commands in startup to ensure containers are running
chipmaurer Jun 18, 2021
b2f9303
Use curl to test for s3 server readiness
chipmaurer Jun 24, 2021
a716810
Use Bash for shell
chipmaurer Jun 24, 2021
3cd7ee0
Add some debug and change setup method annotation
chipmaurer Jun 28, 2021
551e0d5
Force presto to reload tables after s3 server and schema registry con…
chipmaurer Jun 28, 2021
4e542e4
Show firewall and port info
chipmaurer Jun 28, 2021
e5f6c57
More debugging
chipmaurer Jun 28, 2021
fb6dd18
Fix syntax error
chipmaurer Jun 28, 2021
008669f
.github/workflows/s3-build.yml
chipmaurer Jun 28, 2021
4f45c85
More changes to action file
chipmaurer Jun 28, 2021
e48732b
More changes to action file - part 2
chipmaurer Jun 28, 2021
d2eb687
More changes to action file - part 2
chipmaurer Jun 28, 2021
b0b3f50
More changes to action file - part 3
chipmaurer Jun 28, 2021
b64bdf3
More changes to action file - part 4
chipmaurer Jun 28, 2021
3836927
Still trying to get this to work
chipmaurer Jun 28, 2021
c1e2d88
Still trying to get this to work - 1
chipmaurer Jun 28, 2021
67b7595
Make sure aws cli is install
chipmaurer Jun 28, 2021
3bd0904
Replace aws usage with s3curl
chipmaurer Jun 29, 2021
cf47f97
Turn on debugging in the integration test scripts
chipmaurer Jun 29, 2021
1280db2
Make scripts dumber
chipmaurer Jun 30, 2021
0e54feb
Force a schema reset before running tests
chipmaurer Jun 30, 2021
21b3009
Hopefully, this time it will really force a reset of the schema befor…
chipmaurer Jun 30, 2021
678cf9e
Revert back to starting containers in github action yml file
chipmaurer Jul 1, 2021
19b9248
Run integration test in same step as starting containers
chipmaurer Jul 1, 2021
a0f5bc0
Use network host instead of -p for docker run
chipmaurer Jul 1, 2021
3904688
Add network config check
chipmaurer Jul 1, 2021
4ee1fc9
Try to use docker proxy, and dump bucket contents
chipmaurer Jul 1, 2021
224a6d3
Fix yml error
chipmaurer Jul 1, 2021
1ecfaf7
Use localhost instead of 127.0.0.1 - yes, it's dumb but I'm running o…
chipmaurer Jul 1, 2021
1783ab0
Start containers with --bind arg
chipmaurer Jul 1, 2021
e24b314
Remove --bind arg
chipmaurer Jul 1, 2021
f444b1a
Replace localhost with 127.0.0.1
chipmaurer Jul 1, 2021
01a8531
Back out the yml stuff
chipmaurer Jul 1, 2021
506ea6f
add a stupid sleep
chipmaurer Jul 1, 2021
279ed7b
Make sure s3_start REALLY finishes
chipmaurer Jul 1, 2021
17735cc
Go back to starting containers in yml file
chipmaurer Jul 1, 2021
98c9a23
Fail setup on error. Catch listBuckets exception for slow systems du…
chipmaurer Jul 1, 2021
9025561
OK, maybe waiting up to 30 seconds isn't enough. Now waiting up to 2…
chipmaurer Jul 2, 2021
b5d58e5
Run docker logs if can't create bucket
chipmaurer Jul 2, 2021
ff3b5e0
Fix logic errors in setup and s3_start. Add more debug to s3 start s…
chipmaurer Jul 2, 2021
3b1a31e
Make sure hmac digest is installed
chipmaurer Jul 2, 2021
bbf92fd
Don't use sudo
chipmaurer Jul 2, 2021
b19200e
Move install of hmac to action file. Replace sh with bash in java se…
chipmaurer Jul 2, 2021
49646c8
Well, I guess sudo doesn't work
chipmaurer Jul 2, 2021
d3e1895
So, sudo does work, my bad
chipmaurer Jul 2, 2021
addf00c
Updating the README
chipmaurer Jul 2, 2021
d843147
Gradle file cleanup
chipmaurer Jul 6, 2021
d94e1a3
Fix a couple gradle issues, and integration test issues, and depracat…
chipmaurer Jul 6, 2021
68828e6
Applied comments from PR review
chipmaurer Jul 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/*
* Build gradle file for the Pravega connector
*/

plugins {
id 'java'
id 'distribution'
id 'maven'
}

apply from: "$rootDir/gradle/checkstyle.gradle"

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 'org.glassfish.hk2.external:jakarta.inject:2.6.1'
chipmaurer marked this conversation as resolved.
Show resolved Hide resolved
compile 'org.glassfish.jersey.containers:jersey-container-servlet-core:2.30'
compile 'org.glassfish.jersey.core:jersey-common:2.30'
compile 'org.glassfish.jersey.ext:jersey-proxy-client:2.30'
compile 'org.glassfish.jersey.core:jersey-client:2.30'
compile 'org.glassfish.jersey.inject:jersey-hk2:2.30'
compile 'jakarta.validation:jakarta.validation-api:2.0.2'
compile 'com.fasterxml.jackson.core:jackson-databind:2.10.0'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.10.0'
compile 'com.facebook.airlift:bootstrap:0.198'
compile 'com.facebook.airlift:json:0.198'
compile 'com.facebook.airlift:log:0.198'
compile 'com.facebook.airlift:concurrent:0.198'
compile 'com.facebook.airlift:configuration:0.198'
compile 'com.facebook.airlift:log-manager:0.198'
compile 'com.facebook.airlift:jaxrs:0.198'
compile 'com.facebook.airlift:http-server:0.198'
compile 'com.google.guava:guava:26.0-jre'
compile 'com.google.inject:guice:4.2.2'
compile 'com.amazonaws:aws-java-sdk-s3:1.11.871'
compile 'com.amazonaws:aws-java-sdk-core:1.11.871'
compile 'javax.ws.rs:javax.ws.rs-api:2.1'
compile 'org.apache.avro:avro:1.8.1'
compile 'com.opencsv:opencsv:4.6'
compile 'net.sf.opencsv:opencsv:2.3'
compile 'org.json:json:20190722'
compile 'joda-time:joda-time:2.2'
compile 'com.facebook.presto:presto-record-decoder:0.249'
compile 'com.emc.ecs:object-client:3.1.3'
compile 'io.pravega:schemaregistry-client:0.2.0'
compile 'io.pravega:schemaregistry-contract:0.2.0'
compile 'org.apache.parquet:parquet-hadoop:1.10.0'
compile 'org.apache.parquet:parquet-column:1.10.0'
compile 'org.weakref:jmxutils:1.19'
compile 'com.facebook.presto:presto-parquet:0.249'
compile 'com.facebook.presto:presto-memory-context:0.249'
compile 'com.facebook.presto.hadoop:hadoop-apache2:2.7.4-8'
compile 'javax.xml.bind:jaxb-api:2.2.11'
compile 'com.sun.xml.bind:jaxb-core:2.2.11'
compile 'com.sun.xml.bind:jaxb-impl:2.2.11'
compile 'io.airlift:joda-to-java-time-bridge:3'
compile 'org.slf4j:slf4j-simple:1.7.5'
compile 'com.emc.ecs:smart-client:2.2.1'
compile 'com.emc.ecs:object-transform:1.1.0'
compile 'org.jdom:jdom2:2.0.6'
compile 'io.pravega:schemaregistry-common:0.2.0'
compile 'io.pravega:pravega-common:0.9.0'
testImplementation 'com.facebook.presto:presto-tests:0.249'
testImplementation 'org.eclipse.jetty:jetty-server:9.4.14.v20181114'
testImplementation 'org.testng:testng:6.10'
testImplementation 'com.facebook.airlift:testing:0.198'
compile 'com.facebook.drift:drift-api:1.31'
compile 'com.facebook.presto:presto-spi:0.249'
compile 'io.airlift:slice:0.38'
compile 'org.openjdk.jol:jol-core:0.2'
compile 'io.airlift:units:1.3'
compile 'com.facebook.presto:presto-common:0.249'
compile 'com.facebook.presto:presto-main:0.249'
}

/*
testImplementation "io.pravega:schemaregistry-common:${pravegaSchemaRegistryVersion}"
*/

group = 'com.facebook.presto'
version = '0.1.0'
description = 'S3 PrestoDB Connector'
sourceCompatibility = '1.8'

compileJava {
options.debug = true
options.debugOptions.debugLevel = 'lines,source'
options.deprecation = true
}

task copyDependentJars(type: Copy) {
println configurations.compile
from configurations.runtime
into "$buildDir/plugin/libs/s3"
}

jar {
baseName = 's3-connector'
destinationDir = file("$buildDir/plugin/libs/s3")
manifest {
attributes "Main-Class": "com.facebook.presto.s3"
}
}

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

distributions {
main {
contents {
distributionBaseName = 's3-presto-connector'
from(project.configurations.runtime)
from jar
}
}
}

task zip(type: Zip) {
into "$buildDir/plugin/libs/s3"
into (project.name + '-' + project.version)
}

def integration = project.hasProperty("integration")

test {
maxHeapSize = "2048m"
useTestNG() {
suites "src/test/unit-test.xml"
if (integration) {
suites "src/test/integration-test.xml"
}
}
}

jar.dependsOn(copyDependentJars)
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="Header">
<property name="headerFile" value="HEADER" />
</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>
14 changes: 14 additions & 0 deletions config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress checks="JavadocStyle" files=".+Tests\.java" />
<suppress checks="JavadocMethod" files=".+Tests\.java" />
<suppress checks="JavadocStyle" files=".+Test\.java" />
<suppress checks="JavadocMethod" files=".+Test\.java" />
<suppress files="[\\/]generated[\\/]" checks="[a-zA-Z0-9]*"/>
<suppress files="\.pem" checks="[a-zA-Z0-9]*"/>
<suppress files="passwd" checks="[a-zA-Z0-9]*"/>
</suppressions>

Loading