Package com.google.walkaround.proto

Examples of com.google.walkaround.proto.ImportSettings


          sourceInstanceFactory.parseUnchecked(requireParameter(req, "instance"));
      // Rather than enqueueing just one interval 2008-01-01 to 2013-01-01, we
      // split that interval into random parts.  See the note on randomization
      // in FindRemoteWavesProcessor.
      log.info("Enqueueing find waves tasks");
      @Nullable ImportSettings autoImportSettings;
      if ("findwaves".equals(action)) {
        autoImportSettings = null;
      } else {
        autoImportSettings = new ImportSettingsGsonImpl();
        autoImportSettings.setSynthesizeHistory(!preserveHistory);
        if ("private".equals(requireParameter(req, "sharingmode"))) {
          autoImportSettings.setSharingMode(ImportSharingMode.PRIVATE);
        } else if ("shared".equals(requireParameter(req, "sharingmode"))) {
          autoImportSettings.setSharingMode(ImportSharingMode.SHARED);
        } else if ("privateunlessparticipant".equals(requireParameter(req, "sharingmode"))) {
          autoImportSettings.setSharingMode(ImportSharingMode.PRIVATE_UNLESS_PARTICIPANT);
        } else {
          throw new BadRequestException("Bad sharingmode");
        }
      }
      enqueueTasks(findProcessor.get().makeRandomTasksForInterval(instance,
            DaysSinceEpoch.fromYMD(2008, 1, 1),
            DaysSinceEpoch.fromYMD(2013, 1, 1),
            autoImportSettings));
    } else if ("importwavelet".equals(action)) {
      SourceInstance instance =
          sourceInstanceFactory.parseUnchecked(requireParameter(req, "instance"));
      WaveId waveId = WaveId.deserialise(requireParameter(req, "waveid"));
      WaveletId waveletId = WaveletId.deserialise(requireParameter(req, "waveletid"));
      ImportWaveletTask task = new ImportWaveletTaskGsonImpl();
      task.setInstance(instance.serialize());
      task.setWaveId(waveId.serialise());
      task.setWaveletId(waveletId.serialise());
      ImportSettings settings = new ImportSettingsGsonImpl();
      if ("private".equals(requireParameter(req, "sharingmode"))) {
        settings.setSharingMode(ImportSettings.ImportSharingMode.PRIVATE);
      } else if ("shared".equals(requireParameter(req, "sharingmode"))) {
        settings.setSharingMode(ImportSettings.ImportSharingMode.SHARED);
      } else {
        throw new BadRequestException("Unexpected import sharing mode");
      }
      settings.setSynthesizeHistory(!preserveHistory);
      task.setSettings(settings);
      @Nullable String existingSlobIdToIgnore = optionalParameter(req, "ignoreexisting", null);
      if (existingSlobIdToIgnore != null) {
        task.setExistingSlobIdToIgnore(existingSlobIdToIgnore);
      }
View Full Code Here


    List<RobotSearchDigest> results = searchBetween(instance, onOrAfterDays, beforeDays);
    log.info("Search found " + results.size() + " waves");
    if (results.isEmpty()) {
      return ImmutableList.of();
    }
    @Nullable ImportSettings autoImportSettings =
        task.hasAutoImportSettings() ? task.getAutoImportSettings() : null;
    // NOTE(ohler): Having many concurrent tasks like this that all need to write to
    // the PerUserTable leads to a lot of write contention.  We'll just have to
    // keep max-concurrent-requests low.
    scheduleFindWaveletTasks(instance, results, autoImportSettings);
View Full Code Here

          historyWriter.append(participantFixup);
          historyWriter.finish();
        } catch (ChangeRejected e) {
          log.log(Level.SEVERE, "Change rejected somewhere at or before version " + version
              + ", re-importing without history", e);
          ImportSettings settings = task.getSettings();
          settings.setSynthesizeHistory(true);
          task.setSettings(settings);
          throw TaskCompleted.withFollowup(task);
        }
      }
      log.info("Imported wavelet " + waveletName + " as local id " + newId);
View Full Code Here

TOP

Related Classes of com.google.walkaround.proto.ImportSettings

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.