public void removeSegment(IndexSegment segment) {
    // TODO(saurabh): Explain reload scenario here
    Iterator<PrimaryKey> primaryKeyIterator = getPrimaryKeyIterator(segment, _primaryKeyColumns);
    while (primaryKeyIterator.hasNext()) {
      PrimaryKey pk = primaryKeyIterator.next();
      _primaryKeyToSegmentMap.compute(HashUtils.hashPrimaryKey(pk, _hashFunction),
          (primaryKey, currentSegment) -> {
            if (currentSegment == segment) {
              return null;
            } else {
              return currentSegment;
            }
          });
    }
    _serverMetrics.setValueOfPartitionGauge(_tableNameWithType, _partitionId, ServerGauge.DEDUP_PRIMARY_KEYS_COUNT,
        _primaryKeyToSegmentMap.size());
  }
public void removeSegment(IndexSegment segment) {
   
    Iterator<PrimaryKey> primaryKeyIterator = getPrimaryKeyIterator(segment, _primaryKeyColumns);
    while (primaryKeyIterator.hasNext()) {
      PrimaryKey pk = primaryKeyIterator.next();
      _primaryKeyToSegmentMap.compute(HashUtils.hashPrimaryKey(pk, _hashFunction),
          (primaryKey, currentSegment) -> {
            if (currentSegment == segment) {
              return null;
            } else {
              return currentSegment;
            }
          });
    }
    _serverMetrics.setValueOfPartitionGauge(_tableNameWithType, _partitionId, ServerGauge.DEDUP_PRIMARY_KEYS_COUNT,
        _primaryKeyToSegmentMap.size());
  }
public void removesegment(indexsegment segment) { iterator<primarykey> primarykeyiterator = getprimarykeyiterator(segment, _primarykeycolumns); while (primarykeyiterator.hasnext()) { primarykey pk = primarykeyiterator.next(); _primarykeytosegmentmap.compute(hashutils.hashprimarykey(pk, _hashfunction), (primarykey, currentsegment) -> { if (currentsegment == segment) { return null; } else { return currentsegment; } }); } _servermetrics.setvalueofpartitiongauge(_tablenamewithtype, _partitionid, servergauge.dedup_primary_keys_count, _primarykeytosegmentmap.size()); }