@Test public void testGetCodecFactoryIgnoresCase() { CodecFactory codecFactory = WriterUtils.getCodecFactory(Optional.of("SNAPPY"), Optional.<String>absent()); Assert.assertEquals(codecFactory.toString(), "snappy"); codecFactory = WriterUtils.getCodecFactory(Optional.of("snappy"), Optional.<String>absent()); Assert.assertEquals(codecFactory.toString(), "snappy"); }
public static CodecFactory getCodecFactory(Optional<String> codecName, Optional<String> deflateLevel) { if (!codecName.isPresent()) { return CodecFactory.deflateCodec(ConfigurationKeys.DEFAULT_DEFLATE_LEVEL); } else if (codecName.get().equalsIgnoreCase(DataFileConstants.DEFLATE_CODEC)) { if (!deflateLevel.isPresent()) { return CodecFactory.deflateCodec(ConfigurationKeys.DEFAULT_DEFLATE_LEVEL); } return CodecFactory.deflateCodec(Integer.parseInt(deflateLevel.get())); } else { return CodecFactory.fromString(codecName.get().toLowerCase()); } }
WriterUtils { public static CodecFactory getCodecFactory(Optional<String> codecName, Optional<String> deflateLevel) { if (!codecName.isPresent()) { return CodecFactory.deflateCodec(ConfigurationKeys.DEFAULT_DEFLATE_LEVEL); } else if (codecName.get().equalsIgnoreCase(DataFileConstants.DEFLATE_CODEC)) { if (!deflateLevel.isPresent()) { return CodecFactory.deflateCodec(ConfigurationKeys.DEFAULT_DEFLATE_LEVEL); } return CodecFactory.deflateCodec(Integer.parseInt(deflateLevel.get())); } else { return CodecFactory.fromString(codecName.get().toLowerCase()); } } }
WriterUtils { public static CodecFactory getCodecFactory(Optional<String> codecName, Optional<String> deflateLevel) { if (!codecName.isPresent()) { return CodecFactory.deflateCodec(ConfigurationKeys.DEFAULT_DEFLATE_LEVEL); } else if (codecName.get().equalsIgnoreCase(DataFileConstants.DEFLATE_CODEC)) { if (!deflateLevel.isPresent()) { return CodecFactory.deflateCodec(ConfigurationKeys.DEFAULT_DEFLATE_LEVEL); } return CodecFactory.deflateCodec(Integer.parseInt(deflateLevel.get())); } else { return CodecFactory.fromString(codecName.get().toLowerCase()); } }  }
WriterUtils { public static CodecFactory getCodecFactory(Optional<String> codecName, Optional<String> deflateLevel) { if (!codecName.isPresent()) { return CodecFactory.deflateCodec(ConfigurationKeys.DEFAULT_DEFLATE_LEVEL); } else if (codecName.get().equalsIgnoreCase(DataFileConstants.DEFLATE_CODEC)) { if (!deflateLevel.isPresent()) { return CodecFactory.deflateCodec(ConfigurationKeys.DEFAULT_DEFLATE_LEVEL); } return CodecFactory.deflateCodec(Integer.parseInt(deflateLevel.get())); } else { return CodecFactory.fromString(codecName.get().toLowerCase()); } }  static Path getWriterStagingDir(State state, int numBranches, int branchId); static Path getWriterStagingDir(State state, int numBranches, int branchId, String attemptId); static Path getWriterOutputDir(State state, int numBranches, int branchId); static Path getDataPublisherFinalDir(State state, int numBranches, int branchId); static Path getWriterFilePath(State state, int numBranches, int branchId); static Path getNamespaceTableWriterFilePath(State state); static Path getTableNameWriterFilePath(State state); static Path getDefaultWriterFilePath(State state, int numBranches, int branchId); static String getWriterFileName(State state, int numBranches, int branchId, String writerId,
      String formatExtension); static CodecFactory getCodecFactory(Optional<String> codecName, Optional<String> deflateLevel); static void mkdirsWithRecursivePermission(final FileSystem fs, final Path path, FsPermission perm); static void mkdirsWithRecursivePermissionWithRetry(final FileSystem fs, final Path path, FsPermission perm, Config retrierConfig); static URI getWriterFsUri(State state, int numBranches, int branchId); static FileSystem getWriterFS(State state, int numBranches, int branchId); static FileSystem getWriterFs(State state); static Configuration getFsConfiguration(State state); }
WriterUtils { public static CodecFactory getCodecFactory(Optional<String> codecName, Optional<String> deflateLevel) { if (!codecName.isPresent()) { return CodecFactory.deflateCodec(ConfigurationKeys.DEFAULT_DEFLATE_LEVEL); } else if (codecName.get().equalsIgnoreCase(DataFileConstants.DEFLATE_CODEC)) { if (!deflateLevel.isPresent()) { return CodecFactory.deflateCodec(ConfigurationKeys.DEFAULT_DEFLATE_LEVEL); } return CodecFactory.deflateCodec(Integer.parseInt(deflateLevel.get())); } else { return CodecFactory.fromString(codecName.get().toLowerCase()); } }  static Path getWriterStagingDir(State state, int numBranches, int branchId); static Path getWriterStagingDir(State state, int numBranches, int branchId, String attemptId); static Path getWriterOutputDir(State state, int numBranches, int branchId); static Path getDataPublisherFinalDir(State state, int numBranches, int branchId); static Path getWriterFilePath(State state, int numBranches, int branchId); static Path getNamespaceTableWriterFilePath(State state); static Path getTableNameWriterFilePath(State state); static Path getDefaultWriterFilePath(State state, int numBranches, int branchId); static String getWriterFileName(State state, int numBranches, int branchId, String writerId,
      String formatExtension); static CodecFactory getCodecFactory(Optional<String> codecName, Optional<String> deflateLevel); static void mkdirsWithRecursivePermission(final FileSystem fs, final Path path, FsPermission perm); static void mkdirsWithRecursivePermissionWithRetry(final FileSystem fs, final Path path, FsPermission perm, Config retrierConfig); static URI getWriterFsUri(State state, int numBranches, int branchId); static FileSystem getWriterFS(State state, int numBranches, int branchId); static FileSystem getWriterFs(State state); static Configuration getFsConfiguration(State state); static final String WRITER_ENCRYPTED_CONFIG_PATH; static final Config NO_RETRY_CONFIG; }