private void parseLiteralValue(final DNAEncodingInternal encoding) throws IOException, ClassNotFoundException { final Object value = encoding.decode(this.input); this.currentAction = new LiteralAction(value); }
@Override public void addLiteralValue(Object value) { actionCount++; output.writeByte(BaseDNAEncodingImpl.LITERAL_VALUE_ACTION_TYPE); encoding.encode(value, output); }
@Override public void addEntireArray(Object value) { actionCount++; output.writeByte(BaseDNAEncodingImpl.ENTIRE_ARRAY_ACTION_TYPE); encoding.encodeArray(value, output); }
private void parseLiteralValue(final DNAEncodingInternal encoding) throws IOException, ClassNotFoundException { final Object value = encoding.decode(this.input); this.currentAction = new LiteralAction(value); }
@Override public void addLiteralValue(Object value) { actionCount++; output.writeByte(BaseDNAEncodingImpl.LITERAL_VALUE_ACTION_TYPE); encoding.encode(value, output); }
@Override public void addEntireArray(Object value) { actionCount++; output.writeByte(BaseDNAEncodingImpl.ENTIRE_ARRAY_ACTION_TYPE); encoding.encodeArray(value, output); }
private void parseEntireArray(final DNAEncodingInternal encoding) throws IOException, ClassNotFoundException { final Object array = encoding.decode(this.input); this.currentAction = new PhysicalAction(array); }
@Override public void addArrayElementAction(int index, Object value) { actionCount++; output.writeByte(BaseDNAEncodingImpl.ARRAY_ELEMENT_ACTION_TYPE); output.writeInt(index); encoding.encode(value, output); }
@Override public void addSubArrayAction(int start, Object array, int length) { actionCount++; output.writeByte(BaseDNAEncodingImpl.SUB_ARRAY_ACTION_TYPE); output.writeInt(start); encoding.encodeArray(array, output, length); }
private void parseEntireArray(final DNAEncodingInternal encoding) throws IOException, ClassNotFoundException { final Object array = encoding.decode(this.input); this.currentAction = new PhysicalAction(array); }
@Override public void addArrayElementAction(int index, Object value) { actionCount++; output.writeByte(BaseDNAEncodingImpl.ARRAY_ELEMENT_ACTION_TYPE); output.writeInt(index); encoding.encode(value, output); }
@Override public void addSubArrayAction(int start, Object array, int length) { actionCount++; output.writeByte(BaseDNAEncodingImpl.SUB_ARRAY_ACTION_TYPE); output.writeInt(start); encoding.encodeArray(array, output, length); }
private void parseArrayElement(final DNAEncodingInternal encoding) throws IOException, ClassNotFoundException { final int index = this.input.readInt(); final Object value = encoding.decode(this.input); this.currentAction = new PhysicalAction(index, value, value instanceof ObjectID); }
@Override public void addLogicalAction(int method, Object[] parameters) { actionCount++; output.writeByte(BaseDNAEncodingImpl.LOGICAL_ACTION_TYPE); output.writeInt(method); // use a short instead? output.writeByte(parameters.length); for (Object parameter : parameters) { encoding.encode(parameter, output, serializer); } }
private void parseArrayElement(final DNAEncodingInternal encoding) throws IOException, ClassNotFoundException { final int index = this.input.readInt(); final Object value = encoding.decode(this.input); this.currentAction = new PhysicalAction(index, value, value instanceof ObjectID); }
/** * NOTE::README This method is called from instrumented code in the L2. * * @see PhysicalStateClassLoader.createBasicDehydrateMethod() */ @Override public void addPhysicalAction(String fieldName, Object value, boolean canBeReferenced) { if (value == null) { // Normally null values are converted into Null ObjectID much earlier, but this is not true when there are // multiple versions of a class in a cluster sharing data. value = ObjectID.NULL_ID; canBeReferenced = true; } actionCount++; if (canBeReferenced) { // An Object reference can be set to a literal instance, like // Object o = Integer.valueOf(10); // NOTE::Earlier we used to also check LiteralValues.isLiteralInstance(value) before entering this block, but I // think that is unnecessary and wrong when we optimize later to store ObjectIDs as longs in most cases in the L2 output.writeByte(BaseDNAEncodingImpl.PHYSICAL_ACTION_TYPE_REF_OBJECT); } else { output.writeByte(BaseDNAEncodingImpl.PHYSICAL_ACTION_TYPE); } serializer.writeFieldName(output, fieldName); encoding.encode(value, output); }
private void parsePhysical(final DNAEncodingInternal encoding, final boolean isReference) throws IOException, ClassNotFoundException { final String fieldName = this.serializer.readFieldName(this.input); final Object value = encoding.decode(this.input); this.currentAction = new PhysicalAction(fieldName, value, value instanceof ObjectID || isReference); }
/** * NOTE::README This method is called from instrumented code in the L2. * * @see PhysicalStateClassLoader.createBasicDehydrateMethod() */ @Override public void addPhysicalAction(String fieldName, Object value, boolean canBeReferenced) { if (value == null) { // Normally null values are converted into Null ObjectID much earlier, but this is not true when there are // multiple versions of a class in a cluster sharing data. value = ObjectID.NULL_ID; canBeReferenced = true; } actionCount++; if (canBeReferenced) { // An Object reference can be set to a literal instance, like // Object o = Integer.valueOf(10); // NOTE::Earlier we used to also check LiteralValues.isLiteralInstance(value) before entering this block, but I // think that is unnecessary and wrong when we optimize later to store ObjectIDs as longs in most cases in the L2 output.writeByte(BaseDNAEncodingImpl.PHYSICAL_ACTION_TYPE_REF_OBJECT); } else { output.writeByte(BaseDNAEncodingImpl.PHYSICAL_ACTION_TYPE); } serializer.writeFieldName(output, fieldName); encoding.encode(value, output); }
private void parsePhysical(final DNAEncodingInternal encoding, final boolean isReference) throws IOException, ClassNotFoundException { final String fieldName = this.serializer.readFieldName(this.input); final Object value = encoding.decode(this.input); this.currentAction = new PhysicalAction(fieldName, value, value instanceof ObjectID || isReference); }
@Override public void addLogicalAction(int method, Object[] parameters, LogicalChangeID logicalChangeID) { actionCount++; output.writeByte(BaseDNAEncodingImpl.LOGICAL_ACTION_TYPE); output.writeBoolean(logicalChangeID.isNull()); if (!logicalChangeID.isNull()) { output.writeLong(logicalChangeID.toLong()); } output.writeInt(method); // use a short instead? output.writeByte(parameters.length); for (Object parameter : parameters) { encoding.encode(parameter, output, serializer); } }