下面列出了org.apache.commons.lang.NotImplementedException#java.io.DataOutput 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public void writeINodeReferenceWithCount(
INodeReference.WithCount withCount, DataOutput out,
boolean writeUnderConstruction) throws IOException {
final INode referred = withCount.getReferredINode();
final long id = withCount.getId();
final boolean firstReferred = !referenceMap.containsKey(id);
out.writeBoolean(firstReferred);
if (firstReferred) {
FSImageSerialization.saveINode2Image(referred, out,
writeUnderConstruction, this);
referenceMap.put(id, withCount);
} else {
out.writeLong(id);
}
}
@Override
public void write(DataOutput output) throws IOException {
WritableUtils.writeCompressedByteArray(output, this.emptyCFName);
WritableUtils.writeVInt(output, this.columnsTracker.size());
for (Entry<ImmutableBytesPtr, NavigableSet<ImmutableBytesPtr>> entry : this.columnsTracker.entrySet()) {
// write family name
WritableUtils.writeCompressedByteArray(output, entry.getKey().copyBytes());
int qaulsSize = entry.getValue() == null ? 0 : entry.getValue().size();
WritableUtils.writeVInt(output, qaulsSize);
if (qaulsSize > 0) {
for (ImmutableBytesPtr cq : entry.getValue()) {
// write qualifier name
WritableUtils.writeCompressedByteArray(output, cq.copyBytes());
}
}
}
// Write conditionOnlyCfs
WritableUtils.writeVInt(output, this.conditionOnlyCfs.size());
for (byte[] f : this.conditionOnlyCfs) {
WritableUtils.writeCompressedByteArray(output, f);
}
}
/**
* Encodes a built DateTimeZone to the given stream. Call readFrom to
* decode the data into a DateTimeZone object.
*
* @param out the output stream to receive the encoded DateTimeZone
* @since 1.5 (parameter added)
*/
public void writeTo(String zoneID, DataOutput out) throws IOException {
// pass false so zone id is not written out
DateTimeZone zone = toDateTimeZone(zoneID, false);
if (zone instanceof FixedDateTimeZone) {
out.writeByte('F'); // 'F' for fixed
out.writeUTF(zone.getNameKey(0));
writeMillis(out, zone.getOffset(0));
writeMillis(out, zone.getStandardOffset(0));
} else {
if (zone instanceof CachedDateTimeZone) {
out.writeByte('C'); // 'C' for cached, precalculated
zone = ((CachedDateTimeZone)zone).getUncachedZone();
} else {
out.writeByte('P'); // 'P' for precalculated, uncached
}
((PrecalculatedZone)zone).writeTo(out);
}
}
@Override
public void write(DataOutput out) throws IOException {
int numCols = getNumCols();
int numVals = getNumValues();
out.writeInt(_numRows);
out.writeInt(numCols);
out.writeInt(numVals);
// write col indices
for(int i = 0; i < _colIndexes.length; i++)
out.writeInt(_colIndexes[i]);
// write distinct values
for(int i = 0; i < _values.length; i++)
out.writeDouble(_values[i]);
// write data
for(int i = 0; i < _numRows; i++)
out.writeChar(_data[i]);
}
@Override
public void toData(DataOutput out) throws IOException {
super.toData(out);
// extra short added for 7.5
Version version = InternalDataSerializer
.getVersionForDataStreamOrNull(out);
if (version == null || Version.GFE_75.compareTo(version) <= 0) {
short extBits = computeCompressedExtBits((short) 0);
out.writeShort(extBits);
}
DataSerializer.writeString(this.regionPath, out);
out.writeByte(this.op.ordinal);
if (this.callbackArg != null) {
DataSerializer.writeObject(this.callbackArg, out);
}
if (this.hasOldValue) {
out.writeByte(this.oldValueIsObject);
final byte policy = valueIsToDeserializationPolicy(this.oldValueIsObject);
final Object vObj;
final byte[] vBytes;
if (this.oldValueIsObject == VALUE_IS_BYTES && this.oldValue instanceof byte[]) {
vObj = null;
vBytes = (byte[])this.oldValue;
} else {
vObj = this.oldValue;
vBytes = null;
}
writeValue(policy, vObj, vBytes, out);
}
if (this.filterRouting != null) {
InternalDataSerializer.invokeToData(this.filterRouting, out);
}
if (this.versionTag != null) {
InternalDataSerializer.invokeToData(this.versionTag,out);
}
}
@Override
public void write(DataOutput out) throws IOException {
out.writeInt(aggregations.length);
for (int i = 0; i < aggregations.length; i++) {
out.writeInt(aggregations[i].getId().ordinal());
aggregations[i].write(out);
}
}
public void toData(DataOutput output) throws IOException {
DataSerializer.writeString(id_ccy_std, output);
;
output.writeInt(id_region);
DataSerializer.writeString(id_ccy_bse, output);
output.writeFloat(id_region);
}
@Override
public void toData(DataOutput out) throws IOException {
super.toData(out);
DataSerializer.writeNonPrimitiveClassName(this.className, out);
out.writeInt(this.id);
DataSerializer.writeObject(this.eventId, out);
}
public void write(DataOutput out) throws IOException {
UTF8.writeString(out, getBuildVersion());
out.writeInt(getLayoutVersion());
out.writeInt(getNamespaceID());
out.writeLong(getCTime());
out.writeInt(getDistributedUpgradeVersion());
}
@Override
public void write(DataOutput out) throws IOException {
if (!isPermissionLoaded()) {
loadPermissionInfo();
}
super.write(out);
}
@Override
public void toData(DataOutput out)
throws IOException {
super.toData(out);
if (GemFireXDUtils.TraceApplicationJars) {
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_APP_JARS,
"GfxdJarMessage#toData: this.sendBytes " + this.sendBytes
+ " and jar bytes " + Arrays.toString(this.jar_bytes));
}
out.writeLong(this.id);
DataSerializer.writeString(this.schemaName, out);
DataSerializer.writeString(this.sqlName, out);
DataSerializer.writeByte((byte)this.type, out);
if (this.type != JAR_REMOVE) {
if (this.sendBytes) {
if (GemFireXDUtils.TraceApplicationJars) {
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_APP_JARS,
"GfxdJarMessage#toData: writing byte array "
+ Arrays.toString(this.jar_bytes));
}
DataSerializer.writeByteArray(this.jar_bytes, out);
}
else {
if (GemFireXDUtils.TraceApplicationJars) {
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_APP_JARS,
"GfxdJarMessage#toData: sending null jar bytes "
+ Arrays.toString(this.jar_bytes));
}
DataSerializer.writeByteArray(null, out);
}
DataSerializer.writeLong(this.oldId, out);
}
}
@Override
public void write(DataOutput out) throws IOException {
System.out.println("writing Trades cid:" + cid + " tid: " + tid + " eid: " + eid + " tradeDate: " + tradeDate.getTime());
out.writeInt(cid);
out.writeInt(tid);
out.writeInt(eid);
out.writeLong(tradeDate.getTime());
}
@Override
public void operateDTDurationInteger(LongPointable longp1, LongPointable longp2, DataOutput dOut)
throws SystemException, IOException {
long value = longp1.longValue();
value -= longp2.longValue();
dOut.write(ValueTag.XS_DAY_TIME_DURATION_TAG);
dOut.writeLong(value);
}
/**
* 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);
DataSerializer.writeString(this.regionPath,out);
}
/**
* The object implements the writeTo method to save its contents
* by calling the methods of DataOutput for its primitive values and strings or
* calling the writeTo method for other objects.
*
* @param out the stream to write the object to.
* @throws IOException Includes any I/O exceptions that may occur.
*/
public void writeTo(DataOutput out) throws IOException {
out.writeInt(schemaId);
out.writeInt(ids.length);
for (Integer id : ids)
out.writeInt(id);
}
/**
* Write the header information to the provided {@link java.io.DataOutput}.
*
* @param output The output to write to
* @throws IOException If any problems occur writing to the output
*/
public void write(final DataOutput output) throws IOException {
output.write(ManagementProtocol.SIGNATURE);
output.writeByte(ManagementProtocol.VERSION_FIELD);
output.writeInt(getVersion());
output.writeByte(ManagementProtocol.TYPE);
output.writeByte(getType());
}
public void writeTo(DataOutput out) throws IOException {
out.writeByte(iMode);
out.writeByte(iMonthOfYear);
out.writeByte(iDayOfMonth);
out.writeByte(iDayOfWeek);
out.writeBoolean(iAdvance);
writeMillis(out, iMillisOfDay);
}
@Override
public void toData(DataOutput out) throws IOException {
super.toData(out);
DataSerializer.writeInteger(this.bucketId, out);
DataSerializer.writeBoolean(this.isPrimary, out);
DataSerializer.writeByte(this.version, out);
out.writeByte(this.numServerGroups);
if(this.numServerGroups > 0) {
for(String s: this.serverGroups) {
DataSerializer.writeString(s, out);
}
}
}
@Override
public void write(DataOutput output) throws IOException {
// Encode hasSeparator and isFixedLength into vint storing offset array length
// (since there's plenty of room)
int length = offsets.length << 2;
length |= (hasSeparator ? 1 << 1 : 0) | (isFixedLength ? 1 : 0);
ByteUtil.serializeVIntArray(output, offsets, length);
}
public void send(DataOutput out) throws IOException {
out.writeLong(signature);
out.writeLong(cb);
out.writeBoolean(haveToReturnData);
out.writeInt(command);
out.writeInt(returnCode);
out.writeInt(flags);
out.writeInt(protcolVersion);
out.write(payload);
}
public void toData(DataOutput out) throws IOException {
// Do not modify StatAlert to allow 57 cacheservers to function with 57+ agent
// However, update of a new StatAlertDefn on 57 server from 57+ agent not covered with this
DataSerializer.writePrimitiveInt(this.getDefinitionId(), out);
DataSerializer.writeDate(this.getTime(), out);
DataSerializer.writeObjectArray(this.getValues(), out);
DataSerializer.writeString(this.memberId, out);
}
@Override
public void write(DataOutput out) throws IOException {
if (type == NOT_SET || instance == null)
throw new IOException("The GenericWritable has NOT been set correctly. type="
+ type + ", instance=" + instance);
out.writeByte(type);
instance.write(out);
}
@Override
public void toData(DataOutput out) throws IOException {
if (!isNull()) {
out.writeByte(getTypeId());
writeData(out, true);
return;
}
this.writeNullDVD(out);
}
@Override
public void write(DataOutput out) throws IOException {
System.out.println("writing Portfolio cid: " + cid + " sid: " + sid + " qty: " + qty + " availQty: " + availQty + " subTotal: " + subTotal.toPlainString() + " tid: " + tid);
out.writeInt(cid);
out.writeInt(sid);
out.writeInt(tid);
out.writeInt(qty);
out.writeInt(availQty);
out.writeUTF(subTotal.toPlainString());
}
/**
* Writes the state the ZoneOffset to the stream.
*
* @param offset the offset, not null
* @param out the output stream, not null
* @throws IOException if an error occurs
*/
static void writeOffset(ZoneOffset offset, DataOutput out) throws IOException {
final int offsetSecs = offset.getTotalSeconds();
int offsetByte = offsetSecs % 900 == 0 ? offsetSecs / 900 : 127; // compress to -72 to +72
out.writeByte(offsetByte);
if (offsetByte == 127) {
out.writeInt(offsetSecs);
}
}
@Override
public void operateDTDurationDTDuration(LongPointable longp1, LongPointable longp2, DataOutput dOut)
throws SystemException, IOException {
long value = longp1.longValue();
value -= longp2.longValue();
dOut.write(ValueTag.XS_DAY_TIME_DURATION_TAG);
dOut.writeLong(value);
}
@Override
public void write(DataOutput out) throws IOException {
// spatial
out.writeInt(this.spatial);
// temporal
out.writeInt(this.temporal);
// attribute
out.writeFloat(this.value);
}
public void writeTo(DataOutput out) throws IOException {
writeMillis(out, iStandardOffset);
iStartRecurrence.writeTo(out);
iEndRecurrence.writeTo(out);
}
public void toData(DataOutput out) throws IOException {
out.writeInt(this.timeout);
DataSerializer.writeObject(this.action, out);
}
@Override
public void write(DataOutput out) throws IOException {
t.write(out);
out.writeBoolean(synthetic);
out.writeBoolean(omittable);
}