Skip to content

Commit e81963a

Browse files
committed
Bring Apache Arrow classes into arrow-spi library so those could be shared between plugins
Signed-off-by: Andriy Redko <[email protected]>
1 parent 9bef705 commit e81963a

33 files changed

+2384
-17
lines changed

gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ opentelemetry = "1.46.0"
8383
opentelemetrysemconv = "1.29.0-alpha"
8484

8585
# arrow dependencies
86-
arrow = "18.1.0"
86+
arrow = "18.2.0"
8787
flatbuffers = "2.0.0"
8888

8989
[libraries]

libs/arrow-spi/build.gradle

+12
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,20 @@ testingConventions.enabled = false
1313

1414
dependencies {
1515
api project(':libs:opensearch-core')
16+
api "org.apache.arrow:arrow-memory-core:${versions.arrow}"
1617
}
1718

1819
tasks.named('forbiddenApisMain').configure {
1920
replaceSignatureFiles 'jdk-signatures'
2021
}
22+
23+
tasks.named('thirdPartyAudit').configure {
24+
ignoreMissingClasses(
25+
'org.slf4j.Logger',
26+
'org.slf4j.LoggerFactory'
27+
)
28+
ignoreViolations(
29+
'org.apache.arrow.memory.util.MemoryUtil',
30+
'org.apache.arrow.memory.util.MemoryUtil$1'
31+
)
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
af2e83d46089243245decb0c4a6f8bc4231a35f0

libs/arrow-spi/src/main/java/org/opensearch/arrow/spi/StreamManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public interface StreamManager extends AutoCloseable {
3434
* @return A StreamTicket that can be used to access the stream
3535
* @throws IllegalArgumentException if producer is null or parentTaskId is invalid
3636
*/
37-
<VectorRoot, Allocator> StreamTicket registerStream(StreamProducer<VectorRoot, Allocator> producer, TaskId parentTaskId);
37+
<VectorRoot> StreamTicket registerStream(StreamProducer<VectorRoot> producer, TaskId parentTaskId);
3838

3939
/**
4040
* Creates a stream reader for consuming Arrow data using a valid ticket.

libs/arrow-spi/src/main/java/org/opensearch/arrow/spi/StreamProducer.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
package org.opensearch.arrow.spi;
1010

11+
import org.apache.arrow.memory.BufferAllocator;
1112
import org.opensearch.common.annotation.ExperimentalApi;
1213
import org.opensearch.core.tasks.TaskId;
1314

@@ -75,7 +76,7 @@
7576
* @see StreamReader
7677
*/
7778
@ExperimentalApi
78-
public interface StreamProducer<VectorRoot, Allocator> extends Closeable {
79+
public interface StreamProducer<VectorRoot> extends Closeable {
7980

8081
/**
8182
* Creates a VectorSchemaRoot that defines the schema for this stream. This schema will be used
@@ -84,7 +85,7 @@ public interface StreamProducer<VectorRoot, Allocator> extends Closeable {
8485
* @param allocator The allocator to use for creating vectors
8586
* @return A new VectorSchemaRoot instance
8687
*/
87-
VectorRoot createRoot(Allocator allocator);
88+
VectorRoot createRoot(BufferAllocator allocator);
8889

8990
/**
9091
* Creates a job that will produce the stream data in batches. The job will populate
@@ -93,7 +94,7 @@ public interface StreamProducer<VectorRoot, Allocator> extends Closeable {
9394
* @param allocator The allocator to use for any additional memory allocations
9495
* @return A new BatchedJob instance
9596
*/
96-
BatchedJob<VectorRoot> createJob(Allocator allocator);
97+
BatchedJob<VectorRoot> createJob(BufferAllocator allocator);
9798

9899
/**
99100
* Provides an estimate of the total number of rows that will be produced.

plugins/arrow-flight-rpc/build.gradle

+3-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ dependencies {
2323
implementation "org.apache.arrow:arrow-vector:${versions.arrow}"
2424
implementation "org.apache.arrow:arrow-format:${versions.arrow}"
2525
implementation "org.apache.arrow:flight-core:${versions.arrow}"
26-
implementation "org.apache.arrow:arrow-memory-core:${versions.arrow}"
2726

2827
runtimeOnly "org.apache.arrow:arrow-memory-netty:${versions.arrow}"
2928
runtimeOnly "org.apache.arrow:arrow-memory-netty-buffer-patch:${versions.arrow}"
@@ -227,7 +226,8 @@ tasks.named('thirdPartyAudit').configure {
227226
'reactor.blockhound.BlockHound$Builder',
228227
'reactor.blockhound.integration.BlockHoundIntegration',
229228

230-
'com.google.protobuf.util.Timestamps'
229+
'com.google.protobuf.util.Timestamps',
230+
'io.grpc.stub.BlockingClientCall'
231231
)
232232
ignoreViolations(
233233
// Guava internal classes
@@ -293,9 +293,6 @@ tasks.named('thirdPartyAudit').configure {
293293
'io.netty.util.internal.shaded.org.jctools.queues.unpadded.MpscUnpaddedArrayQueueProducerLimitField',
294294
'io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess',
295295
'io.netty.util.internal.shaded.org.jctools.util.UnsafeLongArrayAccess',
296-
'io.netty.util.internal.shaded.org.jctools.util.UnsafeRefArrayAccess',
297-
'org.apache.arrow.memory.util.MemoryUtil',
298-
'org.apache.arrow.memory.util.MemoryUtil$1'
299-
296+
'io.netty.util.internal.shaded.org.jctools.util.UnsafeRefArrayAccess'
300297
)
301298
}

plugins/arrow-flight-rpc/licenses/arrow-format-18.1.0.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
34c4c28ddc01038498b89125c3a9f2329c2227ae

plugins/arrow-flight-rpc/licenses/arrow-memory-core-18.1.0.jar.sha1

-1
This file was deleted.

plugins/arrow-flight-rpc/licenses/arrow-memory-netty-18.1.0.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2b084a03bad216e0ac39d40a6b36d0659709b0b4

plugins/arrow-flight-rpc/licenses/arrow-memory-netty-buffer-patch-18.1.0.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3dc14b412efd53189cc6be49dcc1920580efc76e

plugins/arrow-flight-rpc/licenses/arrow-vector-18.1.0.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8c4ecbc286b28d738730514cd79567d52666c086

plugins/arrow-flight-rpc/licenses/flight-core-18.1.0.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
032f5b195a45dca93ecb103474ef0b2b01512895
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
af2e83d46089243245decb0c4a6f8bc4231a35f0

0 commit comments

Comments
 (0)