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

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

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

origin: apache/incubator-druid

@Override
public void run(Context context) throws IOException, InterruptedException
{
 setup(context);
 while (context.nextKeyValue()) {
  map(context.getCurrentKey(), context.getCurrentValue(), context);
 }
 for (Map.Entry<Interval, HyperLogLogCollector> entry : hyperLogLogs.entrySet()) {
  context.write(
    new LongWritable(entry.getKey().getStartMillis()),
    new BytesWritable(entry.getValue().toByteArray())
  );
 }
 cleanup(context);
}
origin: apache/incubator-gobblin

try {
 while (context.nextKeyValue()) {
  this.map(context.getCurrentKey(), context.getCurrentValue(), context);
origin: com.n3twork.druid/druid-indexing-hadoop

@Override
public void run(Context context) throws IOException, InterruptedException
{
 setup(context);
 while (context.nextKeyValue()) {
  map(context.getCurrentKey(), context.getCurrentValue(), context);
 }
 for (Map.Entry<Interval, HyperLogLogCollector> entry : hyperLogLogs.entrySet()) {
  context.write(
    new LongWritable(entry.getKey().getStartMillis()),
    new BytesWritable(entry.getValue().toByteArray())
  );
 }
 cleanup(context);
}
origin: com.marklogic/mlcp

public void runThreadSafe(Context outerCtx, Context subCtx)
  throws IOException, InterruptedException {
  setup(subCtx);
  KEYIN key = null;
  VALUEIN value = null;
  try {
    while (!ContentPump.shutdown) {
      synchronized (outerCtx) {
        if (!subCtx.nextKeyValue()) {
          break;
        }
        key = subCtx.getCurrentKey();
        value = subCtx.getCurrentValue();
      }
      map(key, value, subCtx);
    }
  } finally {
    if (ContentPump.shutdown && LOG.isDebugEnabled()) {
      LOG.debug("Aborting task...");
    }
    cleanup(subCtx);
  }
}

origin: ch.cern.hadoop/hadoop-mapreduce-client-core

 /**
  * Expert users can override this method for more complete control over the
  * execution of the Mapper.
  * @param context
  * @throws IOException
  */
 public void run(Context context) throws IOException, InterruptedException {
  setup(context);
  try {
   while (context.nextKeyValue()) {
    map(context.getCurrentKey(), context.getCurrentValue(), context);
   }
  } finally {
   cleanup(context);
  }
 }
}
origin: io.prestosql.hadoop/hadoop-apache

 /**
  * Expert users can override this method for more complete control over the
  * execution of the Mapper.
  * @param context
  * @throws IOException
  */
 public void run(Context context) throws IOException, InterruptedException {
  setup(context);
  try {
   while (context.nextKeyValue()) {
    map(context.getCurrentKey(), context.getCurrentValue(), context);
   }
  } finally {
   cleanup(context);
  }
 }
}
origin: org.apache.kudu/kudu-client-tools

@Override
protected void map(NullWritable key, RowResult value, Mapper.Context context)
  throws IOException, InterruptedException {
 // Add as many heads as we need, then we skip the rest.
 do {
  if (headsCache.size() < numUpdatesPerMapper) {
   value = (RowResult)context.getCurrentValue();
   headsCache.add(new Pair<Long, Long>(value.getLong(0), value.getLong(1)));
  }
 } while (context.nextKeyValue());
 // At this point we've exhausted the scanner and hopefully gathered all the linked list
 // heads we needed.
 LOG.info("Processing " + headsCache.size() +
   " linked lists, out of " + numUpdatesPerMapper);
 processAllHeads(context);
}
origin: opencb/opencga

@Override
public void run(Context context) throws IOException, InterruptedException {
  this.setup(context);
  try {
    while (context.nextKeyValue()) {
      this.map(context.getCurrentKey(), context.getCurrentValue(), context);
      annotateVariants(context, false);
    }
    annotateVariants(context, true);
  } catch (VariantAnnotatorException e) {
    throw new RuntimeException(e);
  } finally {
    this.cleanup(context);
  }
}
origin: com.github.jiayuhan-it/hadoop-mapreduce-client-core

 /**
  * Expert users can override this method for more complete control over the
  * execution of the Mapper.
  * @param context
  * @throws IOException
  */
 public void run(Context context) throws IOException, InterruptedException {
  setup(context);
  try {
   while (context.nextKeyValue()) {
    map(context.getCurrentKey(), context.getCurrentValue(), context);
   }
  } finally {
   cleanup(context);
  }
 }
}
origin: org.apache.druid/druid-indexing-hadoop

@Override
public void run(Context context) throws IOException, InterruptedException
{
 setup(context);
 while (context.nextKeyValue()) {
  map(context.getCurrentKey(), context.getCurrentValue(), context);
 }
 for (Map.Entry<Interval, HyperLogLogCollector> entry : hyperLogLogs.entrySet()) {
  context.write(
    new LongWritable(entry.getKey().getStartMillis()),
    new BytesWritable(entry.getValue().toByteArray())
  );
 }
 cleanup(context);
}
origin: io.druid/druid-indexing-hadoop

@Override
public void run(Context context) throws IOException, InterruptedException
{
 setup(context);
 while (context.nextKeyValue()) {
  map(context.getCurrentKey(), context.getCurrentValue(), context);
 }
 for (Map.Entry<Interval, HyperLogLogCollector> entry : hyperLogLogs.entrySet()) {
  context.write(
    new LongWritable(entry.getKey().getStartMillis()),
    new BytesWritable(entry.getValue().toByteArray())
  );
 }
 cleanup(context);
}
origin: io.hops/hadoop-mapreduce-client-core

 /**
  * Expert users can override this method for more complete control over the
  * execution of the Mapper.
  * @param context
  * @throws IOException
  */
 public void run(Context context) throws IOException, InterruptedException {
  setup(context);
  try {
   while (context.nextKeyValue()) {
    map(context.getCurrentKey(), context.getCurrentValue(), context);
   }
  } finally {
   cleanup(context);
  }
 }
}
origin: com.marklogic/mlcp

  @Override
  public void run(Context context) throws IOException, InterruptedException {
    setup(context);
    try {
      while (!ContentPump.shutdown && context.nextKeyValue()) {
        map(context.getCurrentKey(), context.getCurrentValue(), context);
      }
    } finally {
      if (ContentPump.shutdown && LOG.isDebugEnabled()) {
        LOG.debug("Aborting task...");
      }
      cleanup(context);
    }
  }
}
origin: com.facebook.hadoop/hadoop-core

 /**
  * Expert users can override this method for more complete control over the
  * execution of the Mapper.
  * @param context
  * @throws IOException
  */
 public void run(Context context) throws IOException, InterruptedException {
  setup(context);
  while (context.nextKeyValue()) {
   map(context.getCurrentKey(), context.getCurrentValue(), context);
  }
  cleanup(context);
 }
}
origin: apache/incubator-rya

private static RyaStatement nextRyaStatement(final Context context, final RyaTripleContext ryaContext) throws IOException, InterruptedException {
  RyaStatement ryaStatement = null;
  if (context.nextKeyValue()) {
    final Key key = context.getCurrentKey();
    final Value value = context.getCurrentValue();
    try {
      ryaStatement = createRyaStatement(key, value, ryaContext);
    } catch (final TripleRowResolverException e) {
      log.error("TripleRowResolverException encountered while creating statement", e);
    }
  }
  return ryaStatement;
}
origin: org.apache.hadoop/hadoop-mapred

 /**
  * Expert users can override this method for more complete control over the
  * execution of the Mapper.
  * @param context
  * @throws IOException
  */
 public void run(Context context) throws IOException, InterruptedException {
  setup(context);
  while (context.nextKeyValue()) {
   map(context.getCurrentKey(), context.getCurrentValue(), context);
  }
  cleanup(context);
 }
}
origin: ShifuML/shifu

@Override
public boolean nextKeyValue() throws IOException, InterruptedException {
  synchronized(outer) {
    if(!outer.nextKeyValue()) {
      return false;
    }
    key = ReflectionUtils.copy(outer.getConfiguration(), outer.getCurrentKey(), key);
    value = ReflectionUtils.copy(conf, outer.getCurrentValue(), value);
    return true;
  }
}
origin: pl.edu.icm.coansys/commons

@Override
public void run(Context context) throws IOException, InterruptedException {
  setup(context);
  while ((count < fequency) && context.nextKeyValue()) {
    float diff = fequency - count;
    if (random.nextFloat() <= diff) {
      map(context.getCurrentKey(), context.getCurrentValue(), context);
    }
    count++;
  }
  cleanup(context);
}
origin: pl.edu.icm.coansys/commons

@Override
public void run(Context context) throws IOException, InterruptedException {
  setup(context);
  while ((count < limit) && context.nextKeyValue()) {
    map(context.getCurrentKey(), context.getCurrentValue(), context);
    count++;
  }
  cleanup(context);
}
origin: ShifuML/shifu

@Override
public boolean nextKeyValue() throws IOException, InterruptedException {
  synchronized(outer) {
    if(!outer.nextKeyValue()) {
      return false;
    }
    key = ReflectionUtils.copy(outer.getConfiguration(), outer.getCurrentKey(), key);
    value = ReflectionUtils.copy(conf, outer.getCurrentValue(), value);
    return true;
  }
}
org.apache.hadoop.mapreduceMapper$ContextnextKeyValue

Popular methods of Mapper$Context

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

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • findViewById (Activity)
  • getApplicationContext (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Collectors (java.util.stream)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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