Package org.apache.avro.Schema

Examples of org.apache.avro.Schema.Field.schema()


    case RECORD: {
      for (Map.Entry<String, Field> entry : schema.getFields().entrySet()) {
        Field field = entry.getValue();
        if (field.order() == Field.Order.IGNORE) {
          GenericDatumReader.skip(field.schema(), d1);
          GenericDatumReader.skip(field.schema(), d2);
          continue;
        }
        int c = compare(d, field.schema());
        if (c != 0)
          return (field.order() != Field.Order.DESCENDING) ? c : -c;
View Full Code Here


        if (field.order() == Field.Order.IGNORE) {
          GenericDatumReader.skip(field.schema(), d1);
          GenericDatumReader.skip(field.schema(), d2);
          continue;
        }
        int c = compare(d, field.schema());
        if (c != 0)
          return (field.order() != Field.Order.DESCENDING) ? c : -c;
      }
      return 0;
    }
View Full Code Here

    T persistent = newPersistent();
    StateManager stateManager = persistent.getStateManager();
    for (String f : fields) {
      CassandraColumn col = columnMap.get(f);
      Field field = fieldMap.get(f);
      Schema fieldSchema = field.schema();
      Map<String, byte[]> qualMap;
      switch(fieldSchema.getType()) {
        case MAP:
          if (col.isSuperColumn()) {
            qualMap = result.getSuperColumn(col.family, col.superColumn);
View Full Code Here

    for (int i = 0; i < fields.size(); i++) {
      if (!stateManager.isDirty(obj, i)) {
        continue;
      }
      Field field = fields.get(i);
      Type type = field.schema().getType();
      Object o = obj.get(i);
      CassandraColumn col = columnMap.get(field.name());

      switch(type) {
      case MAP:
View Full Code Here

          for (Entry<Utf8, State> e : map.states().entrySet()) {
            Utf8 mapKey = e.getKey();
            switch (e.getValue()) {
            case DIRTY:
              qual = mapKey.toString();
              value = ByteUtils.toBytes(map.get(mapKey), field.schema().getValueType(), datumWriter);
              if (col.isSuperColumn()) {
                mutate.put(col.family, col.superColumn, qual, value);
              } else {
                mutate.put(col.family, qual, value);
              }
View Full Code Here

            j++;
          }
        }
        break;
      default:
        value = ByteUtils.toBytes(o, field.schema(), datumWriter);
        if (col.isSuperColumn()) {
          mutate.put(col.family, col.superColumn, col.column, value);
        } else {
          mutate.put(col.family, col.column, value);
        }
View Full Code Here

    for (int i = 0; iter.hasNext(); i++) {
      Field field = iter.next();
      if (!stateManager.isDirty(persistent, i)) {
        continue;
      }
      Type type = field.schema().getType();
      Object o = persistent.get(i);
      HBaseColumn hcol = mapping.getColumn(field.name());
      switch(type) {
        case MAP:
          if(o instanceof StatefulMap) {
View Full Code Here

            for (Entry<Utf8, State> e : map.states().entrySet()) {
              Utf8 mapKey = e.getKey();
              switch (e.getValue()) {
                case DIRTY:
                  byte[] qual = Bytes.toBytes(mapKey.toString());
                  byte[] val = toBytes(map.get(mapKey), field.schema().getValueType());
                  put.add(hcol.getFamily(), qual, val);
                  hasPuts = true;
                  break;
                case DELETED:
                  qual = Bytes.toBytes(mapKey.toString());
View Full Code Here

              hasPuts = true;
            }
          }
          break;
        default:
          put.add(hcol.getFamily(), hcol.getQualifier(), toBytes(o, field.schema()));
          hasPuts = true;
          break;
      }
    }
    if (hasPuts) {
View Full Code Here

    T persistent = newPersistent();
    StateManager stateManager = persistent.getStateManager();
    for (String f : fields) {
      HBaseColumn col = mapping.getColumn(f);
      Field field = fieldMap.get(f);
      Schema fieldSchema = field.schema();
      switch(fieldSchema.getType()) {
        case MAP:
          NavigableMap<byte[], byte[]> qualMap =
            result.getNoVersionMap().get(col.getFamily());
          if (qualMap == null) {
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.