Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@
import com.atgenomix.seqslab.piper.plugin.api.DataSource;
import com.atgenomix.seqslab.piper.plugin.api.Operator;
import com.atgenomix.seqslab.piper.tags.DeveloperApi;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.api.java.UDF0;
import org.apache.spark.sql.types.StructType;

import java.util.Iterator;

/**
* The operator responsible for loading (reading) a dataset into in-memory DataFrame or copying to local host
Expand All @@ -48,7 +45,7 @@
* @see SupportsScanPartitions
*/
@DeveloperApi
public interface Loader extends Operator, UDF0<Iterator<Row>> {
public interface Loader extends Operator {

/**
* Initializes this operator with a specific data source.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.atgenomix.seqslab.piper.tags.DeveloperApi;
import com.atgenomix.seqslab.piper.tags.FeatureBeforeCall;
import org.apache.spark.sql.api.java.UDF0;

/**
* A mix-in interface for {@link Loader}. Dataset loaders can implement this interface to support
Expand All @@ -28,7 +29,7 @@
*/
@DeveloperApi
@FeatureBeforeCall
public interface SupportsCopyToLocal extends Loader {
public interface SupportsCopyToLocal extends Loader, UDF0<Void> {

/**
* Sets the local destination path where the datasets will be saved.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2021-2022, ATGENOMIX INCORPORATED.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.atgenomix.seqslab.piper.plugin.api.loader;

import com.atgenomix.seqslab.piper.tags.DeveloperApi;
import com.atgenomix.seqslab.piper.tags.FeatureBeforeCall;
import org.apache.spark.sql.api.java.UDF0;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;

/**
* A mix-in interface for {@link Loader}. Dataset loaders can implement this interface to support
* copying storage files or directories directly to local file system.
* Loaders supporting this interface typically localize datasets that do not require
* in-memory processing optimization, e.g. reference files.
* This feature is invoked before calling operator function.
*/
@DeveloperApi
@FeatureBeforeCall
public interface SupportsInMemoryLoading extends Loader, UDF0<Dataset<Row>> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

import com.atgenomix.seqslab.piper.tags.DeveloperApi;
import com.atgenomix.seqslab.piper.tags.FeatureBeforeCall;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.api.java.UDF0;

import java.util.Iterator;

/**
* A mix-in interface for {@link Loader}. Dataset loaders can implement this interface to support
Expand All @@ -27,7 +31,7 @@
*/
@DeveloperApi
@FeatureBeforeCall
public interface SupportsReadPartitions extends Loader {
public interface SupportsReadPartitions extends Loader, UDF0<Iterator<Row>> {

/**
* Get the number of partitions in the data source.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@
import com.atgenomix.seqslab.piper.tags.DeveloperApi;
import com.atgenomix.seqslab.piper.tags.FeatureBeforeCall;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.api.java.UDF0;

import java.util.Iterator;


/**
* A mix-in interface for {@link Loader}. Dataset loaders can implement this interface to support
* transformation of partitioned datasets read by SeqsLab.
*/
@DeveloperApi
@FeatureBeforeCall
public interface SupportsScanPartitions extends Loader {
public interface SupportsScanPartitions extends Loader, UDF0<Iterator<Row>> {

/**
* Set the partition loaded by SeqsLab for applying Loader's call function.
Expand Down
Loading