Skip to content

Commit

Permalink
Upgrade jackson-databind version
Browse files Browse the repository at this point in the history
  • Loading branch information
chaochenq committed Oct 17, 2018
1 parent c29662e commit cfe4483
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 182 deletions.
1 change: 0 additions & 1 deletion bin/aws-kinesis-agent.Debian
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ LOG_CONFIG=${LOG_CONFIG:-/etc/aws-kinesis/log4j.xml}
ARGS=${ARGS:-}
RETVAL=0


# load any configs/environment from /etc/default/<name>
[ -e /etc/default/$DAEMON_NAME ] && . /etc/default/$DAEMON_NAME

Expand Down
1 change: 0 additions & 1 deletion bin/aws-kinesis-agent.Ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ LOG_CONFIG=${LOG_CONFIG:-/etc/aws-kinesis/log4j.xml}
ARGS=${ARGS:-}
RETVAL=0


# load any configs/environment from /etc/default/<name>
[ -e /etc/default/$DAEMON_NAME ] && . /etc/default/$DAEMON_NAME

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.3</version>
<version>2.9.6</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand Down
6 changes: 3 additions & 3 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ download_dependencies() {
com.amazonaws:aws-java-sdk-ec2:${aws_java_sdk_version} \
com.fasterxml.jackson.core:jackson-annotations:2.6.3 \
com.fasterxml.jackson.core:jackson-core:2.6.3 \
com.fasterxml.jackson.core:jackson-databind:2.6.3 \
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.3 \
com.fasterxml.jackson.core:jackson-databind:2.9.6 \
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.9.6 \
com.google.code.findbugs:jsr305:3.0.1 \
com.google.guava:guava:18.0 \
org.apache.httpcomponents:httpclient:4.5.1 \
Expand Down Expand Up @@ -201,7 +201,7 @@ do_install () {
install -m644 ./support/${daemon_name}.cron ${cron_dir}/${daemon_name}
install -m644 ./support/${daemon_name}.sysconfig ${sysconfig_dir}/${daemon_name}
install -m644 ./support/log4j.xml ${config_dir}

# add a user for starting the agent
id -u $agent_user_name > /dev/null 2>&1 || \
useradd -c "Streaming Data Agent" -r $agent_user_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@

import lombok.Getter;

import org.apache.commons.lang3.ArrayUtils;

import com.beust.jcommander.IParameterValidator;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
import com.beust.jcommander.Parameters;
import com.google.common.base.Joiner;
import com.google.common.collect.Range;

@Parameters(separators = "=")
Expand Down Expand Up @@ -96,5 +93,6 @@ public void validate(String name, String value)
}

}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.LinkedHashMap;
import java.util.TimeZone;
import java.util.Date;
import java.util.LinkedHashMap;

import com.amazon.kinesis.streaming.agent.ByteBuffers;
import com.amazon.kinesis.streaming.agent.config.Configuration;
Expand Down Expand Up @@ -70,7 +70,7 @@ public ByteBuffer convert(ByteBuffer data) throws DataConversionException {
if (dataStr.endsWith(NEW_LINE)) {
dataStr = dataStr.substring(0, (dataStr.length() - NEW_LINE.length()));
}

if (timestamp.booleanValue()) {
TimeZone tz = TimeZone.getTimeZone("UTC");
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
Expand All @@ -89,4 +89,4 @@ public ByteBuffer convert(ByteBuffer data) throws DataConversionException {
public String toString() {
return getClass().getSimpleName();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
import java.util.List;
import java.util.Map;

import org.slf4j.LoggerFactory;

import com.amazon.kinesis.streaming.agent.ByteBuffers;
import com.amazon.kinesis.streaming.agent.config.Configuration;
import com.amazon.kinesis.streaming.agent.processing.exceptions.DataConversionException;
import com.amazon.kinesis.streaming.agent.processing.interfaces.IDataConverter;
import com.amazon.kinesis.streaming.agent.processing.interfaces.IJSONPrinter;
import com.amazon.kinesis.streaming.agent.processing.utils.ProcessingUtilsFactory;
import org.slf4j.LoggerFactory;

/**
* Convert a CSV record into JSON record.
Expand Down Expand Up @@ -74,7 +75,7 @@ public ByteBuffer convert(ByteBuffer data) throws DataConversionException {
try {
recordMap.put(fieldNames.get(i), columns[i]);
} catch (ArrayIndexOutOfBoundsException e) {
LoggerFactory.getLogger(getClass()).debug("Null field in CSV detected");
LoggerFactory.getLogger(getClass()).debug("Null field in CSV detected");
recordMap.put(fieldNames.get(i), null);
} catch (Exception e) {
throw new DataConversionException("Unable to create the column map", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import java.util.List;
import java.util.Map;

import org.slf4j.LoggerFactory;

import com.amazon.kinesis.streaming.agent.ByteBuffers;
import com.amazon.kinesis.streaming.agent.config.Configuration;
import com.amazon.kinesis.streaming.agent.processing.exceptions.DataConversionException;
Expand All @@ -26,7 +28,6 @@
import com.amazon.kinesis.streaming.agent.processing.interfaces.IJSONPrinter;
import com.amazon.kinesis.streaming.agent.processing.interfaces.ILogParser;
import com.amazon.kinesis.streaming.agent.processing.utils.ProcessingUtilsFactory;
import org.slf4j.LoggerFactory;

/**
* Parse the log entries from log file, and convert the log entries into JSON.
Expand Down Expand Up @@ -72,7 +73,7 @@ public ByteBuffer convert(ByteBuffer data) throws DataConversionException {
} catch (LogParsingException e) {
// ignore the record if a LogParsingException is thrown
// the record is filtered out in this case
LoggerFactory.getLogger(getClass()).debug("Getting exception while parsing record: [" + dataStr
LoggerFactory.getLogger(getClass()).debug("Getting exception while parsing record: [" + dataStr
+ "], record will be skipped", e);
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ public ByteBuffer convert(ByteBuffer data) throws DataConversionException {
return plugginConverter.convert(data);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static enum DataConversionOption {
CSVTOJSON,
LOGTOJSON,
ADDBRACKETS,
USINGPLUGGIN,
USINGPLUGGIN
}

public static enum LogFormat {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ private void getNewCurrentBuffer() {

private R buildRecord(int offset, int length) {
ByteBuffer data = ByteBuffers.getPartialView(currentBuffer, offset, length);

if (fileFooterPattern != null) {
final Matcher fileFooterMatcher = fileFooterPattern.matcher(ByteBuffers.toString(data, StandardCharsets.UTF_8).trim());
if(fileFooterMatcher.matches()) {
Expand Down
65 changes: 0 additions & 65 deletions support/log4j.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import java.util.concurrent.TimeUnit;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.util.concurrent.AbstractScheduledService;
import org.slf4j.LoggerFactory;

public class RotatingFileGenerator extends AbstractScheduledService {
private static final Logger LOGGER = LoggerFactory.getLogger(RotatingFileGenerator.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
Expand Down
95 changes: 0 additions & 95 deletions tst/com/amazon/kinesis/streaming/agent/testing/test.log4j.xml

This file was deleted.

0 comments on commit cfe4483

Please sign in to comment.