public void deletePath ( LogFilePath path ) throws IOException { TopicPartitionGroup topicPartition = new TopicPartitionGroup ( path . getTopic ( ) , path . getKafkaPartitions ( ) ) ; HashSet < LogFilePath > paths = mFiles . get ( topicPartition ) ; paths . remove ( path ) ; if ( paths . isEmpty ( ) ) { mFiles . remove ( topicPartition ) ; StatsUtil . clearLabel ( "secor.size." + topicPartition . getTopic ( ) + "." + topicPartition . getPartitions ( ) [ 0 ] ) ; StatsUtil . clearLabel ( "secor.modification_age_sec." + topicPartition . getTopic ( ) + "." + topicPartition . getPartitions ( ) [ 0 ] ) ; } deleteWriter ( path ) ; FileUtil . delete ( path . getLogFilePath ( ) ) ; FileUtil . delete ( path . getLogFileCrcPath ( ) ) ; }
Delete a given path the underlying file and the corresponding writer .