Class AbstractCoreKeyAccumuloElementConverter

    • Method Detail

      • getElementId

        public ElementId getElementId​(org.apache.accumulo.core.data.Key key,
                                      boolean includeMatchedVertex)
        Description copied from interface: AccumuloElementConverter
        Gets a new ElementId from an Accumulo Key.
        Specified by:
        getElementId in interface AccumuloElementConverter
        Parameters:
        key - the Key containing serialised parts of the Element
        includeMatchedVertex - if true then the matchedVertex field is set on Edges
        Returns:
        A new ElementId
      • getKeysFromElement

        public Pair<org.apache.accumulo.core.data.Key,​org.apache.accumulo.core.data.Key> getKeysFromElement​(Element element)
        Description copied from interface: AccumuloElementConverter
        Converts an Element Pair of keys which represent the keys created from the given element. If the given element was an entity only one key will be created and the second item in the pair will be null.
        Specified by:
        getKeysFromElement in interface AccumuloElementConverter
        Parameters:
        element - the element to be converted
        Returns:
        The key(s) that represent the given element.
      • getKeysFromEdge

        public Pair<org.apache.accumulo.core.data.Key,​org.apache.accumulo.core.data.Key> getKeysFromEdge​(Edge edge)
        Description copied from interface: AccumuloElementConverter
        Converts an Edge to a pair of Keys.
        Specified by:
        getKeysFromEdge in interface AccumuloElementConverter
        Parameters:
        edge - The edge to be converted
        Returns:
        The key(s) that represent the given edge
      • getValueFromElement

        public org.apache.accumulo.core.data.Value getValueFromElement​(Element element)
        Description copied from interface: AccumuloElementConverter
        Converts the Properties in an element to an Accumulo Value where the property has a position within the store schema that indicates it should be stored in the value.
        Specified by:
        getValueFromElement in interface AccumuloElementConverter
        Parameters:
        element - the element to be converted
        Returns:
        An Accumulo Value representing the Properties that should be stored in the value.
      • getElementFromKey

        public Element getElementFromKey​(org.apache.accumulo.core.data.Key key,
                                         boolean includeMatchedVertex)
        Description copied from interface: AccumuloElementConverter
        Gets a new Element from an Accumulo Key.
        Specified by:
        getElementFromKey in interface AccumuloElementConverter
        Parameters:
        key - the Key containing serialised parts of the Element
        includeMatchedVertex - if true then the matchedVertex field is set on Edges
        Returns:
        A new Element including a partial set of Properties that were store in the Key
      • getFullElement

        public Element getFullElement​(org.apache.accumulo.core.data.Key key,
                                      org.apache.accumulo.core.data.Value value,
                                      boolean includeMatchedVertex)
        Description copied from interface: AccumuloElementConverter
        Returns an Element populated with all the properties defined within the Key and Value.
        Specified by:
        getFullElement in interface AccumuloElementConverter
        Parameters:
        key - the accumulo Key containing serialised parts of the Element
        value - the accumulo Value containing serialised properties of the Element
        includeMatchedVertex - if true then the matchedVertex field is set on Edges
        Returns:
        Returns an Element populated with all the properties defined within the Key and Value
      • getRowKeysFromElement

        public Pair<byte[],​byte[]> getRowKeysFromElement​(Element element)
        Description copied from interface: AccumuloElementConverter
        Creates a byte array representing the Element identifiers, this will be stored in the Accumulo row Key.
        Specified by:
        getRowKeysFromElement in interface AccumuloElementConverter
        Parameters:
        element - the element
        Returns:
        the byte array(s) representing the provided Element identifiers.
      • buildColumnVisibility

        public byte[] buildColumnVisibility​(String group,
                                            Properties properties)
        Description copied from interface: AccumuloElementConverter
        Creates a byte array representing a set of Properties that are to be stored in the column visibility.
        Specified by:
        buildColumnVisibility in interface AccumuloElementConverter
        Parameters:
        group - the element group
        properties - the element properties
        Returns:
        A byte array representing the provided Properties that are marked as to be stored in the provided position in the schema.
      • getPropertiesFromColumnVisibility

        public Properties getPropertiesFromColumnVisibility​(String group,
                                                            byte[] columnVisibility)
        Description copied from interface: AccumuloElementConverter
        Returns a set of Properties that are stored in the part of the key that is provided.
        Specified by:
        getPropertiesFromColumnVisibility in interface AccumuloElementConverter
        Parameters:
        group - the element group
        columnVisibility - the element visibility property serialised into bytes
        Returns:
        The Properties stored within the part of the Key specified e.g Column Qualifier
      • getPropertiesFromColumnQualifier

        public Properties getPropertiesFromColumnQualifier​(String group,
                                                           byte[] bytes)
        Description copied from interface: AccumuloElementConverter
        Returns a set of Properties that are stored in the part of the key that is provided.
        Specified by:
        getPropertiesFromColumnQualifier in interface AccumuloElementConverter
        Parameters:
        group - the element group
        bytes - the element column qualifier properties serialised into bytes
        Returns:
        The Properties stored within the part of the Key specified e.g Column Qualifier
      • getPropertiesAsBytesFromColumnQualifier

        public BytesAndRange getPropertiesAsBytesFromColumnQualifier​(String group,
                                                                     byte[] bytes,
                                                                     int numProps)
        Description copied from interface: AccumuloElementConverter
        Truncates the provided columnQualifier, returning the byte representation of the serialised version of the specified properties.
        Specified by:
        getPropertiesAsBytesFromColumnQualifier in interface AccumuloElementConverter
        Parameters:
        group - the element group
        bytes - the full list of property bytes
        numProps - the number of properties to extract
        Returns:
        details of the bytes range.
      • buildTimestamp

        public long buildTimestamp​(String group,
                                   Properties properties)
        Description copied from interface: AccumuloElementConverter
        Creates a timestamp based on the provided Properties will return a default value if properties do not have a valid timestamp value
        Specified by:
        buildTimestamp in interface AccumuloElementConverter
        Parameters:
        group - the element group
        properties - the element properties
        Returns:
        the timestamp
      • getPropertiesFromTimestamp

        public Properties getPropertiesFromTimestamp​(String group,
                                                     long timestamp)
        Get the properties for a given group defined in the Schema as being stored in the Accumulo timestamp column.
        Specified by:
        getPropertiesFromTimestamp in interface AccumuloElementConverter
        Parameters:
        group - The Element type to be queried
        timestamp - the element timestamp property
        Returns:
        The Properties stored within the Timestamp part of the Key
      • serialiseVertex

        public byte[] serialiseVertex​(Object vertex)
        Description copied from interface: AccumuloElementConverter
        Helper Used to create Bloom Filters, method Serialises a given object (from an EntityId ) with the Identifier Serialiser defined in the schema.
        Specified by:
        serialiseVertex in interface AccumuloElementConverter
        Parameters:
        vertex - the vertex identifier to serialise
        Returns:
        A byte array representing the given object