Skip to content

Commit

Permalink
[GLUTEN-7031] Move iterator wrappers to gluten-core (#7095)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer authored Sep 4, 2024
1 parent 44634ad commit 51e6793
Show file tree
Hide file tree
Showing 19 changed files with 25 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ package org.apache.gluten.backendsapi.velox
import org.apache.gluten.GlutenNumaBindingInfo
import org.apache.gluten.backendsapi.IteratorApi
import org.apache.gluten.execution._
import org.apache.gluten.iterator.Iterators
import org.apache.gluten.metrics.IMetrics
import org.apache.gluten.sql.shims.SparkShimLoader
import org.apache.gluten.substrait.plan.PlanNode
import org.apache.gluten.substrait.rel.{LocalFilesBuilder, LocalFilesNode, SplitInfo}
import org.apache.gluten.substrait.rel.LocalFilesNode.ReadFileFormat
import org.apache.gluten.utils._
import org.apache.gluten.utils.iterator.Iterators
import org.apache.gluten.vectorized._

import org.apache.spark.{SparkConf, TaskContext}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ package org.apache.gluten.datasource
import org.apache.gluten.columnarbatch.ColumnarBatches
import org.apache.gluten.exception.SchemaMismatchException
import org.apache.gluten.execution.RowToVeloxColumnarExec
import org.apache.gluten.iterator.Iterators
import org.apache.gluten.memory.arrow.alloc.ArrowBufferAllocators
import org.apache.gluten.memory.arrow.pool.ArrowNativeMemoryPool
import org.apache.gluten.utils.ArrowUtil
import org.apache.gluten.utils.iterator.Iterators
import org.apache.gluten.vectorized.ArrowWritableColumnVector

import org.apache.spark.TaskContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ package org.apache.gluten.execution

import org.apache.gluten.GlutenConfig
import org.apache.gluten.columnarbatch.ColumnarBatches
import org.apache.gluten.iterator.Iterators
import org.apache.gluten.memory.arrow.alloc.ArrowBufferAllocators
import org.apache.gluten.runtime.Runtimes
import org.apache.gluten.utils.ArrowAbiUtil
import org.apache.gluten.utils.iterator.Iterators
import org.apache.gluten.vectorized._

import org.apache.spark.broadcast.Broadcast
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package org.apache.gluten.execution

import org.apache.gluten.utils.iterator.Iterators
import org.apache.gluten.iterator.Iterators

import org.apache.spark.{broadcast, SparkContext}
import org.apache.spark.sql.execution.joins.BuildSideRelation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package org.apache.gluten.execution
import org.apache.gluten.columnarbatch.ColumnarBatches
import org.apache.gluten.exception.GlutenNotSupportException
import org.apache.gluten.extension.ValidationResult
import org.apache.gluten.iterator.Iterators
import org.apache.gluten.runtime.Runtimes
import org.apache.gluten.utils.iterator.Iterators
import org.apache.gluten.vectorized.NativeColumnarToRowJniWrapper

import org.apache.spark.broadcast.Broadcast
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package org.apache.gluten.execution

import org.apache.gluten.extension.GlutenPlan
import org.apache.gluten.iterator.Iterators
import org.apache.gluten.utils.VeloxBatchResizer
import org.apache.gluten.utils.iterator.Iterators

import org.apache.spark.rdd.RDD
import org.apache.spark.sql.catalyst.InternalRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package org.apache.spark.api.python
import org.apache.gluten.columnarbatch.ColumnarBatches
import org.apache.gluten.exception.GlutenException
import org.apache.gluten.extension.GlutenPlan
import org.apache.gluten.iterator.Iterators
import org.apache.gluten.memory.arrow.alloc.ArrowBufferAllocators
import org.apache.gluten.utils.PullOutProjectHelper
import org.apache.gluten.utils.iterator.Iterators
import org.apache.gluten.vectorized.ArrowWritableColumnVector

import org.apache.spark.{ContextAwareIterator, SparkEnv, TaskContext}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import org.apache.gluten.GlutenConfig
import org.apache.gluten.backendsapi.BackendsApiManager
import org.apache.gluten.columnarbatch.ColumnarBatches
import org.apache.gluten.execution.{RowToVeloxColumnarExec, VeloxColumnarToRowExec}
import org.apache.gluten.iterator.Iterators
import org.apache.gluten.memory.arrow.alloc.ArrowBufferAllocators
import org.apache.gluten.runtime.Runtimes
import org.apache.gluten.utils.ArrowAbiUtil
import org.apache.gluten.utils.iterator.Iterators
import org.apache.gluten.vectorized.ColumnarBatchSerializerJniWrapper

import org.apache.spark.internal.Logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.gluten.utils.iterator

import org.apache.gluten.utils.iterator.IteratorsV1.WrapperBuilderV1
package org.apache.gluten.iterator

import org.apache.spark.TaskContext

import IteratorsV1.WrapperBuilderV1

/**
* Utility class to provide iterator wrappers for non-trivial use cases. E.g. iterators that manage
* payload's lifecycle.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.gluten.utils.iterator

import org.apache.gluten.utils.iterator.Iterators.WrapperBuilder
package org.apache.gluten.iterator

import org.apache.spark.{InterruptibleIterator, TaskContext}
import org.apache.spark.task.TaskResources

import Iterators.WrapperBuilder

import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicBoolean

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.util
package org.apache.spark.task

import org.apache.spark.TaskContext
import org.apache.spark.memory.TaskMemoryManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.gluten.utils.iterator
package org.apache.gluten.iterator

import org.apache.gluten.utils.iterator.Iterators.{V1, WrapperBuilder}
import org.apache.gluten.iterator.Iterators.{V1, WrapperBuilder}

import org.apache.spark.task.TaskResources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.gluten.utils
package org.apache.gluten.task

import org.apache.spark.memory.{MemoryConsumer, MemoryMode}
import org.apache.spark.sql.catalyst.plans.SQLHelper
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.task.{TaskResource, TaskResources}
import org.apache.spark.util.SparkTaskUtil
import org.apache.spark.task.{SparkTaskUtil, TaskResource, TaskResources}

import org.scalatest.funsuite.AnyFunSuite

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.utils.iterator
package org.apache.spark.iterator

import org.apache.gluten.utils.iterator.Iterators
import org.apache.gluten.utils.iterator.Iterators.V1
import org.apache.gluten.iterator.Iterators
import org.apache.gluten.iterator.Iterators.V1

import org.apache.spark.benchmark.{Benchmark, BenchmarkBase}
import org.apache.spark.task.TaskResources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package org.apache.spark.sql.execution

import org.apache.gluten.columnarbatch.ColumnarBatches
import org.apache.gluten.iterator.Iterators
import org.apache.gluten.memory.arrow.alloc.ArrowBufferAllocators
import org.apache.gluten.runtime.Runtimes
import org.apache.gluten.sql.shims.SparkShimLoader
import org.apache.gluten.utils.ArrowAbiUtil
import org.apache.gluten.utils.iterator.Iterators
import org.apache.gluten.vectorized.{ColumnarBatchSerializerJniWrapper, NativeColumnarToRowJniWrapper}

import org.apache.spark.sql.catalyst.InternalRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
package org.apache.spark.sql.execution.utils

import org.apache.gluten.columnarbatch.ColumnarBatches
import org.apache.gluten.iterator.Iterators
import org.apache.gluten.memory.arrow.alloc.ArrowBufferAllocators
import org.apache.gluten.runtime.Runtimes
import org.apache.gluten.utils.iterator.Iterators
import org.apache.gluten.vectorized.{ArrowWritableColumnVector, NativeColumnarToRowInfo, NativeColumnarToRowJniWrapper, NativePartitioning}

import org.apache.spark.{Partitioner, RangePartitioner, ShuffleDependency}
Expand Down
15 changes: 0 additions & 15 deletions gluten-substrait/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,21 +296,6 @@
<clearOutputDirectory>true</clearOutputDirectory>
</configuration>
</execution>
<execution>
<id>compile-gluten-proto</id>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
<configuration>
<protocArtifact>
com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
</protocArtifact>
<protoSourceRoot>src/main/resources/org/apache/gluten/proto</protoSourceRoot>
<clearOutputDirectory>false</clearOutputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ import org.apache.spark.rdd.RDD
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.expressions.Attribute
import org.apache.spark.sql.execution.{ColumnarToRowExec, LeafExecNode, SparkPlan}
import org.apache.spark.task.TaskResources
import org.apache.spark.util.SparkTaskUtil
import org.apache.spark.task.{SparkTaskUtil, TaskResources}

import java.util.{Objects, Properties}

Expand Down

0 comments on commit 51e6793

Please sign in to comment.