@Override
 public void toData(DataOutput out) throws IOException {
   out.writeInt(this.prId);
   out.writeByte(this.scope.ordinal);
   InternalDataSerializer.invokeToData(this.pAttrs, out);
   out.writeBoolean(this.isDestroying);
   out.writeBoolean(this.isColocationComplete);
   InternalDataSerializer.invokeToData(this.nodes, out);
   DataSerializer.writeString(this.partitionResolver, out);
   DataSerializer.writeString(this.colocatedWith, out);
   DataSerializer.writeString(this.fullPath, out);
   InternalDataSerializer.invokeToData(this.ea, out);
   InternalDataSerializer.invokeToData(this.regionIdleTimeout, out);
   InternalDataSerializer.invokeToData(this.regionTimeToLive, out);
   InternalDataSerializer.invokeToData(this.entryIdleTimeout, out);
   InternalDataSerializer.invokeToData(this.entryTimeToLive, out);
   out.writeBoolean(this.firstDataStoreCreated);
   DataSerializer.writeObject(elderFPAs, out);
   DataSerializer.writeArrayList(this.partitionListenerClassNames, out);
   if (this.gatewaySenderIds.isEmpty()) {
     DataSerializer.writeObject(null, out);
   } else {
     DataSerializer.writeObject(this.gatewaySenderIds, out);
   }
 }
예제 #2
0
 @Override
 public void toData(DataOutput out) throws IOException {
   DataSerializer.writeObject(key, out);
   DataSerializer.writeObject(originKey, out);
   DataSerializer.writeBoolean(nodeChange, out);
   DataSerializer.writeHashMap(values, out);
   DataSerializer.writeString(operation, out);
 }
 /**
  * Writes an object to a <code>Datautput</code>.
  *
  * @throws IOException If this serializer cannot write an object to <code>out</code>.
  * @see #fromData
  */
 @Override
 public void toData(DataOutput out) throws IOException {
   // Note: does not call super.toData what a HACK
   out.writeByte(_operation.getEventCode());
   int instantiatorCount = this.serializedInstantiators.length;
   out.writeInt(instantiatorCount);
   for (int i = 0; i < instantiatorCount; i++) {
     DataSerializer.writeByteArray(this.serializedInstantiators[i], out);
   }
   DataSerializer.writeObject(_membershipId, out);
   DataSerializer.writeObject(_eventIdentifier, out);
 }
예제 #4
0
 /**
  * Writes the state of this object to the given <code>DataOutput</code>.
  *
  * @gfcodegen This code is generated by gfcodegen.
  */
 public void toData(DataOutput output) throws IOException {
   DataSerializer.writeString(name, output);
   //		DataSerializer.writeBoolean(isReal, output);
   DataSerializer.writeString(fullPath, output);
   DataSerializer.writeObject(childList, output);
   DataSerializer.writeObject(attrInfo, output);
   DataSerializer.writeObject(temporalType, output);
   DataSerializer.writeString(keyTypeName, output);
   DataSerializer.writeString(valueTypeName, output);
   DataSerializer.writePrimitiveInt(size, output);
   DataSerializer.writeObject(primaryBucketInfoList, output);
   DataSerializer.writeObject(redundantBucketInfoList, output);
 }
 /**
  * @throws IllegalStateException if off-heap and the actual value is not yet known (because the
  *     DistributedSystem has not yet been created)
  */
 public void toData(DataOutput out) throws IOException {
   checkLocalMaxMemoryExists();
   out.writeInt(this.redundancy);
   out.writeLong(this.totalMaxMemory);
   out.writeInt(
       getLocalMaxMemory()); // call the gettor to force it to be computed in the offheap case
   out.writeInt(this.totalNumBuckets);
   DataSerializer.writeString(this.colocatedRegionName, out);
   DataSerializer.writeObject(this.localProperties, out);
   DataSerializer.writeObject(this.globalProperties, out);
   out.writeLong(this.recoveryDelay);
   out.writeLong(this.startupRecoveryDelay);
   DataSerializer.writeObject(this.fixedPAttrs, out);
 }
예제 #6
0
 /**
  * Post 7.1, if changes are made to this method make sure that it is backwards compatible by
  * creating toDataPreXX methods. Also make sure that the callers to this method are backwards
  * compatible by creating toDataPreXX methods for them even if they are not changed. <br>
  * Callers for this method are: <br>
  * SendQueueMessage.toData(DataOutput) <br>
  */
 public void toData(DataOutput out) throws IOException {
   out.writeByte(this.op.ordinal);
   DataSerializer.writeObject(this.cbArg, out);
   if (this.op.isEntry()) {
     DataSerializer.writeObject(this.key, out);
     if (this.op.isUpdate() || this.op.isCreate()) {
       out.writeByte(this.deserializationPolicy);
       if (this.deserializationPolicy != DistributedCacheOperation.DESERIALIZATION_POLICY_EAGER) {
         DataSerializer.writeByteArray(this.value, out);
       } else {
         DataSerializer.writeObject(this.valueObj, out);
       }
     }
   }
 }
 /** call this when the distributed system ID has been modified */
 @edu.umd.cs.findbugs.annotations.SuppressWarnings(
     value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD",
     justification =
         "Only applicable in client DS and in that case too multiple instances do not modify it at the same time.")
 public void updateID(DistributedMember idm) {
   //    this.transientPort = ((InternalDistributedMember)this.memberId).getPort();
   //    if (this.transientPort == 0) {
   //      InternalDistributedSystem.getLoggerI18n().warning(
   //          LocalizedStrings.DEBUG,
   //          "updating client ID when member port is zero: " + this.memberId,
   //          new Exception("stack trace")
   //          );
   //    }
   HeapDataOutputStream hdos = new HeapDataOutputStream(256, Version.CURRENT);
   try {
     DataSerializer.writeObject(idm, hdos);
   } catch (IOException e) {
     throw new InternalGemFireException("Unable to serialize member: " + this.memberId, e);
   }
   this.identity = hdos.toByteArray();
   if (this.memberId != null && this.memberId == systemMemberId) {
     systemMemberId = idm;
     // client_side_identity = this.identity;
   }
   this.memberId = idm;
   this._toString = null; // make sure we don't retain the old ID representation in toString
 }
 @Override
 public void toData(DataOutput out) throws IOException {
   super.toData(out);
   out.writeInt(this.prId);
   out.writeInt(this.processorId);
   DataSerializer.writeObject(this.profiles, out);
 }
 public void saveView(NetView view) {
   if (viewFile == null) {
     return;
   }
   if (!viewFile.delete() && viewFile.exists()) {
     logger.warn(
         "Peer locator is unable to delete persistent membership information in "
             + viewFile.getAbsolutePath());
   }
   try {
     ObjectOutputStream oos = null;
     try {
       oos = new ObjectOutputStream(new FileOutputStream(viewFile));
       oos.writeInt(LOCATOR_FILE_STAMP);
       oos.writeInt(Version.CURRENT_ORDINAL);
       DataSerializer.writeObject(view, oos);
     } finally {
       oos.flush();
       oos.close();
     }
   } catch (Exception e) {
     logger.warn(
         "Peer locator encountered an error writing current membership to disk.  Disabling persistence.  Care should be taken when bouncing this locator as it will not be able to recover knowledge of the running distributed system",
         e);
     this.viewFile = null;
   }
 }
  public static byte[] initializeAndGetDSIdentity(DistributedSystem sys) {
    byte[] client_side_identity = null;
    if (sys == null) {
      // DistributedSystem is required now before handshaking -Kirk
      throw new IllegalStateException(
          LocalizedStrings
              .ClientProxyMembershipID_ATTEMPTING_TO_HANDSHAKE_WITH_CACHESERVER_BEFORE_CREATING_DISTRIBUTEDSYSTEM_AND_CACHE
              .toLocalizedString());
    }
    // if (system != sys)
    {
      // DS already exists... make sure it's for current DS connection
      systemMemberId = sys.getDistributedMember();
      try {
        HeapDataOutputStream hdos = new HeapDataOutputStream(256, Version.CURRENT);
        DataSerializer.writeObject(systemMemberId, hdos);
        client_side_identity = hdos.toByteArray();
      } catch (IOException ioe) {
        throw new InternalGemFireException(
            LocalizedStrings.ClientProxyMembershipID_UNABLE_TO_SERIALIZE_IDENTITY
                .toLocalizedString(),
            ioe);
      }

      system = sys;
    }
    return client_side_identity;
  }
 @Override
 public void toData(DataOutput dout) throws IOException {
   super.toData(dout);
   dout.writeInt(processorId);
   DataSerializer.writeHashMap(channelState, dout);
   DataSerializer.writeObject(requestingMember, dout);
   dout.writeBoolean(this.isSingleFlushTo);
 }
예제 #12
0
 @Override
 public void toData(DataOutput out) throws IOException {
   DataSerializer.writeString(this.type, out);
   DataSerializer.writeObject(this.attributes, out);
   DataSerializer.writeString(this.xmlDefinition, out);
   DataSerializer.writeString(this.searchString, out);
   DataSerializer.writeString(this.prefix, out);
   DataSerializer.writeString(this.namespace, out);
 }
 @Override
 public void toData(DataOutput dout) throws IOException {
   super.toData(dout);
   DataSerializer.writeObject(relayRecipient, dout);
   dout.writeInt(processorId);
   dout.writeInt(processorType);
   dout.writeBoolean(allRegions);
   if (!allRegions) {
     DataSerializer.writeString(regionPath, dout);
   }
 }
  public void toData(DataOutput out) throws IOException {
    out.writeBoolean(host != null);
    if (host != null) {
      DataSerializer.writeInetAddress(host, out);
    }
    out.writeBoolean(directory != null);
    if (directory != null) {
      DataSerializer.writeString(directory, out);
    }

    DataSerializer.writeObject(diskStoreID, out);
    out.writeLong(revokedTime);
  }
  /**
   * Send the contents of this instance to the DataOutput Required to be a {@link
   * com.gemstone.gemfire.DataSerializable}Note: must be symmetric with {@link
   * #fromData(DataInput)}in what it writes
   */
  @Override
  public void toData(DataOutput out) throws IOException {
    super.toData(out);
    short flags = computeCompressedShort();
    out.writeShort(flags);
    if (this.processorId != 0) {
      out.writeInt(this.processorId);
    }
    if (this.processorType != 0) {
      out.writeByte(this.processorType);
    }
    if (this.getTXUniqId() != TXManagerImpl.NOTX) {
      out.writeInt(this.getTXUniqId());
    }
    if (this.getTXMemberId() != null) {
      DataSerializer.writeObject(this.getTXMemberId(), out);
    }
    DataSerializer.writeString(this.regionPath, out);

    // extra field post 9.0
    if (InternalDataSerializer.getVersionForDataStream(out).compareTo(Version.GFE_90) >= 0) {
      out.writeBoolean(this.isTransactionDistributed);
    }
  }
 @Override
 public void toData(DataOutput out) throws IOException {
   super.toData(out);
   out.writeInt(this.id);
   DataSerializer.writeObject(this.healthCode, out);
 }
 @Override
 public void toData(DataOutput dout) throws IOException {
   super.toData(dout);
   DataSerializer.writeObject(sendingMember, dout);
 }
 @Override
 public void toData(DataOutput out) throws IOException {
   super.toData(out);
   DataSerializer.writeObject(this.bridgeInfo, out);
   DataSerializer.writeObject(this.exception, out);
 }
 @Override
 public void toData(DataOutput out) throws IOException {
   super.toData(out);
   DataSerializer.writeObject(this.elementType, out);
 }
 public void toData(DataOutput out) throws IOException {
   DataSerializer.writeObject(this._def, out);
 }
예제 #21
0
 /**
  * Writes the state of this object to the given <code>DataOutput</code>.
  *
  * @gfcodegen This code is generated by gfcodegen.
  */
 public void toData(DataOutput output) throws IOException {
   DataSerializer.writeObject(item, output);
   DataSerializer.writePrimitiveInt(bucketId, output);
   DataSerializer.writePrimitiveInt(resultIndex, output);
 }