private InputSplit[] pruneBuckets(MapWork work, InputSplit[] splits) {
    final BitSet buckets = work.getIncludedBuckets();
    final String bucketIn = buckets.toString();
    List<InputSplit> filteredSplits = new ArrayList<InputSplit>(splits.length / 2);
    for (InputSplit split : splits) {
      final int bucket = Utilities.parseSplitBucket(split);
      if (bucket < 0 || buckets.get(bucket)) {
        // match or UNKNOWN
        filteredSplits.add(split);
      } else {
        LOG.info("Pruning with IN ({}) - removing {}", bucketIn, split);
      }
    }
    if (filteredSplits.size() < splits.length) {
      // reallocate only if any filters pruned
      splits = filteredSplits.toArray(new InputSplit[filteredSplits.size()]);
    }
    return splits;
  }
SplitSerializer is a helper class for taking care of serializing splits to the tez scratch dir
when a size criteria defined by "hive.tez.input.fs.serialization.threshold" is met.
It utilizes an ExecutorService for parallel writes to prevent a single split write operation
becoming the bottleneck (as write() is called from a loop currently).
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/HiveSplitGenerator.java