FSDataOutputStreamWrapper newFSDataOutputStreamWrapper(FSDataOutputStream os) throws IOException { try { return (operatorStats != null) ? new FSDataOutputStreamWithStatsWrapper(os, operatorStats) : new FSDataOutputStreamWrapper(os); } catch(FSError e) { throw propagateFSError(e); } }
@Override public FileSystem getFileSystem(Configuration conf) throws IOException { // Do not return the original filesystem as-is because: // - the path might have been canonicalized and might point to a different URI (viewFS) // - this method might be called from a different security context (and the filesystem // should reflect this) // Instead recreate a new wrapper (but keep the stats context) return FileSystemWrapper.get(this.toUri(), conf, fs.getOperatorStats()); } }
@Override public Path canonicalizePath(Path p) throws IOException { try { Path cp = canonicalizePath(underlyingFs, p); return new PathWrapperWithFileSystem(cp, this); } catch(FSError e) { throw propagateFSError(e); } }
public FileSystemPlugin(final C config, final SabotContext context, final String name, FileSystemWrapper fs, Provider<StoragePluginId> idProvider) { this.name = name; this.config = config; this.idProvider = idProvider; this.fs = fs; this.context = context; this.fsConf = getNewFsConf(); this.lpPersistance = context.getLpPersistence(); this.basePath = config.getPath(); }
@Override public void initialize(URI name, Configuration conf) throws IOException { initialize(name, conf, newLocalFileSystem(conf, config.isLocalAccessAllowed())); }
@Override public void setup(List<String> columnNames) throws IOException { this.columnNames = columnNames; this.fs = FileSystemWrapper.get(conf, stats); }
public FormatPlugin getFormatPlugin(FormatPluginConfig config) { FormatPlugin plugin = formatCreator.getFormatPluginByConfig(config); if (plugin == null) { plugin = formatCreator.newFormatPlugin(config); } return plugin; }
@Before public void setUp() throws IOException { this.ticker = new TestTicker(); pdfsProtocol = new PDFSProtocol(LOCAL_ENDPOINT, DremioTest.DEFAULT_SABOT_CONFIG, this.allocator, fileSystem, true, ticker); }
@Override public void close() throws IOException { fileClosed(is); super.close(); } };
@Override public void setWorkingDirectory(Path newDir) { Path absolutePath = toAbsolutePath(newDir); checkPath(absolutePath); this.workingDirectory = absolutePath; }
@Override public void setWorkingDirectory(Path newDir) { Path absolutePath = toAbsolutePath(newDir); checkPath(absolutePath); this.workingDirectory = absolutePath; }
static FileSystem newLocalFileSystem(Configuration conf, boolean isLocalAccessAllowed) throws IOException { // we'll grab our own local file system so append is supported (rather than the checksum local file system). final FileSystem localFS = isLocalAccessAllowed ? new PDFSLocalFileSystem() : new NoopFileSystem(); localFS.initialize(localFS.getUri(), conf); return localFS; }
@Override public FileSystem run() throws Exception { return dfsc.get(uri, conf, uniqueConnProps); } });
public ListStatusCommand(String path, ListStatusContinuationHandle handle, int limit) { super(DFS.ListStatusResponse.class, DFS.RpcType.LIST_STATUS_REQUEST, newRequest(path, handle, limit)); }
public MkdirsCommand(String path, Integer permission) { super(DFS.MkdirsResponse.class, DFS.RpcType.MKDIRS_REQUEST, newRequest(path, permission)); }
@Override public long getPos() throws IOException { checkClosed(); return pos; }
@Override public FileSystem call() throws Exception { return newRemoteFileSystem(endpoint); } });
/** * Get the response produced by the handler for a given filesystem response. * * @return * @throws IOException * @throws UserException */ private DFS.ListStatusResponse getResponse(final String path, final Object o) throws IOException, UserException { return getResponse(path, o, null, null); }
@Override public NodeEndpoint apply(ServiceHolder input) { return input.getEndpoint(); } }).toList();