Skip to content

Commit

Permalink
Merge pull request #167 from RADAR-base/release-0.5.0
Browse files Browse the repository at this point in the history
Release 0.5.0
  • Loading branch information
yatharthranjan authored Apr 15, 2019
2 parents f47ac47 + afa2079 commit f0343ec
Show file tree
Hide file tree
Showing 51 changed files with 1,371 additions and 281 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
java-sdk/**/build
**/.idea
java-sdk/**/.gradle
java-sdk/**/out
java-sdk/**/src/test
.git
doc
java-sdk/config
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: java
jdk:
- oraclejdk8
env:
- TERM=dumb
- oraclejdk11

cache:
directories:
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:8-jdk-alpine
FROM openjdk:11-jdk-slim

RUN mkdir -p /code/java-sdk
WORKDIR /code/java-sdk
Expand All @@ -13,12 +13,12 @@ ENV GRADLE_OPTS -Dorg.gradle.daemon=false
RUN ./gradlew tasks
COPY java-sdk/radar-schemas-commons/build.gradle /code/java-sdk/radar-schemas-commons/
COPY java-sdk/radar-schemas-commons/src /code/java-sdk/radar-schemas-commons/src
RUN ./gradlew :radar-schemas-commons:classes
RUN ./gradlew :radar-schemas-commons:jar
COPY java-sdk/radar-schemas-tools/build.gradle /code/java-sdk/radar-schemas-tools/
COPY java-sdk/radar-schemas-tools/src /code/java-sdk/radar-schemas-tools/src
RUN ./gradlew distTar && cd radar-schemas-tools/build/distributions && tar xzf radar-schemas-tools*.tar.gz

FROM openjdk:8-jre-alpine
FROM openjdk:11-jre-slim

COPY --from=0 /code/java-sdk/radar-schemas-tools/build/distributions/radar-schemas-tools-*/lib/* /usr/lib/
COPY --from=0 /code/java-sdk/radar-schemas-tools/build/distributions/radar-schemas-tools-*/bin/radar-schemas-tools /usr/bin/
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@ docker-compose run --rm tools radar-schemas-tools register http://schema-registr
docker-compose run --rm tools radar-schemas-tools create zookeeper-1:2181
# run source-catalogue webservice
docker-compose run --rm tools radar-schemas-tools serve -p <portnumber>
# back up the _schemas topic
docker-compose run --rm tools radar-schemas-tools schema-topic --backup -f schema.json -b 1 zookeeper-1:2181
# ensure the validity of the _schemas topic
docker-compose run --rm tools radar-schemas-tools schema-topic --ensure -f schema.json -b 1 -r 1 zookeeper-1:2181
```
2 changes: 1 addition & 1 deletion commons/connector/fitbit/fitbit_activity_log_record.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{"name": "id", "type": "long", "doc": "Activity log ID."},
{"name": "name", "type": ["null", "string"], "doc": "Activity name. Null if none or unknown.", "default": null},
{"name": "logType", "type": ["null", "string"], "doc": "Type of log, e.g. manual. Null if unknown.", "default": null},
{"name": "type", "type": "long", "doc": "Fitbit-generated ID of the type of activity."},
{"name": "type", "type": ["null", "long"], "doc": "Fitbit-generated ID of the type of activity. Null if unknown.", "default": null},
{"name": "source", "type": ["null", "FitbitSource"], "doc": "Source of the data. Null if unknown.", "default": null},
{"name": "manualDataEntry", "type": ["null", "FitbitManualDataEntry"], "doc": "Indicates what values of this record are entered manually. Null if unknown.", "default": null},
{"name": "energy", "type": ["null", "float"], "doc": "Estimated of energy expended during the activity (kJ). Null if unknown.", "default": null},
Expand Down
4 changes: 2 additions & 2 deletions commons/monitor/application/application_record_counts.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"doc": "Number of records cached or created.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "recordsCached", "type": ["null", "int"], "doc": "Number of records currently being cached.", "default": null },
{ "name": "recordsSent", "type": "int", "doc": "Number of records sent since application start." },
{ "name": "recordsCached", "type": ["null", "long"], "doc": "Number of records currently being cached.", "default": null },
{ "name": "recordsSent", "type": "long", "doc": "Number of records sent since application start." },
{ "name": "recordsUnsent", "type": ["null", "int"], "doc": "Number of unsent records.", "default": null }
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"doc": "Schema for reporting the completion status of a questionnaire. This will help in calculating the compliance.",
"fields": [
{ "name": "time", "type": "double", "doc": "Timestamp in UTC (s) when the questionnaire completion log is submitted." },
{ "name": "timeNotification", "type": ["null", "double"], "doc": "Timestamp in UTC (s) when the notification to complete the questionnaire is sent.", "default": null },
{ "name": "name", "type": "string", "doc": "Questionnaire name." },
{ "name": "completionPercentage", "type": [ "null", "double"], "doc": "Percentage of the questionnaire completed. 0 for not at all complete and 100 for full completion. Null if no completion value possible." , "default": null }
]
Expand Down
3 changes: 2 additions & 1 deletion commons/passive/phone/phone_relative_location.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"namespace": "org.radarcns.passive.phone",
"type": "record",
"name": "PhoneRelativeLocation",
"doc": "Data from the gps and network location providers. The latitude and longitude are stated with an unspecified reference offset and can thus be treated as relative locations. They cannot be used to infer absolute location. This means accurate distances or angles between locations cannot be calculated since those depend on the absolute location.",
"doc": "Data from the gps and network location providers. The latitude and longitude are optionally offset with an unspecified reference location and can thus be treated as relative locations. In that case, a location cannot be used to infer absolute location. This means accurate distances or angles between locations cannot be calculated since those depend on the absolute location. The reference location has a random longitude and a latitude that deviates at most 4 degrees in each direction to the initial location.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (s)." },
{ "name": "timeReceived", "type": "double", "doc": "Device receiver timestamp in UTC (s)." },
{ "name": "offsetReference", "type": ["null", "int"], "doc": "Arbitrary reference to the offset. As long as the offset remains equal, so does this reference. If this reference is 0, no offset is used and the contained latitude and longitude can be considered absolute. If this is null, the location is relative to an offset but the offset is unknown: it may vary between different measurements with null reference. Offset references cannot be compared between users.", "default": null},
{ "name": "provider", "type": {
"name": "LocationProvider",
"type": "enum",
Expand Down
12 changes: 5 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
# Zookeeper Cluster #
#---------------------------------------------------------------------------#
zookeeper-1:
image: confluentinc/cp-zookeeper:5.0.0
image: confluentinc/cp-zookeeper:5.1.2
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 2181
Expand All @@ -19,17 +19,16 @@ services:
# Kafka Cluster #
#---------------------------------------------------------------------------#
kafka-1:
image: confluentinc/cp-kafka:5.0.0
image: confluentinc/cp-kafka:5.1.2
depends_on:
- zookeeper-1
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper-1:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-1:9092
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_GROUP_MIN_SESSION_TIMEOUT_MS: 5000
KAFKA_INTER_BROKER_PROTOCOL_VERSION: 0.11.0
KAFKA_LOG_MESSAGE_FORMAT_VERSION: 0.11.0
KAFKA_INTER_BROKER_PROTOCOL_VERSION: 2.1
KAFKA_LOG_MESSAGE_FORMAT_VERSION: 2.1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
Expand All @@ -40,7 +39,7 @@ services:
# Schema Registry #
#---------------------------------------------------------------------------#
schema-registry-1:
image: confluentinc/cp-schema-registry:5.0.0
image: confluentinc/cp-schema-registry:5.1.2
depends_on:
- zookeeper-1
- kafka-1
Expand All @@ -60,6 +59,5 @@ services:
depends_on:
- zookeeper-1
- kafka-1
- schema-registry-1
volumes:
- .:/schemas
20 changes: 6 additions & 14 deletions java-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
//---------------------------------------------------------------------------//

plugins {
id 'com.commercehub.gradle.plugin.avro-base' version '0.9.0'
id 'com.commercehub.gradle.plugin.avro-base' version '0.16.0'
id 'com.jfrog.bintray' version '1.8.4'
id 'com.jfrog.artifactory' version '4.8.1'
id 'com.jfrog.artifactory' version '4.9.1'
}

subprojects {
Expand All @@ -17,25 +17,17 @@ subprojects {
apply plugin: 'idea'

// Configuration
version = '0.4.3'
version = '0.5.0'
group = 'org.radarcns'
ext.githubRepoName = 'RADAR-base/RADAR-Schemas'

targetCompatibility = '1.7'
sourceCompatibility = '1.7'

ext.avroVersion = '1.8.2'

ext.githubUrl = "https://github.com/${githubRepoName}.git"
ext.issueUrl = "https://github.com/${githubRepoName}/issues"
ext.website = 'http://radar-cns.org'

// dependencies
repositories {
jcenter()
mavenCentral()
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local' }
}

dependencies {
api (group: 'org.apache.avro', name: 'avro', version: avroVersion) {
Expand Down Expand Up @@ -92,13 +84,13 @@ subprojects {
}
// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
archiveClassifier.set('sources')
from sourceSets.main.allSource
manifest.from sharedManifest
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier.set('javadoc')
from javadoc.destinationDir
manifest.from sharedManifest
}
Expand Down Expand Up @@ -133,5 +125,5 @@ subprojects {
}

wrapper {
gradleVersion '4.10.2'
gradleVersion '5.2.1'
}
94 changes: 41 additions & 53 deletions java-sdk/config/pmd/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,83 +8,71 @@
This ruleset was parsed from the Codacy default codestyle.
</description>

<rule ref="rulesets/java/strings.xml">
<exclude name="ConsecutiveAppendsShouldReuse"/>
<exclude name="AvoidDuplicateLiterals"/>
</rule>

<rule ref="rulesets/java/unusedcode.xml">
<exclude name="UnusedFormalParameter"/>
</rule>

<rule ref="rulesets/java/unnecessary.xml"/>
<rule ref="rulesets/java/basic.xml"/>

<rule ref="rulesets/java/logging-java.xml/SystemPrintln"/>
<rule ref="rulesets/java/logging-java.xml/AvoidPrintStackTrace"/>

<rule ref="rulesets/java/naming.xml">
<rule ref="category/java/codestyle.xml">
<exclude name="LongVariable"/>
<exclude name="ShortVariable"/>
<exclude name="BooleanGetMethodName"/>
<exclude name="AbstractNaming"/>
<exclude name="TooManyStaticImports"/>
<exclude name="MethodArgumentCouldBeFinal"/>
<exclude name="LocalVariableCouldBeFinal"/>
<exclude name="OnlyOneReturn"/>
<exclude name="AtLeastOneConstructor"/>
<exclude name="DefaultPackage"/>
<exclude name="CommentDefaultAccessModifier"/>
<exclude name="CallSuperInConstructor"/>
<exclude name="ConfusingTernary"/>
</rule>
<rule ref="rulesets/java/naming.xml/ShortMethodName">
<rule ref="category/java/codestyle.xml/ShortMethodName">
<properties>
<property name="minimum" value="2"/>
</properties>
</rule>
<rule ref="rulesets/java/naming.xml/VariableNamingConventions">
<rule ref="category/java/codestyle.xml/FieldNamingConventions">
<properties>
<property name="violationSuppressRegex" value=".*, 'log(ger)?' is not all capitals\."/>
<property name="exclusions" value="logger|serialVersionUID"/>
</properties>
</rule>

<rule ref="rulesets/java/imports.xml">
<exclude name="TooManyStaticImports"/>
</rule>

<rule ref="rulesets/java/strictexception.xml">
<rule ref="category/java/design.xml">
<exclude name="AvoidCatchingGenericException"/>
</rule>

<rule ref="rulesets/java/design.xml">
<exclude name="AvoidDeeplyNestedIfStmts"/>
<exclude name="SwitchDensity"/>
<exclude name="AccessorClassGeneration"/>
<exclude name="ConstructorCallsOverridableMethod"/>
<exclude name="AvoidSynchronizedAtMethodLevel"/>
<exclude name="TooFewBranchesForASwitchStatement"/>
<exclude name="PositionLiteralsFirstInComparisons"/>
<exclude name="ConfusingTernary"/>
<exclude name="UseVarargs"/>
</rule>

<rule ref="rulesets/java/codesize.xml">
<exclude name="CyclomaticComplexity"/>
<exclude name="ExcessiveClassLength"/>
<exclude name="ExcessivePublicCount"/>
<exclude name="TooManyFields"/>
<exclude name="TooManyMethods"/>
<exclude name="LawOfDemeter"/>
<exclude name="LoosePackageCoupling"/>
<exclude name="ExcessiveImports"/>
<exclude name="DataClass"/>
</rule>

<rule ref="rulesets/java/empty.xml">
<exclude name="EmptyCatchBlock"/>
<rule ref="category/java/bestpractices.xml">
<exclude name="GuardLogStatement"/>
<exclude name="PositionLiteralsFirstInComparisons"/>
</rule>

<rule ref="rulesets/java/finalizers.xml"/>
<rule ref="rulesets/java/braces.xml"/>
<rule ref="rulesets/java/clone.xml"/>

<rule ref="rulesets/java/controversial.xml/AssignmentInOperand"/>
<rule ref="rulesets/java/controversial.xml/OneDeclarationPerLine"/>
<rule ref="rulesets/java/controversial.xml/SuspiciousOctalEscape"/>
<rule ref="rulesets/java/controversial.xml/UnnecessaryParentheses"/>
<rule ref="category/java/errorprone.xml">
<exclude name="EmptyCatchBlock"/>
<exclude name="DataflowAnomalyAnalysis"/>
<exclude name="AvoidLiteralsInIfCondition"/>
<exclude name="BeanMembersShouldSerialize"/>
<exclude name="NullAssignment"/>
</rule>

<rule ref="rulesets/java/optimizations.xml/UseArrayListInsteadOfVector"/>
<rule ref="rulesets/java/optimizations.xml/UseArraysAsList"/>
<rule ref="rulesets/java/optimizations.xml/AvoidArrayLoops"/>
<rule ref="rulesets/java/optimizations.xml/UnnecessaryWrapperObjectCreation"/>
<rule ref="rulesets/java/optimizations.xml/AddEmptyString"/>
<rule ref="rulesets/java/optimizations.xml/PrematureDeclaration"/>
<rule ref="category/java/multithreading.xml">
<exclude name="AvoidSynchronizedAtMethodLevel"/>
<exclude name="UseConcurrentHashMap"/>
</rule>
<rule ref="category/java/performance.xml">
<exclude name="AvoidUsingShortType"/>
<exclude name="RedundantFieldInitializer"/>
</rule>
<rule ref="category/java/security.xml"/>
<rule ref="category/java/documentation.xml">
<exclude name="CommentRequired"/>
<exclude name="CommentSize"/>
</rule>
</ruleset>
Binary file modified java-sdk/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion java-sdk/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion java-sdk/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
2 changes: 1 addition & 1 deletion java-sdk/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
8 changes: 8 additions & 0 deletions java-sdk/radar-schemas-commons/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
apply plugin: 'com.jfrog.artifactory'

targetCompatibility = '1.7'
sourceCompatibility = '1.7'

ext.artifactName = 'radar-schemas-commons'
ext.description = 'RADAR Schemas Commons SDK'

Expand All @@ -9,6 +12,11 @@ sourceSets {
}
}

repositories {
jcenter()
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local' }
}

//---------------------------------------------------------------------------//
// Clean settings //
//---------------------------------------------------------------------------//
Expand Down
Loading

0 comments on commit f0343ec

Please sign in to comment.