Package uk.gov.gchq.gaffer.accumulostore
Class AccumuloStore
- java.lang.Object
-
- uk.gov.gchq.gaffer.store.Store
-
- uk.gov.gchq.gaffer.accumulostore.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 Summary
Fields Modifier and Type Field Description static StringFAILED_TO_CREATE_AN_ACCUMULO_FROM_ELEMENT_OF_TYPE_WHEN_TRYING_TO_INSERT_ELEMENTSstatic Set<StoreTrait>TRAITS
-
Constructor Summary
Constructors Constructor Description AccumuloStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddElements(Iterable<? extends Element> elements)Method to addElements into Accumulo.voiddeleteElements(Iterable<? extends Element> elements)Method to deleteElements from Accumulo.org.apache.accumulo.core.client.ConnectorgetConnection()Creates an AccumuloConnectorusing the properties found in properties file associated with the AccumuloStore.StringgetCreatedTime()Retrieves Accumulo Table created time property.AccumuloKeyPackagegetKeyPackage()Gets theAccumuloKeyPackagein use by this AccumuloStore.AccumuloPropertiesgetProperties()Gets allAccumuloPropertiesrelated to the store.StringgetTableName()Gets the name of the Accumulo table backing this storeList<String>getTabletServers()Gets the TabletServers.voidinitialise(String graphId, Schema schema, StoreProperties properties)voidpreInitialise(String graphId, Schema schema, StoreProperties properties)Performs general initialisation without creating the table.voidupdateConfiguration(org.apache.hadoop.conf.Configuration conf, GraphFilters graphFilters, User user)Updates a HadoopConfigurationwith information needed to connect to the Accumulo store.voidvalidateSchemas()-
Methods inherited from class uk.gov.gchq.gaffer.store.Store
addOperationChainOptimisers, addOperationHandler, addOperationHandler, createContext, createStore, createStore, execute, execute, executeJob, executeJob, getCaches, getGraphId, getGraphLibrary, getJobTracker, getNextOperations, getOperationChainOptimisers, getOperationChainValidator, getOperationHandler, getOriginalSchema, getSchema, getSupportedOperations, handleOperation, isSupported, optimiseSchema, populateElement, runAsync, setGraphLibrary, setOriginalSchema, updateJsonSerialiser, updateJsonSerialiser
-
-
-
-
Field Detail
-
TRAITS
public static final Set<StoreTrait> TRAITS
-
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
-
-
Method Detail
-
initialise
public void initialise(String graphId, Schema schema, StoreProperties properties) throws StoreException
- Overrides:
initialisein classStore- Throws:
StoreException
-
getCreatedTime
public String getCreatedTime()
Retrieves Accumulo Table created time property.- Overrides:
getCreatedTimein classStore- 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 StoreExceptionCreates an AccumuloConnectorusing 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 StoreExceptionUpdates a HadoopConfigurationwith information needed to connect to the Accumulo store. It adds iterators to apply the providedView. This method will be used by operations that run MapReduce or Spark jobs against the Accumulo store.- Parameters:
conf- AConfigurationto be updated.graphFilters- The operationGraphFiltersto be applied.user- TheUserto be used.- Throws:
StoreException- If there is a failure to connect to Accumulo or a problem setting the iterators.
-
validateSchemas
public void validateSchemas()
- Overrides:
validateSchemasin classStore
-
getProperties
public AccumuloProperties getProperties()
Gets allAccumuloPropertiesrelated to the store.- Overrides:
getPropertiesin classStore- Returns:
AccumuloProperties.
-
addElements
public void addElements(Iterable<? extends Element> elements) throws StoreException
Method to addElements 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 deleteElements from Accumulo.- Parameters:
elements- The elements to be deleted.- Throws:
StoreException- If there is a failure to delete elements.
-
getKeyPackage
public AccumuloKeyPackage getKeyPackage()
Gets theAccumuloKeyPackagein use by this AccumuloStore.- Returns:
AccumuloKeyPackage.
-
getTabletServers
public List<String> getTabletServers() throws StoreException
Gets the TabletServers.- Returns:
- A list of Strings of TabletServers.
- Throws:
StoreException- If failure.
-
-