Tejaskriya opened a new pull request, #7289:
URL: https://github.com/apache/ozone/pull/7289

   ## What changes were proposed in this pull request?
   
   Currently, `ozone debug ldb scan` command has a `--filter` option supporting 
the following operations for the records stored in the rocksDB: `EQUALS, 
LESSER, GREATER`.
   Adding support for matching with regex will be useful while debugging as any 
pattern of keys can be found with it. 
   For example, if a value has many fields like [name, location->[address, DN, 
IP], version, lastUpdateTime], using the option `--filter={name:regex:^a.*}` 
will display records with name that start with the letter 'a'
   
   A fields along with the regex that should be used to is given to the 
command, and only those records passing the condition it will be shown.
   eg.) `ozone debug ldb --db=/data/metadata/om.db scan --cf=volumeTable 
--filter="usedNamespace:greater:2,adminName:regex:^a.*a$" `
   --> Will show only the records having usedNamespace>2 and adminName starting 
and ending with the letter 'a'.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-11546
   
   ## How was this patch tested?
   
   Added unit tests in TestLDBCli.java and added robot test in 
ozone-debug-ldb.robot.
   Also tested locally in a db:
   ```
   $ ozone debug ldb --db=ZDump/bigDB/omMBdb/om.db scan --cf=keyTable  -l=3  
--fields="objectID,volumeName,bucketName,keyName,dataSize,creationTime" 
--filter="acls.name:equals:systest,creationTime:regex:^172[0-9]*237$"
   
   { 
"/55406660-10tb/ozone-legacy-ec-1st-bucket-55406660/10T-1-terasort-input/_SUCCESS":
 {
     "bucketName" : "ozone-legacy-ec-1st-bucket-55406660",
     "creationTime" : 1722744719237,
     "volumeName" : "55406660-10tb",
     "keyName" : "10T-1-terasort-input/_SUCCESS",
     "dataSize" : 0,
     "objectID" : -9223372036249583104
   }
    }
   
   
   $ ozone debug ldb --db=ZDump/bigDB/om.db scan --cf=volumeTable  
--fields=volume,usedNamespace,adminName  
--filter="usedNamespace:equals:2,adminName:regex:^i.*"
   
   { "/cai": {
     "volume" : "cai",
     "adminName" : "impala",
     "usedNamespace" : 2
   }
    }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to