ElementSerialisation { public byte[] getValue(final Element element) throws SerialisationException { return getValue(element.getGroup(), element.getProperties()); } ElementSerialisation(final Schema schema); byte[] getValue(final Element element); byte[] getValue(final String group, final Properties properties); Properties getPropertiesFromValue(final String group, final byte[] value); Element getPartialElement(final String group, final byte[] rowId, final boolean includeMatchedVertex); Element getElement(final Cell cell, final boolean includeMatchedVertex); Properties getProperties(final String group, final Cell cell); byte[] getColumnVisibility(final Element element); byte[] getColumnVisibility(final String group, final Properties properties); byte[] getColumnQualifier(final Element element); byte[] getColumnQualifier(final String group, final Properties properties); Properties getPropertiesFromColumnQualifier(final String group, final byte[] bytes); byte[] getPropertiesAsBytesFromColumnQualifier(final String group, final byte[] bytes, final int numProps); long getTimestamp(final Element element); long getTimestamp(final Properties properties); Properties getPropertiesFromTimestamp(final String group, final long timestamp); byte[] serialiseVertex(final Object vertex); boolean isEntity(final Cell cell); String getGroup(final Cell cell); String getGroup(final byte[] columnQualifier); @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "If an element is not an Entity it must be an Edge") Pair<byte[], byte[]> getRowKeys(final Element element); byte[] getRowKey(final Entity entity); Pair<byte[], byte[]> getRowKeys(final Edge edge); Pair<Cell, Cell> getCells(final Element element, final CellCreator kvCreator); Pair<Cell, Cell> getCells(final Element element, final Pair<byte[], byte[]> row, final byte[] cq, final CellCreator kvCreator); Pair<Put, Put> getPuts(final Element element); Pair<Put, Put> getPuts(final Element element, final Pair<byte[], byte[]> row, final byte[] cq); EdgeDirection getSourceAndDestination(final byte[] rowKey, final byte[][] sourceDestValues);  }
@Test public void shouldSerialiseWithHistoricValues() throws Exception { Properties properties = new Properties(); properties.put(HBasePropertyNames.PROP_1, 60); properties.put(HBasePropertyNames.PROP_2, Integer.MAX_VALUE); properties.put(HBasePropertyNames.PROP_3, 299); properties.put(HBasePropertyNames.PROP_4, Integer.MIN_VALUE); properties.put(HBasePropertyNames.COUNT, 8); final byte[] value = serialisation.getValue(TestGroups.EDGE, properties); assertArrayEquals(new byte[]{1, 60, 5, -116, 127, -1, -1, -1, 3, -114, 1, 43, 5, -124, 127, -1, -1, -1, 1, 8, 0}, value); }