I have a Table lets say its name is "SampleTab" having a columnfamily named "ColumnFam1" and column named "1" an value as "col1value"
I have written this code and trying to get a output by passing the column value I am getting output as
/04/04 06:50:08 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp 15/04/04 06:50:08 INFO zookeeper.ZooKeeper: Client environment:java.compiler= 15/04/04 06:50:08 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux 15/04/04 06:50:08 INFO zookeeper.ZooKeeper: Client environment:os.arch=i386 15/04/04 06:50:08 INFO zookeeper.ZooKeeper: Client environment:os.version=2.6.18-238.9.1.el5 15/04/04 06:50:08 INFO zookeeper.ZooKeeper: Client environment:user.name=training 15/04/04 06:50:08 INFO zookeeper.ZooKeeper: Client environment:user.home=/home/training 15/04/04 06:50:08 INFO zookeeper.ZooKeeper: Client environment:user.dir=/home/training 15/04/04 06:50:08 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection 15/04/04 06:50:09 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181 15/04/04 06:50:09 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session 15/04/04 06:50:09 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x14c84ae2fb30005, negotiated timeout = 40000 15/04/04 06:50:11 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection 15/04/04 06:50:11 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181 15/04/04 06:50:11 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session 15/04/04 06:50:12 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x14c84ae2fb30006, negotiated timeout = 40000 Get: OUTPUT keyvalues=NONE
Part of my code to Get is below :
HTable table = new HTable(config, tablename);
byte [] row1 = Bytes.toBytes("KeyIn");
Put p1 = new Put(row1);
byte [] databytes = Bytes.toBytes("ColumnFam1");
p1.add(databytes, Bytes.toBytes("1"), Bytes.toBytes("col1value"));
table.put(p1);
Get g = new Get(Bytes.toBytes("col1value"));
g.addColumn(Bytes.toBytes("ColumnFam1"), Bytes.toBytes("1"));
Result result = table.get(g);
System.out.println("Get: OUTPUT " + result);
I there any way to get columnfamily name and column name by passing the value in Get I have also tried without using the g.addColumn line .. it stills gives NONE