1. 程式人生 > >hbase java 讀寫例項

hbase java 讀寫例項

12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.3-1240972, built on 02/06/2012 10:48 GMT
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:host.name=Hadoop48
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.0
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:java.home=/usr/java/jdk1.7.0/jre
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:java.class.path=/home/zhouhh/workspace/.metadata/.plugins/org.apache.hadoop.eclipse/hadoop-conf-9138530567059164014:/home/zhouhh/workspace/myhbase/bin:/home/zhouhh/hadoop-1.0.3/lib/jasper-compiler-5.5.12.jar:/home/zhouhh/hadoop-1.0.3/lib/xmlenc-0.52.jar:/home/zhouhh/hadoop-1.0.3/lib/hadoop-capacity-scheduler-1.0.3.jar:/home/zhouhh/hadoop-1.0.3/lib/jersey-json-1.8.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-logging-1.1.1.jar:/home/zhouhh/hadoop-1.0.3/lib/hsqldb-1.8.0.10.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-configuration-1.6.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-math-2.1.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-net-1.4.1.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-beanutils-1.7.0.jar:/home/zhouhh/hadoop-1.0.3/lib/jdom.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-httpclient-3.0.1.jar:/home/zhouhh/hadoop-1.0.3/lib/junit-4.5.jar:/home/zhouhh/hadoop-1.0.3/lib/jackson-core-asl-1.8.8.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-beanutils-core-1.8.0.jar:/home/zhouhh/hadoop-1.0.3/lib/servlet-api-2.5-20081211.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-io-2.1.jar:/home/zhouhh/hadoop-1.0.3/lib/jsch-0.1.42.jar:/home/zhouhh/hadoop-1.0.3/lib/jetty-6.1.26.jar:/home/zhouhh/hadoop-1.0.3/lib/jersey-server-1.8.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-digester-1.8.jar:/home/zhouhh/hadoop-1.0.3/lib/aspectjtools-1.6.5.jar:/home/zhouhh/hadoop-1.0.3/lib/slf4j-api-1.4.3.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-lang-2.4.jar:/home/zhouhh/hadoop-1.0.3/lib/mockito-all-1.8.5.jar:/home/zhouhh/hadoop-1.0.3/lib/jdeb-0.8.jar:/home/zhouhh/hadoop-1.0.3/lib/oro-2.0.8.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-daemon-1.0.1.jar:/home/zhouhh/hadoop-1.0.3/lib/jackson-mapper-asl-1.8.8.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-codec-1.4.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-el-1.0.jar:/home/zhouhh/hadoop-1.0.3/lib/slf4j-log4j12-1.4.3.jar:/home/zhouhh/hadoop-1.0.3/lib/jasper-runtime-5.5.12.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-collections-3.2.1.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-logging-api-1.0.4.jar:/home/zhouhh/hadoop-1.0.3/lib/hadoop-thriftfs-1.0.3.jar:/home/zhouhh/hadoop-1.0.3/lib/jetty-util-6.1.26.jar:/home/zhouhh/hadoop-1.0.3/lib/aspectjrt-1.6.5.jar:/home/zhouhh/hadoop-1.0.3/lib/hadoop-fairscheduler-1.0.3.jar:/home/zhouhh/hadoop-1.0.3/lib/log4j-1.2.15.jar:/home/zhouhh/hadoop-1.0.3/lib/jets3t-0.6.1.jar:/home/zhouhh/hadoop-1.0.3/lib/core-3.1.1.jar:/home/zhouhh/hadoop-1.0.3/lib/kfs-0.2.2.jar:/home/zhouhh/hadoop-1.0.3/lib/jersey-core-1.8.jar:/home/zhouhh/hadoop-1.0.3/lib/asm-3.2.jar:/home/zhouhh/hadoop-1.0.3/lib/commons-cli-1.2.jar:/home/zhouhh/hadoop-1.0.3/hadoop-ant-1.0.3.jar:/home/zhouhh/hadoop-1.0.3/hadoop-minicluster-1.0.3.jar:/home/zhouhh/hadoop-1.0.3/hadoop-client-1.0.3.jar:/home/zhouhh/hadoop-1.0.3/hadoop-core-1.0.3.jar:/home/zhouhh/hadoop-1.0.3/hadoop-tools-1.0.3.jar:/home/zhouhh/hbase-0.94.0/hbase-0.94.0.jar:/home/zhouhh/hbase-0.94.0/hbase-0.94.0-tests.jar:/home/zhouhh/hbase-0.94.0/slf4j-log4j12-1.5.8.jar:/home/zhouhh/hbase-0.94.0/lib/activation-1.1.jar:/home/zhouhh/hbase-0.94.0/lib/asm-3.1.jar:/home/zhouhh/hbase-0.94.0/lib/avro-1.5.3.jar:/home/zhouhh/hbase-0.94.0/lib/avro-ipc-1.5.3.jar:/home/zhouhh/hbase-0.94.0/lib/commons-beanutils-1.7.0.jar:/home/zhouhh/hbase-0.94.0/lib/commons-beanutils-core-1.8.0.jar:/home/zhouhh/hbase-0.94.0/lib/commons-cli-1.2.jar:/home/zhouhh/hbase-0.94.0/lib/commons-codec-1.4.jar:/home/zhouhh/hbase-0.94.0/lib/commons-collections-3.2.1.jar:/home/zhouhh/hbase-0.94.0/lib/commons-configuration-1.6.jar:/home/zhouhh/hbase-0.94.0/lib/commons-digester-1.8.jar:/home/zhouhh/hbase-0.94.0/lib/commons-el-1.0.jar:/home/zhouhh/hbase-0.94.0/lib/commons-httpclient-3.1.jar:/home/zhouhh/hbase-0.94.0/lib/commons-io-2.1.jar:/home/zhouhh/hbase-0.94.0/lib/commons-lang-2.5.jar:/home/zhouhh/hbase-0.94.0/lib/commons-logging-1.1.1.jar:/home/zhouhh/hbase-0.94.0/lib/commons-math-2.1.jar:/home/zhouhh/hbase-0.94.0/lib/commons-net-1.4.1.jar:/home/zhouhh/hbase-0.94.0/lib/core-3.1.1.jar:/home/zhouhh/hbase-0.94.0/lib/guava-r09.jar:/home/zhouhh/hbase-0.94.0/lib/hadoop-core-1.0.2.jar:/home/zhouhh/hbase-0.94.0/lib/high-scale-lib-1.1.1.jar:/home/zhouhh/hbase-0.94.0/lib/httpclient-4.1.2.jar:/home/zhouhh/hbase-0.94.0/lib/httpcore-4.1.3.jar:/home/zhouhh/hbase-0.94.0/lib/jackson-core-asl-1.5.5.jar:/home/zhouhh/hbase-0.94.0/lib/jackson-jaxrs-1.5.5.jar:/home/zhouhh/hbase-0.94.0/lib/jackson-mapper-asl-1.5.5.jar:/home/zhouhh/hbase-0.94.0/lib/jackson-xc-1.5.5.jar:/home/zhouhh/hbase-0.94.0/lib/jamon-runtime-2.3.1.jar:/home/zhouhh/hbase-0.94.0/lib/jasper-compiler-5.5.23.jar:/home/zhouhh/hbase-0.94.0/lib/jasper-runtime-5.5.23.jar:/home/zhouhh/hbase-0.94.0/lib/jaxb-api-2.1.jar:/home/zhouhh/hbase-0.94.0/lib/jaxb-impl-2.1.12.jar:/home/zhouhh/hbase-0.94.0/lib/jersey-core-1.4.jar:/home/zhouhh/hbase-0.94.0/lib/jersey-json-1.4.jar:/home/zhouhh/hbase-0.94.0/lib/jersey-server-1.4.jar:/home/zhouhh/hbase-0.94.0/lib/jettison-1.1.jar:/home/zhouhh/hbase-0.94.0/lib/jetty-6.1.26.jar:/home/zhouhh/hbase-0.94.0/lib/jetty-util-6.1.26.jar:/home/zhouhh/hbase-0.94.0/lib/jruby-complete-1.6.5.jar:/home/zhouhh/hbase-0.94.0/lib/jsp-2.1-6.1.14.jar:/home/zhouhh/hbase-0.94.0/lib/jsp-api-2.1-6.1.14.jar:/home/zhouhh/hbase-0.94.0/lib/libthrift-0.8.0.jar:/home/zhouhh/hbase-0.94.0/lib/log4j-1.2.16.jar:/home/zhouhh/hbase-0.94.0/lib/netty-3.2.4.Final.jar:/home/zhouhh/hbase-0.94.0/lib/protobuf-java-2.4.0a.jar:/home/zhouhh/hbase-0.94.0/lib/servlet-api-2.5-6.1.14.jar:/home/zhouhh/hbase-0.94.0/lib/slf4j-api-1.5.8.jar:/home/zhouhh/hbase-0.94.0/lib/snappy-java-1.0.3.2.jar:/home/zhouhh/hbase-0.94.0/lib/stax-api-1.0.1.jar:/home/zhouhh/hbase-0.94.0/lib/velocity-1.7.jar:/home/zhouhh/hbase-0.94.0/lib/xmlenc-0.52.jar:/home/zhouhh/hbase-0.94.0/lib/zookeeper-3.4.3.jar
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:os.version=2.6.18-194.el5
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:user.name=zhouhh
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:user.home=/home/zhouhh
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Client environment:user.dir=/home/zhouhh/workspace/myhbase
12/06/07 19:30:00 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
12/06/07 19:30:00 INFO zookeeper.ClientCnxn: Opening socket connection to server /127.0.0.1:2181
12/06/07 19:30:00 INFO client.ZooKeeperSaslClient: Client will not SASL-authenticate because the default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration.
12/06/07 19:30:00 INFO zookeeper.ClientCnxn: Socket connection established to localhost.localdomain/127.0.0.1:2181, initiating session
12/06/07 19:30:00 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 
[email protected]
12/06/07 19:30:00 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost.localdomain/127.0.0.1:2181, sessionid = 0x37c4cc9e3f0018, negotiated timeout = 180000 12/06/07 19:30:01 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=catalogtracker-on-org.apache.h
[email protected]
6a4b72c 12/06/07 19:30:01 INFO zookeeper.ClientCnxn: Opening socket connection to server /127.0.0.1:2181 12/06/07 19:30:01 INFO client.ZooKeeperSaslClient: Client will not SASL-authenticate because the default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration. 12/06/07 19:30:01 INFO zookeeper.ClientCnxn: Socket connection established to localhost.localdomain/127.0.0.1:2181, initiating session 12/06/07 19:30:01 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost.localdomain/127.0.0.1:2181, sessionid = 0x37c4cc9e3f0019, negotiated timeout = 180000 12/06/07 19:30:01 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is
[email protected]
12/06/07 19:30:01 INFO zookeeper.ZooKeeper: Session: 0x37c4cc9e3f0019 closed 12/06/07 19:30:01 INFO zookeeper.ClientCnxn: EventThread shut down 12/06/07 19:30:01 INFO client.HBaseAdmin: Started disable of student 12/06/07 19:30:02 INFO client.HBaseAdmin: Disabled student table student exist,delete it. 12/06/07 19:30:03 INFO client.HBaseAdmin: Deleted student <span style="color: #ff6600;">table student create ok.</span> <span style="color: #ff6600;">put data to student,rowKey:zhh,family:age,qual:,value:28</span> <span style="color: #ff6600;">put data to student,rowKey:zhh,family:sex,qual:,value:male</span> <span style="color: #ff6600;">put data to student,rowKey:yff,family:age,qual:,value:20</span> <span style="color: #ff6600;">put data to student,rowKey:yff,family:sex,qual:,value:female</span> <span style="color: #ff6600;">get from student,rowkey:yff</span> <span style="color: #ff6600;">yff: age:, 20, 1339068604414</span> <span style="color: #ff6600;">yff: sex:, female, 1339068604422</span> <span style="color: #ff6600;">scan student</span> <span style="color: #ff6600;">==============begin=================</span> <span style="color: #ff6600;">yff: age:, 20, 1339068604414</span> <span style="color: #ff6600;">yff: sex:, female, 1339068604422</span> <span style="color: #ff6600;">zhh: age:, 28, 1339068604409</span> <span style="color: #ff6600;">zhh: sex:, male, 1339068604412</span> <span style="color: #ff6600;">================end===============</span>