AnsweredAssumed Answered

HBaseTestingUtility

Question asked by Daniar on Jul 7, 2017
Latest reply on Aug 11, 2017 by cathy

Hello,

 

I have recently tested HBaseTesingUility version 1.1.8-mapr-1703 (hbase-testing-util). I followed suggestions from this post. https://community.mapr.com/thread/9222

 

The code:

 

public class HBaseTest2 {

     public static void main(String[] args) throws Exception {
          HBaseTestingUtility utility = null;
          if (SystemUtils.IS_OS_WINDOWS) {
               System.setProperty("test.build.data.basedirectory", "d:\\tmp");
          }
          Configuration config = HBaseConfiguration.create();
          config.set("fs.defaultFS", "file:///");
          config.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem");
          utility = new HBaseTestingUtility(config);
          utility.startMiniCluster();
          utility.createTable(Bytes.toBytes("Test"), Bytes.toBytes("c"));
          Connection connection = utility.getConnection();
          try (Table table = connection.getTable(TableName.valueOf("Test"))) {
               Put put = new Put(Bytes.toBytes("A1"));
               put.addColumn(Bytes.toBytes("c"), Bytes.toBytes("c"), Bytes.toBytes("v"));
               table.put(put);
               Get get = new Get(put.getRow());
               Result result = table.get(get);
               if (!result.isEmpty()) {
                    System.out.println("RESULT: " + result);
               }
          }
     }
}

 

I get the following exception if I run the code on windows 7 

 

Exception in thread "main" java.lang.RuntimeException: /D:/tmp/3c6f292a-58a2-4868-9be4-e5d353cfc0b3/dfscluster_fc674ea0-6107-4315-afca-d56a87329390/dfs/data/data1
at org.apache.hadoop.fs.RawLocalFileSystem$DeprecatedRawLocalFileStatus.loadNativePermissionInfo(RawLocalFileSystem.java:717)
at org.apache.hadoop.fs.RawLocalFileSystem$DeprecatedRawLocalFileStatus.loadPermissionInfo(RawLocalFileSystem.java:654)
at org.apache.hadoop.fs.RawLocalFileSystem$DeprecatedRawLocalFileStatus.getPermission(RawLocalFileSystem.java:630)
at org.apache.hadoop.util.DiskChecker.mkdirsWithExistsAndPermissionCheck(DiskChecker.java:139)
at org.apache.hadoop.util.DiskChecker.checkDir(DiskChecker.java:156)
at org.apache.hadoop.hdfs.server.datanode.DataNode$DataNodeDiskChecker.checkDir(DataNode.java:2375)
at org.apache.hadoop.hdfs.server.datanode.DataNode.checkStorageLocations(DataNode.java:2417)
at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:2399)
at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2291)
at org.apache.hadoop.hdfs.MiniDFSCluster.startDataNodes(MiniDFSCluster.java:1513)
at org.apache.hadoop.hdfs.MiniDFSCluster.initMiniDFSCluster(MiniDFSCluster.java:896)
at org.apache.hadoop.hdfs.MiniDFSCluster.<init>(MiniDFSCluster.java:806)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniDFSCluster(HBaseTestingUtility.java:574)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:968)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:849)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:843)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:787)
at de.rewe.core.hbase.HBaseTest2.setup(HBaseTest2.java:33)
at de.rewe.core.hbase.HBaseTest2.main(HBaseTest2.java:50)
Caused by: java.io.IOException: The function POSIX.open() is not supported on Windows
at org.apache.hadoop.io.nativeio.NativeIO$POSIX.open(Native Method)
at org.apache.hadoop.fs.RawLocalFileSystem$DeprecatedRawLocalFileStatus.loadNativePermissionInfo(RawLocalFileSystem.java:712)
... 18 more

 

and on Linux I got the following exception:

2017-07-07 10:59:02,647 ERROR [main] server.NIOServerCnxnFactory (NIOServerCnxnFactory.java:uncaughtException(44)) - Thread Thread[main,5,main] died
java.io.IOException: Could not configure server because SASL configuration did not allow the ZooKeeper server to authenticate itself properly: javax.security.auth.login.LoginException: MapR user ticket not available! error = com.mapr.security.MutableInt@7ca0863b
at org.apache.zookeeper.server.ServerCnxnFactory.configureSaslLogin(ServerCnxnFactory.java:205)
at org.apache.zookeeper.server.NIOServerCnxnFactory.configure(NIOServerCnxnFactory.java:87)
at org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster.startup(MiniZooKeeperCluster.java:231)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniZKCluster(HBaseTestingUtility.java:761)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniZKCluster(HBaseTestingUtility.java:731)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:973)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:849)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:843)
at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster(HBaseTestingUtility.java:787)
at de.rewe.core.hbase.HBaseTest2.setup(HBaseTest2.java:33)
at de.rewe.core.hbase.HBaseTest2.main(HBaseTest2.java:50)

Do you have any suggestions?  

 

Many Thanks,

Outcomes