public SparkEncryptConfig getConfig()

in c3r-cli-spark/src/main/java/com/amazonaws/c3r/spark/cli/EncryptMode.java [240:265]


    public SparkEncryptConfig getConfig() {
        final SecretKey keyMaterial = KeyUtil.sharedSecretKeyFromString(System.getenv(KeyUtil.KEY_ENV_VAR));
        final TableSchema tableSchema;
        try {
            tableSchema = GsonUtil.fromJson(FileUtil.readBytes(requiredArgs.getSchema()), TableSchema.class);
        } catch (Exception e) {
            throw new C3rRuntimeException("Failed to parse the table schema file: " + requiredArgs.getSchema()
                    + ". Please see the stack trace for where the parsing failed.", e);
        }
        if (tableSchema == null) {
            throw new C3rIllegalArgumentException("The table schema file was empty: " + requiredArgs.getSchema());
        }

        return SparkEncryptConfig.builder()
                .source(requiredArgs.getInput())
                .fileFormat(optionalArgs.fileFormat)
                .targetDir(optionalArgs.output)
                .overwrite(optionalArgs.overwrite)
                .csvInputNullValue(optionalArgs.csvInputNullValue)
                .csvOutputNullValue(optionalArgs.csvOutputNullValue)
                .secretKey(keyMaterial)
                .salt(requiredArgs.getId().toString())
                .settings(getClientSettings())
                .tableSchema(tableSchema)
                .build();
    }