public Catalog deepCopy() { return new Catalog(this); }
/** * Performs a deep copy on <i>other</i>. */ public GetCatalogResponse(GetCatalogResponse other) { if (other.isSetCatalog()) { this.catalog = new Catalog(other.catalog); } }
/** * Performs a deep copy on <i>other</i>. */ public CreateCatalogRequest(CreateCatalogRequest other) { if (other.isSetCatalog()) { this.catalog = new Catalog(other.catalog); } }
/** * Performs a deep copy on <i>other</i>. */ public AlterCatalogRequest(AlterCatalogRequest other) { if (other.isSetName()) { this.name = other.name; } if (other.isSetNewCat()) { this.newCat = new Catalog(other.newCat); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogResponse struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.catalog = new Catalog(); struct.catalog.read(iprot); struct.setCatalogIsSet(true); } } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, CreateCatalogRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.catalog = new Catalog(); struct.catalog.read(iprot); struct.setCatalogIsSet(true); } } }
public void read(org.apache.thrift.protocol.TProtocol iprot, CreateCatalogRequest struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // CATALOG if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.catalog = new Catalog(); struct.catalog.read(iprot); struct.setCatalogIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }
public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogResponse struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // CATALOG if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.catalog = new Catalog(); struct.catalog.read(iprot); struct.setCatalogIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }
case 2: // NEW_CAT if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.newCat = new Catalog(); struct.newCat.read(iprot); struct.setNewCatIsSet(true);
public Catalog build() throws MetaException { if (name == null) throw new MetaException("You must name the catalog"); if (location == null) throw new MetaException("You must give the catalog a location"); Catalog catalog = new Catalog(name, location); if (description != null) catalog.setDescription(description); return catalog; }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, AlterCatalogRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.name = iprot.readString(); struct.setNameIsSet(true); } if (incoming.get(1)) { struct.newCat = new Catalog(); struct.newCat.read(iprot); struct.setNewCatIsSet(true); } } }
@VisibleForTesting public static void createDefaultCatalog(RawStore ms, Warehouse wh) throws MetaException, InvalidOperationException { try { Catalog defaultCat = ms.getCatalog(DEFAULT_CATALOG_NAME); // Null check because in some test cases we get a null from ms.getCatalog. if (defaultCat !=null && defaultCat.getLocationUri().equals("TBD")) { // One time update issue. When the new 'hive' catalog is created in an upgrade the // script does not know the location of the warehouse. So we need to update it. LOG.info("Setting location of default catalog, as it hasn't been done after upgrade"); defaultCat.setLocationUri(wh.getWhRoot().toString()); ms.alterCatalog(defaultCat.getName(), defaultCat); } } catch (NoSuchObjectException e) { Catalog cat = new Catalog(DEFAULT_CATALOG_NAME, wh.getWhRoot().toString()); long time = System.currentTimeMillis() / 1000; cat.setCreateTime((int) time); cat.setDescription(Warehouse.DEFAULT_CATALOG_COMMENT); ms.createCatalog(cat); } }
private Catalog mCatToCat(MCatalog mCat) { Catalog cat = new Catalog(mCat.getName(), mCat.getLocationUri()); if (mCat.getDescription() != null) { cat.setDescription(mCat.getDescription()); } cat.setCreateTime(mCat.getCreateTime()); return cat; }
Catalog newCat = new Catalog(client.getCatalog(catNames[0])); String newLocation = MetaStoreTestUtils.getTestWarehouseDir("a_different_location"); newCat.setLocationUri(newLocation); newCat = new Catalog(client.getCatalog(catNames[1])); String newDescription = "an even more descriptive description"; newCat.setDescription(newDescription);
/** * Performs a deep copy on <i>other</i>. */ public CreateCatalogRequest(CreateCatalogRequest other) { if (other.isSetCatalog()) { this.catalog = new Catalog(other.catalog); } }
/** * Performs a deep copy on <i>other</i>. */ public AlterCatalogRequest(AlterCatalogRequest other) { if (other.isSetName()) { this.name = other.name; } if (other.isSetNewCat()) { this.newCat = new Catalog(other.newCat); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, CreateCatalogRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.catalog = new Catalog(); struct.catalog.read(iprot); struct.setCatalogIsSet(true); } } }
public Catalog build() throws MetaException { if (name == null) throw new MetaException("You must name the catalog"); if (location == null) throw new MetaException("You must give the catalog a location"); Catalog catalog = new Catalog(name, location); if (description != null) catalog.setDescription(description); return catalog; }
private void createIfNotExistsCatalog(String catalogName) throws TException { try { metastoreClient.getCatalog(catalogName); } catch(NoSuchObjectException e) { String catalogPath = Paths.get(hiveLocalDir.getAbsolutePath(), catalogName + ".catalog").toString(); metastoreClient.createCatalog(new Catalog(catalogName, catalogPath)); } }
private Catalog mCatToCat(MCatalog mCat) { Catalog cat = new Catalog(mCat.getName(), mCat.getLocationUri()); if (mCat.getDescription() != null) { cat.setDescription(mCat.getDescription()); } return cat; }