How to parse aerospike backup file to regenerate data?

余生长醉 提交于 2020-01-03 19:42:35

问题


In the backup file there are a lot of encoded values. How do I get back the original data.
For example there is

+ d q+LsiGs1gD9duJDbzQSXytajtCY=

which is of the format ["+"] [SP] ["d"] [SP] [{digest}] [LF] where q+LsiGs1gD9duJDbzQSXytajtCY= is the key digest. How would the get the primary key from this?

Also Map and List values are represented as opaque byte values. How do we restore the original Map and List?

I would currently need to do all this if I wanted to make a CSV dump out of the backup.


回答1:


The tool asbackup is an open source tool, as is asrestore. The file format is described in the repo aerospike/aerospike-tools-backup on GitHub.

Alternatively, you could use the Kafka connector to move data from Aerospike to another database via Kafka.

The easiest way to do what you're looking for is still to write a program that scans the target namespace, and parses each record into a csv format. You can use predicate filtering to only get records whose last-update-time is greater than a specific timestamp, giving you the progressive backup you want. See the PredExp class of the Java client and its examples.



来源:https://stackoverflow.com/questions/45819023/how-to-parse-aerospike-backup-file-to-regenerate-data

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!