Package org.kitesdk.data

Examples of org.kitesdk.data.URIBuilder


      }
    }
    Dao dao = SpecificAvroDao.buildCompositeDaoWithEntityManager(tablePool,
        tableName, subEntityClasses, schemaManager);
    return new DaoDataset<E>(namespace, name, dao, descriptors.get(0),
        new URIBuilder(repositoryUri, namespace, name).build(), type);
  }
View Full Code Here


      dao = new SpecificAvroDao(tablePool, tableName, entityName, schemaManager);
    } else {
      dao = new GenericAvroDao(tablePool, tableName, entityName, schemaManager);
    }
    return new DaoDataset(namespace, name, dao, descriptor,
        new URIBuilder(repositoryUri, namespace, name).build(), type);
  }
View Full Code Here

        .toString();
  }

  @Override
  public URI getUri() {
    URIBuilder builder = new URIBuilder(dataset.getUri());
    for (Map.Entry<String, String> entry : constraints.toQueryMap().entrySet()) {
      builder.with(entry.getKey(), entry.getValue());
    }
    return builder.build();
  }
View Full Code Here

    Dataset<Record> outputDataset = repo.create("ns", "out", new DatasetDescriptor.Builder()
        .schema(USER_SCHEMA).partitionStrategy(partitionStrategy).build());

    writeTestUsers(inputDataset, 10);

    URI sourceViewUri = new URIBuilder(repo.getUri(), "ns", "in").with("username",
        "test-0").build();
    View<Record> inputView = Datasets.<Record, Dataset<Record>> load(sourceViewUri,
        Record.class);
    Assert.assertEquals(1, datasetSize(inputView));
   
    Pipeline pipeline = new MRPipeline(TestCrunchDatasets.class);
    PCollection<GenericData.Record> data = pipeline.read(CrunchDatasets
        .asSource(sourceViewUri, GenericData.Record.class));
    URI targetViewUri = new URIBuilder(repo.getUri(), "ns", "out").with(
        "email", "email-0").build();
    pipeline.write(data, CrunchDatasets.asTarget(targetViewUri),
        Target.WriteMode.APPEND);
    pipeline.run();
View Full Code Here

    writeTestUsers(inputDataset, 10);

    Pipeline pipeline = new MRPipeline(TestCrunchDatasets.class);
    PCollection<GenericData.Record> data = pipeline.read(
        CrunchDatasets.asSource(new URIBuilder(repo.getUri(), "ns", "in").build(),
            GenericData.Record.class));
    pipeline.write(data, CrunchDatasets.asTarget(
        new URIBuilder(repo.getUri(), "ns", "out").build()), Target.WriteMode.APPEND);
    pipeline.run();

    Assert.assertEquals(10, datasetSize(outputDataset));
  }
View Full Code Here

  String buildDatasetUri(String uriOrName) {
    if (isDataUri(uriOrName)) {
      return uriOrName;
    }
    return new URIBuilder(buildRepoURI(), namespace, uriOrName).build().toString();
  }
View Full Code Here

        .namespace(namespace)
        .name(name)
        .configuration(conf)
        .descriptor(updatedDescriptor)
        .type(type)
        .uri(new URIBuilder(getUri(), namespace, name).build())
        .partitionKey(updatedDescriptor.isPartitioned() ? new PartitionKey() : null)
        .partitionListener(getPartitionListener())
        .build();
  }
View Full Code Here

        .namespace(namespace)
        .name(name)
        .configuration(conf)
        .descriptor(descriptor)
        .type(type)
        .uri(new URIBuilder(getUri(), namespace, name).build())
        .partitionKey(descriptor.isPartitioned() ? new PartitionKey() : null)
        .partitionListener(getPartitionListener())
        .build();

    LOG.debug("Loaded dataset:{}", ds);
View Full Code Here

        .namespace(namespace)
        .name(name)
        .configuration(conf)
        .descriptor(newDescriptor)
        .type(type)
        .uri(new URIBuilder(getUri(), namespace, name).build())
        .partitionKey(newDescriptor.isPartitioned() ? new PartitionKey() : null)
        .partitionListener(getPartitionListener())
        .build();
  }
View Full Code Here

TOP

Related Classes of org.kitesdk.data.URIBuilder

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.