@Override
  public JsonElement serialize(GraphObject src, Type typeOfSrc, JsonSerializationContext context) {

    String localPropertyView = propertyView.get(null);
    JsonElement serializedOutput = null;

    switch (propertyFormat) {
      case NestedKeyValueType:
        serializedOutput =
            serializeNestedKeyValueType(src, typeOfSrc, context, true, localPropertyView, 0);

        break;

      case NestedKeyValue:
        serializedOutput =
            serializeNestedKeyValueType(src, typeOfSrc, context, false, localPropertyView, 0);

        break;

      case FlatNameValue:
        serializedOutput = serializeFlatNameValue(src, typeOfSrc, context, localPropertyView, 0);

        break;
    }

    return serializedOutput;
  }
  @Override
  public GraphObject deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
      throws JsonParseException {

    String localPropertyView = propertyView.get(null);
    GraphObject deserializedOutput = null;

    switch (propertyFormat) {
      case NestedKeyValueType:
        deserializedOutput =
            deserializeNestedKeyValueType(json, typeOfT, context, true, localPropertyView, 0);

        break;

      case NestedKeyValue:
        deserializedOutput =
            deserializeNestedKeyValueType(json, typeOfT, context, false, localPropertyView, 0);

        break;

      case FlatNameValue:
        deserializedOutput = deserializeFlatNameValue(json, typeOfT, context, localPropertyView, 0);

        break;
    }

    return deserializedOutput;
  }
Beispiel #3
0
 public void onException(Throwable ex) {
   UKV.remove(dest());
   Value v = DKV.get(progressKey());
   if (v != null) {
     ChunkProgress p = v.get();
     p = p.error(ex.getMessage());
     DKV.put(progressKey(), p);
   }
   cancel(ex);
 }