public class TierPartitionStateJsonConvert
extends Object
This is a tool that will be useful for manually fixing the metadata in the ftps file when metadata corrupts.
This functionality can be leveraged by following these steps:
1. Convert the ftps file to json format
2. Manually modify the json file
3. Convert the updated json file back to ftps file
4. Use the modified ftps file
SAMPLE USAGE:
Help:
/opt/confluent/bin/kafka-run-class.sh kafka.tier.tools.TierPartitionStateJsonConvert -h
usage: kafka.tier.tools.TierPartitionStateJsonConvert
[-h] {ftps-to-json,json-to-ftps} ...
Provides facilities to fix/manipulate/compare/validate FTPS files
Note:
1. This tool by default generates the output file in adler format
2. Parent directory name of the updated FTPS file should be of the form topic-partition
positional arguments:
{ftps-to-json,json-to-ftps}
Valid options: ftps-to-json, json-to-ftps
ftps-to-json Convert FTPS file to json for manual editing
json-to-ftps Convert modified json file back to FTPS
optional arguments:
-h, --help show this help message and exit
/opt/confluent/bin/kafka-run-class.sh kafka.tier.tools.TierPartitionStateJsonConvert ftps-to-json -h
usage: kafka.tier.tools.TierPartitionStateJsonConvert
ftps-to-json [-h] --input.ftps INPUT.FTPS [--output.json OUTPUT.JSON]
optional arguments:
-h, --help show this help message and exit
--input.ftps INPUT.FTPS
Input ftps file
--output.json OUTPUT.JSON
Output json file
$> bin/kafka-run-class.sh \
kafka.tier.tools.TierPartitionStateJsonConvert.java \
ftps-to-json \
--input.ftps /path/to/input.ftps \
--output.json /path/to/output.json
/opt/confluent/bin/kafka-run-class.sh kafka.tier.tools.TierPartitionStateJsonConvert json-to-ftps -h
usage: kafka.tier.tools.TierPartitionStateJsonConvert
json-to-ftps [-h] --input.json INPUT.JSON [--output.ftps OUTPUT.FTPS]
optional arguments:
-h, --help show this help message and exit
--input.json INPUT.JSON
Input json file
--output.ftps OUTPUT.FTPS
Output ftps file
$> bin/kafka-run-class.sh \
kafka.tier.tools.TierPartitionStateJsonConvert.java \
json-to-ftps \
--input.json /path/to/input.json \
--output.ftps /path/to/output.ftps