Package com.google.walkaround.slob.server.SlobStore

Examples of com.google.walkaround.slob.server.SlobStore.HistoryResult


    try {
      int revision = Integer.parseInt(requireParameter(req, Params.REVISION));
      ConnectResult r = store.reconnect(session.getObjectId(), session.getClientId());
      if (r.getChannelToken() != null) {
        result.put("token", r.getChannelToken());
        HistoryResult history = store.loadHistory(session.getObjectId(), revision, null);
        result.put("history", HistoryHandler.serializeHistory(revision, history.getData()));
        result.put("head", r.getVersion());
      } else {
        // TODO(ohler): Figure out and document how the client-server protocol
        // works and what the different endpoints do.  It's not clear to me why
        // the above case returns history and head version (even though the
View Full Code Here


    }

    SlobId objectId = session.getObjectId();
    SlobStore store = storeSelector.get(session.getStoreType()).getSlobStore();
    JSONObject result = new JSONObject();
    HistoryResult history = store.loadHistory(objectId, startVersion, endVersion);
    result.put("history", serializeHistory(startVersion, history.getData()));
    result.put("more", history.hasMore());

    resp.setContentType("application/json");
    ServletUtil.writeJsonResult(resp.getWriter(), result.toString());
  }
View Full Code Here

      // We have to stop getting the history at conv version, because we're not
      // computing the metadata again for any concurrent ops that got added
      // since we loaded the convResult - so we don't want them getting added
      // into our diff snapshot. We can let the client catch up instead.
      HistoryResult history;
      try {
        history = convStore.loadHistory(convObjectId, intermediateVersion, convVersion);
      } catch (SlobNotFoundException e) {
        throw new RuntimeException(
            "Conv object disappeared when trying to load history: " + convObjectId);
      }

      // Graceful degrade to no diff-on-open if there was too much data.
      // TODO(danilatos): Potentially try to load more history if there's time,
      // or, memcache the current progress so a refresh would have a better
      // chance... or implement composition trees... or some other improvement.
      if (history.hasMore()) {
        return waveWithoutDiffs(convObjectId, convResult, convWavelet, loadedUdw);
      }

      List<String> mutations = mutations(history.getData());

      WaveletDiffSnapshot convSnapshot = serializer.createWaveletDiffMessage(
          intermediateWavelet, convWavelet, lastReadVersions, mutations);
      return new LoadedWave(convObjectId, convResult, convSnapshot, loadedUdw);
    }
View Full Code Here

TOP

Related Classes of com.google.walkaround.slob.server.SlobStore.HistoryResult

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.