@Test public void testDefaultSegmentFetcherFactory() { assertEquals(SegmentFetcherFactory.getSegmentFetcher(HTTP_PROTOCOL).getClass(), HttpSegmentFetcher.class); assertEquals(SegmentFetcherFactory.getSegmentFetcher(HTTPS_PROTOCOL).getClass(), HttpSegmentFetcher.class); assertEquals(SegmentFetcherFactory.getSegmentFetcher(FILE_PROTOCOL).getClass(), PinotFSSegmentFetcher.class); assertEquals(SegmentFetcherFactory.getSegmentFetcher("foo").getClass(), PinotFSSegmentFetcher.class); }
public static SegmentFetcher getSegmentFetcher(String protocol) { SegmentFetcher segmentFetcher = SEGMENT_FETCHER_MAP.get(protocol); if (segmentFetcher != null) { return segmentFetcher; } else { LOGGER.info("Segment fetcher is not configured for protocol: {}, using default", protocol); switch (protocol) { case CommonConstants.HTTP_PROTOCOL: case CommonConstants.HTTPS_PROTOCOL: return DEFAULT_HTTP_SEGMENT_FETCHER; default: return DEFAULT_PINOT_FS_SEGMENT_FETCHER; } } }
SegmentFetcherFactory { public static SegmentFetcher getSegmentFetcher(String protocol) { SegmentFetcher segmentFetcher = SEGMENT_FETCHER_MAP.get(protocol); if (segmentFetcher != null) { return segmentFetcher; } else { LOGGER.info("Segment fetcher is not configured for protocol: {}, using default", protocol); switch (protocol) { case CommonConstants.HTTP_PROTOCOL: case CommonConstants.HTTPS_PROTOCOL: return DEFAULT_HTTP_SEGMENT_FETCHER; default: return DEFAULT_PINOT_FS_SEGMENT_FETCHER; } } } }
SegmentFetcherFactory { public static SegmentFetcher getSegmentFetcher(String protocol) { SegmentFetcher segmentFetcher = SEGMENT_FETCHER_MAP.get(protocol); if (segmentFetcher != null) { return segmentFetcher; } else { LOGGER.info("Segment fetcher is not configured for protocol: {}, using default", protocol); switch (protocol) { case CommonConstants.HTTP_PROTOCOL: case CommonConstants.HTTPS_PROTOCOL: return DEFAULT_HTTP_SEGMENT_FETCHER; default: return DEFAULT_PINOT_FS_SEGMENT_FETCHER; } } } private  SegmentFetcherFactory(); }
SegmentFetcherFactory { public static SegmentFetcher getSegmentFetcher(String protocol) { SegmentFetcher segmentFetcher = SEGMENT_FETCHER_MAP.get(protocol); if (segmentFetcher != null) { return segmentFetcher; } else { LOGGER.info("Segment fetcher is not configured for protocol: {}, using default", protocol); switch (protocol) { case CommonConstants.HTTP_PROTOCOL: case CommonConstants.HTTPS_PROTOCOL: return DEFAULT_HTTP_SEGMENT_FETCHER; default: return DEFAULT_PINOT_FS_SEGMENT_FETCHER; } } } private  SegmentFetcherFactory(); static void init(PinotConfiguration config); static SegmentFetcher getSegmentFetcher(String protocol); static void fetchSegmentToLocal(URI uri, File dest); static void fetchSegmentToLocal(String uri, File dest); static void fetchAndDecryptSegmentToLocal(String uri, File dest, String crypterName); }
SegmentFetcherFactory { public static SegmentFetcher getSegmentFetcher(String protocol) { SegmentFetcher segmentFetcher = SEGMENT_FETCHER_MAP.get(protocol); if (segmentFetcher != null) { return segmentFetcher; } else { LOGGER.info("Segment fetcher is not configured for protocol: {}, using default", protocol); switch (protocol) { case CommonConstants.HTTP_PROTOCOL: case CommonConstants.HTTPS_PROTOCOL: return DEFAULT_HTTP_SEGMENT_FETCHER; default: return DEFAULT_PINOT_FS_SEGMENT_FETCHER; } } } private  SegmentFetcherFactory(); static void init(PinotConfiguration config); static SegmentFetcher getSegmentFetcher(String protocol); static void fetchSegmentToLocal(URI uri, File dest); static void fetchSegmentToLocal(String uri, File dest); static void fetchAndDecryptSegmentToLocal(String uri, File dest, String crypterName);  }