@Override
 public void fromData(DataInput in) throws IOException, ClassNotFoundException {
   this.prId = in.readInt();
   this.scope = Scope.fromOrdinal(in.readByte());
   this.pAttrs = PartitionAttributesImpl.createFromData(in);
   this.isDestroying = in.readBoolean();
   this.isColocationComplete = in.readBoolean();
   this.nodes = new VersionedArrayList();
   InternalDataSerializer.invokeFromData(this.nodes, in);
   this.partitionResolver = DataSerializer.readString(in);
   this.colocatedWith = DataSerializer.readString(in);
   this.fullPath = DataSerializer.readString(in);
   this.ea = EvictionAttributesImpl.createFromData(in);
   this.regionIdleTimeout = ExpirationAttributes.createFromData(in);
   this.regionTimeToLive = ExpirationAttributes.createFromData(in);
   this.entryIdleTimeout = ExpirationAttributes.createFromData(in);
   this.entryTimeToLive = ExpirationAttributes.createFromData(in);
   this.firstDataStoreCreated = in.readBoolean();
   this.elderFPAs = DataSerializer.readObject(in);
   if (this.elderFPAs == null) {
     this.elderFPAs = new LinkedHashSet<FixedPartitionAttributesImpl>();
   }
   this.partitionListenerClassNames = DataSerializer.readArrayList(in);
   this.gatewaySenderIds = DataSerializer.readObject(in);
   if (this.gatewaySenderIds == null) {
     this.gatewaySenderIds = Collections.emptySet();
   }
 }
  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);
      }
    }
  }
Exemple #3
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);
   }
 }
Exemple #4
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);
 }
 public void readData(DataInput in) throws IOException {
   if (!in.readBoolean()) this.name = in.readUTF();
   if (!in.readBoolean()) this.familyName = in.readUTF();
   if (!in.readBoolean()) this.middleName = in.readUTF();
   this.age = in.readInt();
   this.active = in.readBoolean();
   this.salary = in.readDouble();
 }
 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();
 }
Exemple #7
0
  public void readObject(DataInput in) throws IOException {
    super.readObject(in);

    ((Node) node).setBounds(control.readBounds(in));

    ((Node) node).setPickable(in.readBoolean());
    ((Node) node).setCollidable(in.readBoolean());
    ((Node) node).setBoundsAutoCompute(in.readBoolean());
  }
Exemple #8
0
 public void readFrom(DataInput in) throws Exception {
   oob = in.readBoolean();
   sync = in.readBoolean();
   num_threads = in.readInt();
   num_msgs = in.readInt();
   msg_size = in.readInt();
   anycast_count = in.readInt();
   read_percentage = in.readDouble();
 }
 public void fromDelta(DataInput in) throws IOException, InvalidDeltaException {
   if (in.readBoolean()) {
     id = in.readInt();
   }
   if (in.readBoolean()) {
     name = in.readUTF();
   }
   fromDeltaCalled = true;
 }
  /**
   * 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);

    ConnectionControl info = (ConnectionControl) o;
    info.setClose(dataIn.readBoolean());
    info.setExit(dataIn.readBoolean());
    info.setFaultTolerant(dataIn.readBoolean());
    info.setResume(dataIn.readBoolean());
    info.setSuspend(dataIn.readBoolean());
  }
 @Override
 public void readFields(DataInput in) throws IOException {
   progress = in.readFloat();
   if (in.readBoolean()) {
     tezCounters = new TezCounters();
     tezCounters.readFields(in);
   }
   if (in.readBoolean()) {
     statistics = new TaskStatistics();
     statistics.readFields(in);
   }
 }
 public void fromData(DataInput in) throws IOException, ClassNotFoundException {
   boolean hasHost = in.readBoolean();
   if (hasHost) {
     host = DataSerializer.readInetAddress(in);
   }
   boolean hasDirectory = in.readBoolean();
   if (hasDirectory) {
     directory = DataSerializer.readString(in);
   }
   diskStoreID = DataSerializer.readObject(in);
   revokedTime = in.readLong();
 }
  /**
   * 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);

    ConsumerInfo info = (ConsumerInfo) o;
    info.setConsumerId(
        (org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
    info.setBrowser(dataIn.readBoolean());
    info.setDestination(
        (org.apache.activemq.command.ActiveMQDestination)
            looseUnmarsalCachedObject(wireFormat, dataIn));
    info.setPrefetchSize(dataIn.readInt());
    info.setMaximumPendingMessageLimit(dataIn.readInt());
    info.setDispatchAsync(dataIn.readBoolean());
    info.setSelector(looseUnmarshalString(dataIn));
    info.setSubscriptionName(looseUnmarshalString(dataIn));
    info.setNoLocal(dataIn.readBoolean());
    info.setExclusive(dataIn.readBoolean());
    info.setRetroactive(dataIn.readBoolean());
    info.setPriority(dataIn.readByte());

    if (dataIn.readBoolean()) {
      short size = dataIn.readShort();
      org.apache.activemq.command.BrokerId value[] = new org.apache.activemq.command.BrokerId[size];
      for (int i = 0; i < size; i++) {
        value[i] =
            (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat, dataIn);
      }
      info.setBrokerPath(value);
    } else {
      info.setBrokerPath(null);
    }
    info.setAdditionalPredicate(
        (org.apache.activemq.filter.BooleanExpression)
            looseUnmarsalNestedObject(wireFormat, dataIn));
    info.setNetworkSubscription(dataIn.readBoolean());
    info.setOptimizedAcknowledge(dataIn.readBoolean());
    info.setNoRangeAcks(dataIn.readBoolean());

    if (dataIn.readBoolean()) {
      short size = dataIn.readShort();
      org.apache.activemq.command.ConsumerId value[] =
          new org.apache.activemq.command.ConsumerId[size];
      for (int i = 0; i < size; i++) {
        value[i] =
            (org.apache.activemq.command.ConsumerId) looseUnmarsalNestedObject(wireFormat, dataIn);
      }
      info.setNetworkConsumerPath(value);
    } else {
      info.setNetworkConsumerPath(null);
    }
  }
Exemple #14
0
 public void readFrom(DataInput in) throws Exception {
   type = in.readByte();
   boolean isMergeView = in.readBoolean();
   if (isMergeView) view = (View) Util.readStreamable(MergeView.class, in);
   else view = (View) Util.readStreamable(View.class, in);
   mbr = Util.readAddress(in);
   mbrs = Util.readAddresses(in, ArrayList.class);
   join_rsp = (JoinRsp) Util.readStreamable(JoinRsp.class, in);
   my_digest = (Digest) Util.readStreamable(Digest.class, in);
   merge_id = (MergeId) Util.readStreamable(MergeId.class, in);
   merge_rejected = in.readBoolean();
   useFlushIfPresent = in.readBoolean();
 }
Exemple #15
0
 @Override
 public void readFields(DataInput in) throws IOException {
   super.readFields(in);
   byte[] tableBytes = Bytes.readByteArray(in);
   table = TableName.valueOf(tableBytes);
   if (in.readBoolean()) {
     family = Bytes.readByteArray(in);
   }
   if (in.readBoolean()) {
     qualifier = Bytes.readByteArray(in);
   }
   if (in.readBoolean()) {
     namespace = Bytes.toString(Bytes.readByteArray(in));
   }
 }
 public FileEntry(DataInput in, boolean dummy /* to distinguish from general constructor*/)
     throws IOException {
   super(in);
   myTimestamp = in.readLong();
   isReadOnly = in.readBoolean();
   myContent = new StoredContent(in);
 }
 protected String looseUnmarshalString(DataInput dataIn) throws IOException {
   if (dataIn.readBoolean()) {
     return dataIn.readUTF();
   } else {
     return null;
   }
 }
 @Override
 public void readFields(DataInput input) throws IOException {
   byte[] columnNameBytes = Bytes.readByteArray(input);
   PName columnName = PNameFactory.newName(columnNameBytes);
   byte[] familyNameBytes = Bytes.readByteArray(input);
   PName familyName = familyNameBytes.length == 0 ? null : PNameFactory.newName(familyNameBytes);
   // TODO: optimize the reading/writing of this b/c it could likely all fit in a single byte or
   // two
   PDataType dataType = PDataType.values()[WritableUtils.readVInt(input)];
   int maxLength = WritableUtils.readVInt(input);
   int scale = WritableUtils.readVInt(input);
   boolean nullable = input.readBoolean();
   int position = WritableUtils.readVInt(input);
   SortOrder sortOrder = SortOrder.fromSystemValue(WritableUtils.readVInt(input));
   int arrSize = WritableUtils.readVInt(input);
   init(
       columnName,
       familyName,
       dataType,
       maxLength == NO_MAXLENGTH ? null : maxLength,
       scale == NO_SCALE ? null : scale,
       nullable,
       position,
       sortOrder,
       arrSize == -1 ? null : arrSize);
 }
 public Maybe<Type> readFrom(DataInput target) throws IOException {
   boolean exists = target.readBoolean();
   if (exists) {
     return definitely(streamer.readFrom(target));
   }
   return unknown();
 }
Exemple #20
0
 public Object readData(DataInput dataInput) throws IOException {
   if (!dataInput.readBoolean()) {
     return null;
   }
   float val = dataInput.readFloat();
   return Float.valueOf(val);
 }
Exemple #21
0
 public void readFrom(DataInput in) throws Exception {
   type = Type.values()[in.readByte()];
   lock_name = Util.readString(in);
   owner = (Owner) Util.readStreamable(Owner.class, in);
   timeout = in.readLong();
   is_trylock = in.readBoolean();
 }
Exemple #22
0
 /**
  * This method reads this object <code>MQPropertySheet</code> from the specified input stream
  * object.
  *
  * @param is DataInput object
  * @param versionNo
  * @exception java.io.IOException IOException that might be thrown while reading from stream
  * @since Tifosi2.0
  */
 public void fromStream(java.io.DataInput is, int versionNo) throws java.io.IOException {
   m_mqName = readUTF(is);
   m_mqUrl = readUTF(is);
   m_userName = readUTF(is);
   m_passwd = readUTF(is);
   m_isFioranoMQ = is.readBoolean();
 }
  @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 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");
      }
    }
  }
  @Override
  public void read(DataInput in) throws IOException {
    try {
      long msb = in.readLong();
      long lsb = in.readLong();
      this.token = new UUID(msb, lsb);
    } catch (Exception e) {
      throw new UnknownStoreVersionException(e);
    }

    if (!token.equals(JobSchedulerStoreImpl.SCHEDULER_STORE_TOKEN)) {
      throw new UnknownStoreVersionException(token.toString());
    }
    this.version = in.readInt();
    if (in.readBoolean()) {
      setLastUpdateLocation(LocationMarshaller.INSTANCE.readPayload(in));
    } else {
      setLastUpdateLocation(null);
    }
    this.storedSchedulers =
        new BTreeIndex<String, JobSchedulerImpl>(store.getPageFile(), in.readLong());
    this.storedSchedulers.setKeyMarshaller(StringMarshaller.INSTANCE);
    this.storedSchedulers.setValueMarshaller(new JobSchedulerMarshaller(this.store));
    this.journalRC = new BTreeIndex<Integer, Integer>(store.getPageFile(), in.readLong());
    this.journalRC.setKeyMarshaller(IntegerMarshaller.INSTANCE);
    this.journalRC.setValueMarshaller(IntegerMarshaller.INSTANCE);
    this.removeLocationTracker =
        new BTreeIndex<Integer, List<Integer>>(store.getPageFile(), in.readLong());
    this.removeLocationTracker.setKeyMarshaller(IntegerMarshaller.INSTANCE);
    this.removeLocationTracker.setValueMarshaller(new IntegerListMarshaller());

    LOG.info("Scheduler Store version {} loaded", this.version);
  }
 @Override
 public void parseFromInput(DataInput in) throws IOException {
   this.offer = new boolean[in.readShort()];
   for (int i = 0; i < this.offer.length; i++) {
     this.offer[i] = in.readBoolean();
   }
 }
Exemple #27
0
 static TaskStatus createTaskStatus(
     DataInput in,
     TaskAttemptID taskId,
     float progress,
     int numSlots,
     State runState,
     String diagnosticInfo,
     String stateString,
     String taskTracker,
     Phase phase,
     Counters counters)
     throws IOException {
   boolean isMap = in.readBoolean();
   return createTaskStatus(
       isMap,
       taskId,
       progress,
       numSlots,
       runState,
       diagnosticInfo,
       stateString,
       taskTracker,
       phase,
       counters);
 }
Exemple #28
0
  public RangeSliceCommand deserialize(DataInput dis, int version) throws IOException {
    String keyspace = dis.readUTF();
    String columnFamily = dis.readUTF();

    int scLength = dis.readInt();
    ByteBuffer superColumn = null;
    if (scLength > 0) {
      byte[] buf = new byte[scLength];
      dis.readFully(buf);
      superColumn = ByteBuffer.wrap(buf);
    }

    TDeserializer dser = new TDeserializer(new TBinaryProtocol.Factory());
    SlicePredicate pred = new SlicePredicate();
    FBUtilities.deserialize(dser, pred, dis);

    List<IndexExpression> rowFilter = null;
    if (version >= MessagingService.VERSION_11) {
      int filterCount = dis.readInt();
      rowFilter = new ArrayList<IndexExpression>(filterCount);
      for (int i = 0; i < filterCount; i++) {
        IndexExpression expr = new IndexExpression();
        FBUtilities.deserialize(dser, expr, dis);
        rowFilter.add(expr);
      }
    }
    AbstractBounds<RowPosition> range =
        AbstractBounds.serializer().deserialize(dis, version).toRowBounds();

    int maxResults = dis.readInt();
    boolean maxIsColumns = false;
    boolean isPaging = false;
    if (version >= MessagingService.VERSION_11) {
      maxIsColumns = dis.readBoolean();
      isPaging = dis.readBoolean();
    }
    return new RangeSliceCommand(
        keyspace,
        columnFamily,
        superColumn,
        pred,
        range,
        rowFilter,
        maxResults,
        maxIsColumns,
        isPaging);
  }
 @Override
 public boolean readBoolean() {
   try {
     return input.readBoolean();
   } catch (IOException e) {
     throw new IllegalStateException(e);
   }
 }
Exemple #30
0
 public void readFields(DataInput __dataIn) throws IOException {
   if (__dataIn.readBoolean()) {
     this.r_regionkey = null;
   } else {
     this.r_regionkey = Integer.valueOf(__dataIn.readInt());
   }
   if (__dataIn.readBoolean()) {
     this.r_name = null;
   } else {
     this.r_name = Text.readString(__dataIn);
   }
   if (__dataIn.readBoolean()) {
     this.r_comment = null;
   } else {
     this.r_comment = Text.readString(__dataIn);
   }
 }