@Override public void writeTo(DNAWriter writer) { if (dnaCreated.attemptSet()) { writeEventsToDNA(logicalEvents, writer); for (MetaDataDescriptorInternal md : metaData) { ((DNAWriterInternal) writer).addMetaData(md); } return; } throw new IllegalStateException("DNA already created"); }
private void writeDNA(final TCByteBufferOutputStream out, final DNAInternal dna) throws IOException, ClassNotFoundException { final DNAWriterInternal dnaWriter = new DNAWriterImpl(out, dna.getObjectID(), dna.getTypeName(), this.serializer, DNA_STORAGE_ENCODING, dna.isDelta()); writeParentObjectID(dnaWriter, dna.getParentObjectID()); // It is assumed that if this DNA is shared/accessed by multiple threads (simultaneously or other wise) that the DNA // is thread safe and the DNA gives out multiple iteratable cursors or the cursor is resettable final DNACursor cursor = dna.getCursor(); addActions(dnaWriter, cursor, DNA_STORAGE_ENCODING, dna); for (MetaDataDescriptorInternal mdd : dna.getMetaDataReader()) { dnaWriter.addMetaData(mdd); } dnaWriter.markSectionEnd(); dnaWriter.finalizeHeader(); }
@Override public void writeTo(DNAWriter writer) { if (dnaCreated.attemptSet()) { if (arrayEvents != null) { writeEventsToDNA(arrayEvents.values(), writer); } if (physicalEvents != null) { writeEventsToDNA(physicalEvents.values(), writer); } if (logicalEvents != null) { writeEventsToDNA(logicalEvents, writer); } if (literalValueChangedEvents != null) { writeEventsToDNA(literalValueChangedEvents, writer); } for (MetaDataDescriptorInternal md : metaData) { ((DNAWriterInternal) writer).addMetaData(md); } return; } throw new IllegalStateException("DNA already created"); }
@Override public void writeTo(DNAWriter writer) { if (dnaCreated.attemptSet()) { if (arrayEvents != null) { writeEventsToDNA(arrayEvents.values(), writer); } if (physicalEvents != null) { writeEventsToDNA(physicalEvents.values(), writer); } if (logicalEvents != null) { writeEventsToDNA(logicalEvents, writer); } if (literalValueChangedEvents != null) { writeEventsToDNA(literalValueChangedEvents, writer); } for (MetaDataDescriptorInternal md : metaData) { ((DNAWriterInternal) writer).addMetaData(md); } return; } throw new IllegalStateException("DNA already created"); }