
org.memeticlabs.spark.rdd.trycatch.java.JavaSourcePropagatingRDD.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spark-rdd-trycatch Show documentation
Show all versions of spark-rdd-trycatch Show documentation
Error trapping and handling functionality for Spark's RDD API
The newest version!
/**
* Copyright 2017 Tristan Nixon
*
* 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.
*
* Created by Tristan Nixon on 7/13/17.
*/
package org.memeticlabs.spark.rdd.trycatch.java
import scala.reflect.ClassTag
import org.apache.spark.api.java.JavaRDD
import org.apache.spark.rdd.RDD
import org.memeticlabs.spark.rdd.trycatch.{SourcePropagatingRDD, ValueWithSource}
import org.memeticlabs.spark.rdd.trycatch.java.JavaErrorHandlingRDD._
private[memeticlabs] class JavaSourcePropagatingRDD[T,S](rdd: RDD[ValueWithSource[T,S]],
errorHandler: JavaErrorHandler[ValueWithSource[_,S]] )
(implicit tt: ClassTag[T], st: ClassTag[S])
extends JavaRDD[T]( new SourcePropagatingRDD( rdd, errorHandler ) )
object JavaSourcePropagatingRDD
{
import SourcePropagatingRDD.asVWS
def fromSource[S: ClassTag](source: JavaRDD[S],
errorHandler: JavaErrorHandler[ValueWithSource[_,S]] ): RDD[S] =
new JavaSourcePropagatingRDD[S,S]( asVWS( source ), errorHandler )( fakeClassTag[S], fakeClassTag[S] )
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy