/* * Copy serialization states whose serializer's name doesn't match the ones provided in the ignore collection */ public void copyTo( FastBlobStateEngine otherStateEngine, Collection<String> topLevelSerializersToIgnore) { fillDeserializationStatesFromSerializedData(); SimultaneousExecutor executor = new SimultaneousExecutor(4.0d); List<String> topLevelSerializersToCopy = new ArrayList<String>(); for (NFTypeSerializer<?> serializer : getTopLevelSerializers()) { String serializerName = serializer.getName(); if (!topLevelSerializersToIgnore.contains(serializerName)) { topLevelSerializersToCopy.add(serializer.getName()); } } CountDownLatch latch = new CountDownLatch(executor.getMaximumPoolSize() * topLevelSerializersToCopy.size()); for (String serializerizerName : topLevelSerializersToCopy) { executor.submit( getFillSerializationStateRunnable(otherStateEngine, serializerizerName, executor, latch)); } try { latch.await(); } catch (InterruptedException ie) { ie.printStackTrace(); } executor.shutdown(); }
@Override @SuppressWarnings("unchecked") public void doSerialize(SortedMap<K, V> map, NFSerializationRecord rec) { serializationFramework .getFrameworkSerializer() .serializeSortedMap(rec, "map", keySerializer.getName(), valueSerializer.getName(), map); }
private <T> void createSerializationState(NFTypeSerializer<T> serializer) { FastBlobTypeSerializationState<T> serializationState = new FastBlobTypeSerializationState<T>( serializer, numberOfConfigurations, shouldUseObjectIdentityOrdinalCaching); serializationTypeStates.put(serializer.getName(), serializationState); orderedSerializationStates.add(serializationState); deserializationTypeStates.put( serializer.getName(), new FastBlobTypeDeserializationState<T>(serializer)); }
public void fillSerializationStatesFromDeserializedData() { for (NFTypeSerializer<?> serializer : getTopLevelSerializers()) { FastBlobTypeDeserializationState<?> state = getTypeDeserializationState(serializer.getName()); state.fillSerializationState(this); } }