code: public InputSplit[] sample(PathFilter pathFilter, double... weights) {
          URI[] paths = pathFilter != null ? pathFilter.filter(locations()) : locations();
  
          if (weights != null && weights.length > 0 && weights[0] != 1.0) {
              InputSplit[] splits = new InputSplit[weights.length];
              double totalWeight = 0;
              for (int i = 0; i < weights.length; i++) {
                  totalWeight += weights[i];
              }
  
              double cumulWeight = 0;
              int[] partitions = new int[weights.length + 1];
              for (int i = 0; i < weights.length; i++) {
                  partitions[i] = (int) Math.round(cumulWeight * paths.length / totalWeight);
                  cumulWeight += weights[i];
              }
              partitions[weights.length] = paths.length;
  
              for (int i = 0; i < weights.length; i++) {
                  List<URI> uris = new ArrayList<>();
                  for (int j = partitions[i]; j < partitions[i + 1]; j++) {
                      uris.add(paths[j]);
                  }
                  splits[i] = new CollectionInputSplit(uris);
              }
              return splits;
          } else {
              return new InputSplit[] {new CollectionInputSplit(Arrays.asList(paths))};
          }
      }
docs: TODO: Specialize in InputStreamInputSplit and others for CSVRecordReader, etc