public static void setLoadModel(Configuration configuration, CarbonLoadModel loadModel) throws IOException { if (loadModel != null) { configuration.set(LOAD_MODEL, ObjectSerializationUtil.convertObjectToString(loadModel)); } }
/** * get list of partitions to prune */ public static List<PartitionSpec> getPartitionsToPrune(Configuration configuration) throws IOException { String partitionString = configuration.get(PARTITIONS_TO_PRUNE); if (partitionString != null) { return (List<PartitionSpec>) ObjectSerializationUtil.convertStringToObject(partitionString); } return null; }
private static StructType getInputSchema(Configuration configuration) throws IOException { String encodedString = configuration.get(INPUT_SCHEMA); if (encodedString != null) { return (StructType) ObjectSerializationUtil.convertStringToObject(encodedString); } return null; }
public static void setTempStoreLocations(Configuration configuration, String[] tempLocations) throws IOException { if (tempLocations != null && tempLocations.length > 0) { configuration .set(TEMP_STORE_LOCATIONS, ObjectSerializationUtil.convertObjectToString(tempLocations)); } }
public static CarbonLoadModel getCarbonLoadModel(Configuration hadoopConf) throws IOException { String value = hadoopConf.get(LOAD_Model); if (value == null) { return null; } else { return (CarbonLoadModel) ObjectSerializationUtil.convertStringToObject(value); } }
public static void setCarbonLoadModel(Configuration hadoopConf, CarbonLoadModel carbonLoadModel) throws IOException { if (carbonLoadModel != null) { hadoopConf.set(LOAD_Model, ObjectSerializationUtil.convertObjectToString(carbonLoadModel)); } }
public static ReadCommittedScope getReadCommittedScope(Configuration configuration) throws IOException { String subFoldersString = configuration.get(READ_COMMITTED_SCOPE); if (subFoldersString != null) { return (ReadCommittedScope) ObjectSerializationUtil.convertStringToObject(subFoldersString); } return null; }
/** * This method sets the datamapJob in the configuration * @param configuration * @param dataMapJob * @throws IOException */ public static void setDataMapJob(Configuration configuration, Object dataMapJob) throws IOException { if (dataMapJob != null) { String toString = ObjectSerializationUtil.convertObjectToString(dataMapJob); configuration.set(DATA_MAP_DSTR, toString); } }
/** * get datamap job from the configuration * @param configuration job configuration * @return DataMap Job * @throws IOException */ public static DataMapJob getDataMapJob(Configuration configuration) throws IOException { String jobString = configuration.get(DATA_MAP_DSTR); if (jobString != null) { return (DataMapJob) ObjectSerializationUtil.convertStringToObject(jobString); } return null; }
public static void setReadCommittedScope(Configuration configuration, ReadCommittedScope committedScope) { if (committedScope == null) { return; } try { String subFoldersString = ObjectSerializationUtil.convertObjectToString(committedScope); configuration.set(READ_COMMITTED_SCOPE, subFoldersString); } catch (Exception e) { throw new RuntimeException( "Error while setting committedScope information to Job" + committedScope, e); } }
protected Expression getFilterPredicates(Configuration configuration) { try { String filterExprString = configuration.get(FILTER_PREDICATE); if (filterExprString == null) { return null; } Object filter = ObjectSerializationUtil.convertStringToObject(filterExprString); return (Expression) filter; } catch (IOException e) { throw new RuntimeException("Error while reading filter expression", e); } }
/** * set list of partitions to prune */ public static void setPartitionsToPrune(Configuration configuration, List<PartitionSpec> partitions) { if (partitions == null) { return; } try { String partitionString = ObjectSerializationUtil.convertObjectToString(new ArrayList<>(partitions)); configuration.set(PARTITIONS_TO_PRUNE, partitionString); } catch (Exception e) { throw new RuntimeException("Error while setting patition information to Job" + partitions, e); } }
private static String[] getTempStoreLocations(TaskAttemptContext taskAttemptContext) throws IOException { String encodedString = taskAttemptContext.getConfiguration().get(TEMP_STORE_LOCATIONS); if (encodedString != null) { return (String[]) ObjectSerializationUtil.convertStringToObject(encodedString); } return new String[] { System.getProperty("java.io.tmpdir") + "/" + System.nanoTime() + "_" + taskAttemptContext .getTaskAttemptID().toString() }; }
/** * It sets unresolved filter expression. * * @param configuration * @para DataMapJob dataMapJob = getDataMapJob(job.getConfiguration()); m filterExpression */ public static void setFilterPredicates(Configuration configuration, Expression filterExpression) { if (filterExpression == null) { return; } try { String filterString = ObjectSerializationUtil.convertObjectToString(filterExpression); configuration.set(FILTER_PREDICATE, filterString); } catch (Exception e) { throw new RuntimeException("Error while setting filter expression to Job", e); } }
public static CarbonTable getCarbonTable(Configuration configuration) throws IOException { CarbonTable carbonTable = null; String encodedString = configuration.get(TABLE); if (encodedString != null) { byte[] bytes = (byte[]) ObjectSerializationUtil.convertStringToObject(encodedString); TableInfo tableInfo = TableInfo.deserialize(bytes); carbonTable = CarbonTable.buildFromTableInfo(tableInfo); } return carbonTable; }
public static void setInputSchema(Configuration configuration, StructType inputSchema) throws IOException { if (inputSchema != null && inputSchema.getFields().size() > 0) { configuration.set(INPUT_SCHEMA, ObjectSerializationUtil.convertObjectToString(inputSchema)); } else { throw new UnsupportedOperationException("Input schema must be set"); } }
String encodedString = conf.get(LOAD_MODEL); if (encodedString != null) { model = (CarbonLoadModel) ObjectSerializationUtil.convertStringToObject(encodedString); return model;
public static void setCarbonTable(Configuration configuration, CarbonTable carbonTable) throws IOException { if (carbonTable != null) { configuration.set(TABLE, ObjectSerializationUtil.convertObjectToString(carbonTable.getTableInfo().serialize())); } }