Creates all the serializers and comparators.
555029
protected void initInputsSerializersAndComparators(int numInputs) throws Exception {
		this.inputSerializers = new TypeSerializerFactory<?>[numInputs];
		this.inputComparators = this.driver.requiresComparatorOnInput() ? new TypeComparator[numInputs] : null;
		this.inputIterators = new MutableObjectIterator[numInputs];
		
		for (int i = 0; i < numInputs; i++) {
			//  ---------------- create the serializer first ---------------------
			final TypeSerializerFactory<?> serializerFactory = this.config.getInputSerializer(i, this.userCodeClassLoader);
			this.inputSerializers[i] = serializerFactory;
			
			//  ---------------- create the driver's comparator ---------------------
			if (this.inputComparators != null) {
				final TypeComparatorFactory<?> comparatorFactory = this.config.getDriverComparator(i, this.userCodeClassLoader);
				this.inputComparators[i] = comparatorFactory.createComparator();
			}

			this.inputIterators[i] = createInputIterator(this.inputReaders[i], this.inputSerializers[i]);
		}
	}
1229145
def set_custom_serializer(self, _type, serializer):
        
        validate_type(_type)
        validate_serializer(serializer, StreamSerializer)
        self._custom_serializers[_type] = serializer
649879
@SuppressWarnings("unchecked")
	public void initializeSerializers() {
		this.numChannels = this.outputGate.getNumChannels();
		this.serializers = new RecordSerializer[numChannels];
		for (int i = 0; i < this.numChannels; i++) {
			this.serializers[i] = new SpanningRecordSerializer<T>();
		}
	}
316262
public <T> DistinctBufferMaker<T> createDistinctBuffer( Serializer<T> distinctSerializer ) {
        return new MakeDistinctBuffer<T>("buffer-" + dbCounter.incrementAndGet(), distinctSerializer);
    }
462014
def _create_serializer_of_type_with_cache(self, serializer_type: Type) -> "Serializer":
        
        if serializer_type not in self._serializers_cache:
            self._serializers_cache[serializer_type] = self._create_serializer_of_type(serializer_type)
        return self._serializers_cache[serializer_type]
663794
@SuppressWarnings("unchecked")
	private final void instantiateDeserializationUtils() {
		if (this.serializers == null) {
			this.serializers = new TypeSerializer[this.serializerFactories.length];
			for (int i = 0; i < this.serializers.length; i++) {
				this.serializers[i] = this.serializerFactories[i].getSerializer();
			}
		}
		
		this.deserializedFields1 = new Object[this.serializers.length];
		this.deserializedFields2 = new Object[this.serializers.length];
		
		for (int i = 0; i < this.serializers.length; i++) {
			this.deserializedFields1[i] = this.serializers[i].createInstance();
			this.deserializedFields2[i] = this.serializers[i].createInstance();
		}
	}
173178
def create_translated_fields_serializer(shared_model, meta=None, related_name=None, **fields):
    
    if not related_name:
        translated_model = shared_model._parler_meta.root_model
    else:
        translated_model = shared_model._parler_meta[related_name].model

    # Define inner Meta class
    if not meta:
        meta = {}
    meta['model'] = translated_model
    meta.setdefault('fields', ['language_code'] + translated_model.get_translated_fields())

    # Define serialize class attributes
    attrs = {}
    attrs.update(fields)
    attrs['Meta'] = type('Meta', (), meta)

    # Dynamically create the serializer class
    return type('{0}Serializer'.format(translated_model.__name__), (serializers.ModelSerializer,), attrs)
389111
protected void initBroadcastInputsSerializers(int numBroadcastInputs) throws Exception {
		this.broadcastInputSerializers = new TypeSerializerFactory<?>[numBroadcastInputs];

		ClassLoader userCodeClassLoader = getUserCodeClassLoader();

		for (int i = 0; i < numBroadcastInputs; i++) {
			//  ---------------- create the serializer first ---------------------
			final TypeSerializerFactory<?> serializerFactory = this.config.getBroadcastInputSerializer(i, userCodeClassLoader);
			this.broadcastInputSerializers[i] = serializerFactory;
		}
	}
17786
protected Serializer serializer() {
    Serializer serializer = this.serializer;
    if (serializer == null) {
      synchronized (this) {
        serializer = this.serializer;
        if (serializer == null) {
          NamespaceConfig config = this.config.getNamespaceConfig();
          if (config == null) {
            serializer = Serializer.using(Namespaces.BASIC);
          } else {
            serializer = Serializer.using(Namespace.builder()
                .register(Namespaces.BASIC)
                .nextId(Namespaces.BEGIN_USER_CUSTOM_ID)
                .register(new Namespace(config))
                .build());
          }
          this.serializer = serializer;
        }
      }
    }
    return serializer;
  }
13799
def default_serializer
      # Basic
      serializer = Spark::Serializer.find!(config('spark.ruby.serializer')).new

      # Compress
      if config('spark.ruby.serializer.compress')
        serializer = Spark::Serializer.compressed(serializer)
      end

      # Bactching
      batch_size = default_batch_size
      if batch_size == 'auto'
        serializer = Spark::Serializer.auto_batched(serializer)
      else
        serializer = Spark::Serializer.batched(serializer, batch_size)
      end

      # Finally, "container" contains serializers
      serializer
    end
24832
public void init(OutputStream os)
    {
        this.os = os;

        _refs = null;

        if (_serializerFactory == null)
            _serializerFactory = new SerializerFactory();
    }
357381
public static <T> Builder<T> newSorter(Serializer<T> serializer, Comparator<T> comparator) {
        return new Builder<T>(serializer, comparator);
    }
415285
protected Comparator<RequestMapperBean> newComparator()
	{
		return new Comparator<RequestMapperBean>()
		{
			@Override
			public int compare(final RequestMapperBean o1, final RequestMapperBean o2)
			{
				return o1.getCompatibilityScore() - o2.getCompatibilityScore();
			}
		};
	}
180980
public <T> Comparator<T> buildComparator() {
        if (sortedAttributes.isEmpty()) {
            return (o1, o2) -> 0;
        } else {
            Comparator<T> comparator = null;
            for (SortedAttribute sortedAttribute : sortedAttributes) {
                if (comparator == null) {
                    comparator = buildComparator(sortedAttribute);
                } else {
                    comparator = comparator.thenComparing(buildComparator(sortedAttribute));
                }
            }
            return comparator;
        }
    }
310085
protected Serializer<?> createVia(SerializerResolver<?> resolver, Type type, Annotation... hints)
	{
		Set<Type> s = stack.get();

		// Only expose the hints that the resolver has declared
		Set<Class<? extends Annotation>> hintsUsed = resolver.getHints();
		List<Annotation> hintsActive;
		if(hintsUsed == null || hints == null || hints.length == 0)
		{
			hintsActive = Collections.emptyList();
		}
		else
		{
			hintsActive = new ArrayList<>();
			for(Annotation a : hints)
			{
				if(hintsUsed.contains(a.annotationType()))
				{
					hintsActive.add(a);
				}
			}
		}

		// Check if we have already built a serializer for this type
		CacheKey key = new CacheKey(type, hintsActive.toArray());
		Serializer<?> serializer = serializers.get(key);
		if(serializer != null)
		{
			return serializer;
		}

		// Stack to keep track of circular dependencies
		if(s == null)
		{
			s = new HashSet<Type>();
			stack.set(s);
		}

		try
		{
			s.add(type);

			// Find a serializer to use
			TypeEncounterImpl encounter = new TypeEncounterImpl(this, type, hintsActive);

			serializer = resolver.find(encounter);
			if(serializer == null)
			{
				throw new SerializationException("Unable to find serializer for " + type + " using " + resolver.getClass());
			}

			registerIfNamed(type.getErasedType(), serializer);

			// Store the found serializer in the cache
			serializers.put(key, serializer);
			return serializer;
		}
		finally
		{
			s.remove(type);

			if(s.isEmpty())
			{
				stack.remove();
			}
		}
	}
339318
def _create(self):
        

        if 'name' in self._data:
            obj_ref = self.api.add(self.obj_parent(), self.obj_type(), name=self.obj_name())
        else:
            obj_ref = self.api.add(self.obj_parent(), self.obj_type())
        self.api.commit()
        return self.api.remapIds(obj_ref)
30849
private void initCommonAndGroupSchemaSerialization() {
    //TODO Should SerializationInfo contain Configuration ?
    commonSerializers = getSerializers(commonSchema, null);
    commonDeserializers = getDeserializers(commonSchema, commonSchema, null);

    groupSerializers = getSerializers(groupSchema, null);
    groupDeserializers = getDeserializers(groupSchema, groupSchema, null);
  }