// TODO(saurabh): Explain reload scenario here
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) {
// TODO(saurabh): Explain reload scenario here
Iterator<PrimaryKey> primaryKeyIterator = getPrimaryKeyIterator(segment, _primaryKeyColumns);
while (primaryKeyIterator.hasNext()) {
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;
}
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());
}