@Test void testFileBackupThatIsWritable() { File backupDir = new File(System.getProperties().getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); if (backupDir.mkdir()) { LOG.info("Created directory: {}", backupDir); } if (!backupDir.setWritable(false)) { throw new RuntimeException("Failed to revoke writable permission"); } backupDir.deleteOnExit(); bufferConfig.setFileBackupDir(backupDir.getAbsolutePath()); try (Buffer ignored = new Buffer(bufferConfig, recordFormatter)) { fail(); } catch (IllegalArgumentException e) { assertTrue(true); } }
@Override public String toString() { return "PackedForwardBuffer{" + "retentionBuffers=" + retentionBuffers + ", flushableBuffers=" + flushableBuffers + ", backupBuffers=" + backupBuffers + ", bufferPool=" + bufferPool + ", config=" + config + "} " + super.toString(); }
Buffer implements Closeable { @Override public String toString() { return "PackedForwardBuffer{" + "retentionBuffers=" + retentionBuffers + ", flushableBuffers=" + flushableBuffers + ", backupBuffers=" + backupBuffers + ", bufferPool=" + bufferPool + ", config=" + config + "} " + super.toString(); } }
Buffer implements Closeable { @Override public String toString() { return "PackedForwardBuffer{" + "retentionBuffers=" + retentionBuffers + ", flushableBuffers=" + flushableBuffers + ", backupBuffers=" + backupBuffers + ", bufferPool=" + bufferPool + ", config=" + config + "} " + super.toString(); } Buffer(RecordFormatter recordFormatter);  Buffer(final Config config, RecordFormatter recordFormatter); }
Buffer implements Closeable { @Override public String toString() { return "PackedForwardBuffer{" + "retentionBuffers=" + retentionBuffers + ", flushableBuffers=" + flushableBuffers + ", backupBuffers=" + backupBuffers + ", bufferPool=" + bufferPool + ", config=" + config + "} " + super.toString(); } Buffer(RecordFormatter recordFormatter);  Buffer(final Config config, RecordFormatter recordFormatter); void flush(Ingester ingester, boolean force); @Override void close(); float getBufferUsage(); void clearBackupFiles(); long getMaxBufferSize(); String getFileBackupPrefix(); String getFileBackupDir(); void append(String tag, long timestamp, Map<String, Object> data); void append(String tag, EventTime timestamp, Map<String, Object> data); void appendMessagePackMapValue(String tag, long timestamp, byte[] mapValue, int offset, int len); void appendMessagePackMapValue(String tag, EventTime timestamp, byte[] mapValue, int offset, int len); void appendMessagePackMapValue(String tag, long timestamp, ByteBuffer mapValue); void appendMessagePackMapValue(String tag, EventTime timestamp, ByteBuffer mapValue); long getAllocatedSize(); long getBufferedDataSize(); boolean getJvmHeapBufferMode(); String bufferFormatType(); int getChunkInitialSize(); float getChunkExpandRatio(); int getChunkRetentionSize(); int getChunkRetentionTimeMillis(); @Override String toString(); }
Buffer implements Closeable { @Override public String toString() { return "PackedForwardBuffer{" + "retentionBuffers=" + retentionBuffers + ", flushableBuffers=" + flushableBuffers + ", backupBuffers=" + backupBuffers + ", bufferPool=" + bufferPool + ", config=" + config + "} " + super.toString(); } Buffer(RecordFormatter recordFormatter);  Buffer(final Config config, RecordFormatter recordFormatter); void flush(Ingester ingester, boolean force); @Override void close(); float getBufferUsage(); void clearBackupFiles(); long getMaxBufferSize(); String getFileBackupPrefix(); String getFileBackupDir(); void append(String tag, long timestamp, Map<String, Object> data); void append(String tag, EventTime timestamp, Map<String, Object> data); void appendMessagePackMapValue(String tag, long timestamp, byte[] mapValue, int offset, int len); void appendMessagePackMapValue(String tag, EventTime timestamp, byte[] mapValue, int offset, int len); void appendMessagePackMapValue(String tag, long timestamp, ByteBuffer mapValue); void appendMessagePackMapValue(String tag, EventTime timestamp, ByteBuffer mapValue); long getAllocatedSize(); long getBufferedDataSize(); boolean getJvmHeapBufferMode(); String bufferFormatType(); int getChunkInitialSize(); float getChunkExpandRatio(); int getChunkRetentionSize(); int getChunkRetentionTimeMillis(); @Override String toString();  }