You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "klsince (via GitHub)" <gi...@apache.org> on 2024/02/26 21:51:10 UTC

Re: [PR] Custom configuration property reader for segment metadata files [pinot]

klsince commented on code in PR #12440:
URL: https://github.com/apache/pinot/pull/12440#discussion_r1503346467


##########
pinot-spi/src/main/java/org/apache/pinot/spi/env/SegmentMetadataPropertyReader.java:
##########
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.spi.env;
+
+import java.io.Reader;
+import org.apache.commons.configuration2.PropertiesConfiguration.PropertiesReader;
+
+
+public class SegmentMetadataPropertyReader extends PropertiesReader {
+
+  public SegmentMetadataPropertyReader(Reader reader) {
+    super(reader);
+  }
+
+  @Override
+  protected String unescapePropertyName(final String name) {

Review Comment:
   in addition to this method, should we also consider to override this method of `PropertiesReader` 
   ```
           protected void parseProperty(final String line) {
               final String[] property = doParseProperty(line, false); <--- expensive using regex to split `key = value`
   ....
   ```
   
   I think we might just use the index of the first `=` to split the key and value up



-- 
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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org