Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

TestSources serialization failure for Tuple2<String, String> #2710

Open
@neilstevenson

Description

@neilstevenson

On Jet 4.4-SNAPSHOT, readFrom(TestSources.items(List.of(Tuple2.tuple2("hello", "world")))) gives

java.lang.IllegalArgumentException: "fillBufferFn" must be serializable
	at neil.demo.MyThingTest.test(MyThingTest.java:43)
Caused by: java.io.NotSerializableException: com.hazelcast.jet.datamodel.Tuple2
	at neil.demo.MyThingTest.test(MyThingTest.java:43)

Full reproducer

package neil.demo;

import java.util.List;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import com.hazelcast.jet.Jet;
import com.hazelcast.jet.JetInstance;
import com.hazelcast.jet.datamodel.Tuple2;
import com.hazelcast.jet.pipeline.Pipeline;
import com.hazelcast.jet.pipeline.Sinks;
import com.hazelcast.jet.pipeline.test.TestSources;

public class MyThingTest {

    private static JetInstance jetInstance;

    @BeforeAll
    public static void beforeAll() throws Exception {
        jetInstance = Jet.newJetInstance();
    }

    @AfterAll
    public static void afterAll() {
        jetInstance.shutdown();
    }
    
    @Test
    public void test() {
        Object item1 = "hello";
        Object item2 = Tuple2.tuple2("hello", "world");
        
        List<Object> input =
                List.of(item1);
        // This line breaks it
        input = List.of(item2);
        
        Pipeline pipeline = Pipeline.create();

        pipeline
        .readFrom(TestSources.items(input))
        .writeTo(Sinks.logger());

        jetInstance.newJob(pipeline).join();
    }

}

Could be related, hazelcast/hazelcast#17788, if IMDG is trying to deserialize the Java list, IMDG may not know about Tuple2 which is a Jet class.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions