Examples of UriPattern


Examples of com.cloudera.cdk.data.spi.URIPattern

*/
public class Loader implements Loadable {

  @Override
  public void load() {
    Accessor.getDefault().registerDatasetRepository(new URIPattern(URI.create("hbase:*zk")),
        new OptionBuilder<DatasetRepository>() {
          @Override
          public DatasetRepository getFromOptions(Map<String, String> options) {
            Configuration conf = HBaseConfiguration.create();
            String[] hostsAndPort = parseHostsAndPort(options.get("zk"));
View Full Code Here

Examples of com.cloudera.cdk.data.spi.URIPattern

    // Hive-managed data sets
    final OptionBuilder<DatasetRepository> managedBuilder =
        new ManagedBuilder(conf);
    Accessor.getDefault().registerDatasetRepository(
        new URIPattern(URI.create("hive")), managedBuilder);
    Accessor.getDefault().registerDatasetRepository(
        new URIPattern(URI.create("hive://" + hiveAuthority + "/")),
        managedBuilder);

    // external data sets
    final OptionBuilder<DatasetRepository> externalBuilder =
        new ExternalBuilder(conf);

    String hdfsAuthority;
    try {
      // Use a HDFS URI with no authority and the environment's configuration
      // to find the default HDFS information
      final URI hdfs = FileSystem.get(URI.create("hdfs:/"), conf).getUri();
      hdfsAuthority = "&hdfs-host=" + hdfs.getHost() +
          "&hdfs-port=" + hdfs.getPort();
    } catch (IOException ex) {
      logger.warn(
          "Could not locate HDFS, hdfs-host and hdfs-port " +
          "will not be set by default for Hive repositories.");
      hdfsAuthority = "";
    }

    Accessor.getDefault().registerDatasetRepository(
        new URIPattern(URI.create("hive://" + hiveAuthority +
            "/*path?absolute=true" + hdfsAuthority)),
        externalBuilder);
    Accessor.getDefault().registerDatasetRepository(
        new URIPattern(URI.create("hive:*path")), externalBuilder);
  }
View Full Code Here

Examples of com.cloudera.cdk.data.spi.URIPattern

    final Configuration conf = new Configuration();
    final OptionBuilder<DatasetRepository> builder =
        new URIBuilder(conf);

    com.cloudera.cdk.data.impl.Accessor.getDefault().registerDatasetRepository(
        new URIPattern(URI.create("file:/*path?absolute=true")), builder);
    com.cloudera.cdk.data.impl.Accessor.getDefault().registerDatasetRepository(
        new URIPattern(URI.create("file:*path")), builder);

    String hdfsAuthority;
    try {
      // Use a HDFS URI with no authority and the environment's configuration
      // to find the default HDFS information
      final URI hdfs = FileSystem.get(URI.create("hdfs:/"), conf).getUri();
      hdfsAuthority = hdfs.getAuthority();
    } catch (IOException ex) {
      logger.warn(
          "Could not locate HDFS, host and port will not be set by default.");
      hdfsAuthority = "";
    }

    com.cloudera.cdk.data.impl.Accessor.getDefault().registerDatasetRepository(
        new URIPattern(URI.create(
            "hdfs://" + hdfsAuthority + "/*path?absolute=true")),
        builder);
    com.cloudera.cdk.data.impl.Accessor.getDefault().registerDatasetRepository(
        new URIPattern(URI.create("hdfs:*path")), builder);
  }
View Full Code Here

Examples of com.sun.jersey.api.uri.UriPattern

                    ViewableRule.class);
            ci.inject(r);

            // The matching rule for a sub-resource template
            patterns.add(new PatternRulePair<UriRule>(
                    new UriPattern("/([^/]+)"), r));
            // The matching rule for an index template
            patterns.add(new PatternRulePair<UriRule>(
                    UriPattern.EMPTY, r));
        }
        // The terminating rule when the path is not fully consumed and accepted
        patterns.add(new PatternRulePair<UriRule>(
                new UriPattern(".*"), new TerminatingRule()));
        // The terminating rule when the path is fully consumed and accepted
        patterns.add(new PatternRulePair<UriRule>(
                UriPattern.EMPTY, new TerminatingRule()));
        // Create the sequential rules
        final UriRules<UriRule> sequentialRules =
View Full Code Here

Examples of com.sun.jersey.api.uri.UriPattern

            ViewableRule r = new ViewableRule();
            ci.inject(r);

            // The matching rule for a sub-resource template
            patterns.add(new PatternRulePair<UriRule>(
                    new UriPattern("/([^/]+)"), r));       
            // The matching rule for an index template
            patterns.add(new PatternRulePair<UriRule>(
                    UriPattern.EMPTY, r));                   
        }        
        // The terminating rule when the path is not fully consumed and accepted
        patterns.add(new PatternRulePair<UriRule>(
                new UriPattern(".*"), new TerminatingRule()));
        // The terminating rule when the path is fully consumed and accepted
        patterns.add(new PatternRulePair<UriRule>(
                UriPattern.EMPTY, new TerminatingRule()));       
        // Create the sequential rules
        UriRules<UriRule> sequentialRules =
View Full Code Here

Examples of com.sun.jersey.api.uri.UriPattern

                    ViewableRule.class);
            ci.inject(r);

            // The matching rule for a sub-resource template
            patterns.add(new PatternRulePair<UriRule>(
                    new UriPattern("/([^/]+)"), r));       
            // The matching rule for an index template
            patterns.add(new PatternRulePair<UriRule>(
                    UriPattern.EMPTY, r));                   
        }        
        // The terminating rule when the path is not fully consumed and accepted
        patterns.add(new PatternRulePair<UriRule>(
                new UriPattern(".*"), new TerminatingRule()));
        // The terminating rule when the path is fully consumed and accepted
        patterns.add(new PatternRulePair<UriRule>(
                UriPattern.EMPTY, new TerminatingRule()));       
        // Create the sequential rules
        final UriRules<UriRule> sequentialRules =
View Full Code Here

Examples of org.exoplatform.services.rest.uri.UriPattern

    *         because resource with the sane {@link UriPattern} already
    *         registered
    */
   public void addResource(final ObjectFactory<AbstractResourceDescriptor> resourceFactory)
   {
      UriPattern pattern = resourceFactory.getObjectModel().getUriPattern();
      synchronized (rootResources)
      {
         for (ObjectFactory<AbstractResourceDescriptor> resource : rootResources)
         {
            if (resource.getObjectModel().getUriPattern().equals(resourceFactory.getObjectModel().getUriPattern()))
View Full Code Here

Examples of org.exoplatform.services.rest.uri.UriPattern

    *         template not found
    */
   public ObjectFactory<AbstractResourceDescriptor> removeResource(String path)
   {
      ObjectFactory<AbstractResourceDescriptor> resource = null;
      UriPattern pattern = new UriPattern(path);
      synchronized (rootResources)
      {
         for (Iterator<ObjectFactory<AbstractResourceDescriptor>> iter = rootResources.iterator(); iter.hasNext()
            && resource == null;)
         {
            ObjectFactory<AbstractResourceDescriptor> next = iter.next();
            UriPattern resourcePattern = next.getObjectModel().getUriPattern();
            if (pattern.equals(resourcePattern))
            {
               iter.remove();
               resource = next;
            }
View Full Code Here

Examples of org.exoplatform.services.rest.uri.UriPattern

   {
      super(resourceClass, scope);
      if (path != null)
      {
         this.path = new PathValue(path.value());
         uriPattern = new UriPattern(path.value());
      }
      else
      {
         this.path = null;
         uriPattern = null;
View Full Code Here

Examples of org.exoplatform.services.rest.uri.UriPattern

   {
      List<ObjectFactory<FilterDescriptor>> l = new ArrayList<ObjectFactory<FilterDescriptor>>();
      List<String> capturingValues = new ArrayList<String>();
      for (Map.Entry<UriPattern, List<ObjectFactory<FilterDescriptor>>> e : m.entrySet())
      {
         UriPattern uriPattern = e.getKey();
         if (uriPattern != null)
         {
            if (e.getKey().match(path, capturingValues))
            {
               int len = capturingValues.size();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.