You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/07/16 06:40:25 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #8674: Remove segments using valid doc ids instead of primary key

Jackie-Jiang commented on code in PR #8674:
URL: https://github.com/apache/pinot/pull/8674#discussion_r922641266


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/mutable/MutableSegmentImpl.java:
##########
@@ -569,6 +569,19 @@ private RecordInfo getRecordInfo(GenericRow row, int docId) {
     return new RecordInfo(primaryKey, docId, null);
   }
 
+  @Override
+  public void getPrimaryKey(int docId, PrimaryKey reuse) {

Review Comment:
   (minor) move this method next to `getRecord()` for readability



##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/IndexSegment.java:
##########
@@ -86,6 +87,15 @@ public interface IndexSegment {
    */
   GenericRow getRecord(int docId, GenericRow reuse);
 
+  /**
+   * Returns the primaryKey for a given docId
+   *
+   * @param docId Document Id
+   * @param reuse Reusable buffer for the primary key
+   * @return Primary key for the given document Id
+   */
+  void getPrimaryKey(int docId, PrimaryKey reuse);

Review Comment:
   (minor) Consider changing `reuse` to `buffer` since the method has no return value



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/PartitionUpsertMetadataManager.java:
##########
@@ -249,13 +259,19 @@ public void removeSegment(IndexSegment segment) {
     LOGGER.info("Removing upsert metadata for segment: {}", segmentName);
 
     if (!Objects.requireNonNull(segment.getValidDocIds()).getMutableRoaringBitmap().isEmpty()) {

Review Comment:
   (minor) Cache `Objects.requireNonNull(segment.getValidDocIds()).getMutableRoaringBitmap()` into a local variable



-- 
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