use of org.apache.drill.exec.store.StoragePluginRegistry in project drill by apache.
the class BaseTestImpersonation method addMiniDfsBasedStorage.
protected static void addMiniDfsBasedStorage(final Map<String, WorkspaceConfig> workspaces) throws Exception {
// Create a HDFS based storage plugin based on local storage plugin and add it to plugin registry (connection string
// for mini dfs is varies for each run).
final StoragePluginRegistry pluginRegistry = getDrillbitContext().getStorage();
final FileSystemConfig lfsPluginConfig = (FileSystemConfig) pluginRegistry.getPlugin("dfs_test").getConfig();
final FileSystemConfig miniDfsPluginConfig = new FileSystemConfig();
miniDfsPluginConfig.connection = dfsConf.get(FileSystem.FS_DEFAULT_NAME_KEY);
createAndAddWorkspace("tmp", "/tmp", (short) 0777, processUser, processUser, workspaces);
miniDfsPluginConfig.workspaces = workspaces;
miniDfsPluginConfig.formats = ImmutableMap.copyOf(lfsPluginConfig.formats);
miniDfsPluginConfig.setEnabled(true);
pluginRegistry.createOrUpdate(MINIDFS_STORAGE_PLUGIN_NAME, miniDfsPluginConfig, true);
}
use of org.apache.drill.exec.store.StoragePluginRegistry in project drill by apache.
the class TemporaryTablesAutomaticDropTest method testAutomaticDropOfSeveralSessionTemporaryLocations.
@Test
public void testAutomaticDropOfSeveralSessionTemporaryLocations() throws Exception {
File firstSessionTemporaryLocation = createAndCheckSessionTemporaryLocation("first_location", getDfsTestTmpSchemaLocation());
StoragePluginRegistry pluginRegistry = getDrillbitContext().getStorage();
String tempDir = TestUtilities.createTempDir();
try {
TestUtilities.updateDfsTestTmpSchemaLocation(pluginRegistry, tempDir);
File secondSessionTemporaryLocation = createAndCheckSessionTemporaryLocation("second_location", tempDir);
updateClient("new_client");
assertFalse("First session temporary location should be absent", firstSessionTemporaryLocation.exists());
assertFalse("Second session temporary location should be absent", secondSessionTemporaryLocation.exists());
} finally {
TestUtilities.updateDfsTestTmpSchemaLocation(pluginRegistry, getDfsTestTmpSchemaLocation());
}
}
Aggregations