Package com.google.walkaround.slob.shared

Examples of com.google.walkaround.slob.shared.ClientId


          throw new AssertionError("Not implemented");
        }
      };

    SlobId objectId = new SlobId(OBJECT_ID);
    ClientId clientId = new ClientId("s");
    String payload = "{\"a\": 5}";

    // I didn't track down exactly where the 12 comes from.
    int encodingOverhead = 12;
    int idSize = ROOT_ENTITY_KIND.length() + OBJECT_ID.length() + encodingOverhead;
    int versionSize = 8;
    int deltaSize = idSize + DELTA_ENTITY_KIND.length() + versionSize
        + MutationLog.DELTA_CLIENT_ID_PROPERTY.length() + clientId.getId().length()
        + MutationLog.DELTA_OP_PROPERTY.length() + payload.length();
    int snapshotSize = idSize + SNAPSHOT_ENTITY_KIND.length() + versionSize
        + MutationLog.SNAPSHOT_DATA_PROPERTY.length() + SNAPSHOT_STRING.length();
    log.info("deltaSize=" + deltaSize
        + ", snapshotSize=" + snapshotSize);
View Full Code Here


                  Key entityKey, MovableProperty property, BlobKey blobKey) {
                throw new AssertionError();
              }
            });
    MutationLog.Appender appender = mutationLog.prepareAppender().getAppender();
    ClientId clientId = new ClientId("fake-clientid");
    // This will generate one snapshot.
    appender.appendAll(
        ImmutableList.of(
            new ChangeData<String>(clientId, "delta 0 " + massiveString),
            new ChangeData<String>(clientId, "delta 1 " + massiveString),
View Full Code Here

*/
public final class ChangeDataParser {
  private ChangeDataParser() {}

  public static ChangeData<JavaScriptObject> fromJson(JsoView jso) {
    return new ChangeData<JavaScriptObject>(new ClientId(jso.getString("sid")), jso.getJso("op"));
  }
View Full Code Here

      }
    }
  }

  private ClientId getFakeClientId() {
    return new ClientId("");
  }
View Full Code Here

  @Override
  public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    SlobId convObjectId = new SlobId(requireParameter(req, "id"));
    String versionString = optionalParameter(req, "version", null);
    @Nullable Long version = versionString == null ? null : Long.parseLong(versionString);
    @Nullable ClientId clientId = version != null ? null
        : new ClientId(random64.next(
                // TODO(ohler): justify this number
                8));
    LoadedWave wave;
    try {
      if (version == null) {
View Full Code Here

    SlobId objectId = new SlobId(req.getSession().getObjectId());
    Preconditions.checkArgument(req.getVersion() >= 0, "Invalid version: %s", req.getVersion());
    Preconditions.checkArgument(!req.getPayload().isEmpty(), "Empty payload list");

    Update update = new Update(objectId,
        new ClientId(req.getSession().getClientId()),
        req.getVersion(),
        req.getPayload());
    log.info("mutateObject, update=" + update);

    UpResult result;
View Full Code Here

    return objectSessionFromProto(signedSession.getSession());
  }

  public static ObjectSession objectSessionFromProto(ObjectSessionProto proto) {
    return new ObjectSession(new SlobId(proto.getObjectId()),
        new ClientId(proto.getClientId()),
        proto.getStoreType());
  }
View Full Code Here

        JSONObject obj = new JSONObject(json);
        DeltaGsonImpl delta = new DeltaGsonImpl();
        delta.setAuthor(obj.getJSONObject("author").getString("email"));
        delta.setTimestampMillis(obj.getLong("time"));
        delta.setOperation(SERIALIZER.deserializeOp(obj.getJSONObject("op").toString()));
        return new ChangeData<String>(new ClientId(obj.getString("sid")),
            GsonProto.toJson(delta));
      } catch (MessageException e) {
        throw new RuntimeException("MessageException converting " + entity, e);
      } catch (JSONException e) {
        throw new RuntimeException("JSONException converting " + entity, e);
View Full Code Here

  }

  public static class DefaultDeltaEntityConverter implements DeltaEntityConverter {
    @Override public ChangeData<String> convert(Entity entity) {
      return new ChangeData<String>(
          new ClientId(
              DatastoreUtil.getExistingProperty(entity, DELTA_CLIENT_ID_PROPERTY, String.class)),
          DatastoreUtil.getExistingProperty(entity, DELTA_OP_PROPERTY, Text.class).getValue());
    }
View Full Code Here

      convMetadataStore.put(tx, convId, metadata);
      return true;
    }

    private ClientId getFakeClientId() {
      return new ClientId("");
    }
View Full Code Here

TOP

Related Classes of com.google.walkaround.slob.shared.ClientId

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.