Пример #1
0
  /*
   * 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();
  }
Пример #2
0
 @Override
 @SuppressWarnings("unchecked")
 public void doSerialize(SortedMap<K, V> map, NFSerializationRecord rec) {
   serializationFramework
       .getFrameworkSerializer()
       .serializeSortedMap(rec, "map", keySerializer.getName(), valueSerializer.getName(), map);
 }
Пример #3
0
 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));
 }
Пример #4
0
  public void fillSerializationStatesFromDeserializedData() {
    for (NFTypeSerializer<?> serializer : getTopLevelSerializers()) {
      FastBlobTypeDeserializationState<?> state = getTypeDeserializationState(serializer.getName());

      state.fillSerializationState(this);
    }
  }