public void removeTableBlocks(List<String> segmentsToBeRemoved,AbsoluteTableIdentifier absoluteTableIdentifier){
  Object lockObject=tableLockMap.get(absoluteTableIdentifier);
  if (null == lockObject) {
    return;
  }
  Map<BlockInfo,AbstractIndex> map=tableBlocksMap.get(absoluteTableIdentifier);
  if (null == map || map.isEmpty()) {
    return;
  }
  Map<String,List<BlockInfo>> segmentIdToBlockInfoMap=segmentIdToBlockListMap.get(absoluteTableIdentifier);
  if (null == segmentIdToBlockInfoMap || segmentIdToBlockInfoMap.isEmpty()) {
    return;
  }
synchronized (lockObject) {
    for (    String segmentId : segmentsToBeRemoved) {
      List<BlockInfo> tableBlockInfoList=segmentIdToBlockInfoMap.remove(segmentId);
      if (null == tableBlockInfoList) {
        continue;
      }
      Iterator<BlockInfo> tableBlockInfoIterator=tableBlockInfoList.iterator();
      while (tableBlockInfoIterator.hasNext()) {
        BlockInfo info=tableBlockInfoIterator.next();
        map.remove(info);
      }
    }
  }
}

public void removeTableBlocks ( List < String > segmentsToBeRemoved , AbsoluteTableIdentifier absoluteTableIdentifier ) { Object lockObject = tableLockMap . get ( absoluteTableIdentifier ) ; if ( null == lockObject ) { return ; } Map < BlockInfo , AbstractIndex > map = tableBlocksMap . get ( absoluteTableIdentifier ) ; if ( null == map || map . isEmpty ( ) ) { return ; } Map < String , List < BlockInfo > > segmentIdToBlockInfoMap = segmentIdToBlockListMap . get ( absoluteTableIdentifier ) ; if ( null == segmentIdToBlockInfoMap || segmentIdToBlockInfoMap . isEmpty ( ) ) { return ; } synchronized ( lockObject ) { for ( String segmentId : segmentsToBeRemoved ) { List < BlockInfo > tableBlockInfoList = segmentIdToBlockInfoMap . remove ( segmentId ) ; if ( null == tableBlockInfoList ) { continue ; } Iterator < BlockInfo > tableBlockInfoIterator = tableBlockInfoList . iterator ( ) ; while ( tableBlockInfoIterator . hasNext ( ) ) { BlockInfo info = tableBlockInfoIterator . next ( ) ; map . remove ( info ) ; } } } }
this will be used to remove a particular blocks useful in case of deletion of some of the blocks in case of retention or may be some other scenario
