Tabnine Logo
Mapper$Context.getTaskAttemptID
Code IndexAdd Tabnine to your IDE (free)

How to use
getTaskAttemptID
method
in
org.apache.hadoop.mapreduce.Mapper$Context

Best Java code snippets using org.apache.hadoop.mapreduce.Mapper$Context.getTaskAttemptID (Showing top 20 results out of 360)

origin: apache/hbase

testing.injectedFailureCount = context.getTaskAttemptID().getId();
origin: apache/hbase

Exception ex = null;
try {
 zkw = new ZKWatcher(conf, context.getTaskAttemptID().toString(), null);
 clusterIds = Collections.singletonList(ZKClusterId.getUUIDForCluster(zkw));
} catch (ZooKeeperConnectionException e) {
origin: apache/kylin

  private void futureGet(Context context) throws IOException {
    try {
      future.get();
    } catch (Exception e) {
      throw new IOException("Failed to build cube in mapper " + context.getTaskAttemptID().getTaskID().getId(), e);
    }
  }
}
origin: org.apache.hadoop/hadoop-mapred-test

 public void map(LongWritable key, Text value, Context context
 ) throws IOException, InterruptedException {
  String id = context.getTaskAttemptID().toString();
  // Mapper 0 does not output anything
  if (!id.endsWith("0_0")) {
   context.write(key, value);
  }
 }
}
origin: alexholmes/hadoop-book

@Override
protected void setup(Context context)
  throws IOException, InterruptedException {
 Path attemptDir = FileOutputFormat.getWorkOutputPath(context);
 String filename = context.getTaskAttemptID()
   .getTaskID().toString();
 Path sideEffectFile = new Path(attemptDir, filename);
 sideEffectStream = FileSystem.get(context.getConfiguration())
   .create(sideEffectFile);
 log.info("Opened file = {}", sideEffectFile);
}
origin: org.apache.mahout/mahout-core

 @Override
 protected void cleanup(Context context) throws IOException,
  InterruptedException {
  context.write(new IntWritable(context.getTaskAttemptID().getTaskID()
                  .getId()),
         new VectorWritable(new DenseVector(mYtY.getData())));
 }
}
origin: ShifuML/shifu

@SuppressWarnings("unchecked")
private Context createSubContextForHadoop1(Context context) throws NoSuchMethodException,
    InstantiationException, IllegalAccessException, InvocationTargetException {
  Constructor<?> constructor = Context.class.getDeclaredConstructor(Mapper.class, Configuration.class,
      TaskAttemptID.class, RecordReader.class, RecordWriter.class, OutputCommitter.class,
      StatusReporter.class, InputSplit.class);
  constructor.setAccessible(true);
  return (Context) constructor.newInstance(mapper, outer.getConfiguration(), outer.getTaskAttemptID(),
      reader, new SubMapRecordWriter(), context.getOutputCommitter(), new SubMapStatusReporter(),
      outer.getInputSplit());
}
origin: org.apache.kylin/kylin-engine-mr

  private void futureGet(Context context) throws IOException {
    try {
      future.get();
    } catch (Exception e) {
      throw new IOException("Failed to build cube in mapper " + context.getTaskAttemptID().getTaskID().getId(), e);
    }
  }
}
origin: cloudera/search

private Random createRandom(Context context) {
 long taskId = 0;
 if (context.getTaskAttemptID() != null) { // MRUnit returns null
  LOGGER.debug("context.getTaskAttemptID().getId(): {}", context.getTaskAttemptID().getId());
  LOGGER.debug("context.getTaskAttemptID().getTaskID().getId(): {}", context.getTaskAttemptID().getTaskID().getId());
  taskId = context.getTaskAttemptID().getTaskID().getId(); // taskId = 0, 1, ..., N
 }
 // create a good random seed, yet ensure deterministic PRNG sequence for easy reproducability
 return new Random(421439783L * (taskId + 1));
}
origin: ch.cern.hadoop/hadoop-distcp

private Path getTmpFile(Path target, Mapper.Context context) {
 Path targetWorkPath = new Path(context.getConfiguration().
   get(DistCpConstants.CONF_LABEL_TARGET_WORK_PATH));
 Path root = target.equals(targetWorkPath)? targetWorkPath.getParent() : targetWorkPath;
 LOG.info("Creating temp file: " +
   new Path(root, ".distcp.tmp." + context.getTaskAttemptID().toString()));
 return new Path(root, ".distcp.tmp." + context.getTaskAttemptID().toString());
}
origin: org.apache.mahout/mahout-mr

 @Override
 protected void cleanup(Context context) throws IOException,
  InterruptedException {
  context.write(new IntWritable(context.getTaskAttemptID().getTaskID()
                  .getId()),
         new VectorWritable(new DenseVector(mYtY.getData())));
 }
}
origin: ch.cern.hadoop/hadoop-mapreduce-client-jobclient

 public void map(LongWritable key, Text value, Context context
 ) throws IOException, InterruptedException {
  String id = context.getTaskAttemptID().toString();
  // Mapper 0 does not output anything
  if (!id.endsWith("0_0")) {
   context.write(key, value);
  }
 }
}
origin: apache/incubator-gobblin

 GobblinMultiTaskAttempt.runWorkUnits(this.jobState.getJobId(), context.getTaskAttemptID().toString(),
   this.jobState, this.workUnits, this.taskStateTracker, this.taskExecutor, this.taskStateStore,
   multiTaskAttemptCommitPolicy, jobBroker);
GobblinOutputCommitter gobblinOutputCommitter = (GobblinOutputCommitter) context.getOutputCommitter();
gobblinOutputCommitter.getAttemptIdToMultiTaskAttempt()
  .put(context.getTaskAttemptID().toString(), gobblinMultiTaskAttempt);
origin: apache/incubator-gobblin

this.jobMetrics.get()
  .startMetricReportingWithFileSuffix(HadoopUtils.getStateFromConf(configuration),
    context.getTaskAttemptID().toString());
origin: apache/hbase

@Override
protected void setup(Context context) throws IOException, InterruptedException {
 id = Bytes.toBytes("Job: "+context.getJobID() + " Task: " + context.getTaskAttemptID());
 this.connection = ConnectionFactory.createConnection(context.getConfiguration());
 instantiateHTable();
origin: apache/incubator-druid

  outputFS,
  finalSegmentTemplate,
  context.getTaskAttemptID(),
  config.DATA_SEGMENT_PUSHER
),
origin: apache/hbase

byte valBytes[] = new byte[valLength];
int taskId = context.getTaskAttemptID().getTaskID().getId();
assert taskId < Byte.MAX_VALUE : "Unit tests dont support > 127 tasks!";
origin: apache/hbase

byte valBytes[] = new byte[valLength];
int taskId = context.getTaskAttemptID().getTaskID().getId();
assert taskId < Byte.MAX_VALUE : "Unit tests dont support > 127 tasks!";
Random random = new Random();
origin: apache/ignite

  @Override public void run(Context ctx) throws IOException, InterruptedException {
    System.out.println("Running task: " + ctx.getTaskAttemptID().getTaskID().getId());
    latch.get("mapAwaitLatch").await();
    mapExecCnt.incrementAndGet();
    System.out.println("Completed task: " + ctx.getTaskAttemptID().getTaskID().getId());
  }
}
origin: apache/ignite

/** {@inheritDoc} */
@Override protected void setup(Context ctx) throws IOException, InterruptedException {
  X.println("___ Mapper: " + ctx.getTaskAttemptID());
  String taskId = ctx.getTaskAttemptID().toString();
  LocalFileSystem locFs = FileSystem.getLocal(ctx.getConfiguration());
  String workDir = locFs.getWorkingDirectory().toString();
  assertNull(taskWorkDirs.put(workDir, taskId));
}
org.apache.hadoop.mapreduceMapper$ContextgetTaskAttemptID

Popular methods of Mapper$Context

  • write
  • getConfiguration
  • getCounter
  • getInputSplit
  • progress
  • setStatus
  • nextKeyValue
  • getCurrentValue
  • getCurrentKey
  • getNumReduceTasks
  • getJobID
  • getInputFormatClass
  • getJobID,
  • getInputFormatClass,
  • getLocalCacheFiles,
  • getOutputCommitter,
  • getCredentials,
  • getLocalCacheArchives,
  • getStatus,
  • getCacheArchives,
  • getCacheFiles

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onRequestPermissionsResult (Fragment)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • JTextField (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now