in src/main/java/com/aliyun/dts/subscribe/clients/metastore/LocalFileMetaStore.java [43:59]
private String toJson(StoreElement storeElement) {
JSONObject jsonObject = new JSONObject();
jsonObject.put(GROUP_ID_NAME, storeElement.groupName);
JSONArray jsonArray = new JSONArray();
storeElement.streamCheckpoint.forEach((tp, checkpoint) -> {
JSONObject streamCheckpointJsonObject = new JSONObject();
streamCheckpointJsonObject.put(TOPIC_NAME, tp.topic());
streamCheckpointJsonObject.put(PARTITION_NAME, tp.partition());
streamCheckpointJsonObject.put(OFFSET_NAME, checkpoint.getOffset());
streamCheckpointJsonObject.put(TIMESTAMP_NAME, checkpoint.getTimeStamp());
streamCheckpointJsonObject.put(INFO_NAME, checkpoint.getInfo());
jsonArray.add(streamCheckpointJsonObject);
});
jsonObject.put(STREAM_CHECKPOINT_NAME, jsonArray);
return jsonObject.toJSONString();
}