Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.

Commit 1ce46c5

Browse files
author
Florian Lautenschlager
committed
Updated project to latest versions.
1 parent a74b14c commit 1ce46c5

File tree

14 files changed

+141
-82
lines changed

14 files changed

+141
-82
lines changed

build.gradle

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
buildscript {
18-
repositories {
19-
jcenter()
20-
mavenCentral()
21-
maven {
22-
url "https://plugins.gradle.org/m2/"
23-
}
24-
}
25-
dependencies {
26-
classpath 'com.gradle.publish:plugin-publish-plugin:0.9.1'
27-
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
28-
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0'
29-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
30-
}
17+
plugins {
18+
id "org.sonarqube" version "2.1"
19+
id "de.undercouch.download" version "3.1.1"
20+
id "com.github.hierynomus.license" version "0.13.1"
21+
id "com.jfrog.bintray" version "1.7.2"
22+
id 'com.github.kt3k.coveralls' version '2.6.3'
3123
}
3224

3325
allprojects {
@@ -36,6 +28,9 @@ allprojects {
3628

3729
group 'de.qaware.chronix'
3830

31+
version = "0.3"
32+
33+
3934
repositories {
4035
jcenter()
4136
mavenCentral()
@@ -45,7 +40,7 @@ allprojects {
4540
}
4641

4742
jacoco {
48-
toolVersion = '0.7.2.201409121644'
43+
toolVersion = '0.7.6.201602180812'
4944
}
5045
}
5146

@@ -54,11 +49,9 @@ subprojects {
5449
apply plugin: 'groovy'
5550
apply plugin: 'java'
5651
apply plugin: 'maven-publish'
57-
apply plugin: 'com.gradle.plugin-publish'
5852
apply plugin: 'com.jfrog.bintray'
5953
apply plugin: 'com.github.hierynomus.license'
6054

61-
version = "0.2-beta-1"
6255

6356
license {
6457
includes(["**/*.java", "**/*.groovy"])
@@ -151,6 +144,6 @@ tasks.coveralls {
151144
}
152145

153146
task wrapper(type: Wrapper) {
154-
gradleVersion = '2.10'
147+
gradleVersion = '3.1'
155148
}
156149

chronix-importer/LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (C) 2015 QAware GmbH
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

chronix-importer/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ dependencies {
33
compile 'commons-io:commons-io:2.5'
44

55
compile 'de.qaware.chronix:chronix-api:0.1'
6-
compile 'de.qaware.chronix:chronix-server-client:0.2-beta-1'
7-
compile 'de.qaware.chronix:chronix-kassiopeia-simple:0.1.8-beta-4'
8-
compile 'de.qaware.chronix:chronix-kassiopeia-simple-converter:0.1.8-beta-4'
6+
compile 'de.qaware.chronix:chronix-server-client:0.3'
7+
compile 'de.qaware.chronix:chronix-timeseries:0.3'
8+
compile 'de.qaware.chronix:chronix-timeseries-converter:0.3'
99
}

chronix-importer/src/main/java/de/qaware/chronix/importer/DatabaseImporter.java

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1+
/*
2+
* Copyright (C) 2015 QAware GmbH
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package de.qaware.chronix.importer;
217

318
import de.qaware.chronix.ChronixClient;
4-
import de.qaware.chronix.converter.KassiopeiaSimpleConverter;
5-
import de.qaware.chronix.converter.serializer.gen.SimpleProtocolBuffers;
19+
import de.qaware.chronix.converter.MetricTimeSeriesConverter;
20+
import de.qaware.chronix.converter.serializer.gen.MetricProtocolBuffers;
621
import de.qaware.chronix.solr.client.ChronixSolrStorage;
722
import de.qaware.chronix.timeseries.MetricTimeSeries;
23+
import de.qaware.chronix.timeseries.dts.Point;
824
import org.apache.solr.client.solrj.SolrClient;
925
import org.apache.solr.client.solrj.SolrQuery;
1026
import org.apache.solr.client.solrj.impl.HttpSolrClient;
@@ -22,20 +38,17 @@
2238
*/
2339
public class DatabaseImporter {
2440

41+
public static final String DATABASE_SERVER_IP = "localhost";
42+
//Solr connection stuff
43+
public static final String SOLR_BASE_URL = "http://" + DATABASE_SERVER_IP + ":8983/solr/";
44+
public static final SolrClient CHRONIX_SOLR_CLIENT = new HttpSolrClient.Builder(SOLR_BASE_URL + "chronix").build();
2545
//serialized size of the list
2646
private static final int LIST_SERIALIZED_SIZE = 2;
2747
//serialized size of a point
28-
private static final int POINT_SERIALIZED_SIZE = SimpleProtocolBuffers.Point.newBuilder().setT(Instant.now().toEpochMilli()).setV(4711).build().getSerializedSize();
29-
48+
private static final int POINT_SERIALIZED_SIZE = MetricProtocolBuffers.Point.newBuilder().setTlong(Instant.now().toEpochMilli()).setV(4711).build().getSerializedSize();
3049
private static final int SER_SIZE = LIST_SERIALIZED_SIZE + POINT_SERIALIZED_SIZE;
31-
3250
private static final Logger LOGGER = LoggerFactory.getLogger(DatabaseImporter.class);
33-
34-
public static ChronixClient<MetricTimeSeries, SolrClient, SolrQuery> CHRONIX = new ChronixClient<>(new KassiopeiaSimpleConverter(), new ChronixSolrStorage<>(200, null, null));
35-
public static final String DATABASE_SERVER_IP = "localhost";
36-
//Solr connection stuff
37-
public static final String SOLR_BASE_URL = "http://" + DATABASE_SERVER_IP + ":8983/solr/";
38-
public static final SolrClient CHRONIX_SOLR_CLIENT = new HttpSolrClient(SOLR_BASE_URL + "chronix");
51+
public static ChronixClient<MetricTimeSeries, SolrClient, SolrQuery> CHRONIX = new ChronixClient<>(new MetricTimeSeriesConverter(), new ChronixSolrStorage<>(200, null, null));
3952

4053

4154
private DatabaseImporter() {
@@ -61,7 +74,7 @@ public static BiConsumer<List<ImportPoint>, Metadata> importToChronix() {
6174

6275
MetricTimeSeries timeSeries = builder.build();
6376
timeSeries.sort();
64-
List<de.qaware.chronix.timeseries.dt.Point> points = timeSeries.points().collect(Collectors.toList());
77+
List<Point> points = timeSeries.points().collect(Collectors.toList());
6578

6679
final int chunkSize = 128 * 1024;
6780

@@ -80,7 +93,7 @@ public static BiConsumer<List<ImportPoint>, Metadata> importToChronix() {
8093
end = timeSeries.size();
8194
}
8295

83-
List<de.qaware.chronix.timeseries.dt.Point> sublist = points.subList(start, end);
96+
List<Point> sublist = points.subList(start, end);
8497
start += numberOfPoints;
8598

8699
MetricTimeSeries.Builder toAddTs = new MetricTimeSeries.Builder(metadata.getMetric())

chronix-importer/src/main/java/de/qaware/chronix/importer/FileImporter.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright (C) 2015 QAware GmbH
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package de.qaware.chronix.importer;
217

318
import org.apache.commons.io.FileUtils;

chronix-importer/src/main/java/de/qaware/chronix/importer/ImportPoint.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright (C) 2015 QAware GmbH
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package de.qaware.chronix.importer;
217

318
import java.time.Instant;

chronix-importer/src/main/java/de/qaware/chronix/importer/Metadata.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright (C) 2015 QAware GmbH
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package de.qaware.chronix.importer;
217

318
/**

chronix-importer/src/main/java/de/qaware/chronix/importer/Pair.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright (C) 2015 QAware GmbH
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package de.qaware.chronix.importer;
217

318
import org.apache.commons.lang3.builder.EqualsBuilder;
@@ -12,15 +27,15 @@ public final class Pair<T, R> {
1227
private final T first;
1328
private final R second;
1429

15-
public static <T, R> Pair<T, R> of(T first, R second) {
16-
return new Pair<>(first, second);
17-
}
18-
1930
private Pair(T first, R second) {
2031
this.first = first;
2132
this.second = second;
2233
}
2334

35+
public static <T, R> Pair<T, R> of(T first, R second) {
36+
return new Pair<>(first, second);
37+
}
38+
2439
public T getFirst() {
2540
return first;
2641
}

chronix-server-integration/build.gradle

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,12 @@ dependencies {
3131

3232
//Chronix
3333
compile 'de.qaware.chronix:chronix-api:0.1'
34-
compile 'de.qaware.chronix:chronix-server-client:0.1.3'
34+
compile 'de.qaware.chronix:chronix-server-client:0.3'
3535

36-
//Kassiopeia-Simple
37-
compile 'de.qaware.chronix:chronix-kassiopeia-simple:0.1.7'
38-
compile 'de.qaware.chronix:chronix-kassiopeia-simple-converter:0.1.7'
39-
40-
//Kassiopeia
41-
compile 'de.qaware.chronix:chronix-kassiopeia:0.1.7'
42-
compile 'de.qaware.chronix:chronix-kassiopeia-converter:0.1.7'
36+
compile 'de.qaware.chronix:chronix-timeseries:0.3'
37+
compile 'de.qaware.chronix:chronix-timeseries-converter:0.3'
4338

4439
//Solr
45-
compile 'org.apache.solr:solr-solrj:5.5.0'
40+
compile 'org.apache.solr:solr-solrj:6.2.1'
4641

4742
}
Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
package de.qaware.chronix.examples.server;
1717

1818
import de.qaware.chronix.ChronixClient;
19-
import de.qaware.chronix.converter.KassiopeiaSimpleConverter;
19+
import de.qaware.chronix.converter.MetricTimeSeriesConverter;
2020
import de.qaware.chronix.solr.client.ChronixSolrStorage;
2121
import de.qaware.chronix.timeseries.MetricTimeSeries;
22-
import de.qaware.chronix.timeseries.dt.DoubleList;
23-
import de.qaware.chronix.timeseries.dt.LongList;
2422
import org.apache.solr.client.solrj.SolrClient;
2523
import org.apache.solr.client.solrj.SolrQuery;
2624
import org.apache.solr.client.solrj.impl.HttpSolrClient;
@@ -39,13 +37,13 @@
3937
*
4038
* @author f.lautenschlager
4139
*/
42-
public class ChronixClientExampleWithKassiopeiaSimple {
40+
public class ChronixClientExampleMetricTimeSeries {
4341

44-
private static final Logger LOGGER = LoggerFactory.getLogger(ChronixClientExampleWithKassiopeiaSimple.class);
42+
private static final Logger LOGGER = LoggerFactory.getLogger(ChronixClientExampleMetricTimeSeries.class);
4543

4644

4745
public static void main(String[] args) {
48-
SolrClient solr = new HttpSolrClient("http://localhost:8983/solr/chronix/");
46+
SolrClient solr = new HttpSolrClient.Builder("http://localhost:8983/solr/chronix/").build();
4947

5048
//Define a group by function for the time series records
5149
Function<MetricTimeSeries, String> groupBy = ts -> ts.getMetric() + "-" + ts.attribute("host");
@@ -60,11 +58,11 @@ public static void main(String[] args) {
6058
};
6159
//Instantiate a Chronix Client
6260
ChronixClient<MetricTimeSeries, SolrClient, SolrQuery> chronix = new ChronixClient<>(
63-
new KassiopeiaSimpleConverter(), new ChronixSolrStorage<>(200, groupBy, reduce));
61+
new MetricTimeSeriesConverter(), new ChronixSolrStorage<>(200, groupBy, reduce));
6462

6563
//We want the maximum of all time series that metric matches *load*.
6664
SolrQuery query = new SolrQuery("metric:*Load*");
67-
query.addFilterQuery("ag=max");
65+
query.addFilterQuery("function=max");
6866

6967
//The result is a Java Stream. We simply collect the result into a list.
7068
List<MetricTimeSeries> maxTS = chronix.stream(solr, query).collect(Collectors.toList());
@@ -86,15 +84,4 @@ private static String prettyPrint(List<MetricTimeSeries> maxTS) {
8684
}
8785
return sb.toString();
8886
}
89-
90-
private static LongList concat(LongList first, LongList second) {
91-
first.addAll(second);
92-
return first;
93-
}
94-
95-
private static DoubleList concat(DoubleList first, DoubleList second) {
96-
first.addAll(second);
97-
return first;
98-
}
99-
10087
}

0 commit comments

Comments
 (0)