Tabnine Logo
SamzaSqlApplicationConfig.getOutputSystemStreams
Code IndexAdd Tabnine to your IDE (free)

How to use
getOutputSystemStreams
method
in
org.apache.samza.sql.runner.SamzaSqlApplicationConfig

Best Java code snippets using org.apache.samza.sql.runner.SamzaSqlApplicationConfig.getOutputSystemStreams (Showing top 4 results out of 315)

origin: apache/samza

TranslatorContext translatorContext = new TranslatorContext(appDescriptor, relRoot, executionContext);
translatorContextMap.put(queryId, translatorContext);
queryTranslator.translate(relRoot, sqlConfig.getOutputSystemStreams().get(queryId), translatorContext, queryId);
queryId++;
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

@Test
public void testGetInputAndOutputStreamConfigsFanOut() {
 List<String> sqlStmts = Arrays.asList("Insert into testavro.COMPLEX1 select * from testavro.SIMPLE1",
   "insert into testavro.Profile select * from testavro.SIMPLE1");
 Map<String, String> config = SamzaSqlTestConfig.fetchStaticConfigsWithFactories(10);
 config.put(SamzaSqlApplicationConfig.CFG_SQL_STMTS_JSON, JsonUtil.toJson(sqlStmts));
 List<SamzaSqlQueryParser.QueryInfo> queryInfo = fetchQueryInfo(sqlStmts);
 SamzaSqlApplicationConfig samzaSqlApplicationConfig = new SamzaSqlApplicationConfig(new MapConfig(config),
   queryInfo.stream().map(SamzaSqlQueryParser.QueryInfo::getSources).flatMap(Collection::stream)
     .collect(Collectors.toList()),
   queryInfo.stream().map(SamzaSqlQueryParser.QueryInfo::getSink).collect(Collectors.toList()));
 Set<String> inputKeys = samzaSqlApplicationConfig.getInputSystemStreamConfigBySource().keySet();
 Set<String> outputKeys = samzaSqlApplicationConfig.getOutputSystemStreamConfigsBySource().keySet();
 List<String> outputStreamList = samzaSqlApplicationConfig.getOutputSystemStreams();
 Assert.assertEquals(1, inputKeys.size());
 Assert.assertTrue(inputKeys.contains("testavro.SIMPLE1"));
 Assert.assertEquals(2, outputKeys.size());
 Assert.assertTrue(outputKeys.contains("testavro.COMPLEX1"));
 Assert.assertTrue(outputKeys.contains("testavro.Profile"));
 Assert.assertEquals(2, outputStreamList.size());
 Assert.assertEquals("testavro.COMPLEX1", outputStreamList.get(0));
 Assert.assertEquals("testavro.Profile", outputStreamList.get(1));
}
origin: apache/samza

@Test
public void testGetInputAndOutputStreamConfigsFanIn() {
 List<String> sqlStmts = Arrays.asList("Insert into testavro.COMPLEX1 select * from testavro.SIMPLE1",
   "insert into testavro.COMPLEX1 select * from testavro.SIMPLE2");
 Map<String, String> config = SamzaSqlTestConfig.fetchStaticConfigsWithFactories(10);
 config.put(SamzaSqlApplicationConfig.CFG_SQL_STMTS_JSON, JsonUtil.toJson(sqlStmts));
 List<SamzaSqlQueryParser.QueryInfo> queryInfo = fetchQueryInfo(sqlStmts);
 SamzaSqlApplicationConfig samzaSqlApplicationConfig = new SamzaSqlApplicationConfig(new MapConfig(config),
   queryInfo.stream().map(SamzaSqlQueryParser.QueryInfo::getSources).flatMap(Collection::stream)
     .collect(Collectors.toList()),
   queryInfo.stream().map(SamzaSqlQueryParser.QueryInfo::getSink).collect(Collectors.toList()));
 Set<String> inputKeys = samzaSqlApplicationConfig.getInputSystemStreamConfigBySource().keySet();
 Set<String> outputKeys = samzaSqlApplicationConfig.getOutputSystemStreamConfigsBySource().keySet();
 List<String> outputStreamList = samzaSqlApplicationConfig.getOutputSystemStreams();
 Assert.assertEquals(2, inputKeys.size());
 Assert.assertTrue(inputKeys.contains("testavro.SIMPLE1"));
 Assert.assertTrue(inputKeys.contains("testavro.SIMPLE2"));
 Assert.assertEquals(1, outputKeys.size());
 Assert.assertTrue(outputKeys.contains("testavro.COMPLEX1"));
 Assert.assertEquals(2, outputStreamList.size());
 Assert.assertEquals("testavro.COMPLEX1", outputStreamList.get(0));
 Assert.assertEquals("testavro.COMPLEX1", outputStreamList.get(1));
}
org.apache.samza.sql.runnerSamzaSqlApplicationConfiggetOutputSystemStreams

Popular methods of SamzaSqlApplicationConfig

  • <init>
  • createIOResolver
  • getInputSystemStreamConfigBySource
  • getOutputSystemStreamConfigsBySource
  • getUdfMetadata
  • initializePlugin
  • createUdfResolver
  • deserializeSqlStmts
  • getDomainProperties
  • getRelSchemaProviders
  • getSamzaRelConverters
  • getSystemStreamName
  • getSamzaRelConverters,
  • getSystemStreamName,
  • getWindowDurationMs,
  • populateSystemStreams,
  • populateSystemStreamsAndGetRelRoots,
  • serializeSqlStmts,
  • getIoResolver,
  • getMetadataTopicPrefix,
  • getSamzaRelTableKeyConverters

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top Vim plugins
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