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

How to use
TableProvider
in
org.apache.samza.table.descriptors

Best Java code snippets using org.apache.samza.table.descriptors.TableProvider (Showing top 16 results out of 315)

origin: org.apache.samza/samza-core_2.11

/**
 * Shutdown the table manager, internally it shuts down all tables
 */
public void close() {
 tableContexts.values().forEach(ctx -> ctx.tableProvider.close());
}
origin: org.apache.samza/samza-core_2.11

 /**
  * Get a table instance
  * @param tableId Id of the table
  * @return table instance
  */
 public Table getTable(String tableId) {
  Preconditions.checkState(initialized, "TableManager has not been initialized.");

  TableCtx ctx = tableContexts.get(tableId);
  Preconditions.checkNotNull(ctx, "Unknown tableId " + tableId);

  if (ctx.table == null) {
   ctx.table = ctx.tableProvider.getTable();
  }
  return ctx.table;
 }
}
origin: org.apache.samza/samza-core_2.10

/**
 * Initialize table providers with container and task contexts
 * @param context context for the task
 */
public void init(Context context) {
 tableContexts.values().forEach(ctx -> ctx.tableProvider.init(context));
 initialized = true;
}
origin: org.apache.samza/samza-core_2.11

/**
 * Generate table configurations given a list of table specs
 * @param config the job configuration
 * @param tableSpecs the list of tableSpecs
 * @return configuration for the tables
 */
static public Map<String, String> generateConfigsForTableSpecs(Config config, List<TableSpec> tableSpecs) {
 Map<String, String> tableConfigs = new HashMap<>();
 tableSpecs.forEach(tableSpec -> {
   // Add table provider factory config
   tableConfigs.put(String.format(JavaTableConfig.TABLE_PROVIDER_FACTORY, tableSpec.getId()),
     tableSpec.getTableProviderFactoryClassName());
   // Generate additional configuration
   TableProviderFactory tableProviderFactory =
     Util.getObj(tableSpec.getTableProviderFactoryClassName(), TableProviderFactory.class);
   TableProvider tableProvider = tableProviderFactory.getTableProvider(tableSpec);
   tableConfigs.putAll(tableProvider.generateConfig(config, tableConfigs));
  });
 LOG.info("TableConfigGenerator has generated configs {}", tableConfigs);
 return tableConfigs;
}
origin: org.apache.samza/samza-core_2.12

/**
 * Generate table configurations given a list of table specs
 * @param config the job configuration
 * @param tableSpecs the list of tableSpecs
 * @return configuration for the tables
 */
static public Map<String, String> generateConfigsForTableSpecs(Config config, List<TableSpec> tableSpecs) {
 Map<String, String> tableConfigs = new HashMap<>();
 tableSpecs.forEach(tableSpec -> {
   // Add table provider factory config
   tableConfigs.put(String.format(JavaTableConfig.TABLE_PROVIDER_FACTORY, tableSpec.getId()),
     tableSpec.getTableProviderFactoryClassName());
   // Generate additional configuration
   TableProviderFactory tableProviderFactory =
     Util.getObj(tableSpec.getTableProviderFactoryClassName(), TableProviderFactory.class);
   TableProvider tableProvider = tableProviderFactory.getTableProvider(tableSpec);
   tableConfigs.putAll(tableProvider.generateConfig(config, tableConfigs));
  });
 LOG.info("TableConfigGenerator has generated configs {}", tableConfigs);
 return tableConfigs;
}
origin: org.apache.samza/samza-core

/**
 * Initialize table providers with container and task contexts
 * @param context context for the task
 */
public void init(Context context) {
 tableContexts.values().forEach(ctx -> ctx.tableProvider.init(context));
 initialized = true;
}
origin: org.apache.samza/samza-core_2.10

/**
 * Shutdown the table manager, internally it shuts down all tables
 */
public void close() {
 tableContexts.values().forEach(ctx -> ctx.tableProvider.close());
}
origin: org.apache.samza/samza-core

 /**
  * Get a table instance
  * @param tableId Id of the table
  * @return table instance
  */
 public Table getTable(String tableId) {
  Preconditions.checkState(initialized, "TableManager has not been initialized.");

  TableCtx ctx = tableContexts.get(tableId);
  Preconditions.checkNotNull(ctx, "Unknown tableId " + tableId);

  if (ctx.table == null) {
   ctx.table = ctx.tableProvider.getTable();
  }
  return ctx.table;
 }
}
origin: org.apache.samza/samza-core_2.10

/**
 * Generate table configurations given a list of table specs
 * @param config the job configuration
 * @param tableSpecs the list of tableSpecs
 * @return configuration for the tables
 */
static public Map<String, String> generateConfigsForTableSpecs(Config config, List<TableSpec> tableSpecs) {
 Map<String, String> tableConfigs = new HashMap<>();
 tableSpecs.forEach(tableSpec -> {
   // Add table provider factory config
   tableConfigs.put(String.format(JavaTableConfig.TABLE_PROVIDER_FACTORY, tableSpec.getId()),
     tableSpec.getTableProviderFactoryClassName());
   // Generate additional configuration
   TableProviderFactory tableProviderFactory =
     Util.getObj(tableSpec.getTableProviderFactoryClassName(), TableProviderFactory.class);
   TableProvider tableProvider = tableProviderFactory.getTableProvider(tableSpec);
   tableConfigs.putAll(tableProvider.generateConfig(config, tableConfigs));
  });
 LOG.info("TableConfigGenerator has generated configs {}", tableConfigs);
 return tableConfigs;
}
origin: org.apache.samza/samza-core_2.11

/**
 * Initialize table providers with container and task contexts
 * @param context context for the task
 */
public void init(Context context) {
 tableContexts.values().forEach(ctx -> ctx.tableProvider.init(context));
 initialized = true;
}
origin: org.apache.samza/samza-core

/**
 * Shutdown the table manager, internally it shuts down all tables
 */
public void close() {
 tableContexts.values().forEach(ctx -> ctx.tableProvider.close());
}
origin: org.apache.samza/samza-core_2.10

 /**
  * Get a table instance
  * @param tableId Id of the table
  * @return table instance
  */
 public Table getTable(String tableId) {
  Preconditions.checkState(initialized, "TableManager has not been initialized.");

  TableCtx ctx = tableContexts.get(tableId);
  Preconditions.checkNotNull(ctx, "Unknown tableId " + tableId);

  if (ctx.table == null) {
   ctx.table = ctx.tableProvider.getTable();
  }
  return ctx.table;
 }
}
origin: org.apache.samza/samza-core

/**
 * Generate table configurations given a list of table specs
 * @param config the job configuration
 * @param tableSpecs the list of tableSpecs
 * @return configuration for the tables
 */
static public Map<String, String> generateConfigsForTableSpecs(Config config, List<TableSpec> tableSpecs) {
 Map<String, String> tableConfigs = new HashMap<>();
 tableSpecs.forEach(tableSpec -> {
   // Add table provider factory config
   tableConfigs.put(String.format(JavaTableConfig.TABLE_PROVIDER_FACTORY, tableSpec.getId()),
     tableSpec.getTableProviderFactoryClassName());
   // Generate additional configuration
   TableProviderFactory tableProviderFactory =
     Util.getObj(tableSpec.getTableProviderFactoryClassName(), TableProviderFactory.class);
   TableProvider tableProvider = tableProviderFactory.getTableProvider(tableSpec);
   tableConfigs.putAll(tableProvider.generateConfig(config, tableConfigs));
  });
 LOG.info("TableConfigGenerator has generated configs {}", tableConfigs);
 return tableConfigs;
}
origin: org.apache.samza/samza-core_2.12

/**
 * Initialize table providers with container and task contexts
 * @param context context for the task
 */
public void init(Context context) {
 tableContexts.values().forEach(ctx -> ctx.tableProvider.init(context));
 initialized = true;
}
origin: org.apache.samza/samza-core_2.12

/**
 * Shutdown the table manager, internally it shuts down all tables
 */
public void close() {
 tableContexts.values().forEach(ctx -> ctx.tableProvider.close());
}
origin: org.apache.samza/samza-core_2.12

 /**
  * Get a table instance
  * @param tableId Id of the table
  * @return table instance
  */
 public Table getTable(String tableId) {
  Preconditions.checkState(initialized, "TableManager has not been initialized.");

  TableCtx ctx = tableContexts.get(tableId);
  Preconditions.checkNotNull(ctx, "Unknown tableId " + tableId);

  if (ctx.table == null) {
   ctx.table = ctx.tableProvider.getTable();
  }
  return ctx.table;
 }
}
org.apache.samza.table.descriptorsTableProvider

Javadoc

A table provider provides the implementation for a table. It ensures a table is properly constructed and also manages its lifecycle.

Most used methods

  • close
    Shutdown the underlying table
  • generateConfig
    Generate any configuration for this table, the generated configuration is used by Samza container to
  • getTable
    Get an instance of the table for read/write operations
  • init
    Initialize TableProvider with container and task context

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Option (scala)
  • Best IntelliJ 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