congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Reconfigurable.reconfigure
Code IndexAdd Tabnine to your IDE (free)

How to use
reconfigure
method
in
co.cask.cdap.api.dataset.Reconfigurable

Best Java code snippets using co.cask.cdap.api.dataset.Reconfigurable.reconfigure (Showing top 5 results out of 315)

origin: cdapio/cdap

 /**
  * Reconfigure a dataset instance. Delegates to {@link Reconfigurable#reconfigure} if the dataset definition
  * implements that interface, and delegates to {@link #configure} otherwise.
  * @param def the dataset definition that will perform the (re)configure
  * @param name name of the dataset instance to reconfigure
  * @param newProps the updated dataset properties
  * @param currentSpec the current dataset specification
  * @return a new dataset specification representing the updated properties
  * @throws IncompatibleUpdateException if the updated properties are incompatible with the existing properties
  */
 public static DatasetSpecification reconfigure(DatasetDefinition def, String name,
                         DatasetProperties newProps, DatasetSpecification currentSpec)
  throws IncompatibleUpdateException {

  return def instanceof Reconfigurable
   ? ((Reconfigurable) def).reconfigure(name, newProps, currentSpec)
   : def.configure(name, newProps);
 }
}
origin: caskdata/cdap

private void testFileSetReconfigure(boolean expectSuccess, DatasetDefinition def,
                  Boolean wasExternal, String path,
                  Boolean newExternal, String newPath,
                  DatasetProperties extraProps) throws IncompatibleUpdateException {
 Assert.assertTrue(def instanceof Reconfigurable);
 DatasetProperties props = buildFileSetProps(extraProps, wasExternal, path);
 DatasetProperties newProps = buildFileSetProps(extraProps, newExternal, newPath);
 DatasetSpecification spec = def.configure("fs", props);
 if (expectSuccess) {
  ((Reconfigurable) def).reconfigure("fs", newProps, spec);
 } else {
  try {
   ((Reconfigurable) def).reconfigure("fs", newProps, spec);
   Assert.fail("reconfigure should have thrown exception");
  } catch (IncompatibleUpdateException e) {
   // expected
  }
 }
}
origin: caskdata/cdap

private void testTimeSeriesReconfigure(DatasetDefinition def) throws IncompatibleUpdateException {
 DatasetProperties props = DatasetProperties.builder()
  .add(TimeseriesDataset.ATTR_TIME_INTERVAL_TO_STORE_PER_ROW,
     String.valueOf(TimeUnit.HOURS.toMillis(1)))
  .build();
 DatasetProperties compatProps = TableProperties.builder()
  .setTTL(TimeUnit.DAYS.toSeconds(1))
  .add(TimeseriesDataset.ATTR_TIME_INTERVAL_TO_STORE_PER_ROW, String.valueOf(TimeUnit.HOURS.toMillis(1)))
  .build();
 DatasetProperties incompatProps = TableProperties.builder()
  .setTTL(TimeUnit.DAYS.toSeconds(1))
  .add(TimeseriesDataset.ATTR_TIME_INTERVAL_TO_STORE_PER_ROW, String.valueOf(TimeUnit.HOURS.toMillis(2)))
  .build();
 DatasetSpecification spec = def.configure("tt", props);
 Assert.assertTrue(def instanceof Reconfigurable);
 ((Reconfigurable) def).reconfigure("tt", compatProps, spec);
 try {
  ((Reconfigurable) def).reconfigure("tt", incompatProps, spec);
  Assert.fail("reconfigure should have thrown exception");
 } catch (IncompatibleUpdateException e) {
  // expected
 }
}
origin: caskdata/cdap

 .add(IndexedTable.INDEX_COLUMNS_CONF_KEY, "c,b,a")
 .build();
spec = ((Reconfigurable) indexedTableDef).reconfigure("idxtb", compat, spec);
 .build();
try {
 ((Reconfigurable) indexedTableDef).reconfigure("idxtb", incompat, spec);
 Assert.fail("reconfigure should have thrown exception");
} catch (IncompatibleUpdateException e) {
 .build();
try {
 ((Reconfigurable) indexedTableDef).reconfigure("idxtb", incompat, spec);
 Assert.fail("reconfigure should have thrown exception");
} catch (IncompatibleUpdateException e) {
origin: caskdata/cdap

 Partitioning.builder().addStringField("s").build()).build();
try {
 ((Reconfigurable) pfsDef).reconfigure("pfs", noIprops, spec);
 Assert.fail("reconfigure should have thrown exception");
} catch (IncompatibleUpdateException e) {
 Partitioning.builder().addLongField("i").addStringField("s").build()).build();
try {
 ((Reconfigurable) pfsDef).reconfigure("pfs", longIprops, spec);
 Assert.fail("reconfigure should have thrown exception");
} catch (IncompatibleUpdateException e) {
 Partitioning.builder().addStringField("s").addIntField("i").build()).build();
try {
 ((Reconfigurable) pfsDef).reconfigure("pfs", revProps, spec);
 Assert.fail("reconfigure should have thrown exception");
} catch (IncompatibleUpdateException e) {
 .build();
DatasetSpecification oldSpec = pfsDef.configure("pfs", oldProps);
DatasetSpecification newSpec = ((Reconfigurable) pfsDef).reconfigure("pfs", oldProps, oldSpec);
 .build();
oldSpec = pfsDef.configure("pfs", props);
newSpec = ((Reconfigurable) pfsDef).reconfigure("pfs", props, oldSpec);
newSpec = ((Reconfigurable) pfsDef).reconfigure("pfs", props, oldSpec);
co.cask.cdap.api.datasetReconfigurablereconfigure

Javadoc

Validates the new properties, including a compatibility check with the existing spec, and returns a new dataset specification for the dataset instance.

Popular methods of Reconfigurable

    Popular in Java

    • Running tasks concurrently on multiple threads
    • getSupportFragmentManager (FragmentActivity)
    • notifyDataSetChanged (ArrayAdapter)
    • runOnUiThread (Activity)
    • Connection (java.sql)
      A connection represents a link from a Java application to a database. All SQL statements and results
    • DecimalFormat (java.text)
      A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
    • MessageFormat (java.text)
      Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
    • JLabel (javax.swing)
    • Options (org.apache.commons.cli)
      Main entry-point into the library. Options represents a collection of Option objects, which describ
    • Base64 (org.apache.commons.codec.binary)
      Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
    • Top 17 Free Sublime Text Plugins
    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