Java Code Examples for org.kitesdk.data.URIBuilder#with()

The following examples show how to use org.kitesdk.data.URIBuilder#with() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigUtil.java    From sqoop-on-spark with Apache License 2.0 6 votes vote down vote up
/**
 * Returns a dataset uri, including the filesystem location part, if it is
 * provided separated,
 */
public static String buildDatasetUri(String authority, String uri) {
  if (!Strings.isNullOrEmpty(authority) && !uri.contains("://")) {
    URIBuilder builder = new URIBuilder(uri);

    String[] parts = authority.split(":");
    if (parts.length > 0) {
      builder.with("auth:host", parts[0]);
    }
    if (parts.length > 1) {
      builder.with("auth:port", parts[1]);
    }

    return builder.build().toString().replaceFirst("view:", "dataset:");
  }

  return uri;
}
 
Example 2
Source File: AbstractRefinableView.java    From kite with Apache License 2.0 5 votes vote down vote up
@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();
}