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 = SecurityUtils.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 " + SecurityUtils.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()); } }
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 = SecurityUtils.getUser(); return getDelegationToken(owner, renewerKerberosPrincipalName); }
public PrivilegeGrantInfo build() throws MetaException { if (privilege == null) { throw new MetaException("Privilege must be provided."); } if (grantor == null) { try { grantor = SecurityUtils.getUser(); grantorType = PrincipalType.USER; } catch (IOException e) { throw MetaStoreUtils.newMetaException(e); } } return new PrivilegeGrantInfo(privilege, createTime, grantor, grantorType, grantOption); } }
public Function build(Configuration conf) throws MetaException { try { if (owner != null) { owner = SecurityUtils.getUser(); } } catch (IOException e) { throw MetaStoreUtils.newMetaException(e); } if (catName == null) catName = MetaStoreUtils.getDefaultCatalog(conf); Function f = new Function(funcName, dbName, className, owner, ownerType, createTime, funcType, resourceUris); f.setCatName(catName); return f; }
throw new MetaException("Table metadata not deleted since the partition " + partName + " has parent location " + partPath.getParent() + " which is not writable by " + SecurityUtils.getUser());
if (!getWh().isWritable(tablePath.getParent())) { throw new MetaException("Table metadata not deleted since " + tablePath.getParent() + " is not writable by " + SecurityUtils.getUser());
public Database build(Configuration conf) throws MetaException { if (name == null) throw new MetaException("You must name the database"); if (catalogName == null) catalogName = MetaStoreUtils.getDefaultCatalog(conf); Database db = new Database(name, description, location, params); db.setCatalogName(catalogName); db.setCreateTime(createTime); try { if (ownerName == null) ownerName = SecurityUtils.getUser(); db.setOwnerName(ownerName); if (ownerType == null) ownerType = PrincipalType.USER; db.setOwnerType(ownerType); return db; } catch (IOException e) { throw MetaStoreUtils.newMetaException(e); } }
throw new MetaException("Database not dropped since " + path + " is not writable by " + SecurityUtils.getUser()); throw new MetaException("Database metadata not deleted since table: " + materializedView.getTableName() + " has a parent location " + materializedViewPath.getParent() + " which is not writable by " + SecurityUtils.getUser()); throw new MetaException("Database metadata not deleted since table: " + table.getTableName() + " has a parent location " + tablePath.getParent() + " which is not writable by " + SecurityUtils.getUser());
public Table build(Configuration conf) throws MetaException { if (tableName == null) { throw new MetaException("You must set the table name"); } if (ownerType == null) { ownerType = PrincipalType.USER; } if (owner == null) { try { owner = SecurityUtils.getUser(); } catch (IOException e) { throw MetaStoreUtils.newMetaException(e); } } if (catName == null) catName = MetaStoreUtils.getDefaultCatalog(conf); Table t = new Table(tableName, dbName, owner, createTime, lastAccessTime, retention, buildSd(), partCols, tableParams, viewOriginalText, viewExpandedText, type); if (rewriteEnabled) t.setRewriteEnabled(true); if (temporary) t.setTemporary(temporary); t.setCatName(catName); if (!mvReferencedTables.isEmpty()) { CreationMetadata cm = new CreationMetadata(catName, dbName, tableName, mvReferencedTables); if (mvValidTxnList != null) cm.setValidTxnList(mvValidTxnList); t.setCreationMetadata(cm); } return t; }
throw new MetaException(target + " metadata not deleted since " + tblPath.getParent() + " is not writable by " + SecurityUtils.getUser());
.setOwnerName(SecurityUtils.getUser()) .build(conf); Assert.assertEquals(SecurityUtils.getUser(), db.getOwnerName()); client.createDatabase(db); assertEquals("location of the returned db is different from that of inserted db", warehouse.getDatabasePath(db).toString(), db.getLocationUri()); assertEquals(db.getOwnerName(), SecurityUtils.getUser()); assertEquals(db.getOwnerType(), PrincipalType.USER); assertEquals(Warehouse.DEFAULT_CATALOG_NAME, db.getCatalogName());
@Test public void testCreateDatabaseDefaultValues() throws Exception { Database database = new DatabaseBuilder() .setName("dummy") .create(client, metaStore.getConf()); Database createdDatabase = client.getDatabase(database.getName()); Assert.assertNull("Comparing description", createdDatabase.getDescription()); Assert.assertEquals("Comparing location", metaStore.getWarehouseRoot() + "/" + createdDatabase.getName() + ".db", createdDatabase.getLocationUri()); Assert.assertEquals("Comparing parameters", new HashMap<String, String>(), createdDatabase.getParameters()); Assert.assertNull("Comparing privileges", createdDatabase.getPrivileges()); Assert.assertEquals("Comparing owner name", SecurityUtils.getUser(), createdDatabase.getOwnerName()); Assert.assertEquals("Comparing owner type", PrincipalType.USER, createdDatabase.getOwnerType()); }
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 " + SecurityUtils.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()); } }
public PrivilegeGrantInfo build() throws MetaException { if (privilege == null) { throw new MetaException("Privilege must be provided."); } if (grantor == null) { try { grantor = SecurityUtils.getUser(); grantorType = PrincipalType.USER; } catch (IOException e) { throw MetaStoreUtils.newMetaException(e); } } return new PrivilegeGrantInfo(privilege, createTime, grantor, grantorType, grantOption); } }
public Database build(Configuration conf) throws MetaException { if (name == null) throw new MetaException("You must name the database"); if (catalogName == null) catalogName = MetaStoreUtils.getDefaultCatalog(conf); Database db = new Database(name, description, location, params); db.setCatalogName(catalogName); try { if (ownerName == null) ownerName = SecurityUtils.getUser(); db.setOwnerName(ownerName); if (ownerType == null) ownerType = PrincipalType.USER; db.setOwnerType(ownerType); return db; } catch (IOException e) { throw MetaStoreUtils.newMetaException(e); } }
Warehouse.makePartName(partitionKeys, part.getValues()) + " has parent location " + partPath.getParent() + " which is not writable " + "by " + SecurityUtils.getUser());
public Table build(Configuration conf) throws MetaException { if (tableName == null) { throw new MetaException("You must set the table name"); } if (owner == null) { try { owner = SecurityUtils.getUser(); } catch (IOException e) { throw MetaStoreUtils.newMetaException(e); } } if (catName == null) catName = MetaStoreUtils.getDefaultCatalog(conf); Table t = new Table(tableName, dbName, owner, createTime, lastAccessTime, retention, buildSd(), partCols, tableParams, viewOriginalText, viewExpandedText, type); if (rewriteEnabled) t.setRewriteEnabled(true); if (temporary) t.setTemporary(temporary); t.setCatName(catName); if (!mvReferencedTables.isEmpty()) { CreationMetadata cm = new CreationMetadata(catName, dbName, tableName, mvReferencedTables); if (mvValidTxnList != null) cm.setValidTxnList(mvValidTxnList); t.setCreationMetadata(cm); } return t; }
throw new MetaException("Database not dropped since " + path + " is not writable by " + SecurityUtils.getUser()); throw new MetaException("Database metadata not deleted since table: " + materializedView.getTableName() + " has a parent location " + materializedViewPath.getParent() + " which is not writable by " + SecurityUtils.getUser()); throw new MetaException("Database metadata not deleted since table: " + table.getTableName() + " has a parent location " + tablePath.getParent() + " which is not writable by " + SecurityUtils.getUser());
throw new MetaException(target + " metadata not deleted since " + tblPath.getParent() + " is not writable by " + SecurityUtils.getUser());