/** * Adds an instance of dataset. * * @param datasetId the dataset id * @param datasetTypeName dataset type name * @param <T> type of the dataset admin * @return a DatasetAdmin to manage the dataset instance */ protected final <T extends DatasetAdmin> T addDatasetInstance(DatasetId datasetId, String datasetTypeName) throws Exception { return addDatasetInstance(datasetTypeName, datasetId, DatasetProperties.EMPTY); }
/** * Deploys an {@link Application}. * Programs defined in the application must be in the same or children package as the application. * * @param applicationClz the application class * @param bundleEmbeddedJars any extra jars to bundle in the application jar * @return An {@link ApplicationManager} to manage the deployed application. */ protected static ApplicationManager deployApplication(Class<? extends Application> applicationClz, File... bundleEmbeddedJars) { return deployApplication(NamespaceId.DEFAULT, applicationClz, bundleEmbeddedJars); }
/** * Returns a JDBC connection that allows the running of SQL queries over data sets. */ protected final Connection getQueryClient() throws Exception { return getQueryClient(NamespaceId.DEFAULT); }
cConf = createCConf(localDataDir); Assert.assertTrue(binDir.mkdirs()); copyTempFile("hadoop.dll", tmpDir); copyTempFile("winutils.exe", binDir); System.setProperty("hadoop.home.dir", tmpDir.getAbsolutePath()); System.load(new File(tmpDir, "hadoop.dll").getAbsolutePath()); createDataFabricModule(), new TransactionExecutorModule(), new DataSetsModules().getStandaloneModules(),
/** * Gets Dataset manager of Dataset instance of type {@literal <}T>. * * @param datasetInstanceName instance name of dataset * @return Dataset Manager of Dataset instance of type {@literal <}T> * @throws Exception */ protected final <T> DataSetManager<T> getDataset(String datasetInstanceName) throws Exception { return getDataset(NamespaceId.DEFAULT.dataset(datasetInstanceName)); }
/** * Returns a {@link MessagingAdmin} for the given namespace. */ protected static MessagingAdmin getMessagingAdmin(String namespace) { return getMessagingAdmin(new NamespaceId(namespace)); }
/** * Deploys {@link DatasetModule}. * * @param moduleName name of the module * @param datasetModule module class * @throws Exception */ protected static void deployDatasetModule(String moduleName, Class<? extends DatasetModule> datasetModule) throws Exception { deployDatasetModule(NamespaceId.DEFAULT.datasetModule(moduleName), datasetModule); }
@Override @After public void afterTest() throws Exception { try { super.afterTest(); } finally { reset(); } }
cConf = createCConf(localDataDir); Assert.assertTrue(binDir.mkdirs()); copyTempFile("hadoop.dll", tmpDir); copyTempFile("winutils.exe", binDir); System.setProperty("hadoop.home.dir", tmpDir.getAbsolutePath()); System.load(new File(tmpDir, "hadoop.dll").getAbsolutePath()); createDataFabricModule(), new TransactionExecutorModule(), new DataSetsModules().getStandaloneModules(),
/** * Gets Dataset manager of Dataset instance of type {@literal <}T>. * * @param datasetInstanceName instance name of dataset * @return Dataset Manager of Dataset instance of type {@literal <}T> * @throws Exception */ protected final <T> DataSetManager<T> getDataset(String datasetInstanceName) throws Exception { return getDataset(NamespaceId.DEFAULT.dataset(datasetInstanceName)); }
/** * Returns a {@link MessagingAdmin} for the given namespace. */ protected static MessagingAdmin getMessagingAdmin(String namespace) { return getMessagingAdmin(new NamespaceId(namespace)); }
/** * Deploys {@link DatasetModule}. * * @param moduleName name of the module * @param datasetModule module class * @throws Exception */ protected static void deployDatasetModule(String moduleName, Class<? extends DatasetModule> datasetModule) throws Exception { deployDatasetModule(NamespaceId.DEFAULT.datasetModule(moduleName), datasetModule); }
/** * Adds an instance of dataset. * * @param datasetId the dataset id * @param datasetTypeName dataset type name * @param <T> type of the dataset admin * @return a DatasetAdmin to manage the dataset instance */ protected final <T extends DatasetAdmin> T addDatasetInstance(DatasetId datasetId, String datasetTypeName) throws Exception { return addDatasetInstance(datasetTypeName, datasetId, DatasetProperties.EMPTY); }
/** * Deploys an {@link Application}. The {@link co.cask.cdap.api.flow.Flow Flows} and * other programs defined in the application must be in the same or children package as the application. * * @param applicationClz the application class * @param bundleEmbeddedJars any extra jars to bundle in the application jar * @return An {@link ApplicationManager} to manage the deployed application. */ protected static ApplicationManager deployApplication(Class<? extends Application> applicationClz, File... bundleEmbeddedJars) { return deployApplication(NamespaceId.DEFAULT, applicationClz, bundleEmbeddedJars); }
/** * Returns a JDBC connection that allows the running of SQL queries over data sets. */ protected final Connection getQueryClient() throws Exception { return getQueryClient(NamespaceId.DEFAULT); }
/** * Adds an instance of dataset. * * @param datasetTypeName dataset type name * @param datasetInstanceName instance name * @param <T> type of the dataset admin * @return a DatasetAdmin to manage the dataset instance */ protected final <T extends DatasetAdmin> T addDatasetInstance(String datasetTypeName, String datasetInstanceName) throws Exception { return addDatasetInstance(datasetTypeName, NamespaceId.DEFAULT.dataset(datasetInstanceName), DatasetProperties.EMPTY); }
/** * Deploys an {@link Application}. The {@link co.cask.cdap.api.flow.Flow Flows} and * other programs defined in the application must be in the same or children package as the application. * * @param applicationClz the application class * @param appConfig the application config * @param bundleEmbeddedJars any extra jars to bundle in the application jar * @return An {@link ApplicationManager} to manage the deployed application. */ protected static ApplicationManager deployApplication(Class<? extends Application> applicationClz, Config appConfig, File... bundleEmbeddedJars) { return deployApplication(NamespaceId.DEFAULT, applicationClz, appConfig, bundleEmbeddedJars); }
/** * Adds an instance of dataset. * * @param datasetTypeName dataset type name * @param datasetInstanceName instance name * @param <T> type of the dataset admin * @return a DatasetAdmin to manage the dataset instance */ protected final <T extends DatasetAdmin> T addDatasetInstance(String datasetTypeName, String datasetInstanceName) throws Exception { return addDatasetInstance(datasetTypeName, NamespaceId.DEFAULT.dataset(datasetInstanceName), DatasetProperties.EMPTY); }
/** * Deploys an {@link Application}. * Programs defined in the application must be in the same or children package as the application. * * @param applicationClz the application class * @param appConfig the application config * @param bundleEmbeddedJars any extra jars to bundle in the application jar * @return An {@link ApplicationManager} to manage the deployed application. */ protected static ApplicationManager deployApplication(Class<? extends Application> applicationClz, Config appConfig, File... bundleEmbeddedJars) { return deployApplication(NamespaceId.DEFAULT, applicationClz, appConfig, bundleEmbeddedJars); }
/** * Adds an instance of a dataset. * * @param datasetTypeName dataset type name * @param datasetInstanceName instance name * @param props properties * @param <T> type of the dataset admin * @return a DatasetAdmin to manage the dataset instance */ protected static <T extends DatasetAdmin> T addDatasetInstance(String datasetTypeName, String datasetInstanceName, DatasetProperties props) throws Exception { return addDatasetInstance(datasetTypeName, NamespaceId.DEFAULT.dataset(datasetInstanceName), props); }