Package org.apache.druid.indexer
Class Utils
- java.lang.Object
-
- org.apache.druid.indexer.Utils
-
public class Utils extends Object
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancheckAppSuccessForJobIOException(IOException ioe, org.apache.hadoop.mapreduce.Job job, boolean useYarnRMJobStatusFallback)It is possible for a Hadoop Job to succeed, but for `job.waitForCompletion()` to fail because of issues with the JobHistory server.static booleancheckAppSuccessFromYarnRM(org.apache.hadoop.mapreduce.Job job)static booleanexists(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path inputPath)static StringgetFailureMessage(org.apache.hadoop.mapreduce.Job failedJob, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)static Map<String,Object>getStats(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.Path statsPath)static OutputStreammakePathAndOutputStream(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.Path outputPath, boolean deleteExisting)static InputStreamopenInputStream(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.Path inputPath)static InputStreamopenInputStream(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.Path inputPath, org.apache.hadoop.fs.FileSystem fileSystem)static voidstoreStats(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.Path path, Map<String,Object> stats)
-
-
-
Method Detail
-
makePathAndOutputStream
public static OutputStream makePathAndOutputStream(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.Path outputPath, boolean deleteExisting) throws IOException
- Throws:
IOException
-
openInputStream
public static InputStream openInputStream(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.Path inputPath) throws IOException
- Throws:
IOException
-
exists
public static boolean exists(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path inputPath) throws IOException- Throws:
IOException
-
openInputStream
public static InputStream openInputStream(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.Path inputPath, org.apache.hadoop.fs.FileSystem fileSystem) throws IOException
- Throws:
IOException
-
getStats
public static Map<String,Object> getStats(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.Path statsPath) throws IOException
- Throws:
IOException
-
storeStats
public static void storeStats(org.apache.hadoop.mapreduce.JobContext job, org.apache.hadoop.fs.Path path, Map<String,Object> stats) throws IOException- Throws:
IOException
-
getFailureMessage
@Nullable public static String getFailureMessage(org.apache.hadoop.mapreduce.Job failedJob, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
-
checkAppSuccessForJobIOException
public static boolean checkAppSuccessForJobIOException(IOException ioe, org.apache.hadoop.mapreduce.Job job, boolean useYarnRMJobStatusFallback)
It is possible for a Hadoop Job to succeed, but for `job.waitForCompletion()` to fail because of issues with the JobHistory server. When the JobHistory server is unavailable, it's possible to fetch the application's status from the YARN ResourceManager instead. Returns true if both `useYarnRMJobStatusFallback` is enabled and YARN ResourceManager reported success for the target job.
-
checkAppSuccessFromYarnRM
public static boolean checkAppSuccessFromYarnRM(org.apache.hadoop.mapreduce.Job job)
-
-