Examples of MInput


Examples of org.apache.sqoop.model.MInput

  @Override
  protected List<MForm> getForms() {
    List<MForm> forms = new LinkedList<MForm>();

    List<MInput<?>> inputs;
    MInput input;

    inputs = new LinkedList<MInput<?>>();

    input = new MStringInput("f.String", false, (short)30);
    inputs.add(input);
View Full Code Here

Examples of org.apache.sqoop.model.MInput

      JSONObject input = (JSONObject) inputs.get(i);
      MInputType type =
          MInputType.valueOf((String) input.get(FORM_INPUT_TYPE));
      String name = (String) input.get(FORM_INPUT_NAME);
      Boolean sensitive = (Boolean) input.get(FORM_INPUT_SENSITIVE);
      MInput mInput = null;
      switch (type) {
        case STRING: {
          long size = (Long) input.get(FORM_INPUT_SIZE);
          mInput = new MStringInput(name, sensitive.booleanValue(), (short) size);
          break;
        }
        case MAP: {
          mInput = new MMapInput(name, sensitive.booleanValue());
          break;
        }
        case INTEGER: {
          mInput = new MIntegerInput(name, sensitive.booleanValue());
          break;
        }
        case BOOLEAN: {
          mInput = new MBooleanInput(name, sensitive.booleanValue());
          break;
        }
        case ENUM: {
          String values = (String) input.get(FORM_INPUT_VALUES);
          mInput = new MEnumInput(name, sensitive.booleanValue(), values.split(","));
          break;
        }
      }

      // Propagate form ID
      mInput.setPersistenceId((Long)input.get(ID));

      // Propagate form optional value
      if(input.containsKey(FORM_INPUT_VALUE)) {
        switch (type) {
        case MAP:
          try {
            mInput.setValue((Map<String, String>)input.get(FORM_INPUT_VALUE));
          } catch (ClassCastException e) {
            throw new SqoopException(SerializationError.SERIALIZATION_001, name + " requires a 'map' value.");
          }
          break;
        default:
          mInput.restoreFromUrlSafeValueString(
              (String) input.get(FORM_INPUT_VALUE));
          break;
        }
      }
      mInputs.add(mInput);
View Full Code Here

Examples of org.apache.sqoop.model.MInput

    }
    for (MForm form : target) {
      List<MInput<?>> inputs = form.getInputs();
      MForm originalForm = formMap.get(form.getName());
      for (MInput input : inputs) {
        MInput originalInput = originalForm.getInput(input.getName());
        input.setValue(originalInput.getValue());
      }
    }
  }
View Full Code Here

Examples of org.apache.sqoop.model.MInput

  protected List<MForm> getForms() {
    List<MForm> forms = new LinkedList<MForm>();

    List<MInput<?>> inputs;
    MInput input;

    inputs = new LinkedList<MInput<?>>();
    input = new MStringInput("I1", false, (short)30);
    inputs.add(input);
    input = new MMapInput("I2", false);
View Full Code Here

Examples of org.apache.sqoop.model.MInput

        String inputEnumValues = rsetInput.getString(8);
        String value = rsetInput.getString(9);

        MInputType mit = MInputType.valueOf(inputType);

        MInput input = null;
        switch (mit) {
        case STRING:
          input = new MStringInput(inputName, inputSensitivity, inputStrLength);
          break;
        case MAP:
          input = new MMapInput(inputName, inputSensitivity);
          break;
        case BOOLEAN:
          input = new MBooleanInput(inputName, inputSensitivity);
          break;
        case INTEGER:
          input = new MIntegerInput(inputName, inputSensitivity);
          break;
        case ENUM:
          input = new MEnumInput(inputName, inputSensitivity, inputEnumValues.split(","));
          break;
        default:
          throw new SqoopException(DerbyRepoError.DERBYREPO_0006,
              "input-" + inputName + ":" + inputId + ":"
              + "form-" + inputForm + ":" + mit.name());
        }

        // Set persistent ID
        input.setPersistenceId(inputId);

        // Set value
        if(value == null) {
          input.setEmpty();
        } else {
          input.restoreFromUrlSafeValueString(value);
        }

        if (mf.getInputs().size() != inputIndex) {
          throw new SqoopException(DerbyRepoError.DERBYREPO_0009,
            "form: " + mf
View Full Code Here

Examples of org.apache.sqoop.model.MInput

    for (MForm form : target) {
      List<MInput<?>> inputs = form.getInputs();
      MForm originalForm = formMap.get(form.getName());
      for (MInput input : inputs) {
        try {
          MInput originalInput = originalForm.getInput(input.getName());
          input.setValue(originalInput.getValue());
        } catch (SqoopException ex) {
          LOG.warn("Input: " + input.getName() + " not present in old " +
            "connector. So it will not be transferred by the upgrader.");
        }
      }
View Full Code Here

Examples of org.apache.sqoop.model.MInput

    FormSerialization.restoreForm(retrievedJson);
  }

  protected MForm getMapForm() {
    List<MInput<?>> inputs;
    MInput input;

    inputs = new LinkedList<MInput<?>>();

    input = new MMapInput("Map", false);
    inputs.add(input);
View Full Code Here

Examples of org.apache.sqoop.model.MInput

   *
   * @return
   */
  protected MForm getForm() {
    List<MInput<?>> inputs;
    MInput input;

    inputs = new LinkedList<MInput<?>>();

    input = new MStringInput("String", false, (short)30);
    inputs.add(input);
View Full Code Here

Examples of org.apache.sqoop.model.MInput

        String inputEnumValues = rsetInput.getString(8);
        String value = rsetInput.getString(9);

        MInputType mit = MInputType.valueOf(inputType);

        MInput input = null;
        switch (mit) {
        case STRING:
          input = new MStringInput(inputName, inputStrMask, inputStrLength);
          break;
        case MAP:
          input = new MMapInput(inputName);
          break;
        case INTEGER:
          input = new MIntegerInput(inputName);
          break;
        case ENUM:
          input = new MEnumInput(inputName, inputEnumValues.split(","));
          break;
        default:
          throw new SqoopException(DerbyRepoError.DERBYREPO_0006,
              "input-" + inputName + ":" + inputId + ":"
              + "form-" + inputForm + ":" + mit.name());
        }

        // Set persistent ID
        input.setPersistenceId(inputId);

        // Set value
        if(value == null) {
          input.setEmpty();
        } else {
          input.restoreFromUrlSafeValueString(value);
        }

        if (mf.getInputs().size() != inputIndex) {
          throw new SqoopException(DerbyRepoError.DERBYREPO_0009,
            "form: " + mf
View Full Code Here

Examples of org.apache.sqoop.model.MInput

    for (int i = 0; i < inputs.size(); i++) {
      JSONObject input = (JSONObject) inputs.get(i);
      MInputType type =
          MInputType.valueOf((String) input.get(FORM_INPUT_TYPE));
      String name = (String) input.get(FORM_INPUT_NAME);
      MInput mInput = null;
      switch (type) {
        case STRING: {
          boolean mask = (Boolean) input.get(FORM_INPUT_MASK);
          long size = (Long) input.get(FORM_INPUT_SIZE);
          mInput = new MStringInput(name, mask, (short) size);
          break;
        }
        case MAP: {
          mInput = new MMapInput(name);
          break;
        }
        case INTEGER: {
          mInput = new MIntegerInput(name);
          break;
        }
        case ENUM: {
          String values = (String) input.get(FORM_INPUT_VALUES);
          mInput = new MEnumInput(name, values.split(","));
          break;
        }
      }

      // Propagate form ID
      mInput.setPersistenceId((Long)input.get(ID));

      // Propagate form optional value
      if(input.containsKey(FORM_INPUT_VALUE)) {
        mInput.restoreFromUrlSafeValueString(
          (String) input.get(FORM_INPUT_VALUE));
      }
      mInputs.add(mInput);
    }
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.