Package org.apache.gora.persistency

Examples of org.apache.gora.persistency.StatefulHashMap


    return persistent;
  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  private void setField(T persistent, Field field, Map map) {
    persistent.put(field.pos(), new StatefulHashMap(map));
  }
View Full Code Here


              newRecord.put(member.pos(), persistent.get(member.pos()));
            }
            fieldValue = newRecord;
            break;
          case MAP:
            StatefulHashMap map = (StatefulHashMap) fieldValue;
            StatefulHashMap newMap = new StatefulHashMap();
            for (Object mapKey : map.keySet()) {
              newMap.put(mapKey, map.get(mapKey));
              newMap.putState(mapKey, map.getState(mapKey));
            }
            fieldValue = newMap;
            break;
          case ARRAY:
            GenericArray array = (GenericArray) fieldValue;
View Full Code Here

      Field field = fieldMap.get(fieldName);

      switch (field.schema().getType()) {
        case MAP:
          currentMap = new StatefulHashMap();
          currentPos = field.pos();
          currentFam = entry.getKey().getColumnFamily();
          currentSchema = field.schema().getValueType();
         
          currentMap.put(new Utf8(entry.getKey().getColumnQualifierData().toArray()), fromBytes(currentSchema, entry.getValue().get()));
View Full Code Here

    return persistent;
  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  private void setField(T persistent, Field field, Map map) {
    persistent.put(field.pos(), new StatefulHashMap(map));
  }
View Full Code Here

    return persistent;
  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  private void setField(T persistent, Field field, Map map) {
    persistent.put(field.pos(), new StatefulHashMap(map));
  }
View Full Code Here

          }
          if (qualMap == null) {
            continue;
          }
          Schema valueSchema = fieldSchema.getValueType();
          StatefulMap map = new StatefulHashMap();
          for (Entry<String, byte[]> e : qualMap.entrySet()) {
            Utf8 mapKey = new Utf8(e.getKey());
            map.put(mapKey, ByteUtils.fromBytes(e.getValue(), valueSchema, datumReader, null));
            map.putState(mapKey, State.CLEAN);
          }
          setField(persistent, field, map);
          break;
        case ARRAY:
          if (col.isSuperColumn()) {
View Full Code Here

      if (schema.getType() == Type.ARRAY) {
        schema = schema.getElementType();
      }
      serializer = GenericArraySerializer.get(schema);
    } else if (value instanceof StatefulHashMap) {
      StatefulHashMap map = (StatefulHashMap)value;
      if (map.size() == 0) {
        serializer = ByteBufferSerializer.get();
      }
      else {
        Object value0 = map.values().iterator().next();
        Schema schema = TypeUtils.getSchema(value0);
        serializer = StatefulHashMapSerializer.get(schema);
      }
    } else {
      serializer = SerializerTypeInferer.getSerializer(value);
View Full Code Here

      Field field = fieldMap.get(fieldName);

      switch (field.schema().getType()) {
        case MAP:
          currentMap = new StatefulHashMap();
          currentPos = field.pos();
          currentFam = entry.getKey().getColumnFamily();
          currentSchema = field.schema().getValueType();
         
          currentMap.put(new Utf8(entry.getKey().getColumnQualifierData().toArray()), fromBytes(currentSchema, entry.getValue().get()));
View Full Code Here

    return persistent;
  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  private void setField(T persistent, Field field, Map map) {
    persistent.put(field.pos(), new StatefulHashMap(map));
  }
View Full Code Here

      GenericArraySerializer serializer = GenericArraySerializer.get(fieldSchema.getElementType());
      GenericArray genericArray = serializer.fromByteBuffer(byteBuffer);
      value = genericArray;
    } else if (type == Type.MAP) {
      StatefulHashMapSerializer serializer = StatefulHashMapSerializer.get(fieldSchema.getValueType());
      StatefulHashMap map = serializer.fromByteBuffer(byteBuffer);
      value = map;
    } else {
      value = fromByteBuffer(fieldSchema, byteBuffer);
    }
View Full Code Here

TOP

Related Classes of org.apache.gora.persistency.StatefulHashMap

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.