Tabnine Logo
StreamApplicationDescriptor.withApplicationTaskContextFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
withApplicationTaskContextFactory
method
in
org.apache.samza.application.descriptors.StreamApplicationDescriptor

Best Java code snippets using org.apache.samza.application.descriptors.StreamApplicationDescriptor.withApplicationTaskContextFactory (Showing top 5 results out of 315)

origin: apache/samza

/**
 * For unit testing only
 */
@VisibleForTesting
void translate(SamzaSqlQueryParser.QueryInfo queryInfo, StreamApplicationDescriptor appDesc, int queryId) {
 QueryPlanner planner =
   new QueryPlanner(sqlConfig.getRelSchemaProviders(), sqlConfig.getInputSystemStreamConfigBySource(),
     sqlConfig.getUdfMetadata());
 final RelRoot relRoot = planner.plan(queryInfo.getSelectQuery());
 SamzaSqlExecutionContext executionContext = new SamzaSqlExecutionContext(sqlConfig);
 TranslatorContext translatorContext = new TranslatorContext(appDesc, relRoot, executionContext);
 translate(relRoot, sqlConfig.getOutputSystemStreams().get(queryId), translatorContext, queryId);
 Map<Integer, TranslatorContext> translatorContexts = new HashMap<>();
 translatorContexts.put(queryId, translatorContext.clone());
 appDesc.withApplicationTaskContextFactory(new ApplicationTaskContextFactory<SamzaSqlApplicationContext>() {
  @Override
  public SamzaSqlApplicationContext create(ExternalContext externalContext, JobContext jobContext,
    ContainerContext containerContext, TaskContext taskContext,
    ApplicationContainerContext applicationContainerContext) {
   return new SamzaSqlApplicationContext(translatorContexts);
  }
 });
}
origin: apache/samza

appDescriptor.withApplicationTaskContextFactory(new ApplicationTaskContextFactory<SamzaSqlApplicationContext>() {
 @Override
 public SamzaSqlApplicationContext create(ExternalContext externalContext, JobContext jobContext,
origin: org.apache.samza/samza-sql

appDescriptor.withApplicationTaskContextFactory((jobContext,
  containerContext,
  taskContext,
origin: apache/samza

@Test
public void testApplicationTaskContextFactory() {
 ApplicationTaskContextFactory factory = mock(ApplicationTaskContextFactory.class);
 StreamApplication testApp = appDesc -> appDesc.withApplicationTaskContextFactory(factory);
 StreamApplicationDescriptorImpl appSpec = new StreamApplicationDescriptorImpl(testApp, getConfig());
 assertEquals(appSpec.getApplicationTaskContextFactory(), Optional.of(factory));
}
origin: org.apache.samza/samza-sql

/**
 * For unit testing only
 */
@VisibleForTesting
public void translate(SamzaSqlQueryParser.QueryInfo queryInfo, StreamApplicationDescriptor appDesc) {
 QueryPlanner planner =
   new QueryPlanner(sqlConfig.getRelSchemaProviders(), sqlConfig.getSystemStreamConfigsBySource(),
     sqlConfig.getUdfMetadata());
 final RelRoot relRoot = planner.plan(queryInfo.getSql());
 int queryId = 1;
 SamzaSqlExecutionContext executionContext = new SamzaSqlExecutionContext(sqlConfig);
 Map<String, SamzaRelConverter> converters = sqlConfig.getSamzaRelConverters();
 TranslatorContext translatorContext = new TranslatorContext(appDesc, relRoot, executionContext, converters);
 translate(relRoot, translatorContext, queryId);
 Map<Integer, TranslatorContext> translatorContexts = new HashMap<>();
 translatorContexts.put(queryId, translatorContext.clone());
 appDesc.withApplicationTaskContextFactory((jobContext,
   containerContext,
   taskContext,
   applicationContainerContext) ->
   new SamzaSqlApplicationContext(translatorContexts));
}
org.apache.samza.application.descriptorsStreamApplicationDescriptorwithApplicationTaskContextFactory

Popular methods of StreamApplicationDescriptor

  • getInputStream
    Gets the input MessageStream corresponding to the inputDescriptor. A MessageStream, obtained by call
  • getOutputStream
    Gets the OutputStream corresponding to the outputDescriptor. An OutputStream>, obtained by calling t
  • getTable
    Gets the Table corresponding to the TableDescriptor. Multiple invocations of this method with the sa
  • getConfig
  • withApplicationContainerContextFactory
  • withDefaultSystem
  • withProcessorLifecycleListenerFactory

Popular in Java

  • Making http requests using okhttp
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Menu (java.awt)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Join (org.hibernate.mapping)
  • Top 12 Jupyter Notebook Extensions
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