@Test public void testSerializerDuplication() throws Exception { TypeSerializer<String> statefulSerializer = new KryoSerializer<>(String.class, new ExecutionConfig()); TestStateDescriptor<String> descr = new TestStateDescriptor<>("foobar", statefulSerializer); TypeSerializer<String> serializerA = descr.getSerializer(); TypeSerializer<String> serializerB = descr.getSerializer(); assertNotSame(serializerA, serializerB); }
public TypeSerializer<T> getSerializer() { if (serializer != null) { return serializer.duplicate(); } else { throw new IllegalStateException("Serializer not yet initialized."); } }
StateDescriptor implements Serializable { public TypeSerializer<T> getSerializer() { if (serializer != null) { return serializer.duplicate(); } else { throw new IllegalStateException("Serializer not yet initialized."); } } }
StateDescriptor implements Serializable { public TypeSerializer<T> getSerializer() { if (serializer != null) { return serializer.duplicate(); } else { throw new IllegalStateException("Serializer not yet initialized."); } } protected  StateDescriptor(String name, TypeSerializer<T> serializer, @Nullable T defaultValue); protected  StateDescriptor(String name, TypeInformation<T> typeInfo, @Nullable T defaultValue); protected  StateDescriptor(String name, Class<T> type, @Nullable T defaultValue); }
StateDescriptor implements Serializable { public TypeSerializer<T> getSerializer() { if (serializer != null) { return serializer.duplicate(); } else { throw new IllegalStateException("Serializer not yet initialized."); } } protected  StateDescriptor(String name, TypeSerializer<T> serializer, @Nullable T defaultValue); protected  StateDescriptor(String name, TypeInformation<T> typeInfo, @Nullable T defaultValue); protected  StateDescriptor(String name, Class<T> type, @Nullable T defaultValue); String getName(); T getDefaultValue(); TypeSerializer<T> getSerializer(); void setQueryable(String queryableStateName); @Nullable String getQueryableStateName(); boolean isQueryable(); void enableTimeToLive(StateTtlConfig ttlConfig); @Nonnull @Internal StateTtlConfig getTtlConfig(); boolean isSerializerInitialized(); void initializeSerializerUnlessSet(ExecutionConfig executionConfig); @Override final int hashCode(); @Override final boolean equals(Object o); @Override String toString(); abstract Type getType(); }
StateDescriptor implements Serializable { public TypeSerializer<T> getSerializer() { if (serializer != null) { return serializer.duplicate(); } else { throw new IllegalStateException("Serializer not yet initialized."); } } protected  StateDescriptor(String name, TypeSerializer<T> serializer, @Nullable T defaultValue); protected  StateDescriptor(String name, TypeInformation<T> typeInfo, @Nullable T defaultValue); protected  StateDescriptor(String name, Class<T> type, @Nullable T defaultValue); String getName(); T getDefaultValue(); TypeSerializer<T> getSerializer(); void setQueryable(String queryableStateName); @Nullable String getQueryableStateName(); boolean isQueryable(); void enableTimeToLive(StateTtlConfig ttlConfig); @Nonnull @Internal StateTtlConfig getTtlConfig(); boolean isSerializerInitialized(); void initializeSerializerUnlessSet(ExecutionConfig executionConfig); @Override final int hashCode(); @Override final boolean equals(Object o); @Override String toString(); abstract Type getType();  }