/** * Creates the metadata table key entry for a given edge table Key * * @return a key object for use in the Datawave Metadata table */ public static Key getMetadataKey(Key key) { EdgeKey eKey = EdgeKey.decode(key); return eKey.getMetadataKey(); }
/** * Decode the key leaving the row portion native to the accumulo key, leaving the source and sink as they are in the accumulo row. Iterators which create * new keys without the builders, can safely decode with this method and reseek to the same position, without knowledge of the underlying escaping encodings * * @param key * a key from the Datawave edge table * @return an immutable EdgeKey object */ public static EdgeKey decodeForInternal(Key key) { EdgeKeyBuilder builder = EdgeKey.newBuilder(); builder.unescape = false; builder.escape = false; return decode(key, builder); }
/** * Parses edge table keys into the various fields encoded within the key. The source and sink are unescaped, ready to send to external clients. * * @param key * a key from the Datawave edge table * @return an immutable EdgeKey object */ public static EdgeKey decode(Key key) { return decode(key, EdgeKey.newBuilder().unescape()); }
Key revMetaKey = EdgeKey.getMetadataKey(EdgeKey.swapSourceSink(EdgeKey.decode(baseKey)).encode());
@Override public EdgeBase transform(Entry<Key,Value> entry) { EdgeKey edgeKey = EdgeKey.decode(entry.getKey()); Value value = entry.getValue();