Skip to content

Commit

Permalink
fix bug about log info is too large
Browse files Browse the repository at this point in the history
  • Loading branch information
JThink committed Sep 8, 2017
1 parent c8a0ce2 commit f9e1b1e
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 31 deletions.
6 changes: 3 additions & 3 deletions skyeye-alarm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'application'

group = 'skyeye'
applicationName = 'skyeye-alarm'
version = '1.1.0'
version = '1.1.1'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -21,8 +21,8 @@ repositories {
}

ext {
baseVersion = '1.1.0'
dataVersion = '1.1.0'
baseVersion = '1.1.1'
dataVersion = '1.1.1'
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion skyeye-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'maven'
apply plugin: 'eclipse'

group = 'skyeye'
version = '1.1.0'
version = '1.1.1'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down
6 changes: 3 additions & 3 deletions skyeye-benchmark/dubbo-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ allprojects {
apply plugin: 'eclipse'

group = 'skyeye'
version = '1.1.0'
version = '1.1.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
Expand Down Expand Up @@ -37,8 +37,8 @@ subprojects {
ext {
slf4jVersion = '1.7.21'
dubboVersion = '2.8.4-skyeye-trace-1.1.0'
dataVersion = '1.1.0'
clientVersion = '1.1.0'
dataVersion = '1.1.1'
clientVersion = '1.1.1'
zookeeperVerison = '3.4.6'
zkClientVersion = '0.10'
}
Expand Down
4 changes: 2 additions & 2 deletions skyeye-benchmark/hi-log/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ allprojects {
apply plugin: 'eclipse'

group = 'skyeye'
version = '1.1.0'
version = '1.1.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
Expand Down Expand Up @@ -35,7 +35,7 @@ subprojects {
apply plugin: 'eclipse'

ext {
clientVersion = '1.1.0'
clientVersion = '1.1.1'
}

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
Expand Down
4 changes: 2 additions & 2 deletions skyeye-benchmark/log-generater/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'application'

group = 'skyeye'
applicationName = 'log-generater'
version = '1.1.0'
version = '1.1.1'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -21,7 +21,7 @@ repositories {
}

ext {
clientVersion = '1.1.0'
clientVersion = '1.1.1'
}

dependencies {
Expand Down
6 changes: 3 additions & 3 deletions skyeye-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ allprojects {
apply plugin: 'eclipse'

group = 'skyeye'
version = '1.1.0'
version = '1.1.1'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down Expand Up @@ -57,8 +57,8 @@ subprojects {
kafkaVersion = '0.10.0.1'
zookeeperVersion = '3.4.6'
zkclientVersion = '0.10'
baseVersion = '1.1.0'
traceVersion = '1.1.0'
baseVersion = '1.1.1'
traceVersion = '1.1.1'
}

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ protected void append(LoggingEvent event) {
* @param value
*/
private void send(String value) {
// 对value的大小进行判定,当大于某个值认为该日志太大直接丢弃(防止影响到kafka)
if (value.length() > 10000) {
return;
}
final byte[] key = ByteBuffer.allocate(4).putInt(new StringBuilder(app).append(host).toString().hashCode()).array();

final ProducerRecord<byte[], String> record = new ProducerRecord<>(this.topic, key, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public void append(LogEvent event) {
}
// 发送数据到kafka
String value = System.nanoTime() + Constants.SEMICOLON + new String(data);
// 对value的大小进行判定,当大于某个值认为该日志太大直接丢弃(防止影响到kafka)
if (value.length() > 10000) {
return;
}
final ProducerRecord<byte[], String> record = new ProducerRecord<>(this.manager.getTopic(), this.manager.getKey(), value);
LazySingletonProducer.getInstance(this.manager.getConfig()).send(record, new Callback() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ protected void append(E e) {
return;
}
final String value = System.nanoTime() + Constants.SEMICOLON + this.encoder.doEncode(e);
// 对value的大小进行判定,当大于某个值认为该日志太大直接丢弃(防止影响到kafka)
if (value.length() > 10000) {
return;
}
final byte[] key = this.keyBuilder.build(e);
final ProducerRecord<byte[], String> record = new ProducerRecord<byte[], String>(this.topic, key, value);
LazySingletonProducer.getInstance(this.config).send(record, new Callback() {
Expand Down
4 changes: 2 additions & 2 deletions skyeye-collector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ allprojects {
apply plugin: 'eclipse'

group = 'skyeye'
version = '1.1.0'
version = '1.1.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
Expand Down Expand Up @@ -37,7 +37,7 @@ subprojects {
apply plugin: 'eclipse'

ext {
baseVersion = '1.1.0'
baseVersion = '1.1.1'
kafkaVersion = '0.10.0.1'
springBootVersion = '1.5.6.RELEASE'
esVersion = '2.3.3'
Expand Down
2 changes: 1 addition & 1 deletion skyeye-collector/skyeye-collector-metrics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'org.springframework.boot'
apply plugin: 'application'

ext {
dataVersion = '1.1.0'
dataVersion = '1.1.1'
zkclientVersion = '0.10'
}

Expand Down
2 changes: 1 addition & 1 deletion skyeye-collector/skyeye-collector-trace/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'org.springframework.boot'
apply plugin: 'application'

ext {
dataVersion = '1.1.0'
dataVersion = '1.1.1'
fastJsonVersion = '1.2.35'
}

Expand Down
4 changes: 2 additions & 2 deletions skyeye-data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ allprojects {
apply plugin: 'eclipse'

group = 'skyeye'
version = '1.1.0'
version = '1.1.1'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down Expand Up @@ -55,7 +55,7 @@ subprojects {

ext {
slf4jVersion = '1.7.25'
baseVersion = '1.1.0'
baseVersion = '1.1.1'
}

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
Expand Down
6 changes: 3 additions & 3 deletions skyeye-monitor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'application'

group = 'skyeye'
applicationName = 'skyeye-monitor'
version = '1.1.0'
version = '1.1.1'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -23,8 +23,8 @@ repositories {
ext {
zookeeperVersion = '3.4.6'
curatorVersion = '2.11.0'
baseVersion = '1.1.0'
dataVersion = '1.1.0'
baseVersion = '1.1.1'
dataVersion = '1.1.1'
jacksonVersion = '1.9.13'
zkclientVersion = '0.10'
}
Expand Down
4 changes: 2 additions & 2 deletions skyeye-statistics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'application'

group = 'skyeye'
applicationName = 'skyeye-statistics'
version = '1.1.0'
version = '1.1.1'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -27,7 +27,7 @@ ext {
scalaVersion = '2.10.4'
scalaBinaryVersion = '2.10'
sparkVersion = '1.3.0-cdh5.4.0'
baseVersion = '1.1.0'
baseVersion = '1.1.1'
fastjsonVersion = '1.2.35'
zkClientVersion = '0.10'
}
Expand Down
6 changes: 3 additions & 3 deletions skyeye-trace/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'maven'
apply plugin: 'eclipse'

group = 'skyeye'
version = '1.1.0'
version = '1.1.1'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -14,8 +14,8 @@ ext {
mavenPublicUrl = 'http://192.168.88.8:8081/nexus/content/repositories/public'
mavenReleaseUrl = 'http://192.168.88.8:8081/nexus/content/repositories/releases'
mavenSnapshotUrl = "http://192.168.88.8:8081/nexus/content/repositories/snapshots"
baseVersion = '1.1.0'
dataVersion = '1.1.0'
baseVersion = '1.1.1'
dataVersion = '1.1.1'
slf4jVersion = '1.7.21'
fastJsonVersion = '1.2.35'
zookeeperVersion = '3.4.6'
Expand Down
6 changes: 3 additions & 3 deletions skyeye-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'application'

group = 'skyeye'
applicationName = 'skyeye-web'
version = '1.1.0'
version = '1.1.1'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -24,8 +24,8 @@ repositories {
}

ext {
baseVersion = '1.1.0'
dataVersion = '1.1.0'
baseVersion = '1.1.1'
dataVersion = '1.1.1'
jacksonVersion = '1.9.13'
httpclientVersion = '4.5.2'
fastjsonVersion = '1.2.35'
Expand Down

0 comments on commit f9e1b1e

Please sign in to comment.