private void addFileToMap(Matcher matcher, Path file, boolean sawBase, Map<Integer, BucketTracker> splitToBucketMap) { if (!matcher.find()) { LOG.warn("Found a non-bucket file that we thought matched the bucket pattern! " + file.toString() + " Matcher=" + matcher.toString()); } int bucketNum = Integer.parseInt(matcher.group()); BucketTracker bt = splitToBucketMap.get(bucketNum); if (bt == null) { bt = new BucketTracker(); splitToBucketMap.put(bucketNum, bt); } LOG.debug("Adding " + file.toString() + " to list of files for splits"); bt.buckets.add(file); bt.sawBase |= sawBase; }
private void addFileToMap(Matcher matcher, Path file, boolean sawBase, Map<Integer, BucketTracker> splitToBucketMap) { if (!matcher.find()) { LOG.warn("Found a non-bucket file that we thought matched the bucket pattern! " + file.toString()); } int bucketNum = Integer.valueOf(matcher.group()); BucketTracker bt = splitToBucketMap.get(bucketNum); if (bt == null) { bt = new BucketTracker(); splitToBucketMap.put(bucketNum, bt); } LOG.debug("Adding " + file.toString() + " to list of files for splits"); bt.buckets.add(file); bt.sawBase |= sawBase; }
private void addFileToMap(Matcher matcher, Path file, boolean sawBase, Map<Integer, BucketTracker> splitToBucketMap) { if (!matcher.find()) { String msg = "Found a non-bucket file that we thought matched the bucket pattern! " + file.toString() + " Matcher=" + matcher.toString(); LOG.error(msg); //following matcher.group() would fail anyway and we don't want to skip files since that //may be a data loss scenario throw new IllegalArgumentException(msg); } int bucketNum = Integer.parseInt(matcher.group()); BucketTracker bt = splitToBucketMap.get(bucketNum); if (bt == null) { bt = new BucketTracker(); splitToBucketMap.put(bucketNum, bt); } LOG.debug("Adding " + file.toString() + " to list of files for splits"); bt.buckets.add(file); bt.sawBase |= sawBase; }