@Test public void getIndexReturn0IfNoIndex() { Assert.assertEquals(0, offsetComputer.getIndex("123.12")); }
@Override public long getIndex(String fileName) { Matcher matcher = offsetFilePatternGenerator.matcher(fileName); if (matcher.matches()) { try { return Long.parseLong(matcher.group("index")); } catch (NumberFormatException e) { LOGGER.info("Couldn't deviate a valid index from '{}'", fileName); } } return 0L; }
HdfsOffsetComputer implements OffsetComputer { @Override public long getIndex(String fileName) { Matcher matcher = offsetFilePatternGenerator.matcher(fileName); if (matcher.matches()) { try { return Long.parseLong(matcher.group("index")); } catch (NumberFormatException e) { LOGGER.info("Couldn't deviate a valid index from '{}'", fileName); } } return 0L; } }
HdfsOffsetComputer implements OffsetComputer { @Override public long getIndex(String fileName) { Matcher matcher = offsetFilePatternGenerator.matcher(fileName); if (matcher.matches()) { try { return Long.parseLong(matcher.group("index")); } catch (NumberFormatException e) { LOGGER.info("Couldn't deviate a valid index from '{}'", fileName); } } return 0L; } HdfsOffsetComputer(FileSystem fs, Path basePath, int backlogDays);  HdfsOffsetComputer(FileSystem fs, Path basePath, @Nullable String kafkaCluster, int backlogDays); }
HdfsOffsetComputer implements OffsetComputer { @Override public long getIndex(String fileName) { Matcher matcher = offsetFilePatternGenerator.matcher(fileName); if (matcher.matches()) { try { return Long.parseLong(matcher.group("index")); } catch (NumberFormatException e) { LOGGER.info("Couldn't deviate a valid index from '{}'", fileName); } } return 0L; } HdfsOffsetComputer(FileSystem fs, Path basePath, int backlogDays);  HdfsOffsetComputer(FileSystem fs, Path basePath, @Nullable String kafkaCluster, int backlogDays); @Override Map<Integer, Long> computeOffsets(Collection<Integer> partitionIds); @Override String computeDirName(LocalDateTime time); @Override long getIndex(String fileName); @Override String computeTopicGlob(LocalDateTime time, int partition); @Override String computePath(LocalDateTime time, long index, int partition); }
HdfsOffsetComputer implements OffsetComputer { @Override public long getIndex(String fileName) { Matcher matcher = offsetFilePatternGenerator.matcher(fileName); if (matcher.matches()) { try { return Long.parseLong(matcher.group("index")); } catch (NumberFormatException e) { LOGGER.info("Couldn't deviate a valid index from '{}'", fileName); } } return 0L; } HdfsOffsetComputer(FileSystem fs, Path basePath, int backlogDays);  HdfsOffsetComputer(FileSystem fs, Path basePath, @Nullable String kafkaCluster, int backlogDays); @Override Map<Integer, Long> computeOffsets(Collection<Integer> partitionIds); @Override String computeDirName(LocalDateTime time); @Override long getIndex(String fileName); @Override String computeTopicGlob(LocalDateTime time, int partition); @Override String computePath(LocalDateTime time, long index, int partition);  }