Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2013 Cloudera Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package com.cloudera.cdk.maven.plugins;
import  org.apache.hadoop.conf.Configuration;
abstract class AbstractDatasetMojo extends AbstractHadoopMojo {

  
The root directory of the dataset repository. Optional if using HCatalog for metadata storage.
  @Parameter(property = "cdk.rootDirectory")
  protected String rootDirectory;

  
If true, store dataset metadata in HCatalog, otherwise store it on the filesystem.
  @Parameter(property = "cdk.hcatalog")
  protected boolean hcatalog = true;

  
Hadoop configuration properties.
  @Parameter(property = "cdk.hadoopConfiguration")
  private Configuration getConf() {
    Configuration conf = new Configuration(false);
    for (String key : .stringPropertyNames()) {
      String value = .getProperty(key);
      conf.set(keyvalue);
    }
    return conf;
  }
    DatasetRepository repo;
    if (! &&  == null) {
      throw new IllegalArgumentException("Root directory must be specified if not " +
          "using HCatalog.");
    }
    if ( != null) {
      try {
        URI uri = new URI();
        if () {
          .rootDirectory(uri);
        } else {
          .rootDirectory(uri);
        }
      } catch (URISyntaxException e) {
        throw new IllegalArgumentException(e);
      }
    }
    if () {
      repo = .configuration(getConf()).get();
    } else {
      repo = .configuration(getConf()).get();
    }
    return repo;
  }
New to GrepCode? Check out our FAQ X