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

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

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

origin: cdapio/cdap

@Inject
public DatasetInstanceManager(TransactionSystemClientService txClientService,
               TransactionExecutorFactory txExecutorFactory,
               @Named("datasetMDS") DatasetFramework datasetFramework) {
 this.txExecutorFactory = txExecutorFactory;
 Map<String, String> emptyArgs = Collections.emptyMap();
 this.datasetCache = new MultiThreadDatasetCache(new SystemDatasetInstantiator(datasetFramework),
                         new TransactionSystemClientAdapter(txClientService),
                         NamespaceId.SYSTEM, emptyArgs, null,
                         ImmutableMap.of(
                          DatasetMetaTableUtil.INSTANCE_TABLE_NAME, emptyArgs
                         ));
}
origin: cdapio/cdap

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

 @Override
 public void close() throws IOException {
  datasetInstantiator.close();
  context.close();
 }
}
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

private <T> T performDatasetAdmin(final DatasetId datasetInstanceId, Operation<T> operation) throws Exception {
 try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) {
  DatasetAdmin admin = impersonator.doAs(datasetInstanceId, (Callable<DatasetAdmin>) () -> {
   DatasetAdmin admin1 = datasetInstantiator.getDatasetAdmin(datasetInstanceId);
   if (admin1 == null) {
    throw new NotFoundException("Couldn't obtain DatasetAdmin for dataset instance " + datasetInstanceId);
   }
   // returns a DatasetAdmin that executes operations as a particular user, for a particular namespace
   return new ImpersonatingDatasetAdmin(admin1, impersonator, datasetInstanceId);
  });
  try {
   return operation.perform(admin);
  } finally {
   Closeables.closeQuietly(admin);
  }
 }
}
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

private <T> T performDatasetAdmin(final DatasetId datasetInstanceId, Operation<T> operation) throws Exception {
 try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) {
  DatasetAdmin admin = impersonator.doAs(datasetInstanceId, (Callable<DatasetAdmin>) () -> {
   DatasetAdmin admin1 = datasetInstantiator.getDatasetAdmin(datasetInstanceId);
   if (admin1 == null) {
    throw new NotFoundException("Couldn't obtain DatasetAdmin for dataset instance " + datasetInstanceId);
   }
   // returns a DatasetAdmin that executes operations as a particular user, for a particular namespace
   return new ImpersonatingDatasetAdmin(admin1, impersonator, datasetInstanceId);
  });
  try {
   return operation.perform(admin);
  } finally {
   Closeables.closeQuietly(admin);
  }
 }
}
origin: co.cask.cdap/cdap-data-fabric

@Inject
public DatasetInstanceManager(TransactionSystemClientService txClientService,
               TransactionExecutorFactory txExecutorFactory,
               @Named("datasetMDS") DatasetFramework datasetFramework) {
 this.txExecutorFactory = txExecutorFactory;
 Map<String, String> emptyArgs = Collections.emptyMap();
 this.datasetCache = new MultiThreadDatasetCache(new SystemDatasetInstantiator(datasetFramework),
                         new TransactionSystemClientAdapter(txClientService),
                         NamespaceId.SYSTEM, emptyArgs, null,
                         ImmutableMap.of(
                          DatasetMetaTableUtil.INSTANCE_TABLE_NAME, emptyArgs
                         ));
}
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

 @Override
 public void close() throws IOException {
  datasetInstantiator.close();
  context.close();
 }
}
origin: cdapio/cdap

 @Override
 public DynamicDatasetCache get() {
  SystemDatasetInstantiator dsInstantiator = new SystemDatasetInstantiator(dsFramework);
  return new MultiThreadDatasetCache(
   dsInstantiator, txClient, NamespaceId.SYSTEM, ImmutableMap.of(),
   metricsCollectionService.getContext(ImmutableMap.of()),
   ImmutableMap.of()
  );
 }
}
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-app-fabric

 @Override
 public DynamicDatasetCache get() {
  SystemDatasetInstantiator dsInstantiator = new SystemDatasetInstantiator(dsFramework);
  return new MultiThreadDatasetCache(
   dsInstantiator, txClient, NamespaceId.SYSTEM, ImmutableMap.of(),
   metricsCollectionService.getContext(ImmutableMap.of()),
   ImmutableMap.of()
  );
 }
}
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

@Inject
public LocalRouteStore(DatasetFramework datasetFramework, TransactionSystemClient txClient) {
 this.datasetFramework = datasetFramework;
 this.transactional = Transactions.createTransactionalWithRetry(
  Transactions.createTransactional(new MultiThreadDatasetCache(
   new SystemDatasetInstantiator(datasetFramework), txClient,
   NamespaceId.SYSTEM, ImmutableMap.<String, String>of(), null, null)), RetryStrategies.retryOnConflict(20, 100));
}
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

@VisibleForTesting
public DefaultFieldLineageReader(DatasetFramework datasetFramework, TransactionSystemClient txClient,
                 DatasetId fieldLineageDatasetId) {
 this.datasetFramework = datasetFramework;
 this.fieldLineageDatasetId = fieldLineageDatasetId;
 this.transactional = Transactions.createTransactional(new MultiThreadDatasetCache(
  new SystemDatasetInstantiator(datasetFramework), new TransactionSystemClientAdapter(txClient),
  NamespaceId.SYSTEM, ImmutableMap.of(), null, null));
}
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-data-fabric

@Inject
public MDSViewStore(DatasetFramework datasetFramework, TransactionSystemClient txClient) {
 this.datasetFramework = datasetFramework;
 this.transactional = Transactions.createTransactionalWithRetry(
  Transactions.createTransactional(new MultiThreadDatasetCache(
   new SystemDatasetInstantiator(datasetFramework), txClient,
   NamespaceId.SYSTEM, ImmutableMap.<String, String>of(), null, null)),
  RetryStrategies.retryOnConflict(20, 100)
 );
}
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);
 }
}
co.cask.cdap.data.datasetSystemDatasetInstantiator

Javadoc

The data set instantiator creates instances of data sets at runtime. It is mostly a wrapper around DatasetFramework, except it is closeable so that any resources created by dataset classloaders can be properly cleaned up. For example, a DirectoryClassLoaderProvider will fetch dataset jars and unpack them in a local directory, which must be cleaned up after the dataset is no longer needed.

Most used methods

  • <init>
  • getDataset
  • close
  • getDatasetAdmin
  • writeLineage

Popular in Java

  • Updating database using SQL prepared statement
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • String (java.lang)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Notification (javax.management)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top 17 Plugins for Android Studio
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