Skip to content

Commit 98e22a7

Browse files
committed
'Version 1.3.0 of the AWS CloudTrail Processing Library'
1 parent b37099c commit 98e22a7

File tree

94 files changed

+441
-139
lines changed

Some content is hidden

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

94 files changed

+441
-139
lines changed

META-INF/MANIFEST.MF

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: AWS CloudTrail Processing Library for Java
44
Bundle-SymbolicName: com.amazonaws.awscloudtrailprocessinglibrary;singleton:=true
5-
Bundle-Version: 1.2.0
5+
Bundle-Version: 1.3.0
66
Bundle-Vendor: Amazon Technologies, Inc
7-
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
8-
Require-Bundle: com.amazonaws.sdk;bundle-version="1.11.135"
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
8+
Require-Bundle: com.amazonaws.sdk;bundle-version="1.11.830"
99
Export-Package: com.amazonaws.services.cloudtrail,
1010
com.amazonaws.services.cloudtrail.processinglibrary,
1111
com.amazonaws.services.cloudtrail.processinglibrary.configuration,

NOTICE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
AWS CloudTrail Processing Library
2-
Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.

README.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Minimum Requirements
3333
~~~~~~~~~~~~~~~~~~~~
3434

3535
* **AWS Java SDK 1.10.27**: In order to use the |library|, you'll need the `AWS Java SDK`__.
36-
* **Java 1.7**: The |library| requires `Java 1.7 (Java SE 7)`__ or later.
36+
* **Java 1.8**: The |library| requires `Java 1.8 (Java SE 8)`__ or later.
3737

3838
.. __: https://github.com/aws/aws-sdk-java
3939
.. __: http://www.oracle.com/technetwork/java/javase/overview/index.html
@@ -65,6 +65,13 @@ build, use this command::
6565
Release Notes
6666
-------------
6767

68+
Release 1.3.0 (Jul 30, 2020)
69+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70+
* Added support for parsing new section, attributions, in insightContext.
71+
* Added support for parsing new fields, baselineDuration, in statistics section in insightContext.
72+
* Added thread configuration for s3 client, sqs client, and sqs reader to enable performance tuning.
73+
* Updated minimum required Java SE version to 1.8.
74+
6875
Release 1.2.0 (Nov 20, 2019)
6976
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7077
* Added support for a new eventCategory attribute to indicate whether an event is a management, data, or Insights event.

build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ bin.includes = LICENSE.txt,\
77
META-INF/,\
88
.
99

10-
jre.compilation.profile = JavaSE-1.7
10+
jre.compilation.profile = JavaSE-1.8

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>aws-cloudtrail-processing-library</artifactId>
66
<packaging>jar</packaging>
77
<name>AWS CloudTrail Processing Library for Java</name>
8-
<version>1.2.0</version>
8+
<version>1.3.0</version>
99
<description>AWS CloudTrail Processing Library for Java helps Java
1010
developers to easily consume and process log files from AWS
1111
CloudTrail.
@@ -26,7 +26,7 @@
2626
</licenses>
2727

2828
<properties>
29-
<aws-java-sdk.version>1.11.670</aws-java-sdk.version>
29+
<aws-java-sdk.version>1.11.830</aws-java-sdk.version>
3030
</properties>
3131

3232
<dependencies>

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/AWSCloudTrailProcessingExecutor.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -397,6 +397,7 @@ private void buildS3Client() {
397397
ClientConfiguration clientConfiguration = new ClientConfiguration();
398398
clientConfiguration.setConnectionTimeout(SDK_TIME_OUT);
399399
clientConfiguration.setSocketTimeout(SDK_TIME_OUT);
400+
clientConfiguration.setMaxConnections(Math.max(clientConfiguration.DEFAULT_MAX_CONNECTIONS, config.getThreadCount()));
400401

401402
if (s3Client == null) {
402403
s3Client = AmazonS3ClientBuilder.standard()
@@ -408,8 +409,11 @@ private void buildS3Client() {
408409
}
409410
private void buildSqsClient() {
410411
if (sqsClient == null) {
412+
ClientConfiguration clientConfiguration = new ClientConfiguration();
413+
clientConfiguration.setMaxConnections(Math.max(clientConfiguration.DEFAULT_MAX_CONNECTIONS, config.getThreadCount()));
411414
sqsClient = AmazonSQSClientBuilder.standard()
412415
.withCredentials(config.getAwsCredentialsProvider())
416+
.withClientConfiguration(clientConfiguration)
413417
.withRegion(config.getSqsRegion())
414418
.build();
415419
}
@@ -431,7 +435,7 @@ private void buildReaderFactory() {
431435

432436
private void buildThreadPools() {
433437
ThreadPoolFactory threadFactory = new ThreadPoolFactory(config.getThreadCount(), exceptionHandler);
434-
scheduledThreadPool = threadFactory.createScheduledThreadPool();
438+
scheduledThreadPool = threadFactory.createScheduledThreadPool(config.getNumOfParallelReaders());
435439

436440
if (mainThreadPool == null) {
437441
mainThreadPool = threadFactory.createMainThreadPool();

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/ClientConfiguration.java

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -81,6 +81,11 @@ public class ClientConfiguration implements ProcessingConfiguration{
8181
*/
8282
public int threadCount = DEFAULT_THREAD_COUNT;
8383

84+
/**
85+
* The number of SQS reader threads
86+
*/
87+
public int numOfParallelReaders = DEFAULT_NUM_OF_PARALLEL_READERS;
88+
8489
/**
8590
* The time allowed, in seconds, for threads to shut down after {@link AWSCloudTrailProcessingExecutor#stop()} is
8691
* called.
@@ -171,6 +176,14 @@ public int getThreadCount() {
171176
return threadCount;
172177
}
173178

179+
/**
180+
* {@inheritDoc}
181+
*/
182+
@Override
183+
public int getNumOfParallelReaders(){
184+
return numOfParallelReaders;
185+
}
186+
174187
/**
175188
* {@inheritDoc}
176189
*/
@@ -277,6 +290,14 @@ public void setThreadCount(int threadCount) {
277290
this.threadCount = threadCount;
278291
}
279292

293+
/**
294+
* The number of reader threads that pull messages from the SQS
295+
* @param numOfParallelReaders
296+
*/
297+
public void setNumOfParallelReaders(int numOfParallelReaders){
298+
this.numOfParallelReaders = numOfParallelReaders;
299+
}
300+
280301
/**
281302
* Set the time allowed, in seconds, for threads to shut down after
282303
* {@link AWSCloudTrailProcessingExecutor#stop()} is called.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/ProcessingConfiguration.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -53,6 +53,12 @@ public interface ProcessingConfiguration {
5353
*/
5454
public static final int DEFAULT_THREAD_COUNT = 1;
5555

56+
57+
/**
58+
* The default SQS reader thread count
59+
*/
60+
public static final int DEFAULT_NUM_OF_PARALLEL_READERS = 1;
61+
5662
/**
5763
* The default thread termination delay, in seconds; {@value}.
5864
*/
@@ -121,6 +127,12 @@ public interface ProcessingConfiguration {
121127
*/
122128
public int getThreadCount();
123129

130+
/**
131+
* Get a number of reader threads
132+
* @return
133+
*/
134+
public int getNumOfParallelReaders();
135+
124136
/**
125137
* Get the thread termination delay value.
126138
*

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/PropertiesFileConfiguration.java

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -45,6 +45,7 @@ public class PropertiesFileConfiguration implements ProcessingConfiguration{
4545
public static final String VISIBILITY_TIMEOUT = "visibilityTimeout";
4646
public static final String S3_REGION = "s3Region";
4747
public static final String THREAD_COUNT = "threadCount";
48+
public static final String NUM_OF_PARALLEL_READERS = "numOfParallelReaders";
4849
public static final String THREAD_TERMINATION_DELAY_SECONDS = "threadTerminationDelaySeconds";
4950
public static final String MAX_EVENTS_PER_EMIT = "maxEventsPerEmit";
5051
public static final String ENABLE_RAW_EVENT_INFO = "enableRawEventInfo";
@@ -98,6 +99,12 @@ public class PropertiesFileConfiguration implements ProcessingConfiguration{
9899
*/
99100
private int threadCount = DEFAULT_THREAD_COUNT;
100101

102+
103+
/**
104+
* The number of threads used to get SQS messages
105+
*/
106+
private int numOfParallelReaders = DEFAULT_NUM_OF_PARALLEL_READERS;
107+
101108
/**
102109
* The time allowed, in seconds, for threads to shut down after {@link AWSCloudTrailProcessingExecutor#stop()} is
103110
* called.
@@ -147,6 +154,7 @@ public PropertiesFileConfiguration(String propertiesFile) {
147154
sqsRegion = prop.getProperty(SQS_REGION);
148155

149156
threadCount = getIntProperty(prop, THREAD_COUNT);
157+
numOfParallelReaders = getIntProperty(prop, NUM_OF_PARALLEL_READERS);
150158
threadTerminationDelaySeconds = getIntProperty(prop, THREAD_TERMINATION_DELAY_SECONDS);
151159

152160
maxEventsPerEmit = getIntProperty(prop, MAX_EVENTS_PER_EMIT);
@@ -203,6 +211,13 @@ public int getThreadCount() {
203211
return threadCount;
204212
}
205213

214+
/**
215+
* {@inheritDoc}
216+
*/
217+
public int getNumOfParallelReaders(){
218+
return numOfParallelReaders;
219+
}
220+
206221
/**
207222
* {@inheritDoc}
208223
*/
@@ -246,7 +261,8 @@ public void validate() {
246261
LibraryUtils.checkArgumentNotNull(getS3Region(), "S3 Region is null.");
247262

248263
LibraryUtils.checkCondition(getMaxEventsPerEmit() <= 0, "Maximum Events Per Emit is a non-positive integer.");
249-
LibraryUtils.checkCondition(getThreadCount() <= 0, "Thread Count is a non-positive integer.");
264+
LibraryUtils.checkCondition(getThreadCount() <= 0, "Num of Parallel Readers Count is a non-positive integer.");
265+
LibraryUtils.checkCondition(getNumOfParallelReaders() <= 0, "Thread Count is a non-positive integer.");
250266
LibraryUtils.checkCondition(getThreadTerminationDelaySeconds() <= 0, "Thread Termination Delay Seconds is a non-positive integer.");
251267
LibraryUtils.checkCondition(getVisibilityTimeout() <= 0, "Visibility Timeout is a non-positive integer.");
252268
}

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/package-info.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/exceptions/CallbackException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/exceptions/ProcessingLibraryException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/exceptions/package-info.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -16,4 +16,4 @@
1616
/**
1717
* Exceptions that used in AWS CloudTrail Processing Library
1818
*/
19-
package com.amazonaws.services.cloudtrail.processinglibrary.exceptions;
19+
package com.amazonaws.services.cloudtrail.processinglibrary.exceptions;

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/factory/EventReaderFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/factory/SourceSerializerFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/factory/ThreadPoolFactory.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -64,8 +64,8 @@ public ThreadPoolFactory(int threadCount, ExceptionHandler exceptionHandler) {
6464
*
6565
* @return ScheduledExecutorService continuous poll messages from SQS queue.
6666
*/
67-
public ScheduledExecutorService createScheduledThreadPool() {
68-
return Executors.newScheduledThreadPool(1);
67+
public ScheduledExecutorService createScheduledThreadPool(int numOfParallelReaders) {
68+
return Executors.newScheduledThreadPool(numOfParallelReaders);
6969
}
7070

7171
/**

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/factory/package-info.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -16,4 +16,4 @@
1616
/**
1717
* Factories used to construct objects.
1818
*/
19-
package com.amazonaws.services.cloudtrail.processinglibrary.factory;
19+
package com.amazonaws.services.cloudtrail.processinglibrary.factory;

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/impl/DefaultEventFilter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/impl/DefaultEventsProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/impl/DefaultExceptionHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/impl/DefaultProgressReporter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/impl/DefaultSourceFilter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/impl/package-info.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -16,4 +16,4 @@
1616
/**
1717
* Default implementation of call back interfaces.
1818
*/
19-
package com.amazonaws.services.cloudtrail.processinglibrary.impl;
19+
package com.amazonaws.services.cloudtrail.processinglibrary.impl;

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/interfaces/EventFilter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/interfaces/EventsProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/interfaces/ExceptionHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)