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)); } } }
/** * Add an object to this state engine. The images to which this object should be added are * specified with the addToImageFlags[] array of booleans. * * <p>For example, if the FastBlobStateEngine can produce 3 images, getImageConfigurations() will * return a List of size 3. * * <p>If an object added to this state engine should be contained in the images at index 1, but * not at index 0 and 2, then the boolean[] passed into this method should be {false, true, * false}. */ @Deprecated public void add(String type, Object obj, boolean[] addToImageFlags) { add(type, obj, FastBlobImageUtils.toLong(addToImageFlags)); }
/** Add an object to this state engine. This object will be added to all images. */ public void add(String type, Object obj) { add(type, obj, addToAllImagesFlags); }