private void setOutputPath(DataStore<K,T> store, TaskAttemptContext context) { if(store instanceof FileBackedDataStore) { FileBackedDataStore<K, T> fileStore = (FileBackedDataStore<K, T>) store; String uniqueName = FileOutputFormat.getUniqueFile(context, "part", ""); //if file store output is not set, then get the output from FileOutputFormat if(fileStore.getOutputPath() == null) { fileStore.setOutputPath(FileOutputFormat.getOutputPath(context).toString()); } //set the unique name of the data file String path = fileStore.getOutputPath(); fileStore.setOutputPath( path + Path.SEPARATOR + uniqueName); } }
@SuppressWarnings({ "rawtypes" }) private void setInputPath(PartitionQuery<K, T> partitionQuery) throws IOException { //if the data store is file based if(partitionQuery instanceof FileSplitPartitionQuery) { FileSplit split = ((FileSplitPartitionQuery<K,T>)partitionQuery).getSplit(); //set the input path to FileSplit's path. ((FileBackedDataStore)partitionQuery.getDataStore()).setInputPath( split.getPath().toString()); } }
@SuppressWarnings({ "rawtypes" }) private void setInputPath(PartitionQuery<K, T> partitionQuery) throws IOException { //if the data store is file based if(partitionQuery instanceof FileSplitPartitionQuery) { FileSplit split = ((FileSplitPartitionQuery<K,T>)partitionQuery).getSplit(); //set the input path to FileSplit's path. ((FileBackedDataStore)partitionQuery.getDataStore()).setInputPath( split.getPath().toString()); } }
private void setOutputPath(DataStore<K,T> store, TaskAttemptContext context) { if(store instanceof FileBackedDataStore) { FileBackedDataStore<K, T> fileStore = (FileBackedDataStore<K, T>) store; String uniqueName = FileOutputFormat.getUniqueFile(context, "part", ""); //if file store output is not set, then get the output from FileOutputFormat if(fileStore.getOutputPath() == null) { fileStore.setOutputPath(FileOutputFormat.getOutputPath(context).toString()); } //set the unique name of the data file String path = fileStore.getOutputPath(); fileStore.setOutputPath( path + Path.SEPARATOR + uniqueName); } }