Github user merlimat commented on a diff in the pull request:
https://github.com/apache/incubator-pulsar/pull/526#discussion_r123866446
--- Diff:
pulsar-client-admin/src/main/resources/mltool/ManagedLedgerAdminTool.py ---
@@ -0,0 +1,261 @@
+#!/usr/bin/env python
+
+import argparse
+import traceback
+
+from kazoo.client import KazooClient
+
+from mltool import MLDataFormats_pb2
+
+'''
+This util provides api to access managed-ledger data if it's ONLY stored
in binary format in to zookeeper.
+It also provides command line tool-access to execute these commands.
+
+Run: run from parent directory
+python -m mltool.ManagedLedgerAdminTool
+'''
+managedLedgerPath = "/managed-ledgers/"
+printMlCommand = "print-ml"
+deleteMlLedgerIds = "delete-ml-ledgers"
+printCursorsCommands = "print-cursor"
+updateMakDeleteCursor = "update-mark-delete-cursor"
+
+'''
+Returns managed-ledger info for given managed-leger path
+Parameters
+----------
+zk : KazooClient
+ Zookeeper-client instance to query zk-client.
+mlPath : str
+ managed-ledger path
+'''
+def getManagedLedgerInfo(zk, mlPath):
+ try:
+ # get managed-ledger info
+ mlData = zk.get(mlPath)[0]
+ mlInfo = MLDataFormats_pb2.ManagedLedgerInfo()
+ mlInfo.ParseFromString(mlData)
--- End diff --
Is this handling the protobuf text format as well?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---