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

How to use
TwitterEventSchema
in
com.ociweb.pronghorn.network.schema

Best Java code snippets using com.ociweb.pronghorn.network.schema.TwitterEventSchema (Showing top 4 results out of 315)

origin: oci-pronghorn/Pronghorn

public static Pipe<TwitterEventSchema> buildStage(GraphManager gm, boolean sendPostIds, int bottom, Pipe<NetResponseSchema> clientResponsesPipe ,
    Pipe<TwitterStreamControlSchema> control,
    int tweetsCount) {
  
  Pipe<TwitterEventSchema> hosePipe = TwitterEventSchema.instance.newPipe(tweetsCount, MAX_TWEET_TEXT_SIZE);
  new TwitterJSONToTwitterEventsStage(gm, bottom, sendPostIds, clientResponsesPipe, control, hosePipe);
  return hosePipe;
}

origin: oci-pronghorn/Pronghorn

public static void consume(Pipe<TwitterEventSchema> input) {
  while (PipeReader.tryReadFragment(input)) {
    int msgIdx = PipeReader.getMsgIdx(input);
    switch(msgIdx) {
      case MSG_USER_100:
        consumeUser(input);
      break;
      case MSG_USERPOST_101:
        consumeUserPost(input);
      break;
      case -1:
        //requestShutdown();
      break;
    }
    PipeReader.releaseReadLock(input);
  }
}
origin: oci-pronghorn/Pronghorn

@Test
public void pipeDataTest() {
  
  
  Pipe pipe = TwitterEventSchema.instance.newPipe(10, 1000);
  pipe.initBuffers();
  
  PipeWriter.blockWriteFragment(pipe, TwitterEventSchema.MSG_USERPOST_101);
  
  PipeWriter.writeUTF8(pipe, TwitterEventSchema.MSG_USERPOST_101_FIELD_CREATEDAT_57, "this is todays date");
  PipeWriter.writeUTF8(pipe, TwitterEventSchema.MSG_USERPOST_101_FIELD_LANGUAGE_60, "en");
  PipeWriter.writeUTF8(pipe, TwitterEventSchema.MSG_USERPOST_101_FIELD_NAME_52, "name");
  
  PipeWriter.publishWrites(pipe);
  
  boolean ok = PipeReader.tryReadFragment(pipe);
  assertTrue(ok);
  
  String name = PipeReader.readUTF8(pipe, TwitterEventSchema.MSG_USERPOST_101_FIELD_NAME_52, new StringBuilder()).toString();
  String lang = PipeReader.readUTF8(pipe, TwitterEventSchema.MSG_USERPOST_101_FIELD_LANGUAGE_60, new StringBuilder()).toString();
  String create = PipeReader.readUTF8(pipe, TwitterEventSchema.MSG_USERPOST_101_FIELD_CREATEDAT_57, new StringBuilder()).toString();
  
  assertEquals("name",name);
  assertEquals("en",lang);
  assertEquals("this is todays date",create);
  
  
}

origin: oci-pronghorn/Pronghorn

Pipe pipe = TwitterEventSchema.instance.newPipe(10, 1000);
pipe.initBuffers();
DataOutputBlobWriter writer = PipeWriter.outputStream(pipe);
com.ociweb.pronghorn.network.schemaTwitterEventSchema

Most used methods

  • newPipe
  • consumeUser
  • consumeUserPost

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Github Copilot alternatives
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