net.opentsdb.data.deserializers.Deserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentsdb-rpc-kafka Show documentation
Show all versions of opentsdb-rpc-kafka Show documentation
A consumer and publisher for OpenTSDB Kafka messages
// This file is part of OpenTSDB.
// Copyright (C) 2018 The OpenTSDB Authors.
//
// Licensed 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 net.opentsdb.data.deserializers;
import java.util.List;
import com.stumbleupon.async.Deferred;
import net.opentsdb.core.TSDB;
import net.opentsdb.data.TypedIncomingData;
import net.opentsdb.tsd.KafkaRpcPluginThread;
/**
* The interface used to describe a module that will deserialize raw bytes from
* the Kafka buss.
*
* Note that this class is implemented once per consumer group so make sure that
* calls to {@link #deserialize(KafkaRpcPluginThread, byte[])} are thread safe.
*/
public interface Deserializer {
/**
* Called to initialize the implementation.
* @param tsdb A non-null TSDB object to get the config object from.
*/
public void initialize(final TSDB tsdb);
/**
* Called when the plugin is shut down to allow the deserializer to release
* any resources it requires.
* @return Always return a non-null deferred that resolves to null or an
* exception.
*/
public Deferred