Examples of ImportSettings


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

Examples of com.google.walkaround.proto.ImportSettings

    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

Examples of com.google.walkaround.proto.ImportSettings

          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

Examples of org.jdesktop.wonderland.client.jme.artimport.ImportSettings

    void importModel(final File origFile, boolean attachToAvatar)
            throws IOException {
        avatarMoveCB.setSelected(attachToAvatar);

        modelX3dTF.setText(origFile.getAbsolutePath());
        importSettings = new ImportSettings(origFile.toURI().toURL());

        sessionFrame.asyncLoadModel(
                importSettings, new ImportSessionFrame.LoadCompleteListener() {

            public void loadComplete(ImportedModel importedModel) {
View Full Code Here

Examples of org.lilyproject.tools.import_.cli.JsonImport.ImportSettings

    }

    @Test
    public void testLineBasedJsonImport() throws Exception {
        JsonImport.loadJsonLines(table, repository,
                getClass().getResourceAsStream("json_line_input.txt"), new ImportSettings());

        Record record = table.read(repository.getIdGenerator().fromString("USER.jsonline1"));
        assertEquals("hello1", record.getField(new QName("ns", "stringField")));

        record = table.read(repository.getIdGenerator().fromString("USER.jsonline2"));
View Full Code Here

Examples of org.lilyproject.tools.import_.cli.JsonImport.ImportSettings

        assertEquals("hello2", record.getField(new QName("ns", "stringField")));
    }

    @Test
    public void testIgnoreEmptyFields() throws Exception {
        ImportSettings settings = new ImportSettings();
        settings.recordReader = IgnoreAndDeleteEmptyFieldsRecordReader.INSTANCE;
        JsonImport.load(table, repository, getClass().getResourceAsStream("emptyfieldsignore_1.json"), settings);

        QName stringField = new QName("ns", "string");
        QName integerField = new QName("ns", "integer");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.