在Spark Scala中运行时循环引用异常

时间:2019-04-04 15:06:32

标签: scala apache-spark pyspark

我正在spark scala中运行程序并使用java库来处理数据,我正在接受循环引用异常,但是即使在使用非循环库后,编译期间也没有获得异常

线程“ main”中的异常java.lang.UnsupportedOperationException:类中不能有循环引用,但可以得到类org.det.pia.service.AnalysisCollection的循环引用     在org.apache.spark.sql.catalyst.ScalaReflection $。$ anonfun $ serializerFor $ 1(ScalaReflection.scala:628)中     在scala.reflect.internal.tpe.TypeConstraints $ UndoLog.undo(TypeConstraints.scala:68)     在org.apache.spark.sql.catalyst.ScalaReflection.cleanUpReflectionObjects(ScalaReflection.scala:906)     在org.apache.spark.sql.catalyst.ScalaReflection.cleanUpReflectionObjects $(ScalaReflection.scala:905)     在org.apache.spark.sql.catalyst.ScalaReflection $ .cleanUpReflectionObjects(ScalaReflection.scala:46)     在org.apache.spark.sql.catalyst.ScalaReflection $ .serializerFor(ScalaReflection.scala:452)     在org.apache.spark.sql.catalyst.ScalaReflection $。$ anonfun $ serializerFor $ 6(ScalaReflection.scala:644)     在scala.collection.TraversableLike。$ anonfun $ flatMap $ 1(TraversableLike.scala:244)     在scala.collection.immutable.List.foreach(List.scala:392)

scala 


case class FileList( val id: Long, val name: String, val fileName: String, val format: String,
                       val analysisCollection: AnalysisCollection, val analysisProtocolCollection: AnalysisProtocolCollection )

  case class Inputs(val sourceFile:List[SourceFile],val searchDatabase:List[SearchDatabase],val spectraData:List[SpectraData])

  case class AnalysisSoftwareList(val analysisSoftware: List[AnalysisSoftware])

  case class PeptideSpectrumMatch(val id: Long, val charge: Int, val massToCharge: Double,
                                  val deltaMass: Double, val retentionTime: Double, val sequence: String,
                                  val missed: Int, val sourceID: String, val spectrumTitle: String, val pFile: PIAInputFile,
                                  val spectrumID: SpectrumIdentification, val isUnique: Boolean = false,
                                  val isDecoy: Boolean = false, val scores: List[ScoreModel],
                                  val modifications: TreeMap[Integer, Modification], val paramList: List[AbstractParam],
                                  val modificationString: String, val peptideStringID: String, val modificationChanged: Boolean = false,
                                  val identificationKeys: Map[String, String], val peptide: Peptide)

  case class Accession(val id: Long, val accessionStr: String, val files: Set[Long], val descriptions: Map[Long, String],
                       val dbSequence: String, val searchDatabaseRefs: Set[String], val pGroup: Group)

  case class Peptide(val id: Long, val sequence: String, val spectra: List[PeptideSpectrumMatch],
                     val pGroup: Group, val occurrences: HashSet[AccessionOccurrence])

  case class Group(val id: Long, val treeID: Long, val peptides: Map[String, Peptide], val children: TreeMap[Long, Group],
                   val parents: TreeMap[Long, Group],val accessions: Map[String, Accession],
                   val allAccessions: Map[String, Accession])


  case class PiaMergedData(val _date :String,val _name:String, val _ns2:String, val _ns3:String, val filesList: FileList,
                           val inputs: Inputs, val analysisSoftwareList: AnalysisSoftwareList,
                           val spectraList: List[PeptideSpectrumMatch], val accessionsList: List[Accession],
                           val peptidesList: List[Peptide], val groupsList: List[Group]
                          )

  case class AnalysisSoftware(var contactRole: ContactRole, val softwareName:Param, val customizations: String,
                              val version: String,val uri: String)

  case class AnalysisCollection(val spectrumIdentification: List[SpectrumIdentification],
   val proteinDetection: ProteinDetection)

  case class SpectrumIdentification( val inputSpectra: List[InputSpectra], val searchDatabaseRef: List[SearchDatabaseRef],
                                     val spectrumIdentificationProtocolRef: String , val spectrumIdentificationListRef: String,
                                     val spectrumIdentificationList: SpectrumIdentificationList,
                                     val spectrumIdentificationProtocol: SpectrumIdentificationProtocol
  )

  case class InputSpectra(val spectraDataRef: String, val spectraData: SpectraData)

  case class SpectraData(val spectrumIDFormat:SpectrumIDFormat)

  case class SpectrumIDFormat(val cvParam:CvParam)

  case class CvParam(val cvRef: String, val accession: String,val cv: Cv)

  case class Cv(val fullName: String, val version: String, val uri: String, val id: String)

  case class SearchDatabaseRef(val searchDatabaseRef: String, val searchDatabase: SearchDatabase)

  case class SearchDatabase()

  case class SpectrumIdentificationList(val fragmentationTable: FragmentationTable, val spectrumIdentificationResult: List[SpectrumIdentificationResult],
                                        val paramGroup: List[AbstractParam], val numSequencesSearched: Long)

  case class FragmentationTable(val measure: List[Measure])

  case class Measure(val cvParam: List[CvParam])

  case class SpectrumIdentificationResult(val spectrumIdentificationItem: List[SpectrumIdentificationItem],
  val paramGroup: List[AbstractParam], val spectrumID: String, val spectraDataRef: String, val spectraData: SpectraData)

  case class SpectrumIdentificationItem(val peptideEvidenceRef: List[PeptideEvidenceRef], val fragmentation: Fragmentation,
                                       val paramGroup: List[AbstractParam], val chargeState: Int, val experimentalMassToCharge: Double,
                                      val calculatedMassToCharge: Double, val calculatedPI: Float, val peptideRef: String,
                                      val rank: Int, val passThreshold: Boolean = false, val massTableRef: String,
                                      val sampleRef: String, val peptide: Peptide, val massTable: MassTable, val sample: Sample )

  case class PeptideEvidenceRef(val peptideEvidenceRef: String,
  val peptideEvidence: PeptideEvidence)

  case class PeptideEvidence( val paramGroup: List[AbstractParam] , val dbSequenceRef: String ,
                              val peptideRef: String , val start: Integer , val end: Integer ,
  val pre: String , val post: String , val translationTableRef: String , val frame: Integer , val isDecoy: Boolean = false,
  val dbSequence: DBSequence , val peptide: Peptide , val translationTable: TranslationTable )

  case class AbstractParam(val name: String, val value: String, val unitAccession: String, val unitName: String, val unitCvRef: String, val unitCv: Cv)

  case class DBSequence( val paramGroup: List[AbstractParam], val length: Integer,
                         val searchDatabaseRef: String, val accession:String , val searchDatabase: SearchDatabase )

  case class PIAInputFile(val id: Long, val name: String, val fileName: String,
                          val format: String, val analysisCollection: AnalysisCollection, val analysisProtocolCollection: AnalysisProtocolCollection)

  case class AnalysisProtocolCollection(val spectrumIdentificationProtocol: List[SpectrumIdentificationProtocol],
  val proteinDetectionProtocol: ProteinDetectionProtocol
                                       )

  case class ProteinDetection(val inputSpectrumIdentifications: List[InputSpectrumIdentifications],
  val proteinDetectionListRef: String, val proteinDetectionProtocolRef: String, val proteinDetectionList: ProteinDetectionList,
                              val proteinDetectionProtocol: ProteinDetectionProtocol)

0 个答案:

没有答案