Package org.kiji.schema

Examples of org.kiji.schema.KijiURIException


      }
      if (!userInfo.contains(":")) {
        return userInfo;
      }
      if (1 != CharMatcher.is(':').countIn(userInfo)) {
        throw new KijiURIException(
            uri.toString(), "Cannot have more than one ':' in URI user info");
      }
      final List<String> usernameAndPassword =
          ImmutableList.copyOf(Splitter.on(':').split(userInfo));
      Preconditions.checkArgument(2 == usernameAndPassword.size());
View Full Code Here


      }
      if (!userInfo.contains(":")) {
        return null;
      }
      if (1 != CharMatcher.is(':').countIn(userInfo)) {
        throw new KijiURIException(
            uri.toString(), "Cannot have more than one ':' in URI user info");
      }
      final List<String> usernameAndPassword =
          ImmutableList.copyOf(Splitter.on(':').split(userInfo));
      Preconditions.checkArgument(2 == usernameAndPassword.size());
View Full Code Here

        switch (splits.size()) {
          case 1:
            return ImmutableList.copyOf(Splitter.on(',').split(segment));
          case 2:
            if (splits.get(0).contains(",")) {
              throw new KijiURIException(
                  uri.toString(), "Multiple ZooKeeper hosts must be parenthesized.");
            }
            return ImmutableList.of(splits.get(0));
          default:
            throw new KijiURIException(
                uri.toString(), "Invalid ZooKeeper ensemble cluster identifier.");
        }
      }
    }
View Full Code Here

        return null;
      }
      try {
        return Integer.parseInt(parts.get(1));
      } catch (NumberFormatException nfe) {
        throw new KijiURIException(uri.toString(),
            String.format("Can not parse port '%s'.", parts.get(1)));
      }
    }
View Full Code Here

     * @throws KijiURIException If the authority is invalid.
     */
    private ZooKeeperAuthorityParser(URI uri) {
      final String authority = uri.getAuthority();
      if (null == authority) {
        throw new KijiURIException(uri.toString(), "ZooKeeper ensemble missing.");
      }

      if (authority.equals(KijiURI.ENV_URI_STRING)) {
        mZookeeperQuorum = ENV_ZOOKEEPER_QUORUM;
        mZookeeperClientPort = ENV_ZOOKEEPER_CLIENT_PORT;
View Full Code Here

      final List<String> segments =
          ImmutableList.copyOf(Splitter.on('/').omitEmptyStrings().split(uri.getPath()));
      final int size = segments.size();

      if (size - instanceIndex > 3) {
        throw new KijiURIException(uri.toString(), String.format("Too many path segments."));
      }
      final int tableIndex = instanceIndex + 1;
      final int columnsIndex = tableIndex + 1;

      if (size > instanceIndex  && !segments.get(instanceIndex).equals(KijiURI.UNSET_URI_STRING)) {
View Full Code Here

      uriWithScheme = String.format("%s/%s/", KConstants.DEFAULT_HBASE_URI, uri);
    }
    try {
      return new HBaseKijiURIParser().parse(new URI(uriWithScheme));
    } catch (URISyntaxException exn) {
      throw new KijiURIException(uri, exn.getMessage());
    }
  }
View Full Code Here

      return newBuilder(uri.toString()).build();
    } catch (URISyntaxException e) {
      // This should never happen
      throw new InternalKijiError(String.format("KijiURI was incorrectly constructed: %s.", this));
    } catch (IllegalArgumentException e) {
      throw new KijiURIException(this.toString(),
          String.format("Path can not be resolved: %s", path));
    }
  }
View Full Code Here

      }

      try {
        return Lookups.getNamed(KijiURIParser.class).lookup(scheme).parse(uri);
      } catch (NoSuchProviderException e) {
        throw new KijiURIException(
            uri.toString(),
            String.format("No parser available for Kiji scheme '%s'.", scheme));
      }
    }
View Full Code Here

      }
      // Should have no more than a single @ appear!
      final List<String> userInfoAndHostPortInfo =
          ImmutableList.copyOf(Splitter.on('@').split(authority));
      if (2 != userInfoAndHostPortInfo.size()) {
        throw new KijiURIException(
            uri.toString(), "Cannot have more than one '@' in URI authority");
      }
      return userInfoAndHostPortInfo.get(0);
    }
View Full Code Here

TOP

Related Classes of org.kiji.schema.KijiURIException

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.