Package org.kitesdk.data.spi

Examples of org.kitesdk.data.spi.URIPattern


  private Logger console;

  @BeforeClass
  public static void addMockRepoBuilder() throws Exception {
    Registration.register(
        new URIPattern("mock::id"), new URIPattern("mock::id"),
        new OptionBuilder<DatasetRepository>() {
          @Override
          public DatasetRepository getFromOptions(Map<String, String> options) {
            DatasetRepository repo = mock(DatasetRepository.class);
            repos.put(options.get("id"), repo);
View Full Code Here


public class Loader implements Loadable {

  @Override
  public void load() {
    Registration.register(
        new URIPattern("hbase::zk"),
        new URIPattern("hbase::zk/:dataset?namespace=default"),
        new OptionBuilder<DatasetRepository>() {
          @Override
          public DatasetRepository getFromOptions(Map<String, String> options) {
            Configuration conf = HBaseConfiguration.create(DefaultConfiguration.get());
            String[] hostsAndPort = parseHostsAndPort(options.get("zk"));
View Full Code Here

    OptionBuilder<DatasetRepository> managedBuilder = new ManagedBuilder();
    OptionBuilder<DatasetRepository> externalBuilder = new ExternalBuilder();

    Registration.register(
        new URIPattern("hive"),
        new URIPattern("hive::namespace/:dataset"),
        managedBuilder);
    Registration.register(
        new URIPattern("hive"),
        new URIPattern("hive::dataset?namespace=default"),
        managedBuilder);
    Registration.register(
        new URIPattern("hive"),
        new URIPattern("hive?namespace=default"),
        managedBuilder);

    Registration.register(
        new URIPattern("hive://" + NOT_SET),
        new URIPattern("hive:/:namespace/:dataset"),
        managedBuilder);
    Registration.register(
        new URIPattern("hive://" + NOT_SET),
        new URIPattern("hive:/:dataset?namespace=default"),
        managedBuilder);
    Registration.register(
        new URIPattern("hive://" + NOT_SET),
        new URIPattern("hive://" + NOT_SET + "?namespace=default"),
        managedBuilder);

    Registration.register(
        new URIPattern("hive:/*path?absolute=true"),
        new URIPattern("hive:/*path/:namespace/:dataset?absolute=true"),
        externalBuilder);
    Registration.register(
        new URIPattern("hive:*path"),
        new URIPattern("hive:*path/:namespace/:dataset"),
        externalBuilder);
  }
View Full Code Here

  private static final AtomicInteger ids = new AtomicInteger(0);
  private static final Map<String, DatasetRepository> repos = Maps.newHashMap();
  private static boolean registered = false;

  private static void registerMockRepoBuilder() {
    final URIPattern mockPattern = new URIPattern("mock::id");
    Registration.register(
        mockPattern, mockPattern,
        new OptionBuilder<DatasetRepository>() {
          @Override
          public DatasetRepository getFromOptions(Map<String, String> options) {
            DatasetRepository repo = repos.get(options.get("id"));
            if (repo == null) {
              repo = mock(org.kitesdk.data.spi.DatasetRepository.class);
              when(repo.getUri()).thenReturn(
                  URI.create("repo:" + mockPattern.construct(options)));
              repos.put(options.get("id"), repo);
            }
            return repo;
          }
        }
View Full Code Here

    }

    OptionBuilder<DatasetRepository> builder = new URIBuilder();

    Registration.register(
        new URIPattern("file:/*path?absolute=true"),
        new URIPattern("file:/*path/:namespace/:dataset?absolute=true"),
        builder);
    Registration.register(
        new URIPattern("file:*path"),
        new URIPattern("file:*path/:namespace/:dataset"),
        builder);

    Registration.register(
        new URIPattern("hdfs:/*path?absolute=true"),
        new URIPattern("hdfs:/*path/:namespace/:dataset?absolute=true"),
        builder);
    Registration.register(
        new URIPattern("hdfs:*path"),
        new URIPattern("hdfs:*path/:namespace/:dataset"),
        builder);

    Registration.register(
        new URIPattern("webhdfs:/*path?absolute=true"),
        new URIPattern("webhdfs:/*path/:namespace/:dataset?absolute=true"),
        builder);
  }
View Full Code Here

TOP

Related Classes of org.kitesdk.data.spi.URIPattern

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.