public String run() throws IOException, MetaException, TException { String u = ugi.getUserName(); return client.getDelegationToken(c.getUser(), u); } });
private String getUserFromUGI() { // Don't use the userName member, as it may or may not have been set. Get the value from // conf, which calls into getUGI to figure out who the process is running as. try { return conf.getUser(); } catch (IOException e) { errorMessage = "FAILED: Error in determining user while acquiring locks: " + e.getMessage(); SQLState = ErrorMsg.findSQLState(e.getMessage()); downstreamError = e; console.printError(errorMessage, "\n" + org.apache.hadoop.util.StringUtils.stringifyException(e)); } return null; }
if (!getWh().isWritable(tablePath.getParent())) { throw new MetaException("Table metadata not deleted since " + tablePath.getParent() + " is not writable by " + conf.getUser());
try { newTable.setOwner(owner == null? getConf().getUser() : owner);
SessionState.get().getTxnMgr().openTxn(ctx, conf.getUser()); db = sem.getDb();
userFromUGI = conf.getUser(); } catch (IOException e) { errorMessage = "FAILED: Error in determining user while acquiring locks: " + e.getMessage();
public String getDelegationToken(String renewerKerberosPrincipalName) throws MetaException, TException, IOException { //a convenience method that makes the intended owner for the delegation //token request the current user String owner = conf.getUser(); return getDelegationToken(owner, renewerKerberosPrincipalName); }
public String run() throws IOException, MetaException, TException { String u = ugi.getUserName(); return client.getDelegationToken(c.getUser(), u); } });
public String getDelegationToken(String renewerKerberosPrincipalName) throws MetaException, TException, IOException { //a convenience method that makes the intended owner for the delegation //token request the current user String owner = conf.getUser(); return getDelegationToken(owner, renewerKerberosPrincipalName); }
public String getDelegationToken(String renewerKerberosPrincipalName) throws MetaException, TException, IOException { //a convenience method that makes the intended owner for the delegation //token request the current user String owner = conf.getUser(); return getDelegationToken(owner, renewerKerberosPrincipalName); }
private void verifyIsWritablePath(Path dir) throws MetaException { try { if (!wh.isWritable(dir.getParent())) { throw new MetaException("Table partition not deleted since " + dir.getParent() + " is not writable by " + hiveConf.getUser()); } } catch (IOException ex) { LOG.warn("Error from isWritable", ex); throw new MetaException("Table partition not deleted since " + dir.getParent() + " access cannot be checked: " + ex.getMessage()); } }
/** * Update last_modified_by and last_modified_time parameters in parameter map. * * @param params * Parameters. * @param user * user that is doing the updating. */ private boolean updateModifiedParameters(Map<String, String> params, HiveConf conf) { String user = null; try { user = conf.getUser(); } catch (IOException e) { console.printError("Unable to get current user: " + e.getMessage(), stringifyException(e)); return false; } params.put("last_modified_by", user); params.put("last_modified_time", Long.toString(System.currentTimeMillis() / 1000)); return true; }
private void verifyIsWritablePath(Path dir) throws MetaException { try { if (!wh.isWritable(dir.getParent())) { throw new MetaException("Table partition not deleted since " + dir.getParent() + " is not writable by " + hiveConf.getUser()); } } catch (IOException ex) { LOG.warn("Error from isWritable", ex); throw new MetaException("Table partition not deleted since " + dir.getParent() + " access cannot be checked: " + ex.getMessage()); } }
private int setGenericTableAttributes(Table tbl) { try { tbl.setOwner(conf.getUser()); } catch (IOException e) { console.printError("Unable to get current user: " + e.getMessage(), stringifyException(e)); return 1; } // set create time tbl.setCreateTime((int) (System.currentTimeMillis() / 1000)); return 0; }
if (!getWh().isWritable(tablePath.getParent())) { throw new MetaException("Table metadata not deleted since " + tablePath.getParent() + " is not writable by " + conf.getUser());
private void drop_database_core(RawStore ms, final String name, final boolean deleteData) throws NoSuchObjectException, InvalidOperationException, MetaException, IOException { boolean success = false; Database db = null; try { ms.openTransaction(); db = ms.getDatabase(name); if (!get_all_tables(db.getName()).isEmpty()) { throw new InvalidOperationException("Database " + db.getName() + " is not empty"); } Path path = new Path(db.getLocationUri()).getParent(); if (!wh.isWritable(path)) { throw new MetaException("Database not dropped since " + path + " is not writable by " + hiveConf.getUser()); } if (ms.dropDatabase(name)) { success = ms.commitTransaction(); } } finally { if (!success) { ms.rollbackTransaction(); } else if (deleteData) { wh.deleteDir(new Path(db.getLocationUri()), true); // it is not a terrible thing even if the data is not deleted } } }
try { newTable.setOwner(owner == null? getConf().getUser() : owner);
try { newTable.setOwner(owner == null? getConf().getUser() : owner);
try { newTable.setOwner(owner == null? getConf().getUser() : owner);
throw new MetaException("Index table metadata not deleted since " + tblPath.getParent() + " is not writable by " + hiveConf.getUser());