當前位置: 首頁>>代碼示例>>Java>>正文


Java JsonSerde類代碼示例

本文整理匯總了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);
}
 
開發者ID:apache,項目名稱:samza,代碼行數:8,代碼來源:MockCoordinatorStreamSystemFactory.java

示例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>>());
}
 
開發者ID:apache,項目名稱:samza,代碼行數:4,代碼來源:CoordinatorStreamSystemConsumer.java

示例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>>());
}
 
開發者ID:apache,項目名稱:samza,代碼行數:4,代碼來源:CoordinatorStreamSystemProducer.java

示例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();
}
 
開發者ID:apache,項目名稱:samza,代碼行數:12,代碼來源:LoggingEventJsonSerde.java


注:本文中的org.apache.samza.serializers.JsonSerde類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。