Java Code Examples for org.apache.kafka.connect.data.SchemaAndValue#NULL

The following examples show how to use org.apache.kafka.connect.data.SchemaAndValue#NULL . 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: CacheEventConverter.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override public SchemaAndValue toConnectData(String topic, byte[] bytes) {
    CacheEvent evt;

    try {
        evt = deserializer.deserialize(topic, bytes);
    }
    catch (SerializationException e) {
        throw new DataException("Failed to convert to Kafka Connect data due to a serialization error", e);
    }

    if (evt == null) {
        return SchemaAndValue.NULL;
    }
    return new SchemaAndValue(null, evt);
}
 
Example 2
Source File: SchemalessConverter.java    From apicurio-registry with Apache License 2.0 5 votes vote down vote up
@Override
public SchemaAndValue toConnectData(String topic, byte[] bytes) {
    T result = deserializer.deserialize(topic, bytes);
    if (result == null) {
        return SchemaAndValue.NULL;
    }
    return toSchemaAndValue(result);
}