Skip to content

Commit 054dff1

Browse files
ddimensiavjkoskela
authored andcommitted
Whitespace/EOF cleanup, build control changes (#97)
* Cleaned up missing EOF and unnecessary whitespace. * Added 'set -e' to cause the scripts to fail on the first non-zero exit status rather than allow the failures to cascade. * Made output directory and output filename more configurable, moved docker plugin into a profile so it can be disabled. * Fixed issue with maven plugin order being non-deterministic when defined in a profile, made docker skipable with 'skipDockerBuild' variable.
1 parent b24651e commit 054dff1

Some content is hidden

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

45 files changed

+79
-62
lines changed

Histograms.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ by MAD.
66

77
Representation
88
--------------
9-
Histograms are built by incrementing a counter in a bucket and stored as a sparse list of
9+
Histograms are built by incrementing a counter in a bucket and stored as a sparse list of
1010
bucket -> count entries. The bucket is defined by the smallest number stored in that bucket, computed
1111
by using an IEEE Double with a mantissa truncated to n bits of precision. The default in MAD is to use
1212
7 bits of precision. Additionally, the min, max and sum of the samples are stored as IEEE Double values
@@ -15,10 +15,9 @@ alongside the histogram.
1515
Statistics
1616
----------
1717

18-
min - accurate (stored)
19-
max - accurate (stored)
20-
sum - accurate (stored)
21-
quantiles - estimated. accuracy depends on precision of the histogram and value stored. n bits of
22-
precision provides accuracy to within (1 / (2^n)) * value. ex: 7 bits of precision provides accuracy
18+
min - accurate (stored)
19+
max - accurate (stored)
20+
sum - accurate (stored)
21+
quantiles - estimated. accuracy depends on precision of the histogram and value stored. n bits of
22+
precision provides accuracy to within (1 / (2^n)) * value. ex: 7 bits of precision provides accuracy
2323
to within 1% of the computed value.
24-

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ a. You must give any other recipients of the Work or Derivative Works a copy of
8989
this License; and
9090
b. You must cause any modified files to carry prominent notices stating that You
9191
changed the files; and
92-
c. You must retain, in the Source form of any Derivative Works that You
92+
c. You must retain, in the Source form of any Derivative Works that You
9393
distribute, all copyright, patent, trademark, and attribution notices from the
9494
Source form of the Work, excluding those notices that do not pertain to any part
9595
of the Derivative Works; and
@@ -105,7 +105,7 @@ the NOTICE file are for informational purposes only and do not modify the
105105
License. You may add Your own attribution notices within Derivative Works that
106106
You distribute, alongside or as an addendum to the NOTICE text from the Work,
107107
provided that such additional attribution notices cannot be construed as
108-
modifying the License.
108+
modifying the License.
109109

110110
You may add Your own copyright statement to Your modifications and may provide
111111
additional or different license terms and conditions for use, reproduction, or

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ For example:
128128
"serviceName": "MyApplication",
129129
"sources":
130130
[
131-
{
131+
{
132132
"type": "com.arpnetworking.metrics.common.sources.ClientHttpSourceV1",
133-
"name": "my_application_http_source"
133+
"name": "my_application_http_source"
134134
},
135135
{
136136
"type": "com.arpnetworking.metrics.common.sources.FileSource",

mvnw

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,27 @@ case "`uname`" in
5757
#
5858
# Look for the Apple JDKs first to preserve the existing behaviour, and then look
5959
# for the new JDKs provided by Oracle.
60-
#
60+
#
6161
if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then
6262
#
6363
# Apple JDKs
6464
#
6565
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
6666
fi
67-
67+
6868
if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then
6969
#
7070
# Apple JDKs
7171
#
7272
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
7373
fi
74-
74+
7575
if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then
7676
#
7777
# Oracle JDKs
7878
#
7979
export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
80-
fi
80+
fi
8181

8282
if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then
8383
#
@@ -219,7 +219,7 @@ concat_lines() {
219219
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
220220
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
221221

222-
# Provide a "standardized" way to retrieve the CLI args that will
222+
# Provide a "standardized" way to retrieve the CLI args that will
223223
# work with both Windows and non-Windows executions.
224224
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
225225
export MAVEN_CMD_LINE_ARGS

pom.xml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,19 @@
130130
<!-- JVM Debug -->
131131
<debugJavaOptions />
132132
<debugJavaPort>9001</debugJavaPort>
133+
134+
<!-- Docker Overrides -->
135+
<skipDockerBuild>false</skipDockerBuild>
136+
137+
<!-- Assembly Overrides -->
138+
<tgz.finalName>${project.build.finalName}</tgz.finalName>
139+
140+
<!-- Project Overrides -->
141+
<buildDirectory>${project.basedir}/target</buildDirectory>
133142
</properties>
143+
134144
<build>
145+
<directory>${buildDirectory}</directory>
135146
<resources>
136147
<resource>
137148
<directory>src/main/resources</directory>
@@ -205,7 +216,7 @@
205216
<mainClass>com.arpnetworking.metrics.mad.Main</mainClass>
206217
</program>
207218
</programs>
208-
<unixScriptTemplate>${project.basedir}/target/appAssemblerUnixBinTemplate</unixScriptTemplate>
219+
<unixScriptTemplate>${project.build.directory}/appAssemblerUnixBinTemplate</unixScriptTemplate>
209220
<endorsedDir>lib/ext</endorsedDir>
210221
</configuration>
211222
</plugin>
@@ -237,6 +248,7 @@
237248
<goal>single</goal>
238249
</goals>
239250
<configuration>
251+
<finalName>${tgz.finalName}</finalName>
240252
<appendAssemblyId>true</appendAssemblyId>
241253
<attach>false</attach>
242254
<tarLongFileMode>posix</tarLongFileMode>
@@ -317,13 +329,6 @@
317329
<goal>build</goal>
318330
</goals>
319331
</execution>
320-
<execution>
321-
<id>default-remove</id>
322-
<phase>validate</phase>
323-
<configuration>
324-
<removeAll>true</removeAll>
325-
</configuration>
326-
</execution>
327332
<execution>
328333
<id>default-start</id>
329334
<phase>pre-integration-test</phase>
@@ -390,6 +395,7 @@
390395
</run>
391396
</image>
392397
</images>
398+
<skip>${skipDockerBuild}</skip>
393399
</configuration>
394400
</plugin>
395401
</plugins>
@@ -811,5 +817,15 @@
811817
<debugJavaOptions>-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=${debugJavaPort},suspend=n</debugJavaOptions>
812818
</properties>
813819
</profile>
820+
<profile>
821+
<id>no-docker</id>
822+
<activation>
823+
<activeByDefault>false</activeByDefault>
824+
</activation>
825+
<properties>
826+
<skipIntegrationTests>true</skipIntegrationTests>
827+
<skipDockerBuild>true</skipDockerBuild>
828+
</properties>
829+
</profile>
814830
</profiles>
815831
</project>

rpm/scripts/post.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set -e
12
/sbin/chkconfig --add mad
23
mkdir -p /opt/mad/logs
34
chown mad:mad /opt/mad/logs

rpm/scripts/postun.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set -e
12
if [ "$1" -ge 1 ]; then
23
/sbin/service mad condrestart > /dev/null 2>&1
34
fi

rpm/scripts/pre.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set -e
12
getent group mad >/dev/null || groupadd -r mad
23
getent passwd mad >/dev/null || \
34
useradd -r -g mad -d /opt/mad -s /sbin/nologin \

rpm/scripts/preun.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set -e
12
if [ "$1" = 0 ]; then
23
/sbin/service mad stop > /dev/null 2>&1
34
/sbin/chkconfig --del mad

src/main/java/com/arpnetworking/configuration/Configuration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,4 +471,3 @@ public interface Configuration {
471471
*/
472472
<T> T getRequiredAs(Type type) throws NoSuchElementException, IllegalArgumentException;
473473
}
474-

0 commit comments

Comments
 (0)