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

org.apache.flink.connector.base.source.reader.RecordEmitter Maven / Gradle / Ivy

There is a newer version: 1.13.0
Show newest version
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.flink.connector.base.source.reader;

import org.apache.flink.api.connector.source.SourceOutput;
import org.apache.flink.connector.base.source.reader.splitreader.SplitReader;

/**
 * Emit a record to the downstream.
 *
 * @param  the type of the record emitted by the {@link SplitReader}
 * @param  the type of records that are eventually emitted to the {@link SourceOutput}.
 * @param  the mutable type of split state.
 */
public interface RecordEmitter {

    /**
     * Process and emit the records to the {@link SourceOutput}. A few recommendations to the
     * implementation are following:
     *
     * 
    *
  • The method maybe interrupted in the middle. In that case, the same set of records will * be passed to the record emitter again later. The implementation needs to make sure it * reades *
  • *
* * @param element The intermediate element read by the SplitReader. * @param output The output to which the final records are emit to. * @param splitState The state of the split. */ void emitRecord(E element, SourceOutput output, SplitStateT splitState) throws Exception; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy