示例#1
0
  private void copyObjects(
      final FastBlobStateEngine otherStateEngine,
      final String serializerName,
      final int numThreads,
      final int threadNumber) {
    FastBlobTypeDeserializationState<?> typeDeserializationState =
        getTypeDeserializationState(serializerName);
    int maxOrdinal = typeDeserializationState.maxOrdinal() + 1;
    if (maxOrdinal < threadNumber) {
      return;
    }

    FastBlobTypeSerializationState<?> typeSerializationState =
        getTypeSerializationState(serializerName);
    boolean imageMembershipsFlags[] = new boolean[numberOfConfigurations];

    for (int i = threadNumber; i < maxOrdinal; i += numThreads) {
      Object obj = typeDeserializationState.get(i);
      if (obj != null) {
        for (int imageIndex = 0; imageIndex < numberOfConfigurations; imageIndex++) {
          imageMembershipsFlags[imageIndex] =
              typeSerializationState.getImageMembershipBitSet(imageIndex).get(i);
        }
        otherStateEngine.add(
            typeSerializationState.getSchema().getName(),
            obj,
            FastBlobImageUtils.toLong(imageMembershipsFlags));
      }
    }
  }
示例#2
0
  public void fillSerializationStatesFromDeserializedData() {
    for (NFTypeSerializer<?> serializer : getTopLevelSerializers()) {
      FastBlobTypeDeserializationState<?> state = getTypeDeserializationState(serializer.getName());

      state.fillSerializationState(this);
    }
  }
示例#3
0
  /** Add a {@link TypeDeserializationStateListener} to the specified type */
  public <T> void setTypeDeserializationStateListener(
      String type, TypeDeserializationStateListener<T> listener) {
    FastBlobTypeDeserializationState<T> typeState = getTypeDeserializationState(type);
    if (typeState == null) {
      throw new RuntimeException(
          "Unable to find type.  Ensure there exists an NFTypeSerializer with the name: " + type);
    }

    typeState.setListener(listener);
  }
示例#4
0
 public void cleanUpAfterDoubleSnapshotRefresh() {
   for (FastBlobTypeDeserializationState<?> state : deserializationTypeStates.values()) {
     state.clearIdentityOrdinalMap();
   }
 }