Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-2368

one throw "Unable to find registrar for hdfs" with same code

Details

    • Test
    • Status: Resolved
    • P2
    • Resolution: Won't Fix
    • None
    • 2.0.0
    • runner-spark
    • None

    Description

      I have the same code:
      BeamConfiguration.beamConfiguration();
      HadoopFileSystemOptions options = PipelineOptionsFactory.as(HadoopFileSystemOptions.class);
      options.setHdfsConfiguration(Collections.singletonList(config));
      options.setRunner(SparkRunner.class);
      Pipeline pipeline = Pipeline.create(options);
      PCollection<String> recordsFromHdfs = pipeline.apply(TextIO.read().from(inputPath));
      nextPCollection = recordsFromHdfs......
      PCollection<String> recordsToHdfs = nextPCollection.apply(ParDo.of(new OutputHdfsFileFn(delimit)));
      recordsToHdfs.apply(TextIO.write().to(outputPath));
      pipeline.run().waitUntilFinish();
      one run successfully,but another throw exception like this:17/05/26 12:02:38 ERROR yarn.ApplicationMaster: User class threw exception: java.lang.IllegalStateException: Unable to find registrar for hdfs
      java.lang.IllegalStateException: Unable to find registrar for hdfs
      at org.apache.beam.sdk.io.FileSystems.getFileSystemInternal(FileSystems.java:447)
      at org.apache.beam.sdk.io.FileSystems.matchNewResource(FileSystems.java:523)
      at org.apache.beam.sdk.io.FileBasedSink.convertToFileResourceIfPossible(FileBasedSink.java:204)
      at org.apache.beam.sdk.io.TextIO$Write.to(TextIO.java:294)
      at com.chinamobile.cmss.etl.beam.transform.server.SparkMain.main(SparkMain.java:77)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:558)
      17/05/26 12:02:38 INFO yarn.ApplicationMaster: Final app status: FAILED, exitCode: 15, (reason: User class threw exception: java.lang.IllegalStateException: Unable to find registrar for hdfs)
      I find it will setDefaultPipelineOptions(PipelineOptions options) using hdfs,why I always get execuption ?

      Attachments

        Activity

          People

            amitsela Amit Sela
            yuntian liyuntian
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: