congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SystemDatasetInstantiator.getDataset
Code IndexAdd Tabnine to your IDE (free)

How to use
getDataset
method
in
co.cask.cdap.data.dataset.SystemDatasetInstantiator

Best Java code snippets using co.cask.cdap.data.dataset.SystemDatasetInstantiator.getDataset (Showing top 18 results out of 315)

origin: co.cask.cdap/cdap-data-fabric

public <T extends Dataset> T getDataset(DatasetId datasetId, Map<String, String> arguments)
 throws DatasetInstantiationException {
 return getDataset(datasetId, arguments, AccessType.UNKNOWN);
}
origin: cdapio/cdap

public <T extends Dataset> T getDataset(DatasetId datasetId, Map<String, String> arguments)
 throws DatasetInstantiationException {
 return getDataset(datasetId, arguments, AccessType.UNKNOWN);
}
origin: co.cask.cdap/cdap-data-fabric

public <T extends Dataset> T getDataset(DatasetId datasetId)
 throws DatasetInstantiationException {
 return getDataset(datasetId, DatasetDefinition.NO_ARGUMENTS);
}
origin: cdapio/cdap

public <T extends Dataset> T getDataset(DatasetId datasetId)
 throws DatasetInstantiationException {
 return getDataset(datasetId, DatasetDefinition.NO_ARGUMENTS);
}
origin: cdapio/cdap

public void initialize() throws IOException, DatasetManagementException,
 DatasetNotFoundException, ClassNotFoundException {
 dataset = datasetInstantiator.getDataset(datasetId);
 if (dataset instanceof TransactionAware) {
  ((TransactionAware) dataset).startTx(transaction);
 }
}
origin: co.cask.cdap/cdap-explore

public void initialize() throws IOException, DatasetManagementException,
 DatasetNotFoundException, ClassNotFoundException {
 dataset = datasetInstantiator.getDataset(datasetId);
 if (dataset instanceof TransactionAware) {
  ((TransactionAware) dataset).startTx(transaction);
 }
}
origin: cdapio/cdap

private String generateEnableStatement(DatasetId datasetId, DatasetSpecification spec, boolean truncating)
 throws UnsupportedTypeException, ExploreException {
 try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) {
  Dataset dataset = datasetInstantiator.getDataset(datasetId);
  try {
   return generateEnableStatement(dataset, spec, datasetId,
                   tableNaming.getTableName(datasetId, spec.getProperties()), truncating);
  } finally {
   Closeables.closeQuietly(dataset);
  }
 } catch (IOException e) {
  throw new ExploreException("Exception while trying to instantiate dataset " + datasetId, e);
 }
}
origin: co.cask.cdap/cdap-explore

private String generateEnableStatement(DatasetId datasetId, DatasetSpecification spec, boolean truncating)
 throws UnsupportedTypeException, ExploreException {
 try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) {
  Dataset dataset = datasetInstantiator.getDataset(datasetId);
  try {
   return generateEnableStatement(dataset, spec, datasetId,
                   tableNaming.getTableName(datasetId, spec.getProperties()), truncating);
  } finally {
   Closeables.closeQuietly(dataset);
  }
 } catch (IOException e) {
  throw new ExploreException("Exception while trying to instantiate dataset " + datasetId, e);
 }
}
origin: cdapio/cdap

Dataset dataset;
try {
 dataset = datasetInstantiator.getDataset(datasetId);
} catch (Exception e) {
 LOG.error("Exception instantiating dataset {}.", datasetId, e);
origin: co.cask.cdap/cdap-explore

Dataset dataset;
try {
 dataset = datasetInstantiator.getDataset(datasetId);
} catch (Exception e) {
 LOG.error("Exception instantiating dataset {}.", datasetId, e);
origin: co.cask.cdap/cdap-explore

Dataset dataset = datasetInstantiator.getDataset(datasetId);
try {
 alterStatements = generateAlterStatements(datasetId, tableName, dataset, spec, oldSpec);
origin: cdapio/cdap

Dataset dataset = datasetInstantiator.getDataset(datasetId);
try {
 alterStatements = generateAlterStatements(datasetId, tableName, dataset, spec, oldSpec);
origin: co.cask.cdap/cdap-explore

private String generateDisableStatement(DatasetId datasetId, DatasetSpecification spec) throws ExploreException {
 String tableName = tableNaming.getTableName(datasetId, spec.getProperties());
 String databaseName = ExploreProperties.getExploreDatabaseName(spec.getProperties());
 // If table does not exist, nothing to be done
 try {
  exploreService.getTableInfo(datasetId.getNamespace(), databaseName, tableName);
 } catch (TableNotFoundException e) {
  // Ignore exception, since this means table was not found.
  return null;
 }
 try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) {
  Dataset dataset = datasetInstantiator.getDataset(datasetId);
  try {
   if (dataset instanceof FileSet || dataset instanceof PartitionedFileSet) {
    // do not drop the explore table that dataset is reusing an existing table
    if (FileSetProperties.isUseExisting(spec.getProperties())) {
     return null;
    }
   }
   return generateDeleteStatement(dataset, databaseName, tableName);
  } finally {
   Closeables.closeQuietly(dataset);
  }
 } catch (IOException e) {
  LOG.error("Exception creating dataset classLoaderProvider for dataset {}.", datasetId, e);
  throw new ExploreException("Exception instantiating dataset " + datasetId);
 }
}
origin: cdapio/cdap

private String generateDisableStatement(DatasetId datasetId, DatasetSpecification spec) throws ExploreException {
 String tableName = tableNaming.getTableName(datasetId, spec.getProperties());
 String databaseName = ExploreProperties.getExploreDatabaseName(spec.getProperties());
 // If table does not exist, nothing to be done
 try {
  exploreService.getTableInfo(datasetId.getNamespace(), databaseName, tableName);
 } catch (TableNotFoundException e) {
  // Ignore exception, since this means table was not found.
  return null;
 }
 try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) {
  Dataset dataset = datasetInstantiator.getDataset(datasetId);
  try {
   if (dataset instanceof FileSet || dataset instanceof PartitionedFileSet) {
    // do not drop the explore table that dataset is reusing an existing table
    if (FileSetProperties.isUseExisting(spec.getProperties())) {
     return null;
    }
   }
   return generateDeleteStatement(dataset, databaseName, tableName);
  } finally {
   Closeables.closeQuietly(dataset);
  }
 } catch (IOException e) {
  LOG.error("Exception creating dataset classLoaderProvider for dataset {}.", datasetId, e);
  throw new ExploreException("Exception instantiating dataset " + datasetId);
 }
}
origin: cdapio/cdap

/**
 * Creates a new instance of a dataset based on the given information.
 */
private Dataset createDatasetInstance(DatasetCacheKey key, boolean recordLineage) {
 DatasetId datasetId = new DatasetId(key.getNamespace(), key.getName());
 Dataset dataset = instantiator.getDataset(datasetId, key.getArguments(), key.getAccessType());
 if (dataset instanceof MeteredDataset && metricsContext != null) {
  ((MeteredDataset) dataset).setMetricsCollector(
   metricsContext.childContext(Constants.Metrics.Tag.DATASET, key.getName()));
 }
 if (recordLineage) {
  instantiator.writeLineage(datasetId, key.getAccessType());
 }
 return dataset;
}
origin: co.cask.cdap/cdap-data-fabric

/**
 * Creates a new instance of a dataset based on the given information.
 */
private Dataset createDatasetInstance(DatasetCacheKey key, boolean recordLineage) {
 DatasetId datasetId = new DatasetId(key.getNamespace(), key.getName());
 Dataset dataset = instantiator.getDataset(datasetId, key.getArguments(), key.getAccessType());
 if (dataset instanceof MeteredDataset && metricsContext != null) {
  ((MeteredDataset) dataset).setMetricsCollector(
   metricsContext.childContext(Constants.Metrics.Tag.DATASET, key.getName()));
 }
 if (recordLineage) {
  instantiator.writeLineage(datasetId, key.getAccessType());
 }
 return dataset;
}
origin: cdapio/cdap

Dataset dataset = datasetInstantiator.getDataset(datasetId);
if (dataset == null) {
 throw new SerDeException("Could not find dataset " + datasetId);
origin: co.cask.cdap/cdap-explore

Dataset dataset = datasetInstantiator.getDataset(datasetId);
if (dataset == null) {
 throw new SerDeException("Could not find dataset " + datasetId);
co.cask.cdap.data.datasetSystemDatasetInstantiatorgetDataset

Popular methods of SystemDatasetInstantiator

  • <init>
  • close
  • getDatasetAdmin
  • writeLineage

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • getResourceAsStream (ClassLoader)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 12 Jupyter Notebook Extensions
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