public class CarbonWriter
extends java.lang.Object
implements java.lang.AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
protected class |
CarbonWriter.Converter |
protected class |
CarbonWriter.Writer |
| Modifier and Type | Field and Description |
|---|---|
protected static int |
BUFFER_SIZE |
static java.nio.charset.Charset |
DEFAULT_CHARSET |
static org.echocat.jomon.runtime.util.Duration |
DEFAULT_MAX_BUFFER_LIFETIME |
protected static org.echocat.jomon.runtime.concurrent.RetryForSpecifiedCountStrategy<java.lang.Void> |
RETRYING_STRATEGY |
| Constructor and Description |
|---|
CarbonWriter() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected byte[] |
convert(MeasurePoint measurePoint) |
protected void |
convertAndPutIntoQueue(MeasurePoint measurePoint) |
boolean |
equals(java.lang.Object o) |
void |
flush() |
protected java.lang.String |
formatPath(MeasurePoint measurePoint) |
protected java.lang.Number |
formatValue(MeasurePoint measurePoint) |
java.net.InetSocketAddress |
getAddress() |
java.nio.charset.Charset |
getCharset() |
org.echocat.jomon.runtime.util.Duration |
getMaxBufferLifetime() |
protected java.util.List<java.nio.ByteBuffer> |
getNextForWrite(boolean force) |
protected java.net.Socket |
getSocket() |
int |
hashCode() |
void |
init() |
void |
setAddress(java.net.InetSocketAddress address) |
void |
setCharset(java.nio.charset.Charset charset) |
void |
setMaxBufferLifetime(org.echocat.jomon.runtime.util.Duration maxBufferLifetime) |
java.lang.String |
toString() |
protected long |
toUnixTimestamp(MeasurePoint measurePoint) |
void |
write(java.lang.Iterable<MeasurePoint> measurePoints) |
void |
write(MeasurePoint... measurePoints) |
void |
write(MeasurePoint measurePoint) |
MeasurePoint |
write(java.lang.String path,
java.util.Date timestamp,
java.lang.Number value) |
MeasurePoint |
write(java.lang.String path,
java.lang.Number value) |
protected void |
writeMessage(java.nio.ByteBuffer buffer) |
protected void |
writeMessages(java.lang.Iterable<java.nio.ByteBuffer> buffers) |
public static final java.nio.charset.Charset DEFAULT_CHARSET
public static final org.echocat.jomon.runtime.util.Duration DEFAULT_MAX_BUFFER_LIFETIME
protected static final int BUFFER_SIZE
protected static final org.echocat.jomon.runtime.concurrent.RetryForSpecifiedCountStrategy<java.lang.Void> RETRYING_STRATEGY
public java.net.InetSocketAddress getAddress()
public void setAddress(java.net.InetSocketAddress address)
@Nonnull public org.echocat.jomon.runtime.util.Duration getMaxBufferLifetime()
public void setMaxBufferLifetime(@Nonnull
org.echocat.jomon.runtime.util.Duration maxBufferLifetime)
@Nonnull public java.nio.charset.Charset getCharset()
public void setCharset(@Nonnull
java.nio.charset.Charset charset)
public void write(@Nonnull
MeasurePoint... measurePoints)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void write(@Nonnull
java.lang.Iterable<MeasurePoint> measurePoints)
throws java.lang.InterruptedException
java.lang.InterruptedException@Nonnull public MeasurePoint write(@Nonnull java.lang.String path, @Nonnull java.lang.Number value) throws java.lang.InterruptedException
java.lang.InterruptedException@Nonnull public MeasurePoint write(@Nonnull java.lang.String path, @Nonnull java.util.Date timestamp, @Nonnull java.lang.Number value) throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void write(@Nonnull
MeasurePoint measurePoint)
throws java.lang.InterruptedException
java.lang.InterruptedException@PostConstruct
public void init()
throws java.lang.Exception
java.lang.Exception@PreDestroy
public void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exceptionprotected void convertAndPutIntoQueue(@Nonnull
MeasurePoint measurePoint)
@Nonnull
protected byte[] convert(@Nonnull
MeasurePoint measurePoint)
@Nonnull
protected java.lang.String formatPath(@Nonnull
MeasurePoint measurePoint)
@Nonnull
protected java.lang.Number formatValue(@Nonnull
MeasurePoint measurePoint)
@Nonnegative
protected long toUnixTimestamp(@Nonnull
MeasurePoint measurePoint)
@Nonnull
protected java.util.List<java.nio.ByteBuffer> getNextForWrite(boolean force)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void flush()
throws java.io.IOException
java.io.IOExceptionprotected void writeMessages(@Nonnull
java.lang.Iterable<java.nio.ByteBuffer> buffers)
throws java.lang.InterruptedException,
java.io.IOException
java.lang.InterruptedExceptionjava.io.IOExceptionprotected void writeMessage(@Nonnull
java.nio.ByteBuffer buffer)
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOExceptionjava.lang.InterruptedException@Nullable
protected java.net.Socket getSocket()
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOExceptionjava.lang.InterruptedExceptionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2016 echocat. All Rights Reserved.