com.flipkart.hbaseobjectmapper.HBObjectMapperFactory 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
package com.flipkart.hbaseobjectmapper;
import com.flipkart.hbaseobjectmapper.codec.Codec;
/**
* Maintains one instance of {@link HBObjectMapper} class. For internal use only.
*/
class HBObjectMapperFactory {
private HBObjectMapperFactory() {
throw new UnsupportedOperationException();
}
/**
* Default instance of {@link HBObjectMapper}
*/
private static HBObjectMapper hbObjectMapper;
private static final Object[] lock = new Object[0];
static HBObjectMapper construct(Codec codec) {
if (hbObjectMapper == null) {
synchronized (lock) {
hbObjectMapper = codec == null ? new HBObjectMapper() : new HBObjectMapper(codec);
}
}
return hbObjectMapper;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy