Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-21003

Flink add Sink to AliyunOSS doesn't work

    XMLWordPrintableJSON

Details

    Description

      When I add a sink to OSS, use the code below:

      String path = "oss://<bucket>/<dir>";
      StreamingFileSink streamingFileSink = StreamingFileSink
          .forRowFormat(new Path(path), new SimpleStringEncoder<String>("UTF-8"))
          .withRollingPolicy(
              DefaultRollingPolicy.builder()
                  .withRolloverInterval(TimeUnit.MINUTES.toMillis(5))
                  .withInactivityInterval(TimeUnit.MINUTES.toMillis(1))
                  .withMaxPartSize(1024 * 1024 * 10)
                  .build()
          ).build();
      
      strStream.addSink(streamingFileSink);

       It occus an error:

      Recoverable writers on Hadoop are only supported for HDF
      

      Is there any mistakes I made?

      OR

      I want to use Aliyun OSS to store the stream data split to different files. 

      The Flink official document's example is use below:

      // Write to OSS bucket
      stream.writeAsText("oss://<your-bucket>/<object-name>")
      

      How to use this to split to different files by the data's attributes?

       

      Thanks!

       

       

       

       

       

       

       

       

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            OneCloud zhangyunyun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: