Skip to content

Commit 9f177c0

Browse files
committed
#1 - Added the parameters to the readme.
1 parent 63fa617 commit 9f177c0

File tree

5 files changed

+33
-29
lines changed

5 files changed

+33
-29
lines changed

README.adoc

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ java -jar url-collector-master-application-{release-number}.jar --example.parame
7676
| If present and not empty, it overrides the host and port parameter. Let the user inject a https://docs.mongodb.com/manual/reference/connection-string/[MongoDB Connection String] directly. Should be used to define the credentials and other custom connection parameters. *(Default value: "")*
7777

7878
| server.port
79-
| The port where the master server should listen on.
79+
| The port where the master server should listen on. *(Default value: 8080)*
8080
|===
8181

8282
=== Running the Slave Application
@@ -106,34 +106,34 @@ java -jar url-collector-slave-application-{release-number}.jar --example.paramet
106106
| Parameter | Description
107107

108108
| execution.parallelism-target
109-
| Title
109+
| How many work units should be processed at the same time. *(Default value: the number of processor cores multiplied by two)*
110110

111111
| warehouse.type
112-
| Text
112+
| The type of the warehouse. Can be either 'local' or 'aws'.
113113

114114
| warehouse.local.target-directory
115-
| Text
115+
| The target directory where the crawled URLs should be saved. Only used if the _warehouse.type_ is _'local'_.
116116

117117
| warehouse.aws.region
118-
| Text
118+
| The https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingBucket.html[region] of the S3 bucket where the crawled URLs should be uploaded. Only used if the _warehouse.type_ is _'aws'_.
119119

120120
| warehouse.aws.bucket-name
121-
| Text
121+
| The https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingBucket.html[name] of the S3 bucket where the crawled URLs should be uploaded. Only used if the _warehouse.type_ is _'aws'_.
122122

123123
| warehouse.aws.access-key
124-
| Text
124+
| The https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html[access key] for the user that has access to the S3 bucket where the crawled URLs should be uploaded. Only used if the _warehouse.type_ is _'aws'_.
125125

126126
| warehouse.aws.secret-key
127-
| Text
127+
| The https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html[secret key] for the user that has access to the S3 bucket where the crawled URLs should be uploaded. Only used if the _warehouse.type_ is _'aws'_.
128128

129129
| validation.types
130-
| Text
130+
| The list of file executions that we need to save the URLs for.
131131

132132
| master.host
133-
| Text
133+
| The host location of the Master Application. *(Default value: localhost)*
134134

135135
| master.port
136-
| Text
136+
| The port location of the Master Application. *(Default value: 8080)*
137137
|===
138138

139139
=== Starting a crawl
@@ -178,32 +178,32 @@ java -jar url-collector-merger-application-{release-number}.jar --example.parame
178178
| Parameter | Description
179179

180180
| database.host
181-
| Title
181+
| The host location of the MongoDB database server. *(Default value: localhost)*
182182

183183
| database.port
184-
| Text
184+
| The port open for the MongoDB database server. *(Default value: 27017)*
185185

186186
| database.uri
187-
| Text
187+
| If present and not empty, it overrides the host and port parameter. Let the user inject a https://docs.mongodb.com/manual/reference/connection-string/[MongoDB Connection String] directly. Should be used to define the credentials and other custom connection parameters. *(Default value: "")*
188188

189189
| warehouse.type
190-
| Text
190+
| The type of the warehouse. Can be either 'local' or 'aws'.
191191

192192
| warehouse.local.target-directory
193-
| Text
193+
| The target directory where the crawled URLs should be saved. Only used if the _warehouse.type_ is _'local'_.
194194

195195
| warehouse.aws.region
196-
| Text
196+
| The https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingBucket.html[region] of the S3 bucket where the crawled URLs should be uploaded. Only used if the _warehouse.type_ is _'aws'_.
197197

198198
| warehouse.aws.bucket-name
199-
| Text
199+
| The https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingBucket.html[name] of the S3 bucket where the crawled URLs should be uploaded. Only used if the _warehouse.type_ is _'aws'_.
200200

201201
| warehouse.aws.access-key
202-
| Text
202+
| The https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html[access key] for the user that has access to the S3 bucket where the crawled URLs should be uploaded. Only used if the _warehouse.type_ is _'aws'_.
203203

204204
| warehouse.aws.secret-key
205-
| Text
205+
| The https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html[secret key] for the user that has access to the S3 bucket where the crawled URLs should be uploaded. Only used if the _warehouse.type_ is _'aws'_.
206206

207207
| result.path
208-
| Text
208+
| The location where the result of the merge should be saved at. It should be a directory. The result file will be saved there with the filename of 'result.ubds'.
209209
|===

build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import org.springframework.boot.gradle.plugin.SpringBootPlugin
22

33
buildscript {
4-
ext {
5-
springBootVersion = '2.5.4'
6-
}
74
repositories {
85
mavenCentral()
96
maven {
107
url "https://plugins.gradle.org/m2/"
118
}
129
}
1310
dependencies {
14-
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
11+
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.5.4")
1512
}
1613
}
1714

Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
package com.github.bottomlessarchive.urlcollector.command.configuration;
22

33
import lombok.Data;
4+
import lombok.extern.slf4j.Slf4j;
45
import org.springframework.boot.context.properties.ConfigurationProperties;
56
import org.springframework.stereotype.Component;
67

78
@Data
9+
@Slf4j
810
@Component
911
@ConfigurationProperties("execution")
1012
public class ExecutionConfigurationProperties {
1113

1214
private int parallelismTarget = 0;
1315

1416
public int getParallelismTarget() {
15-
if (parallelismTarget == 0) {
16-
return Runtime.getRuntime().availableProcessors() * 2;
17+
int finalTarget = parallelismTarget;
18+
19+
if (finalTarget == 0) {
20+
finalTarget = Runtime.getRuntime().availableProcessors() * 2;
1721
}
1822

19-
return parallelismTarget;
23+
log.info("Initializing the application with parallelism target of {}.", finalTarget);
24+
25+
return finalTarget;
2026
}
2127
}

url-collector-library/url-collector-warehouse-aws/src/main/java/com/github/bottomlessarchive/urlcollector/uploader/service/amazon/configuration/AmazonConfigurationProperties.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
@Data
88
@ConfigurationProperties("warehouse.aws")
9-
@ConditionalOnProperty(name = "warehouse.type", havingValue = "aws")
109
public class AmazonConfigurationProperties {
1110

1211
private String region;

url-collector-library/url-collector-warehouse-aws/src/main/java/com/github/bottomlessarchive/urlcollector/uploader/service/amazon/configuration/AmazonURLBatchWarehouseConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
import com.github.bottomlessarchive.urlcollector.uploader.service.URLBatchWarehouse;
1010
import com.github.bottomlessarchive.urlcollector.uploader.service.amazon.AmazonURLBatchWarehouse;
1111
import lombok.RequiredArgsConstructor;
12+
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
1213
import org.springframework.context.annotation.Bean;
1314
import org.springframework.context.annotation.Configuration;
1415

1516
@Configuration
1617
@RequiredArgsConstructor
18+
@ConditionalOnProperty(name = "warehouse.type", havingValue = "aws")
1719
public class AmazonURLBatchWarehouseConfiguration {
1820

1921
private final AmazonConfigurationProperties awsS3ConfigurationProperties;

0 commit comments

Comments
 (0)