@Override public ComplexPayload deserialize(DataInputView source) throws IOException { try (final DataInputViewStream inViewWrapper = new DataInputViewStream(source)) { Thread currentThread = Thread.currentThread(); if (currentOwnerThread.compareAndSet(null, currentThread)) { return InstantiationUtil.deserializeObject( inViewWrapper, currentThread.getContextClassLoader()); } else { throw new IllegalStateException("Concurrent access to type serializer detected!"); } } catch (ClassNotFoundException e) { throw new IOException("Could not deserialize object.", e); } finally { currentOwnerThread.set(null); } }
private void readV1(DataInputView in, ClassLoader classLoader) throws IOException { nestedSnapshot = NestedSerializersSnapshotDelegate.legacyReadNestedSerializerSnapshots(in, classLoader); try (DataInputViewStream inViewWrapper = new DataInputViewStream(in)) { componentClass = InstantiationUtil.deserializeObject(inViewWrapper, classLoader); } catch (ClassNotFoundException e) { throw new IOException("Could not find requested element class in classpath.", e); } }
@Override public void read(DataInputView in) throws IOException { super.read(in); try (final DataInputViewStream inViewWrapper = new DataInputViewStream(in)) { tupleClass = InstantiationUtil.deserializeObject(inViewWrapper, getUserCodeClassLoader(), true); } catch (ClassNotFoundException e) { throw new IOException("Could not find requested tuple class in classpath.", e); } }
@SuppressWarnings("unchecked") @Override protected void restoreKeyAndNamespaceSerializers( InternalTimersSnapshot<K, N> restoredTimersSnapshot, DataInputView in) throws IOException { DataInputViewStream dis = new DataInputViewStream(in); try { restoredTimersSnapshot.setKeySerializer(InstantiationUtil.deserializeObject(dis, userCodeClassLoader, true)); restoredTimersSnapshot.setNamespaceSerializer(InstantiationUtil.deserializeObject(dis, userCodeClassLoader, true)); } catch (ClassNotFoundException exception) { throw new IOException(exception); } } }
@Override public void read(DataInputView in) throws IOException { super.read(in); if (getReadVersion() == 1) { try (final DataInputViewStream inViewWrapper = new DataInputViewStream(in)) { try { T[] legacyEnumConstants = InstantiationUtil.deserializeObject(inViewWrapper, getUserCodeClassLoader()); this.enumConstants = buildEnumConstantsList(legacyEnumConstants); } catch (ClassNotFoundException e) { throw new IOException("The requested enum class cannot be found in classpath.", e); } catch (IllegalArgumentException e) { throw new IOException("A previously existing enum constant of " + getTypeClass().getName() + " no longer exists.", e); } } } else if (getReadVersion() == VERSION) { int numEnumConstants = in.readInt(); this.enumConstants = new ArrayList<>(numEnumConstants); for (int i = 0; i < numEnumConstants; i++) { enumConstants.add(in.readUTF()); } } else { throw new IOException("Cannot deserialize EnumSerializerConfigSnapshot with version " + getReadVersion()); } }
ExecutionConfig.SerializableSerializer<? extends Serializer<RC>> serializerInstance; try (final DataInputViewStream inViewWrapper = new DataInputViewStream(in)) { serializerInstance = InstantiationUtil.deserializeObject(inViewWrapper, userCodeClassLoader); } catch (ClassNotFoundException e) {
@SuppressWarnings("unchecked") @Override public T deserialize(DataInputView source) throws IOException { if (CONCURRENT_ACCESS_CHECK) { enterExclusiveThread(); } try { checkKryoInitialized(); if (source != previousIn) { DataInputViewStream inputStream = new DataInputViewStream(source); input = new NoFetchingInput(inputStream); previousIn = source; } try { return (T) kryo.readClassAndObject(input); } catch (KryoException ke) { Throwable cause = ke.getCause(); if (cause instanceof EOFException) { throw (EOFException) cause; } else { throw ke; } } } finally { if (CONCURRENT_ACCESS_CHECK) { exitExclusiveThread(); } } }
@Override public NFA<T> deserialize(DataInputView source) throws IOException { try (ObjectInputStream ois = new ObjectInputStream(new DataInputViewStream(source))) { return (NFA<T>) ois.readObject(); } catch (ClassNotFoundException e) { throw new RuntimeException("Could not deserialize NFA.", e); } }
@Override public T deserialize(DataInputView source) throws IOException { try (final DataInputViewStream inViewWrapper = new DataInputViewStream(source)) { return InstantiationUtil.deserializeObject( inViewWrapper, Thread.currentThread().getContextClassLoader()); } catch (ClassNotFoundException e) { throw new IOException("Could not deserialize object.", e); } }
@Override public T deserialize(DataInputView source) throws IOException { try (final DataInputViewStream inViewWrapper = new DataInputViewStream(source)) { return InstantiationUtil.deserializeObject( inViewWrapper, Thread.currentThread().getContextClassLoader()); } catch (ClassNotFoundException e) { throw new IOException("Could not deserialize object.", e); } }
@Override public T deserialize(DataInputView source) throws IOException { try (final DataInputViewStream inViewWrapper = new DataInputViewStream(source)) { return InstantiationUtil.deserializeObject( inViewWrapper, Thread.currentThread().getContextClassLoader()); } catch (ClassNotFoundException e) { throw new IOException("Could not deserialize object.", e); } }
@Override public T deserialize(DataInputView source) throws IOException { try (final DataInputViewStream inViewWrapper = new DataInputViewStream(source)) { return InstantiationUtil.deserializeObject( inViewWrapper, Thread.currentThread().getContextClassLoader()); } catch (ClassNotFoundException e) { throw new IOException("Could not deserialize object.", e); } }
private void readV1(DataInputView in, ClassLoader classLoader) throws IOException { nestedSnapshot = CompositeSerializerSnapshot.legacyReadProductSnapshots(in, classLoader); try (DataInputViewStream inViewWrapper = new DataInputViewStream(in)) { componentClass = InstantiationUtil.deserializeObject(inViewWrapper, classLoader); } catch (ClassNotFoundException e) { throw new IOException("Could not find requested element class in classpath.", e); } }
@Override public void read(DataInputView in) throws IOException { super.read(in); try (final DataInputViewStream inViewWrapper = new DataInputViewStream(in)) { tupleClass = InstantiationUtil.deserializeObject(inViewWrapper, getUserCodeClassLoader(), true); } catch (ClassNotFoundException e) { throw new IOException("Could not find requested tuple class in classpath.", e); } }
@Override public void read(DataInputView in) throws IOException { super.read(in); try (final DataInputViewStream inViewWrapper = new DataInputViewStream(in)) { componentClass = InstantiationUtil.deserializeObject(inViewWrapper, getUserCodeClassLoader()); } catch (ClassNotFoundException e) { throw new IOException("Could not find requested element class in classpath.", e); } }
@Override public void read(DataInputView in) throws IOException { super.read(in); try (final DataInputViewStream inViewWrapper = new DataInputViewStream(in)) { tupleClass = InstantiationUtil.deserializeObject(inViewWrapper, getUserCodeClassLoader(), true); } catch (ClassNotFoundException e) { throw new IOException("Could not find requested tuple class in classpath.", e); } }
@SuppressWarnings("unchecked") @Override protected void restoreKeyAndNamespaceSerializers( InternalTimersSnapshot<K, N> restoredTimersSnapshot, DataInputView in) throws IOException { DataInputViewStream dis = new DataInputViewStream(in); try { restoredTimersSnapshot.setKeySerializer(InstantiationUtil.deserializeObject(dis, userCodeClassLoader, true)); restoredTimersSnapshot.setNamespaceSerializer(InstantiationUtil.deserializeObject(dis, userCodeClassLoader, true)); } catch (ClassNotFoundException exception) { throw new IOException(exception); } } }
@SuppressWarnings("unchecked") @Override protected void restoreKeyAndNamespaceSerializers( InternalTimersSnapshot<K, N> restoredTimersSnapshot, DataInputView in) throws IOException { DataInputViewStream dis = new DataInputViewStream(in); try { restoredTimersSnapshot.setKeySerializer(InstantiationUtil.deserializeObject(dis, userCodeClassLoader, true)); restoredTimersSnapshot.setNamespaceSerializer(InstantiationUtil.deserializeObject(dis, userCodeClassLoader, true)); } catch (ClassNotFoundException exception) { throw new IOException(exception); } } }
@Override public void read(DataInputView in) throws IOException { super.read(in); try (final DataInputViewStream inViewWrapper = new DataInputViewStream(in)) { isPrimitive = InstantiationUtil.deserializeObject(inViewWrapper, getUserCodeClassLoader()); eleType = InstantiationUtil.deserializeObject(inViewWrapper, getUserCodeClassLoader()); } catch (ClassNotFoundException e) { throw new IOException("Could not find requested element class in classpath.", e); } }
mode.toString()); DataInputViewStream dis = new DataInputViewStream(in); ClassLoader previousClassLoader = Thread.currentThread().getContextClassLoader();