private SystemStreamPartition deserializeSystemStreamPartition(String serializedSSP) { Map<String, String> sspPropertiesMap = jsonSerde.fromBytes(serializedSSP.getBytes()); String systemName = sspPropertiesMap.get(SYSTEM_PROP_NAME); String streamName = sspPropertiesMap.get(STREAM_PROP_NAME); Partition partition = new Partition(Integer.parseInt(sspPropertiesMap.get("partition"))); return new SystemStreamPartition(systemName, streamName, partition); }
static KinesisSystemConsumerOffset parse(String metadata) { JsonSerdeV2<KinesisSystemConsumerOffset> jsonSerde = new JsonSerdeV2<>(KinesisSystemConsumerOffset.class); byte[] bytes; try { bytes = metadata.getBytes("UTF-8"); } catch (Exception e) { throw new SamzaException(e); } return jsonSerde.fromBytes(bytes); }