Tabnine Logo
SqlIOConfig.getSystemStream
Code IndexAdd Tabnine to your IDE (free)

How to use
getSystemStream
method
in
org.apache.samza.sql.interfaces.SqlIOConfig

Best Java code snippets using org.apache.samza.sql.interfaces.SqlIOConfig.getSystemStream (Showing top 3 results out of 315)

origin: org.apache.samza/samza-sql

public SamzaSqlApplicationConfig(Config staticConfig, Set<String> inputSystemStreams,
  Set<String> outputSystemStreams) {
 ioResolver = createIOResolver(staticConfig);
 inputSystemStreamConfigBySource = inputSystemStreams.stream()
    .collect(Collectors.toMap(Function.identity(), src -> ioResolver.fetchSourceInfo(src)));
 outputSystemStreamConfigsBySource = outputSystemStreams.stream()
    .collect(Collectors.toMap(Function.identity(), x -> ioResolver.fetchSinkInfo(x)));
 systemStreamConfigsBySource = new HashMap<>(inputSystemStreamConfigBySource);
 systemStreamConfigsBySource.putAll(outputSystemStreamConfigsBySource);
 Set<SqlIOConfig> systemStreamConfigs = new HashSet<>(systemStreamConfigsBySource.values());
 relSchemaProvidersBySource = systemStreamConfigs.stream()
   .collect(Collectors.toMap(SqlIOConfig::getSource,
     x -> initializePlugin("RelSchemaProvider", x.getRelSchemaProviderName(), staticConfig,
       CFG_FMT_REL_SCHEMA_PROVIDER_DOMAIN,
       (o, c) -> ((RelSchemaProviderFactory) o).create(x.getSystemStream(), c))));
 samzaRelConvertersBySource = systemStreamConfigs.stream()
   .collect(Collectors.toMap(SqlIOConfig::getSource,
     x -> initializePlugin("SamzaRelConverter", x.getSamzaRelConverterName(), staticConfig,
       CFG_FMT_SAMZA_REL_CONVERTER_DOMAIN, (o, c) -> ((SamzaRelConverterFactory) o).create(x.getSystemStream(),
         relSchemaProvidersBySource.get(x.getSource()), c))));
 udfResolver = createUdfResolver(staticConfig);
 udfMetadata = udfResolver.getUdfs();
 windowDurationMs = staticConfig.getLong(CFG_GROUPBY_WINDOW_DURATION_MS, DEFAULT_GROUPBY_WINDOW_DURATION_MS);
 // remove the SqlIOConfigs of outputs whose system is "log" out of systemStreamConfigsBySource
 outputSystemStreamConfigsBySource.forEach((k, v) -> {
   if (k.split("\\.")[0].equals(SamzaSqlApplicationConfig.SAMZA_SYSTEM_LOG)) {
     systemStreamConfigsBySource.remove(k);
   }
 });
}
origin: apache/samza

x -> initializePlugin("RelSchemaProvider", x.getRelSchemaProviderName(), staticConfig,
  CFG_FMT_REL_SCHEMA_PROVIDER_DOMAIN,
  (o, c) -> ((RelSchemaProviderFactory) o).create(x.getSystemStream(), c))));
  CFG_FMT_SAMZA_REL_CONVERTER_DOMAIN, (o, c) -> ((SamzaRelConverterFactory) o).create(x.getSystemStream(),
    relSchemaProvidersBySource.get(x.getSource()), c))));
x -> initializePlugin("SamzaRelTableKeyConverter", x.getSamzaRelTableKeyConverterName(),
  staticConfig, CFG_FMT_SAMZA_REL_TABLE_KEY_CONVERTER_DOMAIN,
  (o, c) -> ((SamzaRelTableKeyConverterFactory) o).create(x.getSystemStream(), c))));
origin: apache/samza

@Override
public SqlSchema getTableSchema(ExecutionContext context, String tableName) {
 /**
  *  currently Shell works only for systems that has Avro schemas
  */
 lastErrorMsg = "";
 int execId = execIdSeq.incrementAndGet();
 Map<String, String> staticConfigs = fetchSamzaSqlConfig(execId, context);
 Config samzaSqlConfig = new MapConfig(staticConfigs);
 SqlSchema sqlSchema = null;
 try {
  SqlIOResolver ioResolver = SamzaSqlApplicationConfig.createIOResolver(samzaSqlConfig);
  SqlIOConfig sourceInfo = ioResolver.fetchSourceInfo(tableName);
  RelSchemaProvider schemaProvider =
      SamzaSqlApplicationConfig.initializePlugin("RelSchemaProvider", sourceInfo.getRelSchemaProviderName(),
          samzaSqlConfig, SamzaSqlApplicationConfig.CFG_FMT_REL_SCHEMA_PROVIDER_DOMAIN,
          (o, c) -> ((RelSchemaProviderFactory) o).create(sourceInfo.getSystemStream(), c));
  sqlSchema =  schemaProvider.getSqlSchema();
 } catch (SamzaException ex) {
  String msg = "getTableSchema failed with exception ";
  lastErrorMsg = msg + ex.toString();
  LOG.error(msg, ex);
 }
 return sqlSchema;
}
org.apache.samza.sql.interfacesSqlIOConfiggetSystemStream

Popular methods of SqlIOConfig

  • <init>
  • getRelSchemaProviderName
  • getTableDescriptor
  • getConfig
  • getSamzaRelConverterName
  • getSource
  • getSourceFromSourceParts
  • getSourceParts
  • getSystemName
  • getSamzaRelTableKeyConverterName
  • getStreamId
  • getStreamName
  • getStreamId,
  • getStreamName,
  • isRemoteTable

Popular in Java

  • Finding current android device location
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • findViewById (Activity)
  • Kernel (java.awt.image)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • 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