本文整理了Java中org.kitesdk.data.Dataset.getUri()
方法的一些代码示例,展示了Dataset.getUri()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dataset.getUri()
方法的具体详情如下:
包路径:org.kitesdk.data.Dataset
类名称:Dataset
方法名:getUri
[英]Return a URI for this Dataset. The returned URI should load a copy of this dataset when passed to Datasets#load(java.net.URI,java.lang.Class).
[中]返回此数据集的URI。返回的URI在传递给Datasets#load(java.net.URI,java.lang.Class)时应加载此dataset的副本。
代码示例来源:origin: kite-sdk/kite
@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();
}
代码示例来源:origin: org.kitesdk/kite-tools
private URI getLegacyRepoUri(Dataset<GenericRecord> dataset) {
return FlumeConfigCommand.this.getLegacyRepoUri(dataset.getUri(), dataset.getNamespace());
}
代码示例来源:origin: org.kitesdk/kite-tools
private static void printInfo(Logger console, Dataset<?> dataset) {
DatasetDescriptor desc = dataset.getDescriptor();
String schema = ColumnMappingParser.removeEmbeddedMapping(
PartitionStrategyParser.removeEmbeddedStrategy(desc.getSchema()))
.toString(true);
Collection<String> properties = desc.listProperties();
console.info("\nDataset \"{}\":", dataset.getName());
console.info("\tURI: \"{}\"", dataset.getUri());
console.info("\tSchema: {}", indent(schema));
if (desc.isPartitioned()) {
console.info("\tPartition strategy: {}",
indent(desc.getPartitionStrategy().toString(true)));
} else {
console.info("\tNot partitioned");
}
if (desc.isColumnMapped()) {
console.info("\tColumn mapping: {}",
indent(desc.getColumnMapping().toString(true)));
}
if (!properties.isEmpty()) {
StringBuilder sb = new StringBuilder();
for (String prop : properties) {
sb.append("\n\t\t").append(prop).append("=")
.append(desc.getProperty(prop));
}
console.info("\tProperties:{}", sb.toString());
}
}
代码示例来源:origin: kite-sdk/kite
public DatasetTarget(View<E> view) {
this.view = view;
Configuration temp = emptyConf();
// use appendTo since handleExisting checks for existing data
DatasetKeyOutputFormat.configure(temp).appendTo(view);
this.formatBundle = outputBundle(temp);
this.uri = view.getDataset().getUri();
}
代码示例来源:origin: kite-sdk/kite
protected AbstractRefinableView(AbstractRefinableView<?> view, Schema schema, Class<E> type) {
if (view.dataset instanceof AbstractDataset) {
this.dataset = ((AbstractDataset<?>) view.dataset).asType(type);
} else {
this.dataset = Datasets.load(view.dataset.getUri(), type);
}
this.comparator = view.comparator;
this.constraints = view.constraints;
// thread-safe, so okay to reuse when views share a partition strategy
this.keys = view.keys;
// Resolve our type according to the given schema
this.accessor = DataModelUtil.accessor(type, schema);
this.entityTest = constraints.toEntityPredicate(accessor);
Schema datasetSchema = dataset.getDescriptor().getSchema();
this.canRead = SchemaValidationUtil.canRead(
datasetSchema, accessor.getReadSchema());
this.canWrite = SchemaValidationUtil.canRead(
accessor.getWriteSchema(), datasetSchema);
IncompatibleSchemaException.check(canRead || canWrite,
"The type cannot be used to read from or write to the dataset:\n" +
"Type schema: %s\nDataset schema: %s",
getSchema(), datasetSchema);
}
内容来源于网络,如有侵权,请联系作者删除!