@SuppressWarnings("deprecation") private Admin admin() { assert getOriginalScan() instanceof MapRDBGroupScan; final MapRDBGroupScan dbGroupScan = (MapRDBGroupScan) getOriginalScan(); final UserGroupInformation currentUser = ImpersonationUtil.createProxyUgi(dbGroupScan.getUserName()); final Configuration conf = dbGroupScan.getFormatPlugin().getFsConf(); final Admin admin; try { admin = currentUser.doAs((PrivilegedExceptionAction<Admin>) () -> MapRDB.getAdmin(conf)); } catch (Exception e) { throw new DrillRuntimeException("Failed to get Admin instance for user: " + currentUser.getUserName(), e); } return admin; } }
void init(String host, String port) { try { admin = MapRDB.newAdmin(); initialized = true; gen = new LargeTableGen(admin); } catch (Exception e) { System.out.println("Connection to HBase threw" + e.getMessage()); } } }
if (MapRDB.tableExists(tableName) && DROPTABLE == true) { System.out.println("deleting old table " + tableName); MapRDB.deleteTable(tableName); if (!MapRDB.tableExists(tableName)) { System.out.println("creating table " + tableName); table = MapRDB.createTable(tableName); table.setOption(Table.TableOption.BUFFERWRITE, true); } else { table = MapRDB.getTable(tableName); Document document = MapRDB.newDocument((Object)tick);
@BeforeClass public static void setupTests() throws Exception { if (initCount.get() == 0) { synchronized (MaprDBTestsSuite.class) { if (initCount.get() == 0) { HBaseTestsSuite.configure(false /*manageHBaseCluster*/, true /*createTables*/); HBaseTestsSuite.initCluster(); // Sleep to allow table data to be flushed to tables. // Without this, the row count stats to return 0, // causing the planner to reject optimized plans. Thread.sleep(5000); admin = MapRDB.newAdmin(); conf = HBaseTestsSuite.getConf(); initCount.incrementAndGet(); // must increment while inside the synchronized block return; } } } initCount.incrementAndGet(); return; }
@SuppressWarnings("deprecation") private Admin admin() { assert getOriginalScan() instanceof MapRDBGroupScan; final MapRDBGroupScan dbGroupScan = (MapRDBGroupScan) getOriginalScan(); final UserGroupInformation currentUser = ImpersonationUtil.createProxyUgi(dbGroupScan.getUserName()); final Configuration conf = dbGroupScan.getFormatPlugin().getFsConf(); final Admin admin; try { admin = currentUser.doAs((PrivilegedExceptionAction<Admin>) () -> MapRDB.getAdmin(conf)); } catch (Exception e) { throw new DrillRuntimeException("Failed to get Admin instance for user: " + currentUser.getUserName(), e); } return admin; } }