本文整理匯總了Java中org.apache.samza.serializers.JsonSerde類的典型用法代碼示例。如果您正苦於以下問題:Java JsonSerde類的具體用法?Java JsonSerde怎麽用?Java JsonSerde使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JsonSerde類屬於org.apache.samza.serializers包,在下文中一共展示了JsonSerde類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: deserializeCoordinatorStreamMessage
import org.apache.samza.serializers.JsonSerde; //導入依賴的package包/類
public static CoordinatorStreamMessage deserializeCoordinatorStreamMessage(OutgoingMessageEnvelope msg) {
JsonSerde<List<?>> keySerde = new JsonSerde<>();
Object[] keyArray = keySerde.fromBytes((byte[]) msg.getKey()).toArray();
JsonSerde<Map<String, Object>> msgSerde = new JsonSerde<>();
Map<String, Object> valueMap = msgSerde.fromBytes((byte[]) msg.getMessage());
return new CoordinatorStreamMessage(keyArray, valueMap);
}
示例2: CoordinatorStreamSystemConsumer
import org.apache.samza.serializers.JsonSerde; //導入依賴的package包/類
public CoordinatorStreamSystemConsumer(SystemStream coordinatorSystemStream, SystemConsumer systemConsumer, SystemAdmin systemAdmin) {
this(coordinatorSystemStream, systemConsumer, systemAdmin, new JsonSerde<List<?>>(), new JsonSerde<Map<String, Object>>());
}
示例3: CoordinatorStreamSystemProducer
import org.apache.samza.serializers.JsonSerde; //導入依賴的package包/類
public CoordinatorStreamSystemProducer(SystemStream systemStream, SystemProducer systemProducer, SystemAdmin systemAdmin) {
this(systemStream, systemProducer, systemAdmin, new JsonSerde<List<?>>(), new JsonSerde<Map<String, Object>>());
}
示例4: LoggingEventJsonSerde
import org.apache.samza.serializers.JsonSerde; //導入依賴的package包/類
/**
* Constructs the serde.
*
* @param includeLocationInfo
* Whether to include location info in the logging event or not.
*/
@SuppressWarnings("rawtypes")
public LoggingEventJsonSerde(boolean includeLocationInfo) {
this.includeLocationInfo = includeLocationInfo;
this.jsonSerde = new JsonSerde();
}