Package cz.o2.proxima.direct.io.hbase
Class HBaseDataAccessor
- java.lang.Object
-
- cz.o2.proxima.core.storage.AbstractStorage
-
- cz.o2.proxima.core.storage.AbstractStorage.SerializableAbstractStorage
-
- cz.o2.proxima.direct.io.hbase.HBaseDataAccessor
-
- All Implemented Interfaces:
AbstractDataAccessor,DataAccessor,java.io.Serializable
public class HBaseDataAccessor extends AbstractStorage.SerializableAbstractStorage implements DataAccessor
DataAccessorfor HBase.HBase storage uses URIs in the form of
hbase://<master_hostport>/<table>?family=<family>and stores data using HBase table namedtablein familyfamily.An optional parameter in URI called
vcan be used to distinguish two serialization versions of data in HBaseCell:v=1(default) stores the serialized bytes of a value in a cell directlyv=2uses protobuffer to store more metadata into the value
v=2serialization format is required to support transactions on top of HBase, because the metadata preserves sequentialId (stored inStreamElement#getSequentialId).- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceHBaseDataAccessor.ConfFactoryOptional function to be used when creating configuration from URI.-
Nested classes/interfaces inherited from class cz.o2.proxima.core.storage.AbstractStorage
AbstractStorage.SerializableAbstractStorage
-
-
Constructor Summary
Constructors Constructor Description HBaseDataAccessor(EntityDescriptor entity, java.net.URI uri, java.util.Map<java.lang.String,java.lang.Object> cfg)HBaseDataAccessor(EntityDescriptor entity, java.net.URI uri, java.util.Map<java.lang.String,java.lang.Object> cfg, HBaseDataAccessor.ConfFactory confFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<BatchLogReader>getBatchLogReader(Context context)Retrieve batch log reader.HBaseDataAccessor.ConfFactorygetConfFactory()Just for test purpose!java.util.Optional<RandomAccessReader>getRandomAccessReader(Context context)Retrieve random access reader.java.util.Optional<AttributeWriterBase>getWriter(Context context)Retrieve writer (if applicable).-
Methods inherited from class cz.o2.proxima.core.storage.AbstractStorage
equals, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cz.o2.proxima.core.storage.internal.AbstractDataAccessor
getUri
-
Methods inherited from interface cz.o2.proxima.direct.core.DataAccessor
getCachedView, getCommitLogReader, isAcceptable
-
-
-
-
Constructor Detail
-
HBaseDataAccessor
public HBaseDataAccessor(EntityDescriptor entity, java.net.URI uri, java.util.Map<java.lang.String,java.lang.Object> cfg)
-
HBaseDataAccessor
public HBaseDataAccessor(EntityDescriptor entity, java.net.URI uri, java.util.Map<java.lang.String,java.lang.Object> cfg, HBaseDataAccessor.ConfFactory confFactory)
-
-
Method Detail
-
getConfFactory
public HBaseDataAccessor.ConfFactory getConfFactory()
Just for test purpose!- Returns:
- configuration factory
-
getWriter
public java.util.Optional<AttributeWriterBase> getWriter(Context context)
Description copied from interface:DataAccessorRetrieve writer (if applicable).- Specified by:
getWriterin interfaceDataAccessor- Parameters:
context- the serializable context provided by repository- Returns:
- optional
AttributeWriterBaseof this accessor
-
getRandomAccessReader
public java.util.Optional<RandomAccessReader> getRandomAccessReader(Context context)
Description copied from interface:DataAccessorRetrieve random access reader.- Specified by:
getRandomAccessReaderin interfaceDataAccessor- Parameters:
context- serializable context provided by repository- Returns:
- optional
RandomAccessReaderof this accessor
-
getBatchLogReader
public java.util.Optional<BatchLogReader> getBatchLogReader(Context context)
Description copied from interface:DataAccessorRetrieve batch log reader.- Specified by:
getBatchLogReaderin interfaceDataAccessor- Parameters:
context- serializable context provided by repository- Returns:
- optional
BatchLogReaderof this accessor
-
-