Package org.komamitsu.fluency.buffer
Class Buffer
- java.lang.Object
-
- org.komamitsu.fluency.buffer.Buffer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class Buffer extends java.lang.Object implements java.io.Closeable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBuffer.Config
-
Constructor Summary
Constructors Constructor Description Buffer(Buffer.Config config, RecordFormatter recordFormatter)Buffer(RecordFormatter recordFormatter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(java.lang.String tag, long timestamp, java.util.Map<java.lang.String,java.lang.Object> data)voidappend(java.lang.String tag, EventTime timestamp, java.util.Map<java.lang.String,java.lang.Object> data)voidappendMessagePackMapValue(java.lang.String tag, long timestamp, byte[] mapValue, int offset, int len)voidappendMessagePackMapValue(java.lang.String tag, long timestamp, java.nio.ByteBuffer mapValue)voidappendMessagePackMapValue(java.lang.String tag, EventTime timestamp, byte[] mapValue, int offset, int len)voidappendMessagePackMapValue(java.lang.String tag, EventTime timestamp, java.nio.ByteBuffer mapValue)java.lang.StringbufferFormatType()voidclearBackupFiles()voidclose()protected voidcloseInternal()voidflush(Ingester ingester, boolean force)protected voidflushInternal(Ingester ingester, boolean force)longgetAllocatedSize()longgetBufferedDataSize()floatgetBufferUsage()floatgetChunkExpandRatio()intgetChunkInitialSize()intgetChunkRetentionSize()intgetChunkRetentionTimeMillis()java.lang.StringgetFileBackupDir()java.lang.StringgetFileBackupPrefix()booleangetJvmHeapBufferMode()longgetMaxBufferSize()protected voidloadBufferFromFile(java.util.List<java.lang.String> params, java.nio.channels.FileChannel channel)protected voidsaveAllBuffersToFile()protected voidsaveBuffer(java.util.List<java.lang.String> params, java.nio.ByteBuffer buffer)java.lang.StringtoString()
-
-
-
Constructor Detail
-
Buffer
public Buffer(RecordFormatter recordFormatter)
-
Buffer
public Buffer(Buffer.Config config, RecordFormatter recordFormatter)
-
-
Method Detail
-
saveBuffer
protected void saveBuffer(java.util.List<java.lang.String> params, java.nio.ByteBuffer buffer)
-
flush
public void flush(Ingester ingester, boolean force) throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
getBufferUsage
public float getBufferUsage()
-
clearBackupFiles
public void clearBackupFiles()
-
getMaxBufferSize
public long getMaxBufferSize()
-
getFileBackupPrefix
public java.lang.String getFileBackupPrefix()
-
getFileBackupDir
public java.lang.String getFileBackupDir()
-
loadBufferFromFile
protected void loadBufferFromFile(java.util.List<java.lang.String> params, java.nio.channels.FileChannel channel)
-
saveAllBuffersToFile
protected void saveAllBuffersToFile() throws java.io.IOException- Throws:
java.io.IOException
-
append
public void append(java.lang.String tag, long timestamp, java.util.Map<java.lang.String,java.lang.Object> data) throws java.io.IOException- Throws:
java.io.IOException
-
append
public void append(java.lang.String tag, EventTime timestamp, java.util.Map<java.lang.String,java.lang.Object> data) throws java.io.IOException- Throws:
java.io.IOException
-
appendMessagePackMapValue
public void appendMessagePackMapValue(java.lang.String tag, long timestamp, byte[] mapValue, int offset, int len) throws java.io.IOException- Throws:
java.io.IOException
-
appendMessagePackMapValue
public void appendMessagePackMapValue(java.lang.String tag, EventTime timestamp, byte[] mapValue, int offset, int len) throws java.io.IOException- Throws:
java.io.IOException
-
appendMessagePackMapValue
public void appendMessagePackMapValue(java.lang.String tag, long timestamp, java.nio.ByteBuffer mapValue) throws java.io.IOException- Throws:
java.io.IOException
-
appendMessagePackMapValue
public void appendMessagePackMapValue(java.lang.String tag, EventTime timestamp, java.nio.ByteBuffer mapValue) throws java.io.IOException- Throws:
java.io.IOException
-
flushInternal
protected void flushInternal(Ingester ingester, boolean force) throws java.io.IOException
- Throws:
java.io.IOException
-
closeInternal
protected void closeInternal()
-
getAllocatedSize
public long getAllocatedSize()
-
getBufferedDataSize
public long getBufferedDataSize()
-
getJvmHeapBufferMode
public boolean getJvmHeapBufferMode()
-
bufferFormatType
public java.lang.String bufferFormatType()
-
getChunkInitialSize
public int getChunkInitialSize()
-
getChunkExpandRatio
public float getChunkExpandRatio()
-
getChunkRetentionSize
public int getChunkRetentionSize()
-
getChunkRetentionTimeMillis
public int getChunkRetentionTimeMillis()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-