Search in sources :

Example 1 with TerminateRecord

use of com.alibaba.datax.core.transport.record.TerminateRecord in project DataX by alibaba.

the class BufferedRecordExchanger method getFromReader.

@Override
public Record getFromReader() {
    if (shutdown) {
        throw DataXException.asDataXException(CommonErrorCode.SHUT_DOWN_TASK, "");
    }
    boolean isEmpty = (this.bufferIndex >= this.buffer.size());
    if (isEmpty) {
        receive();
    }
    Record record = this.buffer.get(this.bufferIndex++);
    if (record instanceof TerminateRecord) {
        record = null;
    }
    return record;
}
Also used : TerminateRecord(com.alibaba.datax.core.transport.record.TerminateRecord) Record(com.alibaba.datax.common.element.Record) TerminateRecord(com.alibaba.datax.core.transport.record.TerminateRecord)

Example 2 with TerminateRecord

use of com.alibaba.datax.core.transport.record.TerminateRecord in project DataX by alibaba.

the class BufferedRecordTransformerExchanger method getFromReader.

@Override
public Record getFromReader() {
    if (shutdown) {
        throw DataXException.asDataXException(CommonErrorCode.SHUT_DOWN_TASK, "");
    }
    boolean isEmpty = (this.bufferIndex >= this.buffer.size());
    if (isEmpty) {
        receive();
    }
    Record record = this.buffer.get(this.bufferIndex++);
    if (record instanceof TerminateRecord) {
        record = null;
    }
    return record;
}
Also used : TerminateRecord(com.alibaba.datax.core.transport.record.TerminateRecord) Record(com.alibaba.datax.common.element.Record) TerminateRecord(com.alibaba.datax.core.transport.record.TerminateRecord)

Aggregations

Record (com.alibaba.datax.common.element.Record)2 TerminateRecord (com.alibaba.datax.core.transport.record.TerminateRecord)2