MCPcopy Create free account
hub / github.com/apache/pig / openDFSFile

Method openDFSFile

src/org/apache/pig/impl/io/FileLocalizer.java:169–178  ·  view source on GitHub ↗

This function is meant to be used if the mappers/reducers want to access any HDFS file @param fileName @return InputStream of the open file. @throws IOException

(String fileName)

Source from the content-addressed store, hash-verified

167 * @throws IOException
168 */
169 public static InputStream openDFSFile(String fileName) throws IOException {
170 Configuration conf = PigMapReduce.sJobConfInternal.get();
171 if (conf == null) {
172 throw new RuntimeException(
173 "can't open DFS file while executing locally");
174 }
175
176 return openDFSFile(fileName, ConfigurationUtil.toProperties(conf));
177
178 }
179
180 public static InputStream openDFSFile(String fileName, Properties properties) throws IOException{
181 DataStorage dds = new HDataStorage(properties);

Callers 5

initMethod · 0.95
initMethod · 0.95
openLFSFileMethod · 0.95
openMethod · 0.95

Calls 11

toPropertiesMethod · 0.95
asElementMethod · 0.95
globMatchesFilesMethod · 0.95
getMethod · 0.65
existsMethod · 0.65
isContainerMethod · 0.65
getDataStorageMethod · 0.65
systemElementMethod · 0.65
openMethod · 0.65
toStringMethod · 0.45

Tested by 2

initMethod · 0.76