Package org.apache.hadoop.hive.ql.exec

Examples of org.apache.hadoop.hive.ql.exec.MapredContext


    return true;
  }

  @Override
  public boolean connect(Configuration hconf) {
    MapredContext context = MapredContext.get();
    if (context == null || context.getReporter() == null) {
      return false;
    }
    reporter = context.getReporter();
    return true;
  }
View Full Code Here


public final class HadoopUtils {

    private HadoopUtils() {}

    public static BufferedReader getBufferedReader(File file) throws IOException {
        MapredContext context = MapredContextAccessor.get();
        return getBufferedReader(file, context);
    }
View Full Code Here

    }

    @Nonnull
    public static String getJobId() {
        MapredContext ctx = MapredContextAccessor.get();
        if(ctx == null) {
            throw new IllegalStateException("MapredContext is not set");
        }
        JobConf conf = ctx.getJobConf();
        if(conf == null) {
            throw new IllegalStateException("JobConf is not set");
        }
        String jobId = conf.get("mapred.job.id");
        if(jobId == null) {
View Full Code Here

        JobID jobId = taskId.getJobID();
        return jobId.toString();
    }

    public static int getTaskId() {
        MapredContext ctx = MapredContextAccessor.get();
        if(ctx == null) {
            throw new IllegalStateException("MapredContext is not set");
        }
        JobConf jobconf = ctx.getJobConf();
        if(jobconf == null) {
            throw new IllegalStateException("JobConf is not set");
        }
        int taskid = jobconf.getInt("mapred.task.partition", -1);
        if(taskid == -1) {
View Full Code Here

    public Text evaluate() {
        return evaluate(null);
    }

    public Text evaluate(@Nullable final String regexKey) {
        MapredContext ctx = MapredContextAccessor.get();
        if(ctx == null) {
            throw new IllegalStateException("MapredContext is not set");
        }
        JobConf jobconf = ctx.getJobConf();
        if(jobconf == null) {
            throw new IllegalStateException("JobConf is not set");
        }

        String dumped = HadoopUtils.toString(jobconf, regexKey);
View Full Code Here

    return true;
  }

  @Override
  public boolean connect(Configuration hconf) {
    MapredContext context = MapredContext.get();
    if (context == null || context.getReporter() == null) {
      return false;
    }
    reporter = context.getReporter();
    return true;
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.exec.MapredContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.