com.flipkart.hbaseobjectmapper.HBTable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hbase-object-mapper Show documentation
Show all versions of hbase-object-mapper Show documentation
HBase ORM is a light-weight, thread-safe and performant library that enables:
[1] object-oriented access of HBase rows (Data Access Object) with minimal code and good testability.
[2] reading from and/or writing to HBase tables in Hadoop MapReduce jobs.
This can also be used as an ORM for Bigtable.
The newest version!
package com.flipkart.hbaseobjectmapper;
import com.flipkart.hbaseobjectmapper.codec.Codec;
import java.io.Serializable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.lang.reflect.Type;
import java.util.Map;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Maps an entity class to a table in HBase
*/
@Target(TYPE)
@Retention(RUNTIME)
public @interface HBTable {
/**
* Namespace of the HBase table
*
* @return Name of the HBase table
*/
String namespace() default "default";
/**
* Name/Qualifier of the HBase table
*
* @return Name of the HBase table
*/
String name();
/**
* Column families and their specs
*
* @return Column families and their specs
*/
Family[] families();
/**
* [optional] flags to be passed to codec's {@link Codec#serialize(Serializable, Map) serialize} and {@link Codec#deserialize(byte[], Type, Map) deserialize} methods
*
* Note: These flags will be passed as a Map<String, String>
(param name and param value)
*
* @return Flags
*/
Flag[] rowKeyCodecFlags() default {};
}