return ((HPath)resourcePath).getPath();
}
private static synchronized ContainerDescriptor getTempContainer(final PigContext pigContext)
throws DataStorageException {
ContainerDescriptor tempContainer = null;
String tdir= Utils.substituteVars(pigContext.getProperties().getProperty(PigConfiguration.PIG_TEMP_DIR, "/tmp"));
try {
do {
tempContainer = pigContext.getDfs().asContainer(tdir + "/temp" + r.nextInt());
} while (tempContainer.exists());
createContainer(tempContainer);
}
catch (IOException e) {
// try one last time in case this was due IO Exception caused by dir
// operations on directory created by another JVM at the same instant