Codota Logo
HdfsSpout.fail
Code IndexAdd Codota to your IDE (free)

How to use
fail
method
in
org.apache.storm.hdfs.spout.HdfsSpout

Best Java code snippets using org.apache.storm.hdfs.spout.HdfsSpout.fail (Showing top 1 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: apache/storm

/**
 * Execute a sequence of calls on HdfsSpout.
 *
 * @param cmds: set of commands to run, e.g. "r,r,r,r,a1,f2,...". The commands are: r[N] - receive() called N times aN - ack, item
 * number: N fN - fail, item number: N
 */
private List<String> runSpout(HdfsSpout spout, String... cmds) {
  MockCollector collector = (MockCollector) spout.getCollector();
  for (String cmd : cmds) {
    if (cmd.startsWith("r")) {
      int count = 1;
      if (cmd.length() > 1) {
        count = Integer.parseInt(cmd.substring(1));
      }
      for (int i = 0; i < count; ++i) {
        spout.nextTuple();
      }
    } else if (cmd.startsWith("a")) {
      int n = Integer.parseInt(cmd.substring(1));
      Pair<HdfsSpout.MessageId, List<Object>> item = collector.items.get(n);
      spout.ack(item.getKey());
    } else if (cmd.startsWith("f")) {
      int n = Integer.parseInt(cmd.substring(1));
      Pair<HdfsSpout.MessageId, List<Object>> item = collector.items.get(n);
      spout.fail(item.getKey());
    }
  }
  return collector.lines;
}
org.apache.storm.hdfs.spoutHdfsSpoutfail

Popular methods of HdfsSpout

  • <init>
  • setArchiveDir
  • setBadFilesDir
  • setHdfsUri
  • setReaderType
  • setSourceDir
  • withOutputFields
    Output field names. Number of fields depends upon the reader type
  • ack
  • canCommitNow
  • checkValidReader
  • close
  • closeReaderAndResetTrackers
  • close,
  • closeReaderAndResetTrackers,
  • commitProgress,
  • createFileReader,
  • emitData,
  • getCollector,
  • getDefaultLockDir,
  • getFileForLockFile,
  • getFileProgress

Popular in Java

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getExternalFilesDir (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now