You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2024/04/24 05:29:57 UTC

Re: [PR] HDDS-10744. Standardize byte array conversion to String for LiveFileMetaData in RocksDB. [ozone]

adoroszlai commented on code in PR #6580:
URL: https://github.com/apache/ozone/pull/6580#discussion_r1577255092


##########
hadoop-hdds/rocksdb-checkpoint-differ/src/test/java/org/apache/ozone/rocksdiff/TestRocksDBCheckpointDiffer.java:
##########
@@ -714,25 +715,20 @@ private void readRocksDBInstance(String dbPathArg,
       for (LiveFileMetaData m : liveFileMetaDataList) {
         LOG.debug("SST File: {}. ", m.fileName());
         LOG.debug("\tLevel: {}", m.level());
-        LOG.debug("\tTable: {}", toStr(m.columnFamilyName()));
-        LOG.debug("\tKey Range: {}", toStr(m.smallestKey())
-            + " <-> " + toStr(m.largestKey()));
+        LOG.debug("\tTable: {}", bytes2String(m.columnFamilyName()));
+        LOG.debug("\tKey Range: {}", bytes2String(m.smallestKey()) + " <-> " + bytes2String(m.largestKey()));
         if (differ.debugEnabled(DEBUG_DAG_LIVE_NODES)) {
           printMutableGraphFromAGivenNode(
-              differ.getCompactionNodeMap(),
-              m.fileName(), m.level(),
-              differ.getForwardCompactionDAG());
+              differ.getCompactionNodeMap(), m.fileName(), m.level(), differ.getForwardCompactionDAG());

Review Comment:
   nit: please avoid unrelated formatting change



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeStoreSchemaThreeImpl.java:
##########
@@ -182,9 +180,9 @@ public void compactionIfNeeded() throws Exception {
             long endCId = Long.MIN_VALUE;
             for (LiveFileMetaData file: innerEntry.getValue()) {
               long firstCId = DatanodeSchemaThreeDBDefinition.getContainerId(
-                  FixedLengthStringCodec.bytes2String(file.smallestKey()));
+                  StringUtils.bytes2String(file.smallestKey()));
               long lastCId = DatanodeSchemaThreeDBDefinition.getContainerId(
-                  FixedLengthStringCodec.bytes2String(file.largestKey()));
+                  StringUtils.bytes2String(file.largestKey()));

Review Comment:
   I think `FixedLengthStringCodec` should be kept here, see test failure.
   
   ```
   IllegalStateException: Failed to encode with ISO-8859-1: ...
   	at org.apache.hadoop.hdds.utils.db.StringCodecBase.lambda$encode$0(StringCodecBase.java:101)
   	at org.apache.hadoop.hdds.utils.db.StringCodecBase.string2Bytes(StringCodecBase.java:146)
   	at org.apache.hadoop.hdds.utils.db.FixedLengthStringCodec.string2Bytes(FixedLengthStringCodec.java:48)
   	at org.apache.hadoop.ozone.container.metadata.DatanodeSchemaThreeDBDefinition.getContainerId(DatanodeSchemaThreeDBDefinition.java:164)
   	at org.apache.hadoop.ozone.container.metadata.DatanodeStoreSchemaThreeImpl.compactionIfNeeded(DatanodeStoreSchemaThreeImpl.java:182)
   	at org.apache.hadoop.ozone.container.common.volume.HddsVolume.check(HddsVolume.java:285)
   	at org.apache.hadoop.ozone.container.keyvalue.TestKeyValueContainer.testAutoCompactionSmallSstFile(TestKeyValueContainer.java:899)
   ```
   
   https://github.com/apache/ozone/actions/runs/8809287315/job/24180227796?pr=6580#step:6:1179



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org