Created
June 4, 2018 14:13
-
-
Save AhianZhang/c9dd258293eece7fa033fdc478e67208 to your computer and use it in GitHub Desktop.
HbaseTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.hadoop.hbase.client.Connection; | |
import org.apache.hadoop.hbase.client.Table; | |
import org.junit.Test; | |
import java.io.IOException; | |
/** | |
* Created by AhianZhang on 2018/5/29. | |
*/ | |
public class HBaseTest | |
{ | |
@Test | |
public void getConnTest() throws IOException | |
{ | |
Connection conn = HbaseConn.getHBaseConn(); | |
System.out.println(conn.isClosed()); | |
HbaseConn.closeConn(); | |
System.out.println(conn.isClosed()); | |
} | |
@Test | |
public void getTableTest() throws IOException | |
{ | |
Table table = HbaseConn.getTable("US_POPULATION"); | |
System.out.println(table.getName().getNameAsString()); | |
table.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment