Skip to content

Commit 161d22a

Browse files
committed
Added initial version InfluxData Platform Java client
0 parents  commit 161d22a

File tree

49 files changed

+3487
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3487
-0
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Maven
2+
target/**
3+
.m2/**
4+
5+
# IntelliJ
6+
.idea/**
7+
*.iml
8+
9+
.java-version
10+
11+
**nightly**
12+
**/influxd.bolt

.travis.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# The MIT License
3+
#
4+
# Permission is hereby granted, free of charge, to any person obtaining a copy
5+
# of this software and associated documentation files (the "Software"), to deal
6+
# in the Software without restriction, including without limitation the rights
7+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
# copies of the Software, and to permit persons to whom the Software is
9+
# furnished to do so, subject to the following conditions:
10+
#
11+
# The above copyright notice and this permission notice shall be included in
12+
# all copies or substantial portions of the Software.
13+
#
14+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
# THE SOFTWARE.
21+
#
22+
23+
sudo: required
24+
25+
cache:
26+
timeout: 10000
27+
directories:
28+
- ${PWD}/.m2
29+
30+
services:
31+
- docker
32+
33+
env:
34+
- MAVEN_JAVA_VERSION=3-jdk-10-slim INFLUXDB_VERSION=nightly INFLUX_PLATFORM_VERSION=nightly
35+
- MAVEN_JAVA_VERSION=3-jdk-8-slim INFLUXDB_VERSION=nightly INFLUX_PLATFORM_VERSION=nightly CODE_COV=true
36+
37+
script: ./config/compile-and-test.sh
38+
39+
jobs:
40+
include:
41+
- stage: deploy
42+
script: docker run -it --rm --volume ${PWD}:/usr/src/mymaven --volume ${PWD}/.m2:/root/.m2 --workdir /usr/src/mymaven maven:${MAVEN_JAVA_VERSION} mvn clean deploy -DskipTests -s config/deploy-settings.xml -U -Denv.BONITOO_SNAPSHOT_USER=${BONITOO_SNAPSHOT_USER} -Denv.BONITOO_SNAPSHOT_PASSWORD=${BONITOO_SNAPSHOT_PASSWORD}
43+
env: MAVEN_JAVA_VERSION=3-jdk-8-slim
44+
45+
after_success:
46+
- test "true" = ${CODE_COV:=false} && bash <(curl -s https://codecov.io/bash)
47+
48+
after_failure:
49+
- cat target/surefire-reports/*.txt

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Influxdata, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# influxdata-platform-java
2+
3+
> This library is under development and no stable version has been released yet.
4+
> The API can change at any moment.
5+
6+
[![Build Status](https://travis-ci.org/bonitoo-io/influxdata-platform-java.svg?branch=master)](https://travis-ci.org/bonitoo-io/influxdata-platform-java)
7+
[![codecov](https://codecov.io/gh/bonitoo-io/influxdata-platform-java/branch/master/graph/badge.svg)](https://codecov.io/gh/bonitoo-io/influxdata-platform-java)
8+
[![License](https://img.shields.io/github/license/bonitoo-io/influxdata-platform-java.svg)](https://github.com/bonitoo-io/influxdata-platform-java/blob/master/LICENSE)
9+
[![Snapshot Version](https://img.shields.io/nexus/s/https/apitea.com/nexus/org.influxdata/influxdata-platform-java.svg)](https://apitea.com/nexus/content/repositories/bonitoo-snapshot/org/influxdata/)
10+
[![GitHub issues](https://img.shields.io/github/issues-raw/bonitoo-io/influxdata-platform-java.svg)](https://github.com/bonitoo-io/influxdata-platform-java/issues)
11+
[![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/bonitoo-io/influxdata-platform-java.svg)](https://github.com/bonitoo-io/influxdata-platform-java/pulls)
12+
13+
## Developer
14+
15+
* Add licence to files: `mvn license:format`
16+
* Display outdated dependencies: `mvn versions:display-dependency-updates`

config/checkstyle.xml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
4+
The MIT License
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.
23+
24+
-->
25+
<!DOCTYPE module PUBLIC
26+
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
27+
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
28+
29+
<module name="Checker">
30+
<module name="SuppressWarningsFilter"/>
31+
<module name="FileLength">
32+
<property name="max" value="2500"/>
33+
</module>
34+
<module name="FileTabCharacter"/>
35+
36+
<!-- Trailing spaces -->
37+
<module name="RegexpSingleline">
38+
<property name="format" value="\s+$"/>
39+
<property name="message" value="Line has trailing spaces."/>
40+
</module>
41+
42+
<!-- Space after 'for' and 'if' -->
43+
<module name="RegexpSingleline">
44+
<property name="format" value="^\s*(for|if)\b[^ ]"/>
45+
<property name="message" value="Space needed before opening parenthesis."/>
46+
</module>
47+
48+
<!-- For each spacing -->
49+
<module name="RegexpSingleline">
50+
<property name="format" value="^\s*for \(.*?([^ ]:|:[^ ])"/>
51+
<property name="message" value="Space needed around ':' character."/>
52+
</module>
53+
54+
<module name="TreeWalker">
55+
<property name="cacheFile" value="${checkstyle.cache.file}"/>
56+
<!-- Checks for Javadoc comments. -->
57+
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
58+
<!--module name="JavadocMethod"/-->
59+
<!--module name="JavadocType"/-->
60+
<!--module name="JavadocVariable"/-->
61+
<module name="JavadocStyle"/>
62+
63+
64+
<!-- Checks for Naming Conventions. -->
65+
<!-- See http://checkstyle.sf.net/config_naming.html -->
66+
<module name="ConstantName"/>
67+
<module name="LocalFinalVariableName"/>
68+
<module name="LocalVariableName"/>
69+
<module name="MemberName"/>
70+
<module name="MethodName"/>
71+
<module name="PackageName"/>
72+
<module name="ParameterName"/>
73+
<module name="StaticVariableName"/>
74+
<module name="TypeName"/>
75+
76+
77+
<!-- Checks for imports -->
78+
<!-- See http://checkstyle.sf.net/config_import.html -->
79+
<module name="AvoidStarImport"/>
80+
<module name="IllegalImport"/>
81+
<!-- defaults to sun.* packages -->
82+
<module name="RedundantImport"/>
83+
<module name="UnusedImports">
84+
<property name="processJavadoc" value="true"/>
85+
</module>
86+
<module name="CustomImportOrder">
87+
<property name="specialImportsRegExp" value="org.influxdata"/>
88+
<property name="sortImportsInGroupAlphabetically" value="true"/>
89+
<property name="customImportOrderRules"
90+
value="STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STATIC"/>
91+
</module>
92+
93+
94+
<!-- Checks for Size Violations. -->
95+
<!-- See http://checkstyle.sf.net/config_sizes.html -->
96+
<module name="LineLength">
97+
<property name="max" value="120"/>
98+
</module>
99+
<module name="MethodLength">
100+
<property name="max" value="200"/>
101+
</module>
102+
103+
104+
<!-- Checks for whitespace -->
105+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
106+
<module name="GenericWhitespace"/>
107+
<module name="EmptyForIteratorPad"/>
108+
<module name="MethodParamPad"/>
109+
<module name="NoWhitespaceAfter"/>
110+
<module name="NoWhitespaceBefore"/>
111+
<module name="OperatorWrap"/>
112+
<module name="ParenPad"/>
113+
<module name="TypecastParenPad"/>
114+
<module name="WhitespaceAfter"/>
115+
<module name="WhitespaceAround">
116+
<property name="tokens"
117+
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN,
118+
COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_CATCH,
119+
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN,
120+
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS,
121+
MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SLIST,
122+
SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
123+
</module>
124+
125+
126+
<!-- Modifier Checks -->
127+
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
128+
<module name="ModifierOrder"/>
129+
<!--<module name="RedundantModifier"/>-->
130+
131+
132+
<!-- Checks for blocks. You know, those {}'s -->
133+
<!-- See http://checkstyle.sf.net/config_blocks.html -->
134+
<module name="AvoidNestedBlocks"/>
135+
<module name="EmptyBlock"/>
136+
<module name="LeftCurly"/>
137+
<module name="NeedBraces"/>
138+
<module name="RightCurly"/>
139+
140+
141+
<!-- Checks for common coding problems -->
142+
<!-- See http://checkstyle.sf.net/config_coding.html -->
143+
<module name="CovariantEquals"/>
144+
<module name="EmptyStatement"/>
145+
<module name="EqualsAvoidNull"/>
146+
<module name="EqualsHashCode"/>
147+
<!--module name="HiddenField"/-->
148+
<module name="IllegalInstantiation"/>
149+
<module name="InnerAssignment"/>
150+
<module name="MagicNumber"/>
151+
<module name="MissingSwitchDefault"/>
152+
<!--<module name="RedundantThrows"/>-->
153+
<module name="SimplifyBooleanExpression"/>
154+
<module name="SimplifyBooleanReturn"/>
155+
156+
<!-- Checks for class design -->
157+
<!-- See http://checkstyle.sf.net/config_design.html -->
158+
<!--module name="DesignForExtension"/-->
159+
<module name="FinalClass"/>
160+
<module name="HideUtilityClassConstructor"/>
161+
<module name="InterfaceIsType"/>
162+
<!--module name="VisibilityModifier"/-->
163+
164+
165+
<!-- Miscellaneous other checks. -->
166+
<!-- See http://checkstyle.sf.net/config_misc.html -->
167+
<module name="ArrayTypeStyle"/>
168+
<module name="FinalParameters"/>
169+
<module name="TodoComment"/>
170+
<module name="UpperEll"/>
171+
172+
<!-- Make the @SuppressWarnings annotations available to Checkstyle -->
173+
<module name="SuppressWarningsHolder"/>
174+
</module>
175+
</module>

config/compile-and-test.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
#
3+
# The MIT License
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
# THE SOFTWARE.
22+
#
23+
24+
set -e
25+
26+
DEFAULT_MAVEN_JAVA_VERSION="3-jdk-8-slim"
27+
MAVEN_JAVA_VERSION="${MAVEN_JAVA_VERSION:-$DEFAULT_MAVEN_JAVA_VERSION}"
28+
29+
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
30+
31+
${SCRIPT_PATH}/platform-restart.sh
32+
33+
ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'
34+
INFLUXDB_IP=`ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p' | grep 10`
35+
FLUX_IP=${INFLUXDB_IP}
36+
PLATFORM_IP=${INFLUXDB_IP}
37+
38+
test -t 1 && USE_TTY="-t"
39+
40+
docker run -i ${USE_TTY} --rm \
41+
--volume ${SCRIPT_PATH}/../:/usr/src/mymaven \
42+
--volume ${SCRIPT_PATH}/../.m2:/root/.m2 \
43+
--workdir /usr/src/mymaven \
44+
--link=influxdb \
45+
--link=influxdata-platform \
46+
--env INFLUXDB_VERSION=${INFLUXDB_VERSION} \
47+
--env INFLUXDB_IP=${INFLUXDB_IP} \
48+
--env FLUX_IP=${FLUX_IP} \
49+
--env PLATFORM_IP=${PLATFORM_IP} \
50+
maven:${MAVEN_JAVA_VERSION} mvn clean install -U
51+
52+
docker kill influxdb || true
53+
docker kill influxdata-platform || true

config/deploy-settings.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!--
2+
3+
The MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.
22+
23+
-->
24+
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
26+
<servers>
27+
<server>
28+
<id>bonitoo-snapshot</id>
29+
<username>${env.BONITOO_SNAPSHOT_USER}</username>
30+
<password>${env.BONITOO_SNAPSHOT_PASSWORD}</password>
31+
</server>
32+
</servers>
33+
</settings>

0 commit comments

Comments
 (0)