Examples of FamilyDesc


Examples of org.kiji.schema.avro.FamilyDesc

      /** Families with no ID assigned yet. */
      final List<FamilyLayout> unassigned = Lists.newArrayList();

      final Iterator<FamilyDesc> itFamilyDesc = lgDesc.getFamilies().iterator();
      while (itFamilyDesc.hasNext()) {
        final FamilyDesc familyDesc = itFamilyDesc.next();
        final boolean isRename = (familyDesc.getRenamedFrom() != null);
        final String refFName = isRename ? familyDesc.getRenamedFrom() : familyDesc.getName();
        familyDesc.setRenamedFrom(null);
        if (isRename && (reference == null)) {
          throw new InvalidLayoutException(String.format(
              "Invalid rename: no reference locality group '%s' for family '%s'.",
              getName(), refFName));
        }
        final FamilyLayout refFLayout =
            (reference != null) ? reference.getFamilyMap().get(refFName) : null;
        if (isRename && (refFLayout == null)) {
          throw new InvalidLayoutException(String.format(
              "Invalid rename: cannot find reference family '%s' in locality group '%s'.",
              refFName, getName()));
        }

        final ColumnId refFId = refFIdMap.remove(refFName);

        if (familyDesc.getDelete()) {
          if (refFId == null) {
            throw new InvalidLayoutException(String.format(
                "Deleted family '%s' unknown in reference locality group '%s'.",
                refFName, getName()));
          }
View Full Code Here

Examples of org.kiji.schema.avro.FamilyDesc

  private CellSchema getColumnSchema(final KijiColumnName columnName)
      throws NoSuchColumnException, InvalidLayoutException {
    final boolean groupType = columnName.isFullyQualified();

    // Get the family descriptor.
    final FamilyDesc soughtFd = getFamilyDesc(columnName);

    // If map type, return map schema.
    if (null != soughtFd.getMapSchema()) {
      if (groupType) {
        throw new InvalidLayoutException("A fully qualified map-type column name was provided.");
      } else {
        return soughtFd.getMapSchema();
      }
    }

    // Examine group type columns to return group type column schema.
    for (ColumnDesc cd : soughtFd.getColumns()) {
      if (cd.getName().equals(columnName.getQualifier())) {
        return cd.getColumnSchema();
      } else {
        for (String alias : cd.getAliases()) {
          if (alias.equals(columnName.getQualifier())) {
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.