/** * Passes data to StorageWriter to be written. * * @param data * Data to be written. * @return {@link Future} received from Storage writer. */ private Future<Void> passToStorageWriter(DefaultData data) { // clear aggregated ids when saving to storage if (data instanceof IIdsAwareAggregatedData) { ((IIdsAwareAggregatedData<?>) data).clearAggregatedIds(); } // if I am writing the InvocationAwareData and invocations are not saved // make sure we don't save the invocation affiliation if (!writeInvocationAffiliation) { Map<String, Boolean> kryoPreferences = new HashMap<>(1); kryoPreferences.put(KryoSerializationPreferences.WRITE_INVOCATION_AFFILIATION_DATA, Boolean.FALSE); return getStorageWriter().write(data, kryoPreferences); } else { return getStorageWriter().write(data); } }