@SuppressWarnings("deprecation") @Override protected void initOutput(FileSystem fs, Path path, boolean overwritable, int bufferSize, short replication, long blockSize) throws IOException, StreamLacksCapabilityException { this.output = CommonFSUtils.createForWal(fs, path, overwritable, bufferSize, replication, blockSize, false); if (fs.getConf().getBoolean(CommonFSUtils.UNSAFE_STREAM_CAPABILITY_ENFORCE, true)) { if (!CommonFSUtils.hasCapability(output, "hflush")) { throw new StreamLacksCapabilityException("hflush"); } if (!CommonFSUtils.hasCapability(output, "hsync")) { throw new StreamLacksCapabilityException("hsync"); } } }
newLogFile = getLogFilePath(logId); try { newStream = CommonFSUtils.createForWal(fs, newLogFile, false); } catch (FileAlreadyExistsException e) { LOG.error("Log file with id={} already exists", logId, e);
@Test public void testStreamCreate() throws IOException { try (FSDataOutputStream out = CommonFSUtils.createForWal(util.getDFSCluster().getFileSystem(), new Path("/testStreamCreate"), true)) { assertTrue(CommonFSUtils.hasCapability(out, HFLUSH)); } }
newLogFile = getLogFilePath(logId); try { newStream = CommonFSUtils.createForWal(fs, newLogFile, false); } catch (FileAlreadyExistsException e) { LOG.error("Log file with id={} already exists", logId, e);
@Test public void testStreamCreate() throws IOException { try (FSDataOutputStream out = CommonFSUtils.createForWal(util.getDFSCluster().getFileSystem(), new Path("/testStreamCreate"), true)) { assertTrue(CommonFSUtils.hasCapability(out, HFLUSH)); } }