com.alibaba.otter.canal.sink.exception.CanalSinkException Java Examples

The following examples show how to use com.alibaba.otter.canal.sink.exception.CanalSinkException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractEventParser.java    From canal-1.1.3 with Apache License 2.0 6 votes vote down vote up
protected boolean consumeTheEventAndProfilingIfNecessary(List<CanalEntry.Entry> entrys) throws CanalSinkException,
                                                                                       InterruptedException {
    long startTs = -1;
    boolean enabled = getProfilingEnabled();
    if (enabled) {
        startTs = System.currentTimeMillis();
    }

    boolean result = eventSink.sink(entrys, (runningInfo == null) ? null : runningInfo.getAddress(), destination);

    if (enabled) {
        this.processingInterval = System.currentTimeMillis() - startTs;
    }

    if (consumedEventCount.incrementAndGet() < 0) {
        consumedEventCount.set(0);
    }

    return result;
}
 
Example #2
Source File: AbstractEventParser.java    From DBus with Apache License 2.0 6 votes vote down vote up
protected boolean consumeTheEventAndProfilingIfNecessary(List<CanalEntry.Entry> entrys) throws CanalSinkException,
                                                                                       InterruptedException {
    long startTs = -1;
    boolean enabled = getProfilingEnabled();
    if (enabled) {
        startTs = System.currentTimeMillis();
    }

    boolean result = eventSink.sink(entrys, (runningInfo == null) ? null : runningInfo.getAddress(), destination);

    if (enabled) {
        this.processingInterval = System.currentTimeMillis() - startTs;
    }

    if (consumedEventCount.incrementAndGet() < 0) {
        consumedEventCount.set(0);
    }

    return result;
}
 
Example #3
Source File: BinlogEventSink.java    From jlogstash-input-plugin with Apache License 2.0 6 votes vote down vote up
@Override
public boolean sink(List<CanalEntry.Entry> entries, InetSocketAddress inetSocketAddress, String s) throws CanalSinkException, InterruptedException {
    for (CanalEntry.Entry entry : entries) {
        CanalEntry.EntryType entryType = entry.getEntryType();
        if (entryType != CanalEntry.EntryType.ROWDATA) {
            continue;
        }

        CanalEntry.RowChange rowChange = parseRowChange(entry);

        if(rowChange == null) {
            return false;
        }

        CanalEntry.Header header = entry.getHeader();
        long ts = header.getExecuteTime();
        String schema = header.getSchemaName();
        String table = header.getTableName();
        processRowChange(rowChange, schema, table, ts);
    }

    return true;
}
 
Example #4
Source File: AbstractEventParser.java    From canal with Apache License 2.0 6 votes vote down vote up
protected boolean consumeTheEventAndProfilingIfNecessary(List<CanalEntry.Entry> entrys) throws CanalSinkException,
                                                                                       InterruptedException {
    long startTs = -1;
    boolean enabled = getProfilingEnabled();
    if (enabled) {
        startTs = System.currentTimeMillis();
    }

    boolean result = eventSink.sink(entrys, (runningInfo == null) ? null : runningInfo.getAddress(), destination);

    if (enabled) {
        this.processingInterval = System.currentTimeMillis() - startTs;
    }

    if (consumedEventCount.incrementAndGet() < 0) {
        consumedEventCount.set(0);
    }

    return result;
}
 
Example #5
Source File: EntryEventSink.java    From canal-1.1.3 with Apache License 2.0 4 votes vote down vote up
public boolean sink(List<CanalEntry.Entry> entrys, InetSocketAddress remoteAddress, String destination)
                                                                                                       throws CanalSinkException,
                                                                                                       InterruptedException {
    return sinkData(entrys, remoteAddress);
}
 
Example #6
Source File: FakeEventSink.java    From DataLink with Apache License 2.0 4 votes vote down vote up
@Override
public boolean sink(Object event, InetSocketAddress remoteAddress, String destination)
        throws CanalSinkException, InterruptedException {
    throw new UnsupportedOperationException("sink operation is not support.");
}
 
Example #7
Source File: GatewayEventSink.java    From DataLink with Apache License 2.0 4 votes vote down vote up
@Override
public boolean sink(List<CanalEntry.Entry> event, InetSocketAddress remoteAddress, String destination) throws CanalSinkException, InterruptedException {
    return eventSink.sink(event, remoteAddress, destination);
}
 
Example #8
Source File: EntryEventSink.java    From canal with Apache License 2.0 4 votes vote down vote up
public boolean sink(List<CanalEntry.Entry> entrys, InetSocketAddress remoteAddress, String destination)
                                                                                                       throws CanalSinkException,
                                                                                                       InterruptedException {
    return sinkData(entrys, remoteAddress);
}
 
Example #9
Source File: CanalEventSink.java    From canal-1.1.3 with Apache License 2.0 2 votes vote down vote up
/**
 * 提交数据
 * 
 * @param event
 * @param remoteAddress
 * @param destination
 * @throws CanalSinkException
 * @throws InterruptedException
 */
boolean sink(T event, InetSocketAddress remoteAddress, String destination) throws CanalSinkException,
                                                                          InterruptedException;
 
Example #10
Source File: CanalEventSink.java    From canal with Apache License 2.0 2 votes vote down vote up
/**
 * 提交数据
 * 
 * @param event
 * @param remoteAddress
 * @param destination
 * @throws CanalSinkException
 * @throws InterruptedException
 */
boolean sink(T event, InetSocketAddress remoteAddress, String destination) throws CanalSinkException,
                                                                          InterruptedException;