Class AccumuloStore

  • Direct Known Subclasses:
    SingleUseAccumuloStore

    public class AccumuloStore
    extends Store

    An Accumulo Implementation of the Gaffer Framework

    The key detail of the Accumulo implementation is that any Edge inserted by a user is inserted into the accumulo table twice, once with the source object being put first in the key and once with the destination being put first in the key. This is to enable an edge to be found in a Range scan when providing only one end of the edge.

    • Field Detail

      • FAILED_TO_CREATE_AN_ACCUMULO_FROM_ELEMENT_OF_TYPE_WHEN_TRYING_TO_INSERT_ELEMENTS

        public static final String FAILED_TO_CREATE_AN_ACCUMULO_FROM_ELEMENT_OF_TYPE_WHEN_TRYING_TO_INSERT_ELEMENTS
        See Also:
        Constant Field Values
    • Constructor Detail

      • AccumuloStore

        public AccumuloStore()
    • Method Detail

      • getCreatedTime

        public String getCreatedTime()
        Retrieves Accumulo Table created time property.
        Overrides:
        getCreatedTime in class Store
        Returns:
        Accumulo Table created time string.
      • preInitialise

        public void preInitialise​(String graphId,
                                  Schema schema,
                                  StoreProperties properties)
                           throws StoreException
        Performs general initialisation without creating the table.
        Parameters:
        graphId - The graph ID.
        schema - The Gaffer Schema.
        properties - The Accumulo store properties.
        Throws:
        StoreException - If the store could not be initialised.
      • getConnection

        public org.apache.accumulo.core.client.Connector getConnection()
                                                                throws StoreException
        Creates an Accumulo Connector using the properties found in properties file associated with the AccumuloStore.
        Returns:
        A new Connector.
        Throws:
        StoreException - If there is a failure to connect to accumulo.
      • getTableName

        public String getTableName()
        Gets the name of the Accumulo table backing this store
        Returns:
        Accumulo Table Name
      • updateConfiguration

        public void updateConfiguration​(org.apache.hadoop.conf.Configuration conf,
                                        GraphFilters graphFilters,
                                        User user)
                                 throws StoreException
        Updates a Hadoop Configuration with information needed to connect to the Accumulo store. It adds iterators to apply the provided View. This method will be used by operations that run MapReduce or Spark jobs against the Accumulo store.
        Parameters:
        conf - A Configuration to be updated.
        graphFilters - The operation GraphFilters to be applied.
        user - The User to be used.
        Throws:
        StoreException - If there is a failure to connect to Accumulo or a problem setting the iterators.
      • addElements

        public void addElements​(Iterable<? extends Element> elements)
                         throws StoreException
        Method to add Elements into Accumulo.
        Parameters:
        elements - The elements to be added.
        Throws:
        StoreException - If there is a failure to insert the elements into a table.
      • deleteElements

        public void deleteElements​(Iterable<? extends Element> elements)
                            throws StoreException
        Method to delete Elements from Accumulo.
        Parameters:
        elements - The elements to be deleted.
        Throws:
        StoreException - If there is a failure to delete elements.