Kspace
Kspace

Reputation: 225

Flink - serializable of class (not POJO)

Is it not possible to serialize classes which are not POJO in apache flink? I have an utility class which has many functions and i want to send the Source function an object of that utility class, but flink is throwing serialization exception.

Main Class:

Utilities utilities = new Utilities();
DataStream<MyData> dataStream = env.addSource(new MySource(configData,utilities))

Utilities class :

public class Utilities {


    public Utilities() {
        //default constructor
    }


    public String fun1() {

        //Do something  
    }   

    public String fun2() {

        //Do something  
    }   
}

Upvotes: 0

Views: 685

Answers (1)

gcandal
gcandal

Reputation: 957

Make Utilities implement Serializable.

Upvotes: 1

Related Questions