Created on 06-09-2016 09:20 PM - edited 09-16-2022 03:24 AM
Hi...
while trying to execute the execute the below java code , I was getting the error (mentioned below)
Can anyone help me to resolve the issue..
thanks in advance
import java.io.IOException;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.conf.Configuration;
public class CreateTable {
public static void main(String[] args) throws IOException {
// Instantiating configuration class
Configuration con = HBaseConfiguration.create();
// Instantiating HbaseAdmin class
HBaseAdmin admin = new HBaseAdmin(con);
// Instantiating table descriptor class
HTableDescriptor tableDescriptor = new HTableDescriptor("emp");
// Adding column families to table descriptor
tableDescriptor.addFamily(new HColumnDescriptor("personal"));
tableDescriptor.addFamily(new HColumnDescriptor("professional"));
// Execute the table through admin
admin.createTable(tableDescriptor);
System.out.println(" Table created ");
}
}
error:
16/06/09 21:03:44 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
16/06/09 21:03:44 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
16/06/09 21:03:44 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 16738@quickstart.cloudera
16/06/09 21:03:44 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session
16/06/09 21:03:44 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x15530ed899d002f, negotiated timeout = 40000
Exception in thread "main" java.lang.IllegalArgumentException: Not a host:port pair: PBUF
quickstart.cloudera���ȴ��*
Created 06-10-2016 12:00 AM
Created 06-10-2016 12:00 AM