예제 #1
0
  @Override
  public void readFields(DataInput dIn) throws IOException {
    instanceId = dIn.readUTF();

    // Hadoop Configuration has to get its act right
    int len = dIn.readInt();
    byte[] array = new byte[len];
    dIn.readFully(array);
    ByteArrayInputStream bais = new ByteArrayInputStream(array);
    conf = new XConfiguration(bais);

    def = new LiteWorkflowApp();
    def.readFields(dIn);
    status = Status.valueOf(dIn.readUTF());
    int numExPaths = dIn.readInt();
    for (int x = 0; x < numExPaths; x++) {
      String path = dIn.readUTF();
      String nodeName = dIn.readUTF();
      boolean isStarted = dIn.readBoolean();
      NodeInstance nodeInstance = new NodeInstance(nodeName);
      nodeInstance.started = isStarted;
      executionPaths.put(path, nodeInstance);
    }
    int numVars = dIn.readInt();
    for (int x = 0; x < numVars; x++) {
      String vName = dIn.readUTF();
      String vVal = readBytesAsString(dIn);
      persistentVars.put(vName, vVal);
    }
    refreshLog();
  }
 @Override
 public void fromData(DataInput in) throws IOException, ClassNotFoundException {
   super.fromData(in);
   this.attributeCode = in.readByte();
   this.newValue = in.readInt();
   this.cacheId = in.readInt();
 }
  /**
   * Description of the Method
   *
   * @param is Description of the Parameter
   * @param clientVersionNo Description of the Parameter
   * @exception java.io.IOException Description of the Exception
   */
  public void fromStream(java.io.DataInput is, int clientVersionNo) throws java.io.IOException {
    super.fromStream(is, clientVersionNo);

    m_appContext = readUTF(is);

    int size = is.readInt();

    for (int i = 0; i < size; i++) {
      DmiSourceContext context = new DmiSourceContext();

      context.fromStream(is, clientVersionNo);
      m_vecOfContextsCarriedFwd.add(context);
    }

    if (clientVersionNo <= 3000) return;

    int count = is.readInt();

    for (int i = 0; i < count; i++) {
      String key = readUTF(is);
      String value = readUTF(is);

      m_hashCarryFwdProps.put(key, value);
    }
  }
예제 #4
0
 public void a(DataInput datainput) {
   this.e = datainput.readUnsignedByte();
   this.a = datainput.readInt();
   this.b = datainput.readUnsignedByte();
   this.c = datainput.readInt();
   this.face = datainput.readUnsignedByte();
 }
예제 #5
0
  public void readFields(DataInput in) throws IOException {
    if (in.readBoolean()) {
      this.semiClusterId = in.readUTF();
    }
    this.semiClusterScore = in.readDouble();

    if (in.readBoolean()) {
      int len = in.readInt();
      if (len > 0) {
        for (int i = 0; i < len; i++) {
          SemiClusteringVertex v = new SemiClusteringVertex();
          v.readFields(in);
          semiClusterVertexList.add(v);
        }
      }
    }
    int len = in.readInt();
    if (len > 0) {
      for (int i = 0; i < len; i++) {
        SemiClusterDetails sd = new SemiClusterDetails();
        sd.readFields(in);
        semiClusterContainThis.add(sd);
      }
    }
  }
예제 #6
0
    public PagedRangeCommand deserialize(DataInput in, int version) throws IOException {
      String keyspace = in.readUTF();
      String columnFamily = in.readUTF();
      long timestamp = in.readLong();

      AbstractBounds<RowPosition> keyRange =
          AbstractBounds.serializer.deserialize(in, version).toRowBounds();

      SliceQueryFilter predicate = SliceQueryFilter.serializer.deserialize(in, version);

      ByteBuffer start = ByteBufferUtil.readWithShortLength(in);
      ByteBuffer stop = ByteBufferUtil.readWithShortLength(in);

      int filterCount = in.readInt();
      List<IndexExpression> rowFilter = new ArrayList<IndexExpression>(filterCount);
      for (int i = 0; i < filterCount; i++) {
        IndexExpression expr =
            new IndexExpression(
                ByteBufferUtil.readWithShortLength(in),
                IndexExpression.Operator.findByOrdinal(in.readInt()),
                ByteBufferUtil.readWithShortLength(in));
        rowFilter.add(expr);
      }

      int limit = in.readInt();
      return new PagedRangeCommand(
          keyspace, columnFamily, timestamp, keyRange, predicate, start, stop, rowFilter, limit);
    }
예제 #7
0
  @Override
  public void parseFromDataInput(DataInput read) throws IOException {
    this.buildVersion = read.readUTF();
    this.gameId = read.readInt();
    this.guid = read.readUTF();
    this.password = read.readUTF();
    secret = read.readUTF();
    keyTime = read.readInt();
    int size = read.readUnsignedShort();
    if (size > 0) {
      key = new byte[size];
      read.readFully(key);
    }

    size = read.readInt();
    if (size > 0) {
      byte[] buf = new byte[size];
      read.readFully(buf);
      unkStr = new String(buf, Charset.forName("UTF-8"));
    }

    pk = read.readUTF();
    Tq = read.readUTF();
    H = read.readUTF();
    playPlatform = read.readUTF();
  }
예제 #8
0
 /**
  * Reads the state from the stream.
  *
  * @param in the input stream, not null
  * @return the created object, not null
  * @throws IOException if an error occurs
  */
 static ZoneRules readExternal(DataInput in) throws IOException, ClassNotFoundException {
   int stdSize = in.readInt();
   long[] stdTrans = (stdSize == 0) ? EMPTY_LONG_ARRAY : new long[stdSize];
   for (int i = 0; i < stdSize; i++) {
     stdTrans[i] = Ser.readEpochSec(in);
   }
   ZoneOffset[] stdOffsets = new ZoneOffset[stdSize + 1];
   for (int i = 0; i < stdOffsets.length; i++) {
     stdOffsets[i] = Ser.readOffset(in);
   }
   int savSize = in.readInt();
   long[] savTrans = (savSize == 0) ? EMPTY_LONG_ARRAY : new long[savSize];
   for (int i = 0; i < savSize; i++) {
     savTrans[i] = Ser.readEpochSec(in);
   }
   ZoneOffset[] savOffsets = new ZoneOffset[savSize + 1];
   for (int i = 0; i < savOffsets.length; i++) {
     savOffsets[i] = Ser.readOffset(in);
   }
   int ruleSize = in.readByte();
   ZoneOffsetTransitionRule[] rules =
       (ruleSize == 0) ? EMPTY_LASTRULES : new ZoneOffsetTransitionRule[ruleSize];
   for (int i = 0; i < ruleSize; i++) {
     rules[i] = ZoneOffsetTransitionRule.readExternal(in);
   }
   return new ZoneRules(stdTrans, stdOffsets, savTrans, savOffsets, rules);
 }
예제 #9
0
 @SuppressWarnings("unchecked")
 public void readFields(DataInput is) throws IOException {
   disableCounter = is.readBoolean();
   isMultiInputs = is.readBoolean();
   totalSplits = is.readInt();
   splitIndex = is.readInt();
   inputIndex = is.readInt();
   targetOps = (ArrayList<OperatorKey>) readObject(is);
   int splitLen = is.readInt();
   String splitClassName = is.readUTF();
   try {
     Class splitClass = conf.getClassByName(splitClassName);
     SerializationFactory sf = new SerializationFactory(conf);
     // The correct call sequence for Deserializer is, we shall open, then deserialize, but we
     // shall not close
     Deserializer d = sf.getDeserializer(splitClass);
     d.open((InputStream) is);
     wrappedSplits = new InputSplit[splitLen];
     for (int i = 0; i < splitLen; i++) {
       wrappedSplits[i] = (InputSplit) ReflectionUtils.newInstance(splitClass, conf);
       d.deserialize(wrappedSplits[i]);
     }
   } catch (ClassNotFoundException e) {
     throw new IOException(e);
   }
 }
 @Override
 public void readFields(DataInput in) throws IOException {
   RowKeySchema schema = new RowKeySchema();
   schema.readFields(in);
   int maxLength = getTerminatorCount(schema);
   int andLen = in.readInt();
   List<List<KeyRange>> slots = Lists.newArrayListWithExpectedSize(andLen);
   for (int i = 0; i < andLen; i++) {
     int orlen = in.readInt();
     List<KeyRange> orclause = Lists.newArrayListWithExpectedSize(orlen);
     slots.add(orclause);
     int maxSlotLength = 0;
     for (int j = 0; j < orlen; j++) {
       KeyRange range = new KeyRange();
       range.readFields(in);
       if (range.getLowerRange().length > maxSlotLength) {
         maxSlotLength = range.getLowerRange().length;
       }
       if (range.getUpperRange().length > maxSlotLength) {
         maxSlotLength = range.getUpperRange().length;
       }
       orclause.add(range);
     }
     maxLength += maxSlotLength;
   }
   this.init(slots, schema, maxLength);
 }
예제 #11
0
파일: Content.java 프로젝트: Earne/HiBench
  public final void readFields(DataInput in) throws IOException {
    metadata.clear();
    int sizeOrVersion = in.readInt();
    if (sizeOrVersion < 0) { // version
      version = sizeOrVersion;
      switch (version) {
        case VERSION:
          url = Text.readString(in);
          base = Text.readString(in);

          content = new byte[in.readInt()];
          in.readFully(content);

          contentType = Text.readString(in);
          metadata.readFields(in);
          break;
        default:
          throw new VersionMismatchException((byte) VERSION, (byte) version);
      }
    } else { // size
      byte[] compressed = new byte[sizeOrVersion];
      in.readFully(compressed, 0, compressed.length);
      ByteArrayInputStream deflated = new ByteArrayInputStream(compressed);
      DataInput inflater = new DataInputStream(new InflaterInputStream(deflated));
      readFieldsCompressed(inflater);
    }
  }
예제 #12
0
 /**
  * Deserializes this object.
  *
  * @param in source for raw byte representation
  */
 public void readFields(DataInput in) throws IOException {
   this.clear();
   int size = in.readInt();
   for (int i = 0; i < size; i++) {
     add(i, in.readInt());
   }
 }
예제 #13
0
  @Override
  public void readConstructorParams(DataInput in) throws IOException {
    super.readConstructorParams(in);

    width = in.readInt();
    height = in.readInt();
  }
예제 #14
0
 @Override
 public ResultSetMetaData read(DataInput dataInput, ResultSetMetaData rsmd)
     throws IOException {
   int columnCount = dataInput.readInt();
   StoredColumnMetaData[] columnMetaData = new StoredColumnMetaData[columnCount];
   for (int column = 1; column <= columnCount; column++)
     columnMetaData[column - 1] =
         new StoredColumnMetaData(
             dataInput.readBoolean(),
             dataInput.readBoolean(),
             dataInput.readBoolean(),
             dataInput.readBoolean(),
             dataInput.readInt(),
             dataInput.readBoolean(),
             dataInput.readInt(),
             dataInput.readUTF(),
             dataInput.readUTF(),
             dataInput.readUTF(),
             dataInput.readInt(),
             dataInput.readInt(),
             dataInput.readUTF(),
             dataInput.readUTF(),
             dataInput.readInt(),
             dataInput.readUTF(),
             dataInput.readBoolean(),
             dataInput.readBoolean(),
             dataInput.readBoolean(),
             dataInput.readUTF());
   return new ColumnMetaDataResultSetMetaData(columnMetaData);
 }
예제 #15
0
 @Override
 public void readFields(DataInput in) throws IOException {
   // read head (rows, cols)
   _numRows = in.readInt();
   int numCols = in.readInt();
   // read columns (value type, data)
   _schema.clear();
   _coldata.clear();
   for (int j = 0; j < numCols; j++) {
     ValueType vt = ValueType.values()[in.readByte()];
     String name = in.readUTF();
     Array arr = null;
     switch (vt) {
       case STRING:
         arr = new StringArray(new String[_numRows]);
         break;
       case BOOLEAN:
         arr = new BooleanArray(new boolean[_numRows]);
         break;
       case INT:
         arr = new LongArray(new long[_numRows]);
         break;
       case DOUBLE:
         arr = new DoubleArray(new double[_numRows]);
         break;
       default:
         throw new IOException("Unsupported value type: " + vt);
     }
     arr.readFields(in);
     _schema.add(vt);
     _colnames.add(name);
     _coldata.add(arr);
   }
 }
 @Override
 public void fromData(DataInput in) throws IOException, ClassNotFoundException {
   super.fromData(in);
   this.prId = in.readInt();
   this.processorId = in.readInt();
   this.profiles = DataSerializer.readObject(in);
 }
예제 #17
0
 public void a(DataInput datainput) {
   this.a = datainput.readInt();
   this.b = datainput.readShort();
   this.c = datainput.readInt();
   this.d = datainput.readByte();
   this.e = d(datainput);
 }
  /*
   * (non-Javadoc)
   * @see eu.stratosphere.core.io.IOReadableWritable#read(java.io.DataInput)
   */
  @Override
  public void read(final DataInput in) throws IOException {
    this.mode = ExecutionMode.values()[in.readInt()];

    final ArrayList<String> requiredPackages = new ArrayList<String>();
    for (int count = in.readInt(); count > 0; count--) requiredPackages.add(in.readUTF());
    this.query = null;
    final byte[] planBuffer = new byte[in.readInt()];
    in.readFully(planBuffer);

    final JobID dummId = new JobID();
    try {
      LibraryCacheManager.register(
          dummId, requiredPackages.toArray(new String[requiredPackages.size()]));
      SopremoEnvironment.getInstance().setClassLoader(LibraryCacheManager.getClassLoader(dummId));
      this.query = SopremoUtil.deserialize(planBuffer, SopremoPlan.class);
    } catch (final IOException e) {
      e.printStackTrace();
    } finally {
      try {
        LibraryCacheManager.unregister(dummId);
      } catch (final IOException e) {
      }
    }
  }
예제 #19
0
파일: PostTable.java 프로젝트: dcsch/jogl
  /** Creates new PostTable */
  protected PostTable(final DirectoryEntry de, final DataInput di) throws IOException {
    this.de = (DirectoryEntry) de.clone();
    version = di.readInt();
    italicAngle = di.readInt();
    underlinePosition = di.readShort();
    underlineThickness = di.readShort();
    isFixedPitch = di.readInt();
    minMemType42 = di.readInt();
    maxMemType42 = di.readInt();
    minMemType1 = di.readInt();
    maxMemType1 = di.readInt();

    if (version == 0x00020000) {
      numGlyphs = di.readUnsignedShort();
      glyphNameIndex = new int[numGlyphs];
      for (int i = 0; i < numGlyphs; i++) {
        glyphNameIndex[i] = di.readUnsignedShort();
      }
      int h = highestGlyphNameIndex();
      if (h > 257) {
        h -= 257;
        psGlyphName = new String[h];
        for (int i = 0; i < h; i++) {
          final int len = di.readUnsignedByte();
          final byte[] buf = new byte[len];
          di.readFully(buf);
          psGlyphName[i] = new String(buf);
        }
      }
      // } else if (version == 0x00025000) {
      // } else if (version == 0x00030000) {
    }
  }
  @Override
  public void readFields(DataInput in) throws IOException {
    initialize();
    int numFields = in.readInt();

    for (int i = 0; i < numFields; ++i) {
      byte type = in.readByte();

      if (type == BYTE) {
        fields.add(in.readByte());
      } else if (type == BOOLEAN) {
        fields.add(in.readBoolean());
      } else if (type == INT) {
        fields.add(in.readInt());
      } else if (type == LONG) {
        fields.add(in.readLong());
      } else if (type == FLOAT) {
        fields.add(in.readFloat());
      } else if (type == DOUBLE) {
        fields.add(in.readDouble());
      } else if (type == STRING) {
        fields.add(in.readUTF());
      } else if (type == BYTE_ARRAY) {
        int len = in.readShort();
        byte[] bytes = new byte[len];
        in.readFully(bytes);
        fields.add(bytes);
      } else {
        throw new IllegalArgumentException("Failed encoding, unknown element type in stream");
      }
    }
  }
예제 #21
0
 @Override
 public void readFields(DataInput dataInput) throws IOException {
   int length1 = dataInput.readInt();
   int length2 = dataInput.readInt();
   int s1Len = dataInput.readInt();
   int s2Len = dataInput.readInt();
   if (length1 > 0) {
     first = new byte[length1];
     dataInput.readFully(first);
   }
   if (length2 > 0) {
     second = new byte[length2];
     dataInput.readFully(second);
   }
   if (s1Len > 0) {
     byte[] s1Bytes = new byte[s1Len];
     dataInput.readFully(s1Bytes);
     uriFirst = new String(s1Bytes, Charset.forName("UTF-8"));
   }
   if (s2Len > 0) {
     byte[] s2Bytes = new byte[s2Len];
     dataInput.readFully(s2Bytes);
     uriSecond = new String(s2Bytes, Charset.forName("UTF-8"));
   }
 }
예제 #22
0
  /**
   * Un-marshal an object instance from the data input stream
   *
   * @param o the object to un-marshal
   * @param dataIn the data input stream to build the object from
   * @throws IOException
   */
  public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn)
      throws IOException {
    super.looseUnmarshal(wireFormat, o, dataIn);

    ReplayCommand info = (ReplayCommand) o;
    info.setFirstNakNumber(dataIn.readInt());
    info.setLastNakNumber(dataIn.readInt());
  }
예제 #23
0
 public void readFields(DataInput in) throws IOException {
   timespent = in.readInt();
   estimated_revenue = in.readDouble();
   int len = in.readInt();
   byte[] b = new byte[len];
   in.readFully(b);
   query_term = new String(b);
 }
 @Override
 public void readFields(DataInput in) throws IOException {
   int numEdges = in.readInt();
   initialize(numEdges);
   for (int i = 0; i < numEdges; ++i) {
     neighbors.add(in.readInt());
   }
 }
예제 #25
0
파일: DSParams.java 프로젝트: capveg/envi
 public DSParams(DataInput in) throws IOException {
   msec_per_frame = in.readInt();
   x = in.readInt();
   y = in.readInt();
   width = in.readInt();
   height = in.readInt();
   zoom = in.readFloat();
 }
예제 #26
0
 /**
  * Read an array of integers
  *
  * @param in DataInput
  * @return array of ints
  * @throws IOException I/O errors
  */
 public static int[] readIntArray(DataInput in) throws IOException {
   int size = in.readInt();
   int[] result = new int[size];
   for (int i = 0; i < size; ++i) {
     result[i] = in.readInt();
   }
   return result;
 }
예제 #27
0
 protected void readConstructorParams(DataInput in) throws IOException {
   super.readConstructorParams(in);
   format = in.readInt();
   height = in.readInt();
   width = in.readInt();
   byReference = in.readBoolean();
   yUp = in.readBoolean();
 }
예제 #28
0
 public BlockDescriptor(DataInput dataIn) throws IOException {
   blockType = dataIn.readInt();
   unknown = dataIn.readInt();
   outOffset = dataIn.readLong() * 0x200;
   outSize = dataIn.readLong() * 0x200;
   inOffset = dataIn.readLong();
   inSize = dataIn.readLong();
 }
예제 #29
0
 public void readFields(DataInput in) throws IOException {
   userid = in.readLong();
   start = in.readLong();
   end = in.readLong();
   nhits = in.readInt();
   age = in.readInt();
   isMale = in.readInt();
 }
예제 #30
0
  /**
   * Un-marshal an object instance from the data input stream
   *
   * @param o the object to un-marshal
   * @param dataIn the data input stream to build the object from
   * @throws IOException
   */
  public void tightUnmarshal(
      OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
    super.tightUnmarshal(wireFormat, o, dataIn, bs);

    ReplayCommand info = (ReplayCommand) o;
    info.setFirstNakNumber(dataIn.readInt());
    info.setLastNakNumber(dataIn.readInt());
  }