public class JobHelper extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
JobHelper.DataPusher
Simple interface for retry operations
|
Modifier and Type | Field and Description |
---|---|
static String |
DESCRIPTOR_JSON |
static String |
INDEX_ZIP |
Constructor and Description |
---|
JobHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
authenticate(HadoopDruidIndexerConfig config)
Dose authenticate against a secured hadoop cluster
In case of any bug fix make sure to fix the code at HdfsStorageAuthentication#authenticate as well.
|
static long |
copyFileToZipStream(File file,
ZipOutputStream zipOutputStream,
org.apache.hadoop.util.Progressable progressable) |
static boolean |
deleteWithRetry(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
boolean recursive) |
static org.apache.hadoop.fs.Path |
distributedClassPath(org.apache.hadoop.fs.Path base) |
static org.apache.hadoop.fs.Path |
distributedClassPath(String path) |
static void |
ensurePaths(HadoopDruidIndexerConfig config) |
static URI |
getURIFromSegment(DataSegment dataSegment) |
static org.apache.hadoop.conf.Configuration |
injectSystemProperties(org.apache.hadoop.conf.Configuration conf) |
static void |
injectSystemProperties(org.apache.hadoop.mapreduce.Job job) |
static boolean |
isHdfs(org.apache.hadoop.fs.FileSystem fs) |
static org.apache.hadoop.fs.Path |
makeFileNamePath(org.apache.hadoop.fs.Path basePath,
org.apache.hadoop.fs.FileSystem fs,
DataSegment segmentTemplate,
String baseFileName) |
static org.apache.hadoop.fs.Path |
makeTmpPath(org.apache.hadoop.fs.Path basePath,
org.apache.hadoop.fs.FileSystem fs,
DataSegment segmentTemplate,
org.apache.hadoop.mapreduce.TaskAttemptID taskAttemptID) |
static org.apache.hadoop.fs.Path |
prependFSIfNullScheme(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path) |
static ProgressIndicator |
progressIndicatorForContext(org.apache.hadoop.mapreduce.TaskAttemptContext context) |
static boolean |
runJobs(List<Jobby> jobs,
HadoopDruidIndexerConfig config) |
static DataSegment |
serializeOutIndex(DataSegment segmentTemplate,
org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.util.Progressable progressable,
File mergedBase,
org.apache.hadoop.fs.Path finalIndexZipFilePath,
org.apache.hadoop.fs.Path finalDescriptorPath,
org.apache.hadoop.fs.Path tmpPath) |
static void |
setupClasspath(org.apache.hadoop.fs.Path distributedClassPath,
org.apache.hadoop.fs.Path intermediateClassPath,
org.apache.hadoop.mapreduce.Job job)
Uploads jar files to hdfs and configures the classpath.
|
static com.google.common.base.Predicate<Throwable> |
shouldRetryPredicate() |
static long |
unzipNoGuava(org.apache.hadoop.fs.Path zip,
org.apache.hadoop.conf.Configuration configuration,
File outDir,
org.apache.hadoop.util.Progressable progressable) |
static void |
writeSegmentDescriptor(org.apache.hadoop.fs.FileSystem outputFS,
DataSegment segment,
org.apache.hadoop.fs.Path descriptorPath,
org.apache.hadoop.util.Progressable progressable) |
static long |
zipAndCopyDir(File baseDir,
OutputStream baseOutputStream,
org.apache.hadoop.util.Progressable progressable) |
public static final String INDEX_ZIP
public static final String DESCRIPTOR_JSON
public static org.apache.hadoop.fs.Path distributedClassPath(String path)
public static org.apache.hadoop.fs.Path distributedClassPath(org.apache.hadoop.fs.Path base)
public static void authenticate(HadoopDruidIndexerConfig config)
config
- containing the principal name and keytab path.public static void setupClasspath(org.apache.hadoop.fs.Path distributedClassPath, org.apache.hadoop.fs.Path intermediateClassPath, org.apache.hadoop.mapreduce.Job job) throws IOException
distributedClassPath
- classpath shared across multiple jobsintermediateClassPath
- classpath exclusive for this job. used to upload SNAPSHOT jar files.job
- job to runIOException
public static final com.google.common.base.Predicate<Throwable> shouldRetryPredicate()
public static void injectSystemProperties(org.apache.hadoop.mapreduce.Job job)
public static org.apache.hadoop.conf.Configuration injectSystemProperties(org.apache.hadoop.conf.Configuration conf)
public static void ensurePaths(HadoopDruidIndexerConfig config)
public static boolean runJobs(List<Jobby> jobs, HadoopDruidIndexerConfig config)
public static DataSegment serializeOutIndex(DataSegment segmentTemplate, org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.util.Progressable progressable, File mergedBase, org.apache.hadoop.fs.Path finalIndexZipFilePath, org.apache.hadoop.fs.Path finalDescriptorPath, org.apache.hadoop.fs.Path tmpPath) throws IOException
IOException
public static void writeSegmentDescriptor(org.apache.hadoop.fs.FileSystem outputFS, DataSegment segment, org.apache.hadoop.fs.Path descriptorPath, org.apache.hadoop.util.Progressable progressable) throws IOException
IOException
public static long zipAndCopyDir(File baseDir, OutputStream baseOutputStream, org.apache.hadoop.util.Progressable progressable) throws IOException
IOException
public static long copyFileToZipStream(File file, ZipOutputStream zipOutputStream, org.apache.hadoop.util.Progressable progressable) throws IOException
IOException
public static boolean isHdfs(org.apache.hadoop.fs.FileSystem fs)
public static org.apache.hadoop.fs.Path makeFileNamePath(org.apache.hadoop.fs.Path basePath, org.apache.hadoop.fs.FileSystem fs, DataSegment segmentTemplate, String baseFileName)
public static org.apache.hadoop.fs.Path makeTmpPath(org.apache.hadoop.fs.Path basePath, org.apache.hadoop.fs.FileSystem fs, DataSegment segmentTemplate, org.apache.hadoop.mapreduce.TaskAttemptID taskAttemptID)
public static org.apache.hadoop.fs.Path prependFSIfNullScheme(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path)
public static long unzipNoGuava(org.apache.hadoop.fs.Path zip, org.apache.hadoop.conf.Configuration configuration, File outDir, org.apache.hadoop.util.Progressable progressable) throws IOException
IOException
public static URI getURIFromSegment(DataSegment dataSegment)
public static ProgressIndicator progressIndicatorForContext(org.apache.hadoop.mapreduce.TaskAttemptContext context)
public static boolean deleteWithRetry(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, boolean recursive)
Copyright © 2011–2017. All rights reserved.