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

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

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

origin: apache/samza

String getSourceName() {
 return SqlIOConfig.getSourceFromSourceParts(relNode.getTable().getQualifiedName());
}
origin: org.apache.samza/samza-sql

public SqlIOConfig(String systemName, String streamName, List<String> sourceParts,
  Config systemConfig, TableDescriptor tableDescriptor) {
 HashMap<String, String> streamConfigs = new HashMap<>(systemConfig);
 this.systemName = systemName;
 this.streamName = streamName;
 this.source = getSourceFromSourceParts(sourceParts);
 this.sourceParts = sourceParts;
 this.systemStream = new SystemStream(systemName, streamName);
 this.tableDescriptor = Optional.ofNullable(tableDescriptor);
 samzaRelConverterName = streamConfigs.get(CFG_SAMZA_REL_CONVERTER);
 Validate.notEmpty(samzaRelConverterName,
   String.format("%s is not set or empty for system %s", CFG_SAMZA_REL_CONVERTER, systemName));
 relSchemaProviderName = streamConfigs.get(CFG_REL_SCHEMA_PROVIDER);
 // Removing the Samza SQL specific configs to get the remaining Samza configs.
 streamConfigs.remove(CFG_SAMZA_REL_CONVERTER);
 streamConfigs.remove(CFG_REL_SCHEMA_PROVIDER);
 // Currently, only local table is supported. And it is assumed that all tables are local tables.
 if (tableDescriptor != null) {
  streamConfigs.put(String.format(StreamConfig.BOOTSTRAP_FOR_STREAM_ID(), streamName), "true");
  streamConfigs.put(String.format(StreamConfig.CONSUMER_OFFSET_DEFAULT_FOR_STREAM_ID(), streamName), "oldest");
 }
 config = new MapConfig(streamConfigs);
}
origin: apache/samza

public SqlIOConfig(String systemName, String streamName, List<String> sourceParts,
  Config systemConfig, TableDescriptor tableDescriptor) {
 HashMap<String, String> streamConfigs = new HashMap<>(systemConfig);
 this.source = getSourceFromSourceParts(sourceParts);
 this.sourceParts = sourceParts;
 this.systemStream = new SystemStream(systemName, streamName);
origin: apache/samza

private SqlIOConfig resolveSourceConfigForTable(RelNode relNode, TranslatorContext context) {
 if (relNode instanceof LogicalProject) {
  return resolveSourceConfigForTable(((LogicalProject) relNode).getInput(), context);
 }
 // We are returning the sourceConfig for the table as null when the table is in another join rather than an output
 // table, that's because the output of stream-table join is considered a stream.
 if (relNode.getInputs().size() > 1) {
  return null;
 }
 String sourceName = SqlIOConfig.getSourceFromSourceParts(relNode.getTable().getQualifiedName());
 SqlIOConfig sourceConfig =
   context.getExecutionContext().getSamzaSqlApplicationConfig().getInputSystemStreamConfigBySource().get(sourceName);
 if (sourceConfig == null) {
  throw new SamzaException("Unsupported source found in join statement: " + sourceName);
 }
 return sourceConfig;
}
origin: org.apache.samza/samza-sql

 void translate(final TableScan tableScan, final TranslatorContext context,
   Map<String, DelegatingSystemDescriptor> systemDescriptors, Map<String, MessageStream<KV<Object, Object>>> inputMsgStreams) {
  StreamApplicationDescriptor streamAppDesc = context.getStreamAppDescriptor();
  List<String> tableNameParts = tableScan.getTable().getQualifiedName();
  String sourceName = SqlIOConfig.getSourceFromSourceParts(tableNameParts);

  Validate.isTrue(relMsgConverters.containsKey(sourceName), String.format("Unknown source %s", sourceName));
  SqlIOConfig sqlIOConfig = systemStreamConfig.get(sourceName);
  final String systemName = sqlIOConfig.getSystemName();
  final String streamName = sqlIOConfig.getStreamName();
  final String source = sqlIOConfig.getSource();

  KVSerde<Object, Object> noOpKVSerde = KVSerde.of(new NoOpSerde<>(), new NoOpSerde<>());
  DelegatingSystemDescriptor
    sd = systemDescriptors.computeIfAbsent(systemName, DelegatingSystemDescriptor::new);
  GenericInputDescriptor<KV<Object, Object>> isd = sd.getInputDescriptor(streamName, noOpKVSerde);

  MessageStream<KV<Object, Object>> inputStream = inputMsgStreams.computeIfAbsent(source, v -> streamAppDesc.getInputStream(isd));
  MessageStream<SamzaSqlRelMessage> samzaSqlRelMessageStream = inputStream.map(new ScanMapFunction(sourceName, queryId));
  context.registerMessageStream(tableScan.getId(), samzaSqlRelMessageStream);
 }
}
origin: apache/samza

StreamApplicationDescriptor streamAppDesc = context.getStreamAppDescriptor();
List<String> tableNameParts = tableScan.getTable().getQualifiedName();
String sourceName = SqlIOConfig.getSourceFromSourceParts(tableNameParts);
origin: org.apache.samza/samza-sql

String targetName = SqlIOConfig.getSourceFromSourceParts(tableNameParts);
org.apache.samza.sql.interfacesSqlIOConfiggetSourceFromSourceParts

Popular methods of SqlIOConfig

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

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • getSystemService (Context)
  • getResourceAsStream (ClassLoader)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JCheckBox (javax.swing)
  • JFrame (javax.swing)
  • Top PhpStorm 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