Skip to content

Commit 5e559d7

Browse files
committed
Amazon: Wrap at 140 columns (#34495)
Applies our standard column wrapping to the `discovery-ec2` and `repository-s3` plugins.
1 parent b23d996 commit 5e559d7

File tree

9 files changed

+576
-277
lines changed

9 files changed

+576
-277
lines changed

buildSrc/src/main/resources/checkstyle_suppressions.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -709,17 +709,4 @@
709709
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]versioning[/\\]SimpleVersioningIT.java" checks="LineLength" />
710710
<suppress files="modules[/\\]lang-painless[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]painless[/\\]ContextExampleTests.java" checks="LineLength" />
711711
<suppress files="modules[/\\]reindex[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]reindex[/\\]TransportUpdateByQueryAction.java" checks="LineLength" />
712-
<suppress files="plugins[/\\]discovery-ec2[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]ec2[/\\]AbstractAwsTestCase.java" checks="LineLength" />
713-
<suppress files="plugins[/\\]discovery-ec2[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]ec2[/\\]AmazonEC2Mock.java" checks="LineLength" />
714-
<suppress files="plugins[/\\]discovery-gce[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]discovery[/\\]gce[/\\]GceNetworkTests.java" checks="LineLength" />
715-
<suppress files="plugins[/\\]mapper-murmur3[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]index[/\\]mapper[/\\]murmur3[/\\]Murmur3FieldMapper.java" checks="LineLength" />
716-
<suppress files="plugins[/\\]repository-azure[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]blobstore[/\\]AzureBlobContainer.java" checks="LineLength" />
717-
<suppress files="plugins[/\\]repository-azure[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]blobstore[/\\]AzureBlobStore.java" checks="LineLength" />
718-
<suppress files="plugins[/\\]repository-azure[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]storage[/\\]AzureStorageServiceImpl.java" checks="LineLength" />
719-
<suppress files="plugins[/\\]repository-azure[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]storage[/\\]AzureStorageSettings.java" checks="LineLength" />
720-
<suppress files="plugins[/\\]repository-azure[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cloud[/\\]azure[/\\]storage[/\\]AzureStorageServiceMock.java" checks="LineLength" />
721-
<suppress files="plugins[/\\]repository-hdfs[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]repositories[/\\]hdfs[/\\]HdfsRepository.java" checks="LineLength" />
722-
<suppress files="plugins[/\\]repository-hdfs[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]repositories[/\\]hdfs[/\\]HdfsTests.java" checks="LineLength" />
723-
<suppress files="plugins[/\\]repository-s3[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]repositories[/\\]s3[/\\]S3Repository.java" checks="LineLength" />
724-
<suppress files="plugins[/\\]repository-s3[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]repositories[/\\]s3[/\\]AmazonS3Wrapper.java" checks="LineLength" />
725712
</suppressions>

plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/AbstractAwsTestCase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ protected Settings nodeSettings(int nodeOrdinal) {
5656
throw new IllegalArgumentException("could not load aws tests config", e);
5757
}
5858
} else {
59-
throw new IllegalStateException("to run integration tests, you need to set -Dtests.thirdparty=true and -Dtests.config=/path/to/elasticsearch.yml");
59+
throw new IllegalStateException(
60+
"to run integration tests, you need to set -Dtests.thirdparty=true and -Dtests.config=/path/to/elasticsearch.yml");
6061
}
6162
} catch (SettingsException exception) {
6263
throw new IllegalStateException("your test configuration file is incorrect: " + System.getProperty("tests.config"), exception);

plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2/AmazonEC2Mock.java

Lines changed: 447 additions & 206 deletions
Large diffs are not rendered by default.

plugins/mapper-murmur3/src/main/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ protected void setupFieldType(BuilderContext context) {
8282

8383
public static class TypeParser implements Mapper.TypeParser {
8484
@Override
85-
public Mapper.Builder<?, ?> parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException {
85+
public Mapper.Builder<?, ?> parse(String name, Map<String, Object> node,
86+
ParserContext parserContext) throws MapperParsingException {
8687
Builder builder = new Builder(name);
8788

8889
// tweaking these settings is no longer allowed, the entire purpose of murmur3 fields is to store a hash

plugins/repository-azure/src/main/java/org/elasticsearch/cloud/azure/storage/AzureStorageSettings.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ private static AzureStorageSettings getPrimary(List<AzureStorageSettings> settin
367367
if (primary == null) {
368368
primary = setting;
369369
} else {
370-
throw new SettingsException("Multiple default Azure data stores configured: [" + primary.getName() + "] and [" + setting.getName() + "]");
370+
throw new SettingsException("Multiple default Azure data stores configured: [" + primary.getName()
371+
+ "] and [" + setting.getName() + "]");
371372
}
372373
}
373374
}

plugins/repository-hdfs/src/main/java/org/elasticsearch/repositories/hdfs/HdfsRepository.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public HdfsRepository(RepositoryMetaData metadata, Environment environment,
8282
uri = URI.create(uriSetting);
8383
if ("hdfs".equalsIgnoreCase(uri.getScheme()) == false) {
8484
throw new IllegalArgumentException(String.format(Locale.ROOT,
85-
"Invalid scheme [%s] specified in uri [%s]; only 'hdfs' uri allowed for hdfs snapshot/restore", uri.getScheme(), uriSetting));
85+
"Invalid scheme [%s] specified in uri [%s]; only 'hdfs' uri allowed for hdfs snapshot/restore",
86+
uri.getScheme(), uriSetting));
8687
}
8788
if (Strings.hasLength(uri.getPath()) && uri.getPath().equals("/") == false) {
8889
throw new IllegalArgumentException(String.format(Locale.ROOT,
@@ -134,7 +135,8 @@ private HdfsBlobStore createBlobstore(URI uri, String path, Settings repositoryS
134135
}
135136
});
136137

137-
logger.debug("Using file-system [{}] for URI [{}], path [{}]", fileContext.getDefaultFileSystem(), fileContext.getDefaultFileSystem().getUri(), path);
138+
logger.debug("Using file-system [{}] for URI [{}], path [{}]", fileContext.getDefaultFileSystem(),
139+
fileContext.getDefaultFileSystem().getUri(), path);
138140

139141
try {
140142
return new HdfsBlobStore(fileContext, path, bufferSize, isReadOnly(), haEnabled);

plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsTests.java

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,20 @@ public void testSimpleWorkflow() {
7676
assertThat(count(client, "test-idx-3"), equalTo(100L));
7777

7878
logger.info("--> snapshot");
79-
CreateSnapshotResponse createSnapshotResponse = client.admin().cluster().prepareCreateSnapshot("test-repo", "test-snap").setWaitForCompletion(true).setIndices("test-idx-*", "-test-idx-3").get();
79+
CreateSnapshotResponse createSnapshotResponse = client.admin().cluster()
80+
.prepareCreateSnapshot("test-repo", "test-snap")
81+
.setWaitForCompletion(true)
82+
.setIndices("test-idx-*", "-test-idx-3")
83+
.get();
8084
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), greaterThan(0));
81-
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), equalTo(createSnapshotResponse.getSnapshotInfo().totalShards()));
85+
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(),
86+
equalTo(createSnapshotResponse.getSnapshotInfo().totalShards()));
8287

83-
assertThat(client.admin().cluster().prepareGetSnapshots("test-repo").setSnapshots("test-snap").get().getSnapshots().get(0).state(), equalTo(SnapshotState.SUCCESS));
88+
assertThat(client.admin().cluster()
89+
.prepareGetSnapshots("test-repo")
90+
.setSnapshots("test-snap")
91+
.get()
92+
.getSnapshots().get(0).state(), equalTo(SnapshotState.SUCCESS));
8493

8594
logger.info("--> delete some data");
8695
for (int i = 0; i < 50; i++) {
@@ -101,7 +110,9 @@ public void testSimpleWorkflow() {
101110
client.admin().indices().prepareClose("test-idx-1", "test-idx-2").get();
102111

103112
logger.info("--> restore all indices from the snapshot");
104-
RestoreSnapshotResponse restoreSnapshotResponse = client.admin().cluster().prepareRestoreSnapshot("test-repo", "test-snap").setWaitForCompletion(true).execute().actionGet();
113+
RestoreSnapshotResponse restoreSnapshotResponse = client.admin().cluster()
114+
.prepareRestoreSnapshot("test-repo", "test-snap")
115+
.setWaitForCompletion(true).get();
105116
assertThat(restoreSnapshotResponse.getRestoreInfo().totalShards(), greaterThan(0));
106117

107118
ensureGreen();
@@ -113,7 +124,11 @@ public void testSimpleWorkflow() {
113124
logger.info("--> delete indices");
114125
client().admin().indices().prepareDelete("test-idx-1", "test-idx-2").get();
115126
logger.info("--> restore one index after deletion");
116-
restoreSnapshotResponse = client.admin().cluster().prepareRestoreSnapshot("test-repo", "test-snap").setWaitForCompletion(true).setIndices("test-idx-*", "-test-idx-2").execute().actionGet();
127+
restoreSnapshotResponse = client.admin().cluster()
128+
.prepareRestoreSnapshot("test-repo", "test-snap")
129+
.setWaitForCompletion(true)
130+
.setIndices("test-idx-*", "-test-idx-2")
131+
.get();
117132
assertThat(restoreSnapshotResponse.getRestoreInfo().totalShards(), greaterThan(0));
118133
ensureGreen();
119134
assertThat(count(client, "test-idx-1"), equalTo(100L));

plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
* <dt>{@code bucket}</dt><dd>S3 bucket</dd>
4646
* <dt>{@code base_path}</dt><dd>Specifies the path within bucket to repository data. Defaults to root directory.</dd>
4747
* <dt>{@code concurrent_streams}</dt><dd>Number of concurrent read/write stream (per repository on each node). Defaults to 5.</dd>
48-
* <dt>{@code chunk_size}</dt><dd>Large file can be divided into chunks. This parameter specifies the chunk size. Defaults to not chucked.</dd>
48+
* <dt>{@code chunk_size}</dt>
49+
* <dd>Large file can be divided into chunks. This parameter specifies the chunk size. Defaults to not chucked.</dd>
4950
* <dt>{@code compress}</dt><dd>If set to true metadata files will be stored compressed. Defaults to false.</dd>
5051
* </dl>
5152
*/

0 commit comments

Comments
 (0)