use of org.apache.drill.exec.store.dfs.WorkspaceConfig in project drill by apache.
the class TestUtilities method makeDfsTmpSchemaImmutable.
/**
* Make the dfs.tmp schema immutable, so that tests writers don't use the dfs.tmp to create views.
* Schema "dfs.tmp" added as part of the default bootstrap plugins file that comes with drill-java-exec jar
*/
public static void makeDfsTmpSchemaImmutable(final StoragePluginRegistry pluginRegistry) throws ExecutionSetupException {
@SuppressWarnings("resource") final FileSystemPlugin dfsPlugin = (FileSystemPlugin) pluginRegistry.getPlugin(dfsPluginName);
final FileSystemConfig dfsPluginConfig = (FileSystemConfig) dfsPlugin.getConfig();
final WorkspaceConfig tmpWSConfig = dfsPluginConfig.workspaces.get(dfsTmpSchema);
final WorkspaceConfig newTmpWSConfig = new WorkspaceConfig(tmpWSConfig.getLocation(), false, tmpWSConfig.getDefaultInputFormat());
dfsPluginConfig.workspaces.remove(dfsTmpSchema);
dfsPluginConfig.workspaces.put(dfsTmpSchema, newTmpWSConfig);
pluginRegistry.createOrUpdate(dfsPluginName, dfsPluginConfig, true);
}
use of org.apache.drill.exec.store.dfs.WorkspaceConfig in project drill by apache.
the class TestCTTAS method init.
@BeforeClass
public static void init() throws Exception {
MockUp<UUID> uuidMockUp = mockRandomUUID(session_id);
Properties testConfigurations = cloneDefaultTestConfigProperties();
testConfigurations.put(ExecConstants.DEFAULT_TEMPORARY_WORKSPACE, TEMP_SCHEMA);
updateTestCluster(1, DrillConfig.create(testConfigurations));
uuidMockUp.tearDown();
StoragePluginRegistry pluginRegistry = getDrillbitContext().getStorage();
FileSystemConfig pluginConfig = (FileSystemConfig) pluginRegistry.getPlugin(test_schema).getConfig();
pluginConfig.workspaces.put(temp2_wk, new WorkspaceConfig(TestUtilities.createTempDir(), true, null));
pluginRegistry.createOrUpdate(test_schema, pluginConfig, true);
fs = FileSystem.get(new Configuration());
expectedFolderPermission = new FsPermission(StorageStrategy.TEMPORARY.getFolderPermission());
expectedFilePermission = new FsPermission(StorageStrategy.TEMPORARY.getFilePermission());
}
Aggregations