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
DataAccessor
for HBase.HBase storage uses URIs in the form of
hbase://<master_hostport>/<table>?family=<family>
and stores data using HBase table namedtable
in familyfamily
.An optional parameter in URI called
v
can 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=2
uses protobuffer to store more metadata into the value
v=2
serialization 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 interface
HBaseDataAccessor.ConfFactory
Optional 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.ConfFactory
getConfFactory()
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:DataAccessor
Retrieve writer (if applicable).- Specified by:
getWriter
in interfaceDataAccessor
- Parameters:
context
- the serializable context provided by repository- Returns:
- optional
AttributeWriterBase
of this accessor
-
getRandomAccessReader
public java.util.Optional<RandomAccessReader> getRandomAccessReader(Context context)
Description copied from interface:DataAccessor
Retrieve random access reader.- Specified by:
getRandomAccessReader
in interfaceDataAccessor
- Parameters:
context
- serializable context provided by repository- Returns:
- optional
RandomAccessReader
of this accessor
-
getBatchLogReader
public java.util.Optional<BatchLogReader> getBatchLogReader(Context context)
Description copied from interface:DataAccessor
Retrieve batch log reader.- Specified by:
getBatchLogReader
in interfaceDataAccessor
- Parameters:
context
- serializable context provided by repository- Returns:
- optional
BatchLogReader
of this accessor
-
-