Tabnine Logo
HiveRegisterStep.getException
Code IndexAdd Tabnine to your IDE (free)

How to use
getException
method
in
org.apache.gobblin.hive.HiveRegisterStep

Best Java code snippets using org.apache.gobblin.hive.HiveRegisterStep.getException (Showing top 2 results out of 315)

origin: apache/incubator-gobblin

@Override
public void execute() throws IOException {
 if (this.verifyBeforeRegistering) {
  if (!this.hiveSpec.getTable().getLocation().isPresent()) {
   throw getException("Table does not have a location parameter.");
  }
  Path tablePath = new Path(this.hiveSpec.getTable().getLocation().get());
  FileSystem fs = this.hiveSpec.getPath().getFileSystem(new Configuration());
  if (!fs.exists(tablePath)) {
   throw getException(String.format("Table location %s does not exist.", tablePath));
  }
  if (this.hiveSpec.getPartition().isPresent()) {
   if (!this.hiveSpec.getPartition().get().getLocation().isPresent()) {
    throw getException("Partition does not have a location parameter.");
   }
   Path partitionPath = new Path(this.hiveSpec.getPartition().get().getLocation().get());
   if (!fs.exists(this.hiveSpec.getPath())) {
    throw getException(String.format("Partition location %s does not exist.", partitionPath));
   }
  }
 }
 try (HiveRegister hiveRegister = HiveRegister.get(this.props, this.metastoreURI)) {
  log.info("Registering Hive Spec " + this.hiveSpec);
  ListenableFuture<Void> future = hiveRegister.register(this.hiveSpec);
  future.get();
 } catch (InterruptedException | ExecutionException ie) {
  throw new IOException("Hive registration was interrupted.", ie);
 }
}
origin: org.apache.gobblin/gobblin-hive-registration

@Override
public void execute() throws IOException {
 if (this.verifyBeforeRegistering) {
  if (!this.hiveSpec.getTable().getLocation().isPresent()) {
   throw getException("Table does not have a location parameter.");
  }
  Path tablePath = new Path(this.hiveSpec.getTable().getLocation().get());
  FileSystem fs = this.hiveSpec.getPath().getFileSystem(new Configuration());
  if (!fs.exists(tablePath)) {
   throw getException(String.format("Table location %s does not exist.", tablePath));
  }
  if (this.hiveSpec.getPartition().isPresent()) {
   if (!this.hiveSpec.getPartition().get().getLocation().isPresent()) {
    throw getException("Partition does not have a location parameter.");
   }
   Path partitionPath = new Path(this.hiveSpec.getPartition().get().getLocation().get());
   if (!fs.exists(this.hiveSpec.getPath())) {
    throw getException(String.format("Partition location %s does not exist.", partitionPath));
   }
  }
 }
 try (HiveRegister hiveRegister = HiveRegister.get(this.props, this.metastoreURI)) {
  log.info("Registering Hive Spec " + this.hiveSpec);
  ListenableFuture<Void> future = hiveRegister.register(this.hiveSpec);
  future.get();
 } catch (InterruptedException | ExecutionException ie) {
  throw new IOException("Hive registration was interrupted.", ie);
 }
}
org.apache.gobblin.hiveHiveRegisterStepgetException

Popular methods of HiveRegisterStep

  • <init>

Popular in Java

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • setScale (BigDecimal)
  • runOnUiThread (Activity)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now