Tabnine Logo
ReturnResults
Code IndexAdd Tabnine to your IDE (free)

How to use
ReturnResults
in
org.apache.storm.drpc

Best Java code snippets using org.apache.storm.drpc.ReturnResults (Showing top 11 results out of 315)

origin: apache/storm

public static void main(String[] args) throws Exception {
  TopologyBuilder builder = new TopologyBuilder();
  DRPCSpout spout = new DRPCSpout("exclamation");
  builder.setSpout("drpc", spout);
  builder.setBolt("exclaim", new ExclamationBolt(), 3).shuffleGrouping("drpc");
  builder.setBolt("return", new ReturnResults(), 3).shuffleGrouping("exclaim");
  Config conf = new Config();
  StormSubmitter.submitTopology("exclaim", conf, builder.createTopology());
  try (DRPCClient drpc = DRPCClient.getConfiguredClient(conf)) {
    System.out.println(drpc.execute("exclamation", "aaa"));
    System.out.println(drpc.execute("exclamation", "bbb"));
  }
}
origin: apache/storm

  _collector.fail(input);
reconnectClient((DRPCInvocationsClient) client);
origin: com.yahoo.bullet/bullet-storm

 /**
 * Creates and initializes a Publisher that writes to the DRPC servers. Intended to be used inside a Storm
 * bolt in a Storm topology.
 *
 * @param config Needs the Storm configuration {@link Map} in {@link com.yahoo.bullet.storm.BulletStormConfig#STORM_CONFIG}.
 */
public DRPCResultPublisher(BulletConfig config) {
  // Get the Storm Config that has all the relevant cluster settings and properties
  Map stormConfig = config.getRequiredConfigAs(DRPCConfig.STORM_CONFIG, Map.class);
  collector = new DRPCOutputCollector();
  // Wrap the collector in a OutputCollector (it just delegates to the underlying DRPCOutputCollector)
  OutputCollector boltOutputCollector = new OutputCollector(collector);
  bolt = new ReturnResults();
  // No need for a TopologyContext
  bolt.prepare(stormConfig, null, boltOutputCollector);
}
origin: com.yahoo.bullet/bullet-storm

  @Override
  public void close() {
    bolt.cleanup();
  }
}
origin: com.yahoo.bullet/bullet-storm

@Override
public void send(PubSubMessage message) throws PubSubException {
  Metadata metadata = message.getMetadata();
  // Remove the content
  String content = metadata.getContent().toString();
  log.debug("Removing metadata {} for result {}@{}: {}", content, message.getId(), message.getSequence(), message.getContent());
  metadata.setContent(null);
  String serializedMessage = message.asJSON();
  Tuple tuple = new DRPCTuple(new Values(serializedMessage, content));
  // This sends the message through DRPC and not to the collector but it acks or fails accordingly.
  bolt.execute(tuple);
  if (!collector.isAcked()) {
    throw new PubSubException("Message not acked. Unable to send message through DRPC:\n " + serializedMessage);
  }
  // Otherwise, we're good to proceed
  collector.reset();
}
origin: bullet-db/bullet-storm

 /**
 * Creates and initializes a Publisher that writes to the DRPC servers. Intended to be used inside a Storm
 * bolt in a Storm topology.
 *
 * @param config Needs the Storm configuration {@link Map} in {@link com.yahoo.bullet.storm.BulletStormConfig#STORM_CONFIG}.
 */
public DRPCResultPublisher(BulletConfig config) {
  // Get the Storm Config that has all the relevant cluster settings and properties
  Map stormConfig = config.getRequiredConfigAs(DRPCConfig.STORM_CONFIG, Map.class);
  collector = new DRPCOutputCollector();
  // Wrap the collector in a OutputCollector (it just delegates to the underlying DRPCOutputCollector)
  OutputCollector boltOutputCollector = new OutputCollector(collector);
  bolt = new ReturnResults();
  // No need for a TopologyContext
  bolt.prepare(stormConfig, null, boltOutputCollector);
}
origin: bullet-db/bullet-storm

  @Override
  public void close() {
    bolt.cleanup();
  }
}
origin: bullet-db/bullet-storm

@Override
public void send(PubSubMessage message) throws PubSubException {
  Metadata metadata = message.getMetadata();
  // Remove the content
  String content = metadata.getContent().toString();
  log.debug("Removing metadata {} for result {}@{}: {}", content, message.getId(), message.getSequence(), message.getContent());
  metadata.setContent(null);
  String serializedMessage = message.asJSON();
  Tuple tuple = new DRPCTuple(new Values(serializedMessage, content));
  // This sends the message through DRPC and not to the collector but it acks or fails accordingly.
  bolt.execute(tuple);
  if (!collector.isAcked()) {
    throw new PubSubException("Message not acked. Unable to send message through DRPC:\n " + serializedMessage);
  }
  // Otherwise, we're good to proceed
  collector.reset();
}
origin: apache/storm

    .fieldsGrouping(PREPARE_ID, PrepareRequest.RETURN_STREAM, new Fields("request"));
i++;
builder.setBolt(boltId(i), new ReturnResults())
    .noneGrouping(boltId(i - 1));
return builder.createTopology();
origin: org.apache.storm/storm-core

  _collector.fail(input);
reconnectClient((DRPCInvocationsClient) client);
origin: org.apache.storm/storm-core

    .fieldsGrouping(PREPARE_ID, PrepareRequest.RETURN_STREAM, new Fields("request"));
i++;
builder.setBolt(boltId(i), new ReturnResults())
    .noneGrouping(boltId(i-1));
return builder.createTopology();
org.apache.storm.drpcReturnResults

Most used methods

  • <init>
  • reconnectClient
  • cleanup
  • execute
  • prepare

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • BoxLayout (javax.swing)
  • JOptionPane (javax.swing)
  • Best plugins for Eclipse
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