initialize(new Configuration());
FileSystem.initialize(flinkConfig); } catch (IOException e) { throw new IOException("Error while configuring the filesystems.", e);
public static void main(String[] args) throws Exception { ParameterTool pt = ParameterTool.fromArgs(args); String configDir = pt.getRequired("configDir"); LOG.info("Loading configuration from {}", configDir); final Configuration flinkConfig = GlobalConfiguration.loadConfiguration(configDir); try { FileSystem.initialize(flinkConfig); } catch (IOException e) { throw new Exception("Error while setting the default filesystem scheme from configuration.", e); } // run the history server SecurityUtils.install(new SecurityConfiguration(flinkConfig)); try { SecurityUtils.getInstalledContext().runSecured(new Callable<Integer>() { @Override public Integer call() throws Exception { HistoryServer hs = new HistoryServer(flinkConfig); hs.run(); return 0; } }); System.exit(0); } catch (Throwable t) { final Throwable strippedThrowable = ExceptionUtils.stripException(t, UndeclaredThrowableException.class); LOG.error("Failed to run HistoryServer.", strippedThrowable); strippedThrowable.printStackTrace(); System.exit(1); } }
public CliFrontend( Configuration configuration, List<CustomCommandLine<?>> customCommandLines) throws Exception { this.configuration = Preconditions.checkNotNull(configuration); this.customCommandLines = Preconditions.checkNotNull(customCommandLines); try { FileSystem.initialize(this.configuration); } catch (IOException e) { throw new Exception("Error while setting the default " + "filesystem scheme from configuration.", e); } this.customCommandLineOptions = new Options(); for (CustomCommandLine<?> customCommandLine : customCommandLines) { customCommandLine.addGeneralOptions(customCommandLineOptions); customCommandLine.addRunOptions(customCommandLineOptions); } this.clientTimeout = AkkaUtils.getClientTimeout(this.configuration); this.defaultParallelism = configuration.getInteger(CoreOptions.DEFAULT_PARALLELISM); }
FileSystem.initialize(configuration);
@AfterClass public static void resetFileSystemConfiguration() throws IOException { FileSystem.initialize(new Configuration()); }
FileSystem.initialize(configuration); } catch (IOException e) { throw new IOException("Error while configuring the filesystems.", e);
@After public void clearFsSettings() throws IOException { FileSystem.initialize(new Configuration()); }
org.apache.flink.core.fs.FileSystem.initialize(configuration); } catch (IOException e) { throw new IOException("Error while setting the default " +
FileSystem.initialize(this.flinkConfig); } catch (IOException e) { throw new SqlClientException(
@Test public void testExplicitlySetToLocal() throws Exception { final Configuration conf = new Configuration(); conf.setString(CoreOptions.DEFAULT_FILESYSTEM_SCHEME, LocalFileSystem.getLocalFsURI().toString()); FileSystem.initialize(conf); URI justPath = new URI(tempFolder.newFile().toURI().getPath()); assertNull(justPath.getScheme()); FileSystem fs = FileSystem.get(justPath); assertEquals("file", fs.getUri().getScheme()); }
conf.setString(ConfigConstants.HDFS_SITE_CONFIG, hadoopConfig.getAbsolutePath()); FileSystem.initialize(conf);
@Test public void testExplicitlySetToOther() throws Exception { final Configuration conf = new Configuration(); conf.setString(CoreOptions.DEFAULT_FILESYSTEM_SCHEME, "otherFS://localhost:1234/"); FileSystem.initialize(conf); URI justPath = new URI(tempFolder.newFile().toURI().getPath()); assertNull(justPath.getScheme()); try { FileSystem.get(justPath); fail("should have failed with an exception"); } catch (UnsupportedFileSystemSchemeException e) { assertTrue(e.getMessage().contains("otherFS")); } }
@Test public void testExplicitlyPathTakesPrecedence() throws Exception { final Configuration conf = new Configuration(); conf.setString(CoreOptions.DEFAULT_FILESYSTEM_SCHEME, "otherFS://localhost:1234/"); FileSystem.initialize(conf); URI pathAndScheme = tempFolder.newFile().toURI(); assertNotNull(pathAndScheme.getScheme()); FileSystem fs = FileSystem.get(pathAndScheme); assertEquals("file", fs.getUri().getScheme()); } }
@AfterClass public static void teardown() throws IOException, InterruptedException { try { if (fs != null) { // clean up fs.delete(basePath, true); // now directory must be gone checkPathExistence(basePath, false, deadline); } } finally { FileSystem.initialize(new Configuration()); } } }
FileSystem.initialize(config); FileSystem.initialize(new Configuration());
FileSystem.initialize(config); FileSystem.initialize(new Configuration());
private void configureFileSystems(Configuration configuration) throws Exception { LOG.info("Install default filesystem."); try { FileSystem.initialize(configuration); } catch (IOException e) { throw new IOException("Error while setting the default " + "filesystem scheme from configuration.", e); } }
protected void configureFileSystems(Configuration configuration) throws Exception { LOG.info("Install default filesystem."); try { FileSystem.initialize(configuration); } catch (IOException e) { throw new IOException("Error while setting the default " + "filesystem scheme from configuration.", e); } }
private void configureFileSystems(Configuration configuration) throws Exception { LOG.info("Install default filesystem."); try { FileSystem.initialize(configuration); } catch (IOException e) { throw new IOException("Error while setting the default " + "filesystem scheme from configuration.", e); } }