Example #1
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   chainedProperties = (ChainedProperties) in.readObject();
   immutable = in.readBoolean();
   sequential = in.readBoolean();
   sequentialAgenda = (SequentialAgenda) in.readObject();
   maintainTms = in.readBoolean();
   removeIdentities = in.readBoolean();
   shareAlphaNodes = in.readBoolean();
   shareBetaNodes = in.readBoolean();
   permGenThreshold = in.readInt();
   alphaNodeHashingThreshold = in.readInt();
   compositeKeyDepth = in.readInt();
   indexLeftBetaMemory = in.readBoolean();
   indexRightBetaMemory = in.readBoolean();
   indexPrecedenceOption = (IndexPrecedenceOption) in.readObject();
   assertBehaviour = (AssertBehaviour) in.readObject();
   executorService = (String) in.readObject();
   consequenceExceptionHandler = (String) in.readObject();
   ruleBaseUpdateHandler = (String) in.readObject();
   conflictResolver = (ConflictResolver) in.readObject();
   advancedProcessRuleIntegration = in.readBoolean();
   multithread = in.readBoolean();
   maxThreads = in.readInt();
   eventProcessingMode = (EventProcessingOption) in.readObject();
   classLoaderCacheEnabled = in.readBoolean();
   phreakEnabled = in.readBoolean();
   declarativeAgenda = in.readBoolean();
   componentFactory = (ReteooComponentFactory) in.readObject();
 }
  @SuppressWarnings("unchecked")
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    this._threshold = in.readInt();
    final int used = in.readInt();
    this._used = used;

    final int keylen = in.readInt();
    final Object[] keys = new Object[keylen];
    final long[] values = new long[keylen];
    final byte[] states = new byte[keylen];
    for (int i = 0; i < used; i++) {
      Object k = in.readObject();
      long v = in.readLong();
      int hash = keyHash(k);
      int keyIdx = hash % keylen;
      if (states[keyIdx] != FREE) { // second hash
        int decr = 1 + (hash % (keylen - 2));
        for (; ; ) {
          keyIdx -= decr;
          if (keyIdx < 0) {
            keyIdx += keylen;
          }
          if (states[keyIdx] == FREE) {
            break;
          }
        }
      }
      states[keyIdx] = FULL;
      keys[keyIdx] = k;
      values[keyIdx] = v;
    }
    this._keys = (K[]) keys;
    this._values = values;
    this._states = states;
  }
  @Override
  public void readExternal(ObjectInput objectInput) throws IOException {
    // Read binary words sizes.
    prefixSizeInBytes = objectInput.readInt();
    descIndexSizeInBytes = objectInput.readInt();

    // Read possible lengths.
    int sizeOfLengths = objectInput.readInt();
    possibleLengths.clear();
    for (int i = 0; i < sizeOfLengths; i++) {
      possibleLengths.add(objectInput.readInt());
    }

    // Read description pool size.
    int descriptionPoolSize = objectInput.readInt();
    // Read description pool.
    if (descriptionPool == null || descriptionPool.length < descriptionPoolSize) {
      descriptionPool = new String[descriptionPoolSize];
    }
    for (int i = 0; i < descriptionPoolSize; i++) {
      String description = objectInput.readUTF();
      descriptionPool[i] = description;
    }
    readEntries(objectInput);
  }
Example #4
0
  /**
   * Implements Externalizable interface to read serialized form
   *
   * @param s Input stream to serialize from
   */
  public void readExternal(java.io.ObjectInput s) throws ClassNotFoundException, IOException {
    int numFields = s.readInt();
    if (numFields > 0) {
      fields = new ArrayList(numFields);
      columnInfos = new HashMap();
      for (int i = 0; i < numFields; i++) {
        String fieldName = s.readUTF();
        fields.add(fieldName);

        Object colInfo = s.readObject();
        columnInfos.put(fieldName, colInfo);
      }
    }

    int numRows = s.readInt();
    if (numRows > 0) {
      records = new ArrayList(numRows);
      for (int row = 0; row < numRows; row++) {
        List record = new ArrayList(numFields);
        for (int col = 0; col < numFields; col++) {
          record.add(s.readObject());
        }
        records.add(record);
      }
    }
  }
  /* package */ boolean recoverFromFile(File file) throws InternalGemFireException {
    if (!file.exists()) {
      return false;
    }

    logger.info("Peer locator recovering from " + file.getAbsolutePath());
    try (ObjectInput ois = new ObjectInputStream(new FileInputStream(file))) {
      if (ois.readInt() != LOCATOR_FILE_STAMP) {
        return false;
      }

      ObjectInput ois2 = ois;
      int version = ois2.readInt();
      if (version != Version.CURRENT_ORDINAL) {
        Version geodeVersion = Version.fromOrdinalNoThrow((short) version, false);
        logger.info("Peer locator found that persistent view was written with {}", geodeVersion);
        ois2 = new VersionedObjectInput(ois2, geodeVersion);
      }

      Object o = DataSerializer.readObject(ois2);
      this.view = (NetView) o;

      logger.info("Peer locator initial membership is " + view);
      return true;

    } catch (Exception e) {
      String msg = LOCATOR_UNABLE_TO_RECOVER_VIEW.toLocalizedString(file.toString());
      logger.warn(msg, e);
      if (!file.delete() && file.exists()) {
        logger.warn("Peer locator was unable to recover from or delete " + file);
        this.viewFile = null;
      }
      throw new InternalGemFireException(msg, e);
    }
  }
Example #6
0
  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    iUniqueId = in.readLong();
    iInstructionalType = (String) in.readObject();
    iName = (String) in.readObject();

    int nrSections = in.readInt();
    iSections.clear();
    for (int i = 0; i < nrSections; i++) iSections.add(new XSection(in));

    iConfigId = in.readLong();
    iParentId = in.readLong();
    if (iParentId < 0) iParentId = null;

    iCreditAbbv = (String) in.readObject();
    iCreditText = (String) in.readObject();

    iAllowOverlap = in.readBoolean();

    int nrCredits = in.readInt();
    iCreditByCourse.clear();
    for (int i = 0; i < nrCredits; i++)
      iCreditByCourse.put(
          in.readLong(), new String[] {(String) in.readObject(), (String) in.readObject()});
  }
 @Override
 public List<List<Object>> readBatch(ObjectInput in, String[] types)
     throws IOException, ClassNotFoundException {
   int rows = in.readInt();
   if (rows == 0) {
     return new ArrayList<List<Object>>(0);
   }
   if (rows == -1) {
     return null;
   }
   byte version = (byte) 0;
   if (rows < 0) {
     rows = -(rows + 1);
     version = in.readByte();
   }
   int columns = in.readInt();
   List<List<Object>> batch = new ResizingArrayList<List<Object>>(rows);
   int numBytes = rows / 8;
   int extraRows = rows % 8;
   for (int currentRow = 0; currentRow < rows; currentRow++) {
     batch.add(currentRow, Arrays.asList(new Object[columns]));
   }
   byte[] isNullBuffer = new byte[(extraRows > 0) ? numBytes + 1 : numBytes];
   for (int col = 0; col < columns; col++) {
     getSerializer(types[col], version).readColumn(in, col, batch, isNullBuffer);
   }
   return batch;
 }
  /**
   * @param in Object input.
   * @return Read collection.
   * @throws IOException If failed.
   * @throws ClassNotFoundException If failed.
   */
  private Collection<Object> readFieldsCollection(ObjectInput in)
      throws IOException, ClassNotFoundException {
    assert fields;

    int size = in.readInt();

    if (size == -1) return null;

    Collection<Object> res = new ArrayList<>(size);

    for (int i = 0; i < size; i++) {
      int size0 = in.readInt();

      Collection<Object> col = new ArrayList<>(size0);

      for (int j = 0; j < size0; j++) col.add(in.readObject());

      assert col.size() == size0;

      res.add(col);
    }

    assert res.size() == size;

    return res;
  }
Example #9
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   int size = in.readInt();
   this.items = UnifiedMap.newMap(size);
   for (int i = 0; i < size; i++) {
     this.addOccurrences((T) in.readObject(), in.readInt());
   }
 }
Example #10
0
  /**
   * Reads object from data input. Note we do not use externalizable interface to eliminate
   * marshaller.
   *
   * @param in Data input.
   * @throws IOException If read failed.
   */
  @Override
  public void readExternal(ObjectInput in) throws IOException {
    start = in.readLong();
    len = in.readLong();

    int size;

    if (in.readBoolean()) {
      size = in.readInt();

      nodeIds = new ArrayList<>(size);

      for (int i = 0; i < size; i++) nodeIds.add(U.readUuid(in));
    }

    size = in.readInt();

    names = new ArrayList<>(size);

    for (int i = 0; i < size; i++) names.add(in.readUTF());

    size = in.readInt();

    hosts = new ArrayList<>(size);

    for (int i = 0; i < size; i++) hosts.add(in.readUTF());
  }
Example #11
0
 @Override
 public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException {
   keyTypeClassName = input.readUTF();
   version = input.readInt();
   mergePoint = input.readInt();
   instanceCount = input.readInt();
 }
Example #12
0
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   eventType = in.readShort();
   streamId = in.readInt();
   bufferLength = in.readInt();
 }
Example #13
0
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    // TODO Auto-generated method stub
    _n_inputs = in.readInt();
    _n_outputs = in.readInt();
    build();

    _eig_mat = (double[][]) in.readObject();
  }
 @Override
 protected Object readObject(ObjectInput in) throws IOException {
   int scale = in.readInt();
   int length = in.readInt();
   byte[] bytes = new byte[length];
   in.readFully(bytes);
   return new BigDecimal(new BigInteger(bytes), scale);
 }
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   SpliceLogUtils.trace(LOG, "readExternal");
   super.readExternal(in);
   leftHashKeyItem = in.readInt();
   rightHashKeyItem = in.readInt();
   emptyRightRowsReturned = in.readInt();
 }
Example #16
0
 /**
  * It reads serialized data coming from flex client
  *
  * @param in
  * @throws IOException
  * @throws ClassNotFoundException
  */
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   // TODO Auto-generated method stub
   toolTip = in.readUTF();
   pathId = in.readUTF();
   isSelected = in.readBoolean();
   sourceNodeId = in.readInt();
   destinationNodeId = in.readInt();
 }
Example #17
0
 /** Implement Externalizable interface. */
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   _comparator = (Comparator) in.readObject();
   _keySerializer = (Serializer) in.readObject();
   _valueSerializer = (Serializer) in.readObject();
   _height = in.readInt();
   _root = in.readLong();
   _pageSize = in.readInt();
   _entries = in.readInt();
 }
Example #18
0
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   this.baseOffset = BYTE_ARRAY_OFFSET;
   this.sizeInBytes = in.readInt();
   this.numFields = in.readInt();
   this.bitSetWidthInBytes = calculateBitSetWidthInBytes(numFields);
   this.baseObject = new byte[sizeInBytes];
   in.readFully((byte[]) baseObject);
 }
 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
   in.readByte();
   this._pos = in.readInt();
   final int len = in.readInt();
   this._data = new short[len];
   for (int i = 0; i < len; ++i) {
     this._data[i] = in.readShort();
   }
 }
Example #20
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   reply = true;
   int length = in.readInt();
   uuid = new byte[length];
   in.read(uuid, 0, length);
   length = in.readInt();
   rpcId = new byte[length];
   in.read(rpcId, 0, length);
 }
Example #21
0
  @SuppressWarnings("unchecked")
  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {

    this.fixMessageArr =
        (FixMessageContainer<net.openhft.fix.include.v42.FixMessage>[]) in.readObject();
    this.objGetPosition = in.readInt();
    this.objectPutPosition = in.readInt();
  }
 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
   in.readByte();
   int size = in.readInt();
   this.setUp(size);
   while (size-- > 0) {
     final int val = in.readInt();
     this.add(val);
   }
 }
 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
   in.readByte();
   int size = in.readInt();
   this.setUp(size);
   while (size-- > 0) {
     final int key = in.readInt();
     final V val = (V) in.readObject();
     this.put(key, val);
   }
 }
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   index = in.readInt();
   type = in.readByte();
   ovalue = in.readObject();
   lvalue = in.readLong();
   bvalue = in.readBoolean();
   dvalue = in.readDouble();
   isNull = in.readBoolean();
   hashCode = in.readInt();
 }
Example #25
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   reply = in.readBoolean();
   int length = in.readInt();
   uuid = new byte[length];
   in.read(uuid, 0, length);
   length = in.readInt();
   rpcId = new byte[length];
   in.read(rpcId, 0, length);
   message = (Serializable) in.readObject();
 }
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   int v1 = in.readInt();
   int v2 = in.readInt();
   int v3 = in.readInt();
   bytes1 = new byte[v2];
   in.readFully(bytes1);
   bytes2 = new byte[v3];
   in.readFully(bytes2);
   int v4 = 0;
 }
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   if (in.readBoolean()) {
     descColumns = new boolean[in.readInt()];
     for (int i = 0; i < descColumns.length; i++) descColumns[i] = in.readBoolean();
   }
   if (in.readBoolean()) {
     nullsOrderedLow = new boolean[in.readInt()];
     for (int i = 0; i < nullsOrderedLow.length; i++) nullsOrderedLow[i] = in.readBoolean();
   }
 }
Example #28
0
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   sender = in.readInt();
   eid = in.readInt();
   type = in.readInt();
   regency = in.readInt();
   leader = in.readInt();
   state = (ApplicationState) in.readObject();
   view = (View) in.readObject();
 }
Example #29
0
  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {

    rows = in.readInt();
    columns = in.readInt();

    self = new double[rows * columns];

    for (int i = 0; i < rows * columns; i++) {
      self[i] = in.readDouble();
    }
  }
Example #30
0
  public final void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {

    int num = in.readInt();
    mapTable = new Entry[num];
    listTable = new Entry[num];
    threshold = (int) (num * LOAD_FACTOR);
    int size = in.readInt();
    for (int i = 0; i < size; i++) {
      Object key = in.readObject();
      Object value = in.readObject();
      put(key, value);
    }
  }