public class GTSDecoder
extends java.lang.Object
| Constructor and Description |
|---|
GTSDecoder(long baseTimestamp,
byte[] key,
java.nio.ByteBuffer bb) |
GTSDecoder(long baseTimestamp,
java.nio.ByteBuffer bb) |
| Modifier and Type | Method and Description |
|---|---|
GeoTimeSerie |
decode() |
GeoTimeSerie |
decode(GeoTimeSerie.TYPE type) |
GeoTimeSerie |
decode(GeoTimeSerie.TYPE type,
boolean strict)
Decode any remaining values into a GTS instance.
|
GTSDecoder |
dedup()
Returns a new instance of GTSDecoder with duplicates removed
WARNING: the duplicates removal is done in the order in which the values are found in the decoder.
|
void |
dump(java.io.PrintWriter pw) |
GTSDecoder |
duplicate()
Duplicate the current GTSDecoder.
|
static GTSDecoder |
fromBlock(byte[] block,
byte[] key) |
long |
getBaseTimestamp() |
java.lang.Object |
getBinaryValue() |
java.nio.ByteBuffer |
getBuffer() |
long |
getClassId() |
GTSEncoder |
getCompatibleEncoder(long basets) |
long |
getCount() |
long |
getElevation() |
GTSEncoder |
getEncoder() |
GTSEncoder |
getEncoder(boolean safeMetadata)
Return an encoder with all data from the last value retrieved (post call to next())
onwards
|
java.util.Map<java.lang.String,java.lang.String> |
getLabels() |
long |
getLabelsId() |
long |
getLocation() |
Metadata |
getMetadata() |
java.lang.String |
getName() |
int |
getRemainingSize() |
long |
getTimestamp() |
java.lang.Object |
getValue() |
boolean |
isBinary() |
boolean |
next()
Attempt to read the next measurement and associated metadata (timestamp, location, elevation)
|
void |
setClassId(long classId) |
void |
setLabel(java.lang.String key,
java.lang.String value) |
void |
setLabels(java.util.Map<java.lang.String,java.lang.String> labels) |
void |
setLabelsId(long labelsId) |
void |
setMetadata(Metadata metadata) |
void |
setName(java.lang.String name) |
public GTSDecoder(long baseTimestamp,
java.nio.ByteBuffer bb)
baseTimestamp - Base timestamp for computing deltas.bb - ByteBuffer containing the encoded GTS. Only remaining data will be read.
Encrypted data will silently be skipped.public GTSDecoder(long baseTimestamp,
byte[] key,
java.nio.ByteBuffer bb)
baseTimestamp - Base timestamp for computing deltas.key - AES Wrapping key to use for unwrapping encrypted databb - ByteBuffer containing the encoded GTS. Only remaining data will be read.
Encrypted data that cannot be decrypted will be silently ignored.
If the buffer contains encrypted data which could be decrypted,
reallocation will take place therefore 'bb' and the internal buffer
used by this instance of GTSDecoder will
differ after the first encrypted chunk is encountered.public boolean next()
public long getTimestamp()
public long getLocation()
public long getElevation()
public java.lang.Object getValue()
public boolean isBinary()
public java.lang.Object getBinaryValue()
public GeoTimeSerie decode(GeoTimeSerie.TYPE type, boolean strict)
type - TYPE to force for the resulting GTSstrict - Set to true to force values to be of uniform types, will throw RuntimeException if notpublic GeoTimeSerie decode(GeoTimeSerie.TYPE type)
public GeoTimeSerie decode()
public GTSEncoder getCompatibleEncoder(long basets)
public long getBaseTimestamp()
public long getClassId()
public void setClassId(long classId)
public long getLabelsId()
public void setLabelsId(long labelsId)
public java.lang.String getName()
public void setName(java.lang.String name)
public java.util.Map<java.lang.String,java.lang.String> getLabels()
public void setLabels(java.util.Map<java.lang.String,java.lang.String> labels)
public void setLabel(java.lang.String key,
java.lang.String value)
public void setMetadata(Metadata metadata)
public Metadata getMetadata()
public GTSEncoder getEncoder(boolean safeMetadata) throws java.io.IOException
safeMetadata - Is it safe to reuse the Metadata?java.io.IOExceptionpublic GTSEncoder getEncoder() throws java.io.IOException
java.io.IOExceptionpublic int getRemainingSize()
public long getCount()
public GTSDecoder dedup() throws java.io.IOException
java.io.IOExceptionpublic java.nio.ByteBuffer getBuffer()
public GTSDecoder duplicate()
public void dump(java.io.PrintWriter pw)
public static GTSDecoder fromBlock(byte[] block, byte[] key) throws java.io.IOException
java.io.IOException