public static Integer extractPartitionName(String fileName,PartitionerType partitioner){
  if (partitioner == PartitionerType.MODULUS || partitioner == PartitionerType.CASCADING) {
    if (!fileName.startsWith(Constants.FILE_PREFIX)) {
      return null;
    }
    try {
      return Integer.parseInt(fileName.substring(5,10));
    }
 catch (    NumberFormatException e) {
      return null;
    }
  }
  return null;
}

public static Integer extractPartitionName ( String fileName , PartitionerType partitioner ) { if ( partitioner == PartitionerType . MODULUS || partitioner == PartitionerType . CASCADING ) { if ( ! fileName . startsWith ( Constants . FILE_PREFIX ) ) { return null ; } try { return Integer . parseInt ( fileName . substring ( 5 , 10 ) ) ; } catch ( NumberFormatException e ) { return null ; } } return null ; }
extracts the partition name for a file . it expects file names with the prefix part - 00000 etc . currently only modulus sharding is supported .
