java - Hbase Kundera Table with namespace not working -


using kundera wanted create tables in given namespace

example

foo:bar  

where foo namespace & bar tablename

this not happening below configuration

here persistent unit

    <provider>com.impetus.kundera.kunderapersistence</provider>      <properties>         <property name="kundera.nodes" value="zookeeperip" />         <property name="kundera.port" value="2181" />         <property name="kundera.client.property" value="user.xml"/>         <property name="kundera.keyspace" value="userprofile" />         <property name="kundera.dialect" value="hbase" />         <property name="kundera.ddl.auto.prepare" value="update" />         <property name="kundera.client.lookup.class" value="com.impetus.client.hbase.hbaseclientfactory" />     </properties> </persistence-unit> 

here user.xml

<clientproperties>     <datastores>         <datastore>             <name>hbase</name>             <connection>                 <properties>                     <property name="hbase.zookeeper.quorum" value="zookeeperip"/>                     <property name="hbase.zookeeper.property.clientport" value="2181"/>                 </properties>             </connection>             <schemas>                 <schema>                     <name>univercity</name>                     <tables>                         <table>                             <name>student</name>                             <properties>                                 <property name="ttl" value="12345678"/>                                 <property name="versions" value="6"/>                                 <property name="min_versions" value="3"/>                                 <property name="compression" value="gz"/>                                 <property name="compression_compact" value="gz"/>                             </properties>                         </table>                         <table>                             <name>cources</name>                             <properties>                                 <property name="ttl" value="12345678"/>                                 <property name="versions" value="6"/>                                 <property name="min_versions" value="3"/>                                 <property name="compression" value="gz"/>                                 <property name="compression_compact" value="gz"/>                             </properties>                         </table>  </tables>                 </schema>             </schemas>         </datastore>     </datastores> </clientproperties> 

my entity classes looks below

@entity @table(name = "student",  schema = "userprofile@hbase_pu") public class student{  @id @column(name = "studentid") string studentid @column(name = "name") string name  }  @entity @table(name = "cources",  schema = "userprofile@hbase_pu") public class cource{  @id @column(name = "courceid") string courceid @column(name = "name") string name  } 

when run test cases get

userprofile table & student & cources column families

what expect is

userprofile:student 1 table & userprofile:cource onother table

i feel keyspace in kundera persitence.xml takes tablename & entities column family

how avoid ??

i think using kundera-hbase

<dependency>      <groupid>com.impetus.kundera.client</groupid>      <artifactid>kundera-hbase</artifactid>      <version>${kundera.version}</version> </dependency> 

for usecase, should use kundera-hbase-v2

<dependency>      <groupid>com.impetus.kundera.client</groupid>      <artifactid>kundera-hbase-v2</artifactid>      <version>${kundera.version}</version> </dependency> 

mapping in kundera-hbase

  • keyspace ==> htable
  • entity ==> column family (a column family each entity class)

and in kundera-hbase-v2

  • keyspace ==> namespace
  • entity ==> htable (one htable each entity)

check kundera wiki more details. also, make sure using latest version of kundera.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -