Skip to content

Commit

Permalink
Merge branch 'opensearch-project:main' into main-opentelemetry-scope
Browse files Browse the repository at this point in the history
  • Loading branch information
suranjay authored Jul 5, 2023
2 parents 1ad337f + c9974a4 commit bccb622
Show file tree
Hide file tree
Showing 77 changed files with 1,579 additions and 189 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Dependencies
- Bump `log4j-core` from 2.18.0 to 2.19.0
- Bump `forbiddenapis` from 3.3 to 3.4
- Bump `avro` from 1.11.0 to 1.11.1
- Bump `avro` from 1.11.1 to 1.11.2
- Bump `woodstox-core` from 6.3.0 to 6.3.1
- Bump `xmlbeans` from 5.1.0 to 5.1.1 ([#4354](https://github.com/opensearch-project/OpenSearch/pull/4354))
- Bump `reactor-netty-core` from 1.0.19 to 1.0.22 ([#4447](https://github.com/opensearch-project/OpenSearch/pull/4447))
Expand Down Expand Up @@ -77,6 +77,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Support OpenSSL Provider with default Netty allocator ([#5460](https://github.com/opensearch-project/OpenSearch/pull/5460))
- Replaces ZipInputStream with ZipFile to fix Zip Slip vulnerability ([#7230](https://github.com/opensearch-project/OpenSearch/pull/7230))
- Add missing validation/parsing of SearchBackpressureMode of SearchBackpressureSettings ([#7541](https://github.com/opensearch-project/OpenSearch/pull/7541))
- Adds log4j configuration for telemetry LogSpanExporter ([#8393](https://github.com/opensearch-project/OpenSearch/pull/8393))

### Security

Expand All @@ -95,6 +96,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Add API to initialize extensions ([#8029]()https://github.com/opensearch-project/OpenSearch/pull/8029)
- Add distributed tracing framework ([#7543](https://github.com/opensearch-project/OpenSearch/issues/7543))
- Enable Point based optimization for custom comparators ([#8168](https://github.com/opensearch-project/OpenSearch/pull/8168))
- [Extensions] Support extension additional settings with extension REST initialization ([#8414](https://github.com/opensearch-project/OpenSearch/pull/8414))
- Adds mock implementation for TelemetryPlugin ([#7545](https://github.com/opensearch-project/OpenSearch/issues/7545))

### Dependencies
- Bump `com.azure:azure-storage-common` from 12.21.0 to 12.21.1 (#7566, #7814)
Expand Down Expand Up @@ -127,6 +130,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [Upgrade] Lucene 9.7.0 release (#8272)
- Bump `org.jboss.resteasy:resteasy-jackson2-provider` from 3.0.26.Final to 6.2.4.Final in /qa/wildfly ([#8209](https://github.com/opensearch-project/OpenSearch/pull/8209))
- Bump `com.google.api-client:google-api-client` from 1.34.0 to 2.2.0 ([#8276](https://github.com/opensearch-project/OpenSearch/pull/8276))
- Update Apache HttpCore/ HttpClient and Apache HttpCore5 / HttpClient5 dependencies ([#8434](https://github.com/opensearch-project/OpenSearch/pull/8434))
- Bump `org.apache.maven:maven-model` from 3.9.2 to 3.9.3 (#8403)

### Changed
- Replace jboss-annotations-api_1.2_spec with jakarta.annotation-api ([#7836](https://github.com/opensearch-project/OpenSearch/pull/7836))
Expand Down Expand Up @@ -163,4 +168,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Security

[Unreleased 3.0]: https://github.com/opensearch-project/OpenSearch/compare/2.x...HEAD
[Unreleased 2.x]: https://github.com/opensearch-project/OpenSearch/compare/2.8...2.x
[Unreleased 2.x]: https://github.com/opensearch-project/OpenSearch/compare/2.8...2.x
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ dependencies {
api 'de.thetaphi:forbiddenapis:3.5.1'
api 'com.avast.gradle:gradle-docker-compose-plugin:0.16.12'
api "org.yaml:snakeyaml:${props.getProperty('snakeyaml')}"
api 'org.apache.maven:maven-model:3.9.2'
api 'org.apache.maven:maven-model:3.9.3'
api 'com.networknt:json-schema-validator:1.0.85'
api 'org.jruby.jcodings:jcodings:1.0.58'
api 'org.jruby.joni:joni:2.2.1'
Expand Down
8 changes: 4 additions & 4 deletions buildSrc/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ netty = 4.1.94.Final
joda = 2.12.2

# client dependencies
httpclient5 = 5.1.4
httpcore5 = 5.1.5
httpclient = 4.5.13
httpcore = 4.4.15
httpclient5 = 5.2.1
httpcore5 = 5.2.2
httpclient = 4.5.14
httpcore = 4.4.16
httpasyncclient = 4.1.5
commonslogging = 1.2
commonscodec = 1.15
Expand Down
1 change: 0 additions & 1 deletion client/rest/licenses/httpclient5-5.1.4.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions client/rest/licenses/httpclient5-5.2.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0c900514d3446d9ce5d9dbd90c21192048125440
1 change: 0 additions & 1 deletion client/rest/licenses/httpcore5-5.1.5.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions client/rest/licenses/httpcore5-5.2.2.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6da28f5aa6c2b129ef49632e041a5203ce7507b2
1 change: 0 additions & 1 deletion client/rest/licenses/httpcore5-h2-5.1.5.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions client/rest/licenses/httpcore5-h2-5.2.2.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
54ee1ed58fe8ac40be1083ea9873a6c734939ab9
1 change: 0 additions & 1 deletion client/sniffer/licenses/httpclient5-5.1.4.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions client/sniffer/licenses/httpclient5-5.2.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0c900514d3446d9ce5d9dbd90c21192048125440
1 change: 0 additions & 1 deletion client/sniffer/licenses/httpcore5-5.1.5.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions client/sniffer/licenses/httpcore5-5.2.2.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6da28f5aa6c2b129ef49632e041a5203ce7507b2

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1194890e6f56ec29177673f2f12d0b8e627dec98

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
51cf043c87253c9f58b539c9f7e44c8894223850
1 change: 0 additions & 1 deletion plugins/discovery-ec2/licenses/httpclient-4.5.13.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions plugins/discovery-ec2/licenses/httpclient-4.5.14.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1194890e6f56ec29177673f2f12d0b8e627dec98
1 change: 0 additions & 1 deletion plugins/discovery-ec2/licenses/httpcore-4.4.15.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions plugins/discovery-ec2/licenses/httpcore-4.4.16.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
51cf043c87253c9f58b539c9f7e44c8894223850
1 change: 0 additions & 1 deletion plugins/discovery-gce/licenses/httpclient-4.5.13.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions plugins/discovery-gce/licenses/httpclient-4.5.14.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1194890e6f56ec29177673f2f12d0b8e627dec98
1 change: 0 additions & 1 deletion plugins/discovery-gce/licenses/httpcore-4.4.15.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions plugins/discovery-gce/licenses/httpcore-4.4.16.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
51cf043c87253c9f58b539c9f7e44c8894223850
2 changes: 1 addition & 1 deletion plugins/repository-hdfs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dependencies {
}
api 'org.apache.htrace:htrace-core4:4.2.0-incubating'
api "org.apache.logging.log4j:log4j-core:${versions.log4j}"
api 'org.apache.avro:avro:1.11.1'
api 'org.apache.avro:avro:1.11.2'
api 'com.google.code.gson:gson:2.10.1'
runtimeOnly "com.google.guava:guava:${versions.guava}"
api "commons-logging:commons-logging:${versions.commonslogging}"
Expand Down
1 change: 0 additions & 1 deletion plugins/repository-hdfs/licenses/avro-1.11.1.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions plugins/repository-hdfs/licenses/avro-1.11.2.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
97e62e8be2b37e849f1bdb5a4f08121d47cc9806
1 change: 0 additions & 1 deletion plugins/repository-s3/licenses/httpclient-4.5.13.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions plugins/repository-s3/licenses/httpclient-4.5.14.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1194890e6f56ec29177673f2f12d0b8e627dec98
1 change: 0 additions & 1 deletion plugins/repository-s3/licenses/httpcore-4.4.15.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions plugins/repository-s3/licenses/httpcore-4.4.16.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
51cf043c87253c9f58b539c9f7e44c8894223850
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessage;
import org.opensearch.ExceptionsHelper;
import org.opensearch.action.ActionListener;
import org.opensearch.common.Nullable;
import org.opensearch.common.SetOnce;
import org.opensearch.common.blobstore.BlobContainer;
Expand Down Expand Up @@ -296,6 +297,35 @@ private static DeleteObjectsRequest bulkDelete(String bucket, List<String> blobs
.build();
}

@Override
public void listBlobsByPrefixInSortedOrder(
String blobNamePrefix,
int limit,
BlobNameSortOrder blobNameSortOrder,
ActionListener<List<BlobMetadata>> listener
) {
// As AWS S3 returns list of keys in Lexicographic order, we don't have to fetch all the keys in order to sort them
// We fetch only keys as per the given limit to optimize the fetch. If provided sort order is not Lexicographic,
// we fall-back to default implementation of fetching all the keys and sorting them.
if (blobNameSortOrder != BlobNameSortOrder.LEXICOGRAPHIC) {
super.listBlobsByPrefixInSortedOrder(blobNamePrefix, limit, blobNameSortOrder, listener);
} else {
if (limit < 0) {
throw new IllegalArgumentException("limit should not be a negative value");
}
String prefix = blobNamePrefix == null ? keyPath : buildKey(blobNamePrefix);
try (AmazonS3Reference clientReference = blobStore.clientReference()) {
List<BlobMetadata> blobs = executeListing(clientReference, listObjectsRequest(prefix, limit), limit).stream()
.flatMap(listing -> listing.contents().stream())
.map(s3Object -> new PlainBlobMetadata(s3Object.key().substring(keyPath.length()), s3Object.size()))
.collect(Collectors.toList());
listener.onResponse(blobs.subList(0, Math.min(limit, blobs.size())));
} catch (final Exception e) {
listener.onFailure(new IOException("Exception when listing blobs by prefix [" + prefix + "]", e));
}
}
}

@Override
public Map<String, BlobMetadata> listBlobsByPrefix(@Nullable String blobNamePrefix) throws IOException {
String prefix = blobNamePrefix == null ? keyPath : buildKey(blobNamePrefix);
Expand Down Expand Up @@ -339,10 +369,25 @@ public Map<String, BlobContainer> children() throws IOException {
}

private static List<ListObjectsV2Response> executeListing(AmazonS3Reference clientReference, ListObjectsV2Request listObjectsRequest) {
return executeListing(clientReference, listObjectsRequest, -1);
}

private static List<ListObjectsV2Response> executeListing(
AmazonS3Reference clientReference,
ListObjectsV2Request listObjectsRequest,
int limit
) {
return SocketAccess.doPrivileged(() -> {
final List<ListObjectsV2Response> results = new ArrayList<>();
int totalObjects = 0;
ListObjectsV2Iterable listObjectsIterable = clientReference.get().listObjectsV2Paginator(listObjectsRequest);
listObjectsIterable.forEach(results::add);
for (ListObjectsV2Response listObjectsV2Response : listObjectsIterable) {
results.add(listObjectsV2Response);
totalObjects += listObjectsV2Response.contents().size();
if (limit != -1 && totalObjects > limit) {
break;
}
}
return results;
});
}
Expand All @@ -356,6 +401,10 @@ private ListObjectsV2Request listObjectsRequest(String keyPath) {
.build();
}

private ListObjectsV2Request listObjectsRequest(String keyPath, int limit) {
return listObjectsRequest(keyPath).toBuilder().maxKeys(Math.min(limit, 1000)).build();
}

private String buildKey(String blobName) {
return keyPath + blobName;
}
Expand Down
Loading

0 comments on commit bccb622

Please sign in to comment.