All Downloads are FREE. Search and download functionalities are using the official Maven repository.

co.decodable.sdk.pipeline.internal.DelegatingEnumeratorStateSerializer Maven / Gradle / Ivy

Go to download

A software development kit for implementing Apache Flink jobs and running them on Decodable

There is a newer version: 1.0.0.Beta7
Show newest version
/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * Copyright Decodable, Inc.
 *
 * Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
 */
package co.decodable.sdk.pipeline.internal;

import co.decodable.sdk.pipeline.DecodableSourceEnumeratorState;
import java.io.IOException;
import org.apache.flink.connector.kafka.source.enumerator.KafkaSourceEnumState;
import org.apache.flink.core.io.SimpleVersionedSerializer;

public class DelegatingEnumeratorStateSerializer
    implements SimpleVersionedSerializer {

  private final SimpleVersionedSerializer delegate;

  public DelegatingEnumeratorStateSerializer(
      SimpleVersionedSerializer delegate) {
    this.delegate = delegate;
  }

  @Override
  public int getVersion() {
    return delegate.getVersion();
  }

  @Override
  public byte[] serialize(DecodableSourceEnumeratorState obj) throws IOException {
    return delegate.serialize(((DecodableSourceEnumeratorStateImpl) obj).getDelegate());
  }

  @Override
  public DecodableSourceEnumeratorState deserialize(int version, byte[] serialized)
      throws IOException {
    return new DecodableSourceEnumeratorStateImpl(delegate.deserialize(version, serialized));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy