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

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

Best Java code snippets using co.cask.cdap.api.dataset.Reconfigurable (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.datasetReconfigurable

Javadoc

Interface implemented by DatasetDefinitions that have a way to reconfigure the dataset properties. It is optional for a dataset type to implement this interface; if not implemented, the dataset system will assume that no compatibility check is required and call DatasetDefinition#configure(String,DatasetProperties) instead to obtain the new dataset specification.

Most used methods

  • reconfigure
    Validates the new properties, including a compatibility check with the existing spec, and returns a

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • IsNull (org.hamcrest.core)
    Is the value null?
  • 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